Files
openstapps/src/things/abstract/academic-term.ts
2019-08-21 10:34:04 +02:00

101 lines
2.5 KiB
TypeScript

/*
* 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 <https://www.gnu.org/licenses/>.
*/
import {SCMetaTranslations} from '../../general/i18n';
import {SCISO8601Date} from '../../general/time';
import {SCThing, SCThingMeta, SCThingWithoutReferences} from './thing';
/**
* An academic term without references
*/
export interface SCAcademicTermWithoutReferences
extends SCThingWithoutReferences {
/**
* Short name of the academic term, using the given pattern
*
* @aggregatable
* @filterable
* @keyword
*/
acronym: string;
/**
* End date of the academic term
*/
endDate: SCISO8601Date;
/**
* End date of lectures in the academic term
*/
eventsEndDate?: SCISO8601Date;
/**
* Start date of lectures in the academic term
*/
eventsStartDate?: SCISO8601Date;
/**
* Start date of the academic term
*/
startDate: SCISO8601Date;
}
/**
* An academic term
*/
export interface SCAcademicTerm
extends SCAcademicTermWithoutReferences, SCThing {
// noop
}
/**
* Meta information about academic terms
*/
export class SCAcademicTermWithoutReferencesMeta
extends SCThingMeta implements SCMetaTranslations<SCThing> {
/**
* Translations of fields
*/
fieldTranslations = {
de: {
...SCThingMeta.getInstance<SCThingMeta>().fieldTranslations.de,
acronym: 'Akronym',
endDate: 'Enddatum',
eventsEndDate: 'Enddatum der Veranstaltungen',
eventsStartDate: 'Startdatum der Veranstaltungen',
startDate: 'Startdatum',
},
en: {
...SCThingMeta.getInstance<SCThingMeta>().fieldTranslations.en,
acronym: 'acronym',
endDate: 'end date',
eventsEndDate: 'end date of events',
eventsStartDate: 'start date of events',
startDate: 'start date',
},
};
/**
* Translations of values of fields
*/
fieldValueTranslations = {
de: {
...SCThingMeta.getInstance<SCThingMeta>().fieldValueTranslations.de,
},
en: {
...SCThingMeta.getInstance<SCThingMeta>().fieldValueTranslations.en,
},
};
}