feat: add core

This commit is contained in:
Karl-Philipp Wulfert
2018-11-29 16:22:57 +01:00
commit 2d770dde44
131 changed files with 41268 additions and 0 deletions

View File

@@ -0,0 +1,113 @@
/*
* Copyright (C) 2018 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 {SCEvent, SCEventWithoutReferences} from '../base/Event';
import {
SCThingWithCategoriesSpecificValues,
SCThingWithCategoriesTranslatableProperties,
SCThingWithCategoriesWithoutReferences,
} from '../base/ThingWithCategories';
import {SCThingMeta} from '../Thing';
import {SCTranslations} from '../types/i18n';
/**
* Type of an academic event
*/
export type SCAcademicEventType = 'academic event';
/**
* An academic event without references
*/
export interface SCAcademicEventWithoutReferences
extends SCEventWithoutReferences,
SCThingWithCategoriesWithoutReferences<SCAcademicEventCategories,
SCThingWithCategoriesSpecificValues> {
/**
* Majors of the academic event that this event belongs to
*/
majors?: string[];
/**
* Original unmapped category from the source of the academic event
*/
originalCategory?: string;
/**
* Translated fields of an academic event
*/
translations?: SCTranslations<SCAcademicEventTranslatableProperties>;
/**
* Type of an academic event
*/
type: SCAcademicEventType;
}
export interface SCAcademicEvent extends SCEvent, SCAcademicEventWithoutReferences {
/**
* Translated fields of an academic event
*/
translations?: SCTranslations<SCAcademicEventTranslatableProperties>;
/**
* Type of an academic event
*/
type: SCAcademicEventType;
}
/**
* Event meta data
*/
export class SCAcademicEventMeta extends SCThingMeta {
static fieldValueTranslations = {
...SCThingMeta.fieldValueTranslations,
de: {
type: 'Event',
},
};
}
/**
* Categories of academic events
*/
export type SCAcademicEventCategories =
'lecture'
| 'seminar'
| 'integrated course'
| 'written 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
*/
majors?: string[];
/**
* Translation of the original unmapped category from the source of the academic event
*/
originalCategory?: string;
}