/* * 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 {SCMetaTranslations, SCTranslations} from '../general/i18n'; import {SCEvent, SCEventMeta, SCEventWithoutReferences} from './abstract/event'; import {SCThingMeta, SCThingType} from './abstract/thing'; import { SCThingWithCategories, SCThingWithCategoriesSpecificValues, SCThingWithCategoriesTranslatableProperties, SCThingWithCategoriesWithoutReferences, SCThingWithCategoriesWithoutReferencesMeta, } from './abstract/thing-with-categories'; /** * An academic event without references */ export interface SCAcademicEventWithoutReferences extends SCEventWithoutReferences, SCThingWithCategoriesWithoutReferences { /** * Majors of the academic event that this event belongs to * * @aggregatable * @keyword */ majors?: string[]; /** * Original unmapped category from the source of the academic event * * @keyword */ originalCategory?: string; /** * Translated fields of an academic event */ translations?: SCTranslations; /** * Type of an academic event */ type: SCThingType.AcademicEvent; } /** * An academic event * * @validatable * @indexable */ export interface SCAcademicEvent extends SCEvent, SCAcademicEventWithoutReferences, SCThingWithCategories { /** * Translated fields of an academic event */ translations?: SCTranslations; /** * Type of an academic event */ type: SCThingType.AcademicEvent; } /** * Categories of academic events */ export type SCAcademicEventCategories = 'lecture' | 'seminar' | 'integrated course' | 'written exam' | 'oral exam' | 'tutorial' | 'project' | 'colloquium' | 'practicum' | 'introductory class' | 'course' | 'practicum introduction' | 'excursion' | 'special'; /** * Translatable properties of an academic event */ export interface SCAcademicEventTranslatableProperties extends SCThingWithCategoriesTranslatableProperties { /** * Translations of the majors of the academic event that this event belongs to * * @keyword */ majors?: string[]; /** * Translation of the original unmapped category from the source of the academic event * * @keyword */ originalCategory?: string; } /** * Meta information about academic events */ export class SCAcademicEventMeta extends SCThingMeta implements SCMetaTranslations { /** * Translations of fields */ fieldTranslations = { de: { ...SCEventMeta.getInstance().fieldTranslations.de, ...SCThingWithCategoriesWithoutReferencesMeta.getInstance().fieldTranslations.de, majors: 'Hauptfächer', originalCategory: 'ursprüngliche Kategorie', }, en: { ...SCEventMeta.getInstance().fieldTranslations.en, ...SCThingWithCategoriesWithoutReferencesMeta.getInstance().fieldTranslations.en, majors: 'majors', originalCategory: 'original category', }, }; /** * Translations of values of fields */ fieldValueTranslations = { de: { ...SCEventMeta.getInstance().fieldValueTranslations.de, ...SCThingWithCategoriesWithoutReferencesMeta.getInstance().fieldValueTranslations.de, categories: { 'colloquium': 'Kolloquium', 'course': 'Kurs', 'excursion': 'Exkursion', 'integrated course': '', 'introductory class': 'Einführungsveranstaltung', 'lecture': 'Vorlesung', 'oral exam': 'mündliche Prüfung', 'practicum': 'Praktikum', 'practicum introduction': 'Einführungspraktikum', 'project': 'Projekt', 'seminar': 'Seminar', 'special': 'Sonderveranstalltung', 'tutorial': 'Tutorium', 'written exam': 'Schriftilche Prüfung', }, type: 'akademische Veranstaltung', }, en: { ...SCEventMeta.getInstance().fieldValueTranslations.en, ...SCThingWithCategoriesWithoutReferencesMeta.getInstance().fieldValueTranslations.en, type: SCThingType.AcademicEvent, }, }; }