/* * Copyright (C) 2019 StApps * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Free * Software Foundation, version 3. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * * You should have received a copy of the GNU General Public License along with * this program. If not, see . */ import {SCLanguage, SCMetaTranslations, SCTranslations} from '../../general/i18n'; import {SCISO8601Date} from '../../general/time'; import {SCOrganizationWithoutReferences} from '../organization'; import {SCPersonWithoutReferences} from '../person'; import {SCThingMeta, SCThingTranslatableProperties, SCThingWithoutReferences} from './thing'; import { SCAcademicPriceGroup, SCThingThatCanBeOffered, SCThingThatCanBeOfferedMeta, SCThingThatCanBeOfferedTranslatableProperties, SCThingThatCanBeOfferedWithoutReferences, } from './thing-that-can-be-offered'; /** * A creative work without references */ export interface SCCreativeWorkWithoutReferences extends SCThingWithoutReferences, SCThingThatCanBeOfferedWithoutReferences { /** * Date the creative work was published * * @filterable */ datePublished?: SCISO8601Date; /** * List of languages this creative work is written/recorded/... in */ inLanguages?: SCLanguage[]; /** * Keywords of the creative work * * @aggregatable * @filterable * @keyword */ keywords?: string[]; /** * Translated fields of the creative work */ translations?: SCTranslations; } /** * A creative work */ export interface SCCreativeWork extends SCCreativeWorkWithoutReferences, SCThingThatCanBeOffered { /** * Authors of the creative work */ authors?: SCPersonWithoutReferences[]; /** * List of publishers of the creative work */ publishers?: Array; /** * Translated fields of the creative work */ translations?: SCTranslations; } /** * Translatable properties of creative works */ export interface SCCreativeWorkTranslatableProperties extends SCThingTranslatableProperties, SCThingThatCanBeOfferedTranslatableProperties { /** * Translation of the keywords of the creative work * * @keyword */ keywords?: string[]; } /** * Meta information about creative works */ export class SCCreativeWorkMeta extends SCThingMeta implements SCMetaTranslations { /** * Translations of fields */ fieldTranslations = { de: { ...SCThingMeta.getInstance().fieldTranslations.de, ...SCThingThatCanBeOfferedMeta.getInstance().fieldTranslations.de, authors: 'Authoren', datePublished: 'Veröffentlichungsdatum', inLanguages: 'verfügbare Übersetzungen', keywords: 'Schlagwörter', publishers: 'Verleger', }, en: { ...SCThingMeta.getInstance().fieldTranslations.en, ...SCThingThatCanBeOfferedMeta.getInstance().fieldTranslations.en, authors: 'authors', datePublished: 'release date', inLanguages: 'available Languages', keywords: 'keywords', publishers: 'publishers', }, }; /** * Translations of values of fields */ fieldValueTranslations = { de: { ...SCThingMeta.getInstance().fieldValueTranslations.de, ...SCThingThatCanBeOfferedMeta.getInstance().fieldValueTranslations.en, }, en: { ...SCThingMeta.getInstance().fieldValueTranslations.en, ...SCThingThatCanBeOfferedMeta.getInstance().fieldValueTranslations.en, }, }; }