import CollectionConfig from './CollectionConfig';

export class EYEDesmetConfig extends CollectionConfig {

	constructor(clientId, user, collectionId, stats, info) {
		super(clientId, user, collectionId, stats, info);
	}

	getCollectionMediaTypes() {
		return ['video'];
	}

	getMetadataFieldCategories() {
		return [
			{
				'id' : 'titles',
				'label' : 'Search in: titles',
				'fields' : [
					'dc:title',
					'dcterms:alternative'
				]
			}
		]
	}

	getFacets() {
		return [
			{
				field: 'dc:creator.keyword',
				title : 'Creator',
				id : 'creator',
				type : 'string'
			},
			{
				field: 'dcterms:subject.@value.keyword',
				title : 'Subject',
				id : 'subject',
				type : 'string'
			},
			{
				field: 'dc:coverage.keyword',
				title : 'Location',
				id : 'coverage',
				type : 'string'
			}
		];
	}

	getItemDetailData(result, currentDateField) {
		result = this.formatSearchResult(result);
		const formattedResult = {}

		//then add the most basic top level data
		formattedResult.resourceId = result._id;
		formattedResult.index = result._index;
		formattedResult.docType = result._type;

		formattedResult.rawData = result;

		return formattedResult;
	}

}

export default EYEDesmetConfig;