fix: adjust model to remove references from things without references

Fixes #69
This commit is contained in:
Karl-Philipp Wulfert
2019-05-14 17:57:10 +02:00
parent da0507ee34
commit ca72c20bd0
36 changed files with 585 additions and 400 deletions

View File

@@ -12,39 +12,46 @@
* 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 {SCThing} from '../Thing';
import {SCThingMeta} from '../Thing';
import {SCThing, SCThingMeta, SCThingWithoutReferences} from '../Thing';
import {SCMetaTranslations} from '../types/i18n';
/**
* An academic degree without references
*/
export interface SCAcademicDegreeWithoutReferences extends SCThing {
export interface SCAcademicDegreeWithoutReferences
extends SCThingWithoutReferences {
/**
* The achievable academic degree
*/
academicDegree: SCGermanAcademicDegree;
/**
* The achievable academic degree with academic field specification
* The achievable academic degree with academic field specification
* (eg. Master of Science)
*/
academicDegreewithField: string;
/**
* The achievable academic degree with academic field specification
* The achievable academic degree with academic field specification
* shorted (eg. M.Sc.).
*/
academicDegreewithFieldShort: string;
}
export interface SCAcademicDegree extends SCAcademicDegreeWithoutReferences {
/**
* An academic degree
*/
export interface SCAcademicDegree
extends SCAcademicDegreeWithoutReferences, SCThing {
// noop
}
/**
* Meta information about academic degrees
*/
export class SCAcademicDegreeMeta extends SCThingMeta implements SCMetaTranslations<SCAcademicDegree> {
export class SCAcademicDegreeMeta
extends SCThingMeta
implements SCMetaTranslations<SCAcademicDegree> {
/**
* Translations of fields
*/
@@ -86,11 +93,12 @@ export class SCAcademicDegreeMeta extends SCThingMeta implements SCMetaTranslati
/**
* Types of (german) academic degrees
*/
export type SCGermanAcademicDegree = 'bachelor' |
'diploma' |
'doctor' |
'licentiate' |
'magister' |
'master' |
'master pupil' |
'state examination' ;
export type SCGermanAcademicDegree =
'bachelor'
| 'diploma'
| 'doctor'
| 'licentiate'
| 'magister'
| 'master'
| 'master pupil'
| 'state examination' ;

View File

@@ -12,14 +12,15 @@
* 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 {SCThing, SCThingMeta} from '../Thing';
import {SCThing, SCThingMeta, SCThingWithoutReferences} from '../Thing';
import {SCMetaTranslations} from '../types/i18n';
import {SCISO8601Date} from '../types/Time';
/**
* An academic term without references
*/
export interface SCAcademicTermWithoutReferences extends SCThing {
export interface SCAcademicTermWithoutReferences
extends SCThingWithoutReferences {
/**
* Short name of the academic term, using the given pattern
*/
@@ -46,31 +47,40 @@ export interface SCAcademicTermWithoutReferences extends SCThing {
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> {
export class SCAcademicTermWithoutReferencesMeta
extends SCThingMeta implements SCMetaTranslations<SCThing> {
/**
* Translations of fields
*/
fieldTranslations = {
de: {
... SCThingMeta.getInstance().fieldTranslations.de,
...SCThingMeta.getInstance().fieldTranslations.de,
},
en: {
... SCThingMeta.getInstance().fieldTranslations.en,
...SCThingMeta.getInstance().fieldTranslations.en,
},
};
/**
* Translations of values of fields
*/
fieldValueTranslations = {
fieldValueTranslations = {
de: {
... SCThingMeta.getInstance().fieldValueTranslations.de,
...SCThingMeta.getInstance().fieldValueTranslations.de,
},
en: {
... SCThingMeta.getInstance().fieldValueTranslations.en,
...SCThingMeta.getInstance().fieldValueTranslations.en,
},
};
}

View File

@@ -12,7 +12,7 @@
* 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 {SCThing, SCThingMeta, SCThingTranslatableProperties} from '../Thing';
import {SCThingMeta, SCThingTranslatableProperties, SCThingWithoutReferences} from '../Thing';
import {SCOrganizationWithoutReferences} from '../things/Organization';
import {SCPersonWithoutReferences} from '../things/Person';
import {SCLanguage, SCMetaTranslations, SCTranslations} from '../types/i18n';
@@ -21,12 +21,14 @@ import {
SCAcademicPriceGroup,
SCThingThatCanBeOffered,
SCThingThatCanBeOfferedTranslatableProperties,
SCThingThatCanBeOfferedWithoutReferences,
} from './ThingThatCanBeOffered';
/**
* A creative work without references
*/
export interface SCCreativeWorkWithoutReferences extends SCThing {
export interface SCCreativeWorkWithoutReferences
extends SCThingWithoutReferences, SCThingThatCanBeOfferedWithoutReferences {
/**
* Date the creative work was published
*/
@@ -51,7 +53,8 @@ export interface SCCreativeWorkWithoutReferences extends SCThing {
/**
* A creative work
*/
export interface SCCreativeWork extends SCCreativeWorkWithoutReferences, SCThingThatCanBeOffered<SCAcademicPriceGroup> {
export interface SCCreativeWork
extends SCCreativeWorkWithoutReferences, SCThingThatCanBeOffered<SCAcademicPriceGroup> {
/**
* Authors of the creative work
*/
@@ -82,28 +85,29 @@ export interface SCCreativeWorkTranslatableProperties
/**
* Meta information about creative works
*/
export class SCCreativeWorkMeta extends SCThingMeta implements SCMetaTranslations<SCCreativeWork> {
export class SCCreativeWorkMeta
extends SCThingMeta implements SCMetaTranslations<SCCreativeWork> {
/**
* Translations of fields
*/
fieldTranslations = {
de: {
... SCThingMeta.getInstance().fieldTranslations.de,
...SCThingMeta.getInstance().fieldTranslations.de,
},
en: {
... SCThingMeta.getInstance().fieldTranslations.en,
...SCThingMeta.getInstance().fieldTranslations.en,
},
};
/**
* Translations of values of fields
*/
fieldValueTranslations = {
fieldValueTranslations = {
de: {
... SCThingMeta.getInstance().fieldValueTranslations.de,
...SCThingMeta.getInstance().fieldValueTranslations.de,
},
en: {
... SCThingMeta.getInstance().fieldValueTranslations.en,
...SCThingMeta.getInstance().fieldValueTranslations.en,
},
};
}

View File

@@ -12,7 +12,7 @@
* 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 {SCThing, SCThingMeta} from '../Thing';
import {SCThing, SCThingMeta, SCThingWithoutReferences} from '../Thing';
import {SCCatalogWithoutReferences} from '../things/Catalog';
import {SCPersonWithoutReferences} from '../things/Person';
import {SCSemesterWithoutReferences} from '../things/Semester';
@@ -22,7 +22,8 @@ import {SCCreativeWorkWithoutReferences} from './CreativeWork';
/**
* An event without references
*/
export interface SCEventWithoutReferences extends SCThing {
export interface SCEventWithoutReferences
extends SCThingWithoutReferences {
/**
* Maximum number of participants of the event
*
@@ -41,7 +42,8 @@ export interface SCEventWithoutReferences extends SCThing {
/**
* An event
*/
export interface SCEvent extends SCEventWithoutReferences {
export interface SCEvent
extends SCEventWithoutReferences, SCThing {
/**
* Academic terms that an event belongs to, e.g. semester(s).
*/
@@ -73,28 +75,29 @@ export interface SCEvent extends SCEventWithoutReferences {
/**
* Meta information about events
*/
export class SCEventMeta extends SCThingMeta implements SCMetaTranslations<SCEvent> {
export class SCEventMeta
extends SCThingMeta implements SCMetaTranslations<SCEvent> {
/**
* Translations of fields
*/
fieldTranslations = {
de: {
... SCThingMeta.getInstance().fieldTranslations.de,
...SCThingMeta.getInstance().fieldTranslations.de,
},
en: {
... SCThingMeta.getInstance().fieldTranslations.en,
...SCThingMeta.getInstance().fieldTranslations.en,
},
};
/**
* Translations of values of fields
*/
fieldValueTranslations = {
fieldValueTranslations = {
de: {
... SCThingMeta.getInstance().fieldValueTranslations.de,
...SCThingMeta.getInstance().fieldValueTranslations.de,
},
en: {
... SCThingMeta.getInstance().fieldValueTranslations.en,
...SCThingMeta.getInstance().fieldValueTranslations.en,
},
};
}

View File

@@ -12,7 +12,7 @@
* 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 {SCThing, SCThingMeta, SCThingTranslatableProperties} from '../Thing';
import {SCThing, SCThingMeta, SCThingTranslatableProperties, SCThingWithoutReferences} from '../Thing';
import {SCGeoInformation} from '../types/GeoInformation';
import {SCMetaTranslations, SCTranslations} from '../types/i18n';
import {SCPostalAddress} from '../types/PostalAddress';
@@ -20,7 +20,8 @@ import {SCPostalAddress} from '../types/PostalAddress';
/**
* A place without references
*/
export interface SCPlaceWithoutReferences extends SCThing {
export interface SCPlaceWithoutReferences
extends SCThingWithoutReferences {
/**
* Address of the place
*/
@@ -44,38 +45,53 @@ export interface SCPlaceWithoutReferences extends SCThing {
* Translated fields of a place
*/
translations?: SCTranslations<SCPlaceWithoutReferencesTranslatableProperties>;
}
export interface SCPlaceWithoutReferencesTranslatableProperties extends SCThingTranslatableProperties {
/**
* A place
*/
export interface SCPlace
extends SCPlaceWithoutReferences, SCThing {
/**
* Translated fields of a place
*/
translations?: SCTranslations<SCPlaceWithoutReferencesTranslatableProperties>;
}
/**
* Translatable properties of a place without references
*/
export interface SCPlaceWithoutReferencesTranslatableProperties
extends SCThingTranslatableProperties {
address?: SCPostalAddress;
}
/**
* Meta information about creative works
*/
export class SCPlaceWithoutReferencesMeta extends SCThingMeta implements SCMetaTranslations<SCPlaceWithoutReferences> {
export class SCPlaceWithoutReferencesMeta
extends SCThingMeta implements SCMetaTranslations<SCPlaceWithoutReferences> {
/**
* Translations of fields
*/
fieldTranslations = {
de: {
... SCThingMeta.getInstance().fieldTranslations.de,
...SCThingMeta.getInstance().fieldTranslations.de,
},
en: {
... SCThingMeta.getInstance().fieldTranslations.en,
...SCThingMeta.getInstance().fieldTranslations.en,
},
};
/**
* Translations of values of fields
*/
fieldValueTranslations = {
fieldValueTranslations = {
de: {
... SCThingMeta.getInstance().fieldValueTranslations.de,
...SCThingMeta.getInstance().fieldValueTranslations.de,
},
en: {
... SCThingMeta.getInstance().fieldValueTranslations.en,
...SCThingMeta.getInstance().fieldValueTranslations.en,
},
};
}

View File

@@ -12,24 +12,27 @@
* 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 {SCThing, SCThingUserOrigin} from '../Thing';
import {SCThing, SCThingUserOrigin, SCThingWithoutReferences} from '../Thing';
/**
* An encapsulation of the data (e.g. a thing) that is saved, which provides additional information.
*/
export interface SCSaveableThingWithoutReferences extends SCThing {
export interface SCSaveableThingWithoutReferences
extends SCThingWithoutReferences {
// noop
}
/**
* An encapsulation of the data (e.g. a thing) that is saved, which provides additional information.
*/
export interface SCSaveableThing<T extends SCThingWithoutReferences>
extends SCSaveableThingWithoutReferences, SCThing {
/**
* The contained data
*/
data: T;
/**
* Type of the origin
*/
origin: SCThingUserOrigin;
}
/**
* An encapsulation of the data (e.g. a thing) that is saved, which provides additional information.
*/
export interface SCSaveableThing<T extends SCThing> extends SCSaveableThingWithoutReferences {
/**
* The contained data
*/
data: T;
}

View File

@@ -19,22 +19,26 @@ import {SCInPlace} from '../types/Places';
/**
* A thing that is or happens in a place
*/
export interface SCThingInPlace extends SCThing, SCInPlace {}
export interface SCThingInPlace
extends SCThing, SCInPlace {
// noop
}
/**
* Meta information about thing in a place
*/
export class SCThingInPlaceMeta extends SCThingMeta implements SCMetaTranslations<SCThingInPlace> {
export class SCThingInPlaceMeta
extends SCThingMeta implements SCMetaTranslations<SCThingInPlace> {
/**
* Translations of fields
*/
fieldTranslations = {
de: {
... SCThingMeta.getInstance().fieldTranslations.de,
...SCThingMeta.getInstance().fieldTranslations.de,
inPlace: 'Ort',
},
en: {
... SCThingMeta.getInstance().fieldTranslations.en,
...SCThingMeta.getInstance().fieldTranslations.en,
inPlace: 'location',
},
};
@@ -42,12 +46,12 @@ export class SCThingInPlaceMeta extends SCThingMeta implements SCMetaTranslation
/**
* Translations of values of fields
*/
fieldValueTranslations = {
fieldValueTranslations = {
de: {
... SCThingMeta.getInstance().fieldValueTranslations.de,
...SCThingMeta.getInstance().fieldValueTranslations.de,
},
en: {
... SCThingMeta.getInstance().fieldValueTranslations.en,
...SCThingMeta.getInstance().fieldValueTranslations.en,
},
};
}

View File

@@ -12,7 +12,7 @@
* 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 {SCThing, SCThingMeta} from '../Thing';
import {SCThing, SCThingMeta, SCThingWithoutReferences} from '../Thing';
import {SCMetaTranslations} from '../types/i18n';
/**
@@ -24,41 +24,50 @@ export type SCThingThatAcceptsPaymentsAcceptedPayments =
| 'Cafeteria Card';
/**
* A place without references that accepts payments
* A thing without references that accepts payments
*/
export interface SCThingThatAcceptsPaymentsWithoutReferences extends SCThing {
export interface SCThingThatAcceptsPaymentsWithoutReferences
extends SCThingWithoutReferences {
/**
* Accepted payments of the place
*/
paymentsAccepted?: SCThingThatAcceptsPaymentsAcceptedPayments[];
}
/**
* A thing that accepts payments
*/
export interface SCThingThatAcceptsPayments
extends SCThingThatAcceptsPaymentsWithoutReferences, SCThing {
// noop
}
/**
* Meta information about a thing without references that accepts payments
*/
export class SCThingThatAcceptsPaymentsWithoutReferencesMeta extends SCThingMeta implements
SCMetaTranslations<SCThingThatAcceptsPaymentsWithoutReferences> {
export class SCThingThatAcceptsPaymentsWithoutReferencesMeta
extends SCThingMeta implements SCMetaTranslations<SCThingThatAcceptsPaymentsWithoutReferences> {
/**
* Translations of fields
*/
fieldTranslations = {
de: {
... SCThingMeta.getInstance().fieldTranslations.de,
...SCThingMeta.getInstance().fieldTranslations.de,
},
en: {
... SCThingMeta.getInstance().fieldTranslations.en,
...SCThingMeta.getInstance().fieldTranslations.en,
},
};
/**
* Translations of values of fields
*/
fieldValueTranslations = {
fieldValueTranslations = {
de: {
... SCThingMeta.getInstance().fieldValueTranslations.de,
...SCThingMeta.getInstance().fieldValueTranslations.de,
},
en: {
... SCThingMeta.getInstance().fieldValueTranslations.en,
...SCThingMeta.getInstance().fieldValueTranslations.en,
},
};
}

View File

@@ -12,7 +12,7 @@
* 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 {SCThing, SCThingTranslatableProperties} from '../Thing';
import {SCThing, SCThingTranslatableProperties, SCThingWithoutReferences} from '../Thing';
import {SCOrganizationWithoutReferences} from '../things/Organization';
import {SCPersonWithoutReferences} from '../things/Person';
import {SCTranslations} from '../types/i18n';
@@ -32,7 +32,8 @@ export interface SCPriceGroup {
/**
* Price distinctions for academic context
*/
export interface SCAcademicPriceGroup extends SCPriceGroup {
export interface SCAcademicPriceGroup
extends SCPriceGroup {
/**
* Price for employees
*/
@@ -52,7 +53,8 @@ export interface SCAcademicPriceGroup extends SCPriceGroup {
/**
* A thing without references that can be offered
*/
export interface SCThingThatCanBeOfferedWithoutReferences extends SCThing {
export interface SCThingThatCanBeOfferedWithoutReferences
extends SCThingWithoutReferences {
/**
* Translations of a thing that can be offered
*/
@@ -63,11 +65,16 @@ export interface SCThingThatCanBeOfferedWithoutReferences extends SCThing {
* A thing that can be offered
*/
export interface SCThingThatCanBeOffered<T extends SCPriceGroup>
extends SCThing {
extends SCThing, SCThingThatCanBeOfferedWithoutReferences {
/**
* List of offers for that thing
*/
offers?: Array<SCThingThatCanBeOfferedOffer<T>>;
/**
* Translations of a thing that can be offered
*/
translations?: SCTranslations<SCThingThatCanBeOfferedTranslatableProperties>;
}
/**

View File

@@ -12,7 +12,7 @@
* 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 {SCThing, SCThingMeta, SCThingTranslatableProperties} from '../Thing';
import {SCThing, SCThingMeta, SCThingTranslatableProperties, SCThingWithoutReferences} from '../Thing';
import {SCMetaTranslations, SCTranslations} from '../types/i18n';
import {SCMap} from '../types/Map';
@@ -22,9 +22,8 @@ import {SCMap} from '../types/Map';
* !!! BEWARE !!!
* `T` should be a union type - e.g. `T = 'foo' | 'bar' | 'foobar';`
*/
export interface SCThingWithCategoriesWithoutReferences<T,
U extends SCThingWithCategoriesSpecificValues>
extends SCThing {
export interface SCThingWithCategoriesWithoutReferences<T, U extends SCThingWithCategoriesSpecificValues>
extends SCThingWithoutReferences {
/**
* Categories of a thing with categories
*/
@@ -43,10 +42,22 @@ export interface SCThingWithCategoriesWithoutReferences<T,
translations?: SCTranslations<SCThingWithCategoriesTranslatableProperties>;
}
/**
* A thing with categories
*/
export interface SCThingWithCategories<T, U extends SCThingWithCategoriesSpecificValues>
extends SCThing, SCThingWithCategoriesWithoutReferences<T, U> {
/**
* Translated fields of a thing with categories
*/
translations?: SCTranslations<SCThingWithCategoriesTranslatableProperties>;
}
/**
* Translatable properties of a thing with categories
*/
export interface SCThingWithCategoriesTranslatableProperties extends SCThingTranslatableProperties {
export interface SCThingWithCategoriesTranslatableProperties
extends SCThingTranslatableProperties {
/**
* translations of the categories of a thing with categories
*/
@@ -88,8 +99,8 @@ export interface SCThingWithCategoriesSpecificValues {
/**
* Meta information about a thing without references that accepts payments
*/
export class SCThingWithCategoriesWithoutReferencesMeta<T, U> implements
SCMetaTranslations<SCThingWithCategoriesWithoutReferences<T, U>> {
export class SCThingWithCategoriesWithoutReferencesMeta<T, U>
implements SCMetaTranslations<SCThingWithCategoriesWithoutReferences<T, U>> {
protected static _instance: SCThingMeta;
@@ -98,22 +109,22 @@ export class SCThingWithCategoriesWithoutReferencesMeta<T, U> implements
*/
fieldTranslations = {
de: {
... SCThingMeta.getInstance().fieldTranslations.de,
...SCThingMeta.getInstance().fieldTranslations.de,
},
en: {
... SCThingMeta.getInstance().fieldTranslations.en,
...SCThingMeta.getInstance().fieldTranslations.en,
},
};
/**
* Translations of values of fields
*/
fieldValueTranslations = {
fieldValueTranslations = {
de: {
... SCThingMeta.getInstance().fieldValueTranslations.de,
...SCThingMeta.getInstance().fieldValueTranslations.de,
},
en: {
... SCThingMeta.getInstance().fieldValueTranslations.en,
...SCThingMeta.getInstance().fieldValueTranslations.en,
},
};

View File

@@ -1,23 +0,0 @@
/*
* 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 {SCThing, SCThingTranslatableProperties} from '../Thing';
import {SCTranslations} from '../types/i18n';
/**
* A thing that has translations
*/
export interface SCThingWithTranslations extends SCThing {
translations: SCTranslations<SCThingTranslatableProperties>;
}

View File

@@ -14,6 +14,7 @@
*/
import {SCEvent, SCEventMeta, SCEventWithoutReferences} from '../base/Event';
import {
SCThingWithCategories,
SCThingWithCategoriesSpecificValues,
SCThingWithCategoriesTranslatableProperties,
SCThingWithCategoriesWithoutReferences,
@@ -27,8 +28,7 @@ import {SCMetaTranslations, SCTranslations} from '../types/i18n';
*/
export interface SCAcademicEventWithoutReferences
extends SCEventWithoutReferences,
SCThingWithCategoriesWithoutReferences<SCAcademicEventCategories,
SCThingWithCategoriesSpecificValues> {
SCThingWithCategoriesWithoutReferences<SCAcademicEventCategories, SCThingWithCategoriesSpecificValues> {
/**
* Majors of the academic event that this event belongs to
*/
@@ -55,7 +55,9 @@ export interface SCAcademicEventWithoutReferences
*
* @validatable
*/
export interface SCAcademicEvent extends SCEvent, SCAcademicEventWithoutReferences {
export interface SCAcademicEvent
extends SCEvent, SCAcademicEventWithoutReferences,
SCThingWithCategories<SCAcademicEventCategories, SCThingWithCategoriesSpecificValues> {
/**
* Translated fields of an academic event
*/
@@ -104,37 +106,39 @@ export interface SCAcademicEventTranslatableProperties
/**
* Meta information about academic events
*/
export class SCAcademicEventMeta extends SCThingMeta implements SCMetaTranslations<SCAcademicEvent> {
export class SCAcademicEventMeta
extends SCThingMeta
implements SCMetaTranslations<SCAcademicEvent> {
/**
* Translations of fields
*/
fieldTranslations = {
de: {
... SCEventMeta.getInstance().fieldTranslations.de,
... SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCAcademicEventCategories,
SCThingWithCategoriesSpecificValues>().fieldTranslations.de,
...SCEventMeta.getInstance().fieldTranslations.de,
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCAcademicEventCategories,
SCThingWithCategoriesSpecificValues>().fieldTranslations.de,
},
en: {
... SCEventMeta.getInstance().fieldTranslations.en,
... SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCAcademicEventCategories,
SCThingWithCategoriesSpecificValues>().fieldTranslations.en,
...SCEventMeta.getInstance().fieldTranslations.en,
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCAcademicEventCategories,
SCThingWithCategoriesSpecificValues>().fieldTranslations.en,
},
};
/**
* Translations of values of fields
*/
fieldValueTranslations = {
fieldValueTranslations = {
de: {
... SCEventMeta.getInstance().fieldValueTranslations.de,
... SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCAcademicEventCategories,
SCThingWithCategoriesSpecificValues>().fieldValueTranslations.de,
...SCEventMeta.getInstance().fieldValueTranslations.de,
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCAcademicEventCategories,
SCThingWithCategoriesSpecificValues>().fieldValueTranslations.de,
type: 'akademische Veranstaltung',
},
en: {
... SCEventMeta.getInstance().fieldValueTranslations.en,
... SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCAcademicEventCategories,
SCThingWithCategoriesSpecificValues>().fieldValueTranslations.en,
...SCEventMeta.getInstance().fieldValueTranslations.en,
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCAcademicEventCategories,
SCThingWithCategoriesSpecificValues>().fieldValueTranslations.en,
type: SCThingType.AcademicEvent,
},
};

View File

@@ -19,6 +19,7 @@ import {
SCCreativeWorkWithoutReferences,
} from '../base/CreativeWork';
import {
SCThingWithCategories,
SCThingWithCategoriesSpecificValues,
SCThingWithCategoriesTranslatableProperties,
SCThingWithCategoriesWithoutReferences,
@@ -32,8 +33,7 @@ import {SCMetaTranslations, SCTranslations} from '../types/i18n';
*/
export interface SCArticleWithoutReferences
extends SCCreativeWorkWithoutReferences,
SCThingWithCategoriesWithoutReferences<SCArticleCategories,
SCThingWithCategoriesSpecificValues> {
SCThingWithCategoriesWithoutReferences<SCArticleCategories, SCThingWithCategoriesSpecificValues> {
/**
* Article itself as markdown
*/
@@ -55,7 +55,9 @@ export interface SCArticleWithoutReferences
*
* @validatable
*/
export interface SCArticle extends SCCreativeWork, SCArticleWithoutReferences {
export interface SCArticle
extends SCCreativeWork, SCArticleWithoutReferences,
SCThingWithCategories<SCArticleCategories, SCThingWithCategoriesSpecificValues> {
/**
* Translated fields of an article
*/
@@ -86,37 +88,38 @@ export interface SCArticleTranslatableProperties
/**
* Meta information about an article
*/
export class SCArticleMeta extends SCThingMeta implements SCMetaTranslations<SCArticle> {
export class SCArticleMeta
extends SCThingMeta implements SCMetaTranslations<SCArticle> {
/**
* Translations of fields
*/
fieldTranslations = {
de: {
... SCCreativeWorkMeta.getInstance().fieldTranslations.de,
... SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCArticleCategories,
SCThingWithCategoriesSpecificValues>().fieldTranslations.de,
...SCCreativeWorkMeta.getInstance().fieldTranslations.de,
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCArticleCategories,
SCThingWithCategoriesSpecificValues>().fieldTranslations.de,
},
en: {
... SCCreativeWorkMeta.getInstance().fieldTranslations.en,
... SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCArticleCategories,
SCThingWithCategoriesSpecificValues>().fieldTranslations.en,
...SCCreativeWorkMeta.getInstance().fieldTranslations.en,
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCArticleCategories,
SCThingWithCategoriesSpecificValues>().fieldTranslations.en,
},
};
/**
* Translations of values of fields
*/
fieldValueTranslations = {
fieldValueTranslations = {
de: {
... SCCreativeWorkMeta.getInstance().fieldValueTranslations.de,
... SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCArticleCategories,
SCThingWithCategoriesSpecificValues>().fieldValueTranslations.de,
...SCCreativeWorkMeta.getInstance().fieldValueTranslations.de,
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCArticleCategories,
SCThingWithCategoriesSpecificValues>().fieldValueTranslations.de,
type: 'Artikel',
},
en: {
... SCCreativeWorkMeta.getInstance().fieldValueTranslations.en,
... SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCArticleCategories,
SCThingWithCategoriesSpecificValues>().fieldValueTranslations.en,
...SCCreativeWorkMeta.getInstance().fieldValueTranslations.en,
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCArticleCategories,
SCThingWithCategoriesSpecificValues>().fieldValueTranslations.en,
type: SCThingType.Article,
},
};

View File

@@ -26,7 +26,8 @@ import {SCPersonWithoutReferences} from './Person';
/**
* A book without references
*/
export interface SCBookWithoutReferences extends SCCreativeWorkWithoutReferences {
export interface SCBookWithoutReferences
extends SCCreativeWorkWithoutReferences {
/**
* Edition of a book
*/
@@ -58,7 +59,8 @@ export interface SCBookWithoutReferences extends SCCreativeWorkWithoutReferences
*
* @validatable
*/
export interface SCBook extends SCCreativeWork, SCBookWithoutReferences {
export interface SCBook
extends SCCreativeWork, SCBookWithoutReferences {
/**
* Authors of the creative work
*/
@@ -95,23 +97,23 @@ export class SCBookMeta extends SCThingMeta implements SCMetaTranslations<SCBook
*/
fieldTranslations = {
de: {
... SCCreativeWorkMeta.getInstance().fieldTranslations.de,
...SCCreativeWorkMeta.getInstance().fieldTranslations.de,
},
en: {
... SCCreativeWorkMeta.getInstance().fieldTranslations.en,
...SCCreativeWorkMeta.getInstance().fieldTranslations.en,
},
};
/**
* Translations of values of fields
*/
fieldValueTranslations = {
fieldValueTranslations = {
de: {
... SCCreativeWorkMeta.getInstance().fieldValueTranslations.de,
...SCCreativeWorkMeta.getInstance().fieldValueTranslations.de,
type: 'Buch',
},
en: {
... SCCreativeWorkMeta.getInstance().fieldValueTranslations.en,
...SCCreativeWorkMeta.getInstance().fieldValueTranslations.en,
type: SCThingType.Book,
},
};

View File

@@ -13,11 +13,13 @@
* this program. If not, see <https://www.gnu.org/licenses/>.
*/
import {
SCPlace,
SCPlaceWithoutReferences,
SCPlaceWithoutReferencesMeta,
SCPlaceWithoutReferencesTranslatableProperties,
} from '../base/Place';
import {
SCThingWithCategories,
SCThingWithCategoriesSpecificValues,
SCThingWithCategoriesTranslatableProperties,
SCThingWithCategoriesWithoutReferences,
@@ -37,8 +39,7 @@ export type SCBuildingCategories =
| 'restroom';
export interface SCBuildingWithoutReferences
extends SCThingWithCategoriesWithoutReferences<SCBuildingCategories,
SCThingWithCategoriesSpecificValues>,
extends SCThingWithCategoriesWithoutReferences<SCBuildingCategories, SCThingWithCategoriesSpecificValues>,
SCPlaceWithoutReferences {
/**
* Categories of a building
@@ -66,7 +67,9 @@ export interface SCBuildingWithoutReferences
*
* @validatable
*/
export interface SCBuilding extends SCBuildingWithoutReferences {
export interface SCBuilding
extends SCBuildingWithoutReferences, SCPlace,
SCThingWithCategories<SCBuildingCategories, SCThingWithCategoriesSpecificValues> {
/**
* Translated fields of a building
*/
@@ -79,39 +82,41 @@ export interface SCBuilding extends SCBuildingWithoutReferences {
}
export interface SCBuildingTranslatableProperties
extends SCPlaceWithoutReferencesTranslatableProperties, SCThingWithCategoriesTranslatableProperties {
extends SCPlaceWithoutReferencesTranslatableProperties, SCThingWithCategoriesTranslatableProperties {
floors?: string[];
}
/**
* Meta information about a place
*/
export class SCBuildingMeta extends SCThingMeta implements SCMetaTranslations<SCBuilding> {
/**
* Meta information about a place
*/
export class SCBuildingMeta
extends SCThingMeta
implements SCMetaTranslations<SCBuilding> {
/**
* Translations of fields
*/
fieldTranslations = {
de: {
... SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCBuildingCategories,
SCThingWithCategoriesSpecificValues>().fieldTranslations.de,
... SCPlaceWithoutReferencesMeta.getInstance().fieldTranslations.de,
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCBuildingCategories,
SCThingWithCategoriesSpecificValues>().fieldTranslations.de,
...SCPlaceWithoutReferencesMeta.getInstance().fieldTranslations.de,
floors: 'Etagen',
},
en: {
... SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCBuildingCategories,
SCThingWithCategoriesSpecificValues>().fieldTranslations.en,
... SCPlaceWithoutReferencesMeta.getInstance().fieldTranslations.en,
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCBuildingCategories,
SCThingWithCategoriesSpecificValues>().fieldTranslations.en,
...SCPlaceWithoutReferencesMeta.getInstance().fieldTranslations.en,
},
};
/**
* Translations of values of fields
*/
fieldValueTranslations = {
fieldValueTranslations = {
de: {
... SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCBuildingCategories,
SCThingWithCategoriesSpecificValues>().fieldValueTranslations.de,
... SCPlaceWithoutReferencesMeta.getInstance().fieldValueTranslations.de,
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCBuildingCategories,
SCThingWithCategoriesSpecificValues>().fieldValueTranslations.de,
...SCPlaceWithoutReferencesMeta.getInstance().fieldValueTranslations.de,
categories: {
'cafe': 'Café',
'canteen': 'Kantine',
@@ -125,9 +130,9 @@ export class SCBuildingMeta extends SCThingMeta implements SCMetaTranslations<SC
type: 'Gebäude',
},
en: {
... SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCBuildingCategories,
SCThingWithCategoriesSpecificValues>().fieldValueTranslations.en,
... SCPlaceWithoutReferencesMeta.getInstance().fieldValueTranslations.en,
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCBuildingCategories,
SCThingWithCategoriesSpecificValues>().fieldValueTranslations.en,
...SCPlaceWithoutReferencesMeta.getInstance().fieldValueTranslations.en,
type: SCThingType.Building,
},
};

View File

@@ -14,19 +14,20 @@
*/
import {SCAcademicTermWithoutReferences} from '../base/AcademicTerm';
import {
SCThingWithCategories,
SCThingWithCategoriesSpecificValues,
SCThingWithCategoriesTranslatableProperties,
SCThingWithCategoriesWithoutReferences,
SCThingWithCategoriesWithoutReferencesMeta,
} from '../base/ThingWithCategories';
import {SCThingMeta, SCThingType} from '../Thing';
import {SCMetaTranslations} from '../types/i18n';
import {SCThing, SCThingMeta, SCThingType} from '../Thing';
import {SCMetaTranslations, SCTranslations} from '../types/i18n';
/**
* A catalog without references
*/
export interface SCCatalogWithoutReferences
extends SCThingWithCategoriesWithoutReferences<SCCatalogCategories,
SCThingWithCategoriesSpecificValues> {
extends SCThingWithCategoriesWithoutReferences<SCCatalogCategories, SCThingWithCategoriesSpecificValues> {
/**
* Level of the catalog (0 for 'root catalog', 1 for its subcatalog, 2 for its subcatalog etc.)
*
@@ -45,7 +46,9 @@ export interface SCCatalogWithoutReferences
*
* @validatable
*/
export interface SCCatalog extends SCCatalogWithoutReferences {
export interface SCCatalog
extends SCCatalogWithoutReferences, SCThing,
SCThingWithCategories<SCCatalogCategories, SCThingWithCategoriesSpecificValues> {
/**
* Academic term that a catalog belongs to (e.g. semester)
*/
@@ -61,42 +64,48 @@ export interface SCCatalog extends SCCatalogWithoutReferences {
*/
superCatalogs?: SCCatalogWithoutReferences[];
/**
* Translated fields of a catalog
*/
translations?: SCTranslations<SCThingWithCategoriesTranslatableProperties>;
/**
* Type of a catalog
*/
type: SCThingType.Catalog;
}
/**
* Catalog meta data
*/
export class SCCatalogMeta extends SCThingMeta implements SCMetaTranslations<SCCatalog> {
/**
* Catalog meta data
*/
export class SCCatalogMeta
extends SCThingMeta implements SCMetaTranslations<SCCatalog> {
/**
* Translations of fields
*/
fieldTranslations = {
de: {
... SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCCatalogCategories,
SCThingWithCategoriesSpecificValues>().fieldTranslations.de,
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCCatalogCategories,
SCThingWithCategoriesSpecificValues>().fieldTranslations.de,
},
en: {
... SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCCatalogCategories,
SCThingWithCategoriesSpecificValues>().fieldTranslations.en,
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCCatalogCategories,
SCThingWithCategoriesSpecificValues>().fieldTranslations.en,
},
};
/**
* Translations of values of fields
*/
fieldValueTranslations = {
fieldValueTranslations = {
de: {
... SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCCatalogCategories,
SCThingWithCategoriesSpecificValues>().fieldValueTranslations.de,
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCCatalogCategories,
SCThingWithCategoriesSpecificValues>().fieldValueTranslations.de,
type: 'Verzeichnis',
},
en: {
... SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCCatalogCategories,
SCThingWithCategoriesSpecificValues>().fieldValueTranslations.en,
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCCatalogCategories,
SCThingWithCategoriesSpecificValues>().fieldValueTranslations.en,
type: SCThingType.Catalog,
},
};

View File

@@ -12,7 +12,7 @@
* 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 {SCAcademicDegree, SCAcademicDegreeMeta} from '../base/AcademicDegree';
import {SCAcademicDegree, SCAcademicDegreeMeta, SCAcademicDegreeWithoutReferences} from '../base/AcademicDegree';
import {
SCAcademicPriceGroup,
SCThingThatCanBeOffered,
@@ -22,13 +22,13 @@ import {
import {SCThingMeta, SCThingType} from '../Thing';
import {SCLanguage, SCMetaTranslations, SCTranslations} from '../types/i18n';
import {SCDateSeriesWithoutReferences} from './DateSeries';
import {SCOrganization} from './Organization';
import {SCOrganizationWithoutReferences} from './Organization';
/**
* A course of studies without references
*/
export interface SCCourseOfStudiesWithoutReferences extends SCAcademicDegree,
SCThingThatCanBeOfferedWithoutReferences {
export interface SCCourseOfStudiesWithoutReferences
extends SCAcademicDegreeWithoutReferences, SCThingThatCanBeOfferedWithoutReferences {
/**
* The main language in which the course of studies
* is beeing offered
@@ -66,18 +66,18 @@ export interface SCCourseOfStudiesWithoutReferences extends SCAcademicDegree,
*
* @validatable
*/
export interface SCCourseOfStudies extends SCCourseOfStudiesWithoutReferences,
SCThingThatCanBeOffered<SCAcademicPriceGroup> {
export interface SCCourseOfStudies
extends SCCourseOfStudiesWithoutReferences, SCThingThatCanBeOffered<SCAcademicPriceGroup>, SCAcademicDegree {
/**
* The department that manages the course of studies
*/
department: SCOrganization;
department: SCOrganizationWithoutReferences;
/**
* The secretary that administers requests and
* questions concerning the course of studies
*/
secretary: SCOrganization;
secretary: SCOrganizationWithoutReferences;
/**
* Dates at which the course of studies is planned to start
@@ -85,7 +85,7 @@ export interface SCCourseOfStudies extends SCCourseOfStudiesWithoutReferences,
startDates?: SCDateSeriesWithoutReferences[];
/**
* Translated fields of a dish
* Translated fields of a course of studies
*/
translations?: SCTranslations<SCCourseOfStudiesTranslatableProperties>;
@@ -95,14 +95,20 @@ export interface SCCourseOfStudies extends SCCourseOfStudiesWithoutReferences,
type: SCThingType.CourseOfStudies;
}
/**
* Translatable properties of a course of studies
*/
export interface SCCourseOfStudiesTranslatableProperties
extends SCThingThatCanBeOfferedTranslatableProperties {
// noop
}
/**
* Meta information about a course of studies
*/
export class SCCourseOfStudiesMeta extends SCThingMeta implements SCMetaTranslations<SCCourseOfStudies> {
export class SCCourseOfStudiesMeta
extends SCThingMeta
implements SCMetaTranslations<SCCourseOfStudies> {
/**
* Translations of fields
*/

View File

@@ -29,7 +29,8 @@ import {SCSportCourseWithoutReferences} from './SportCourse';
/**
* Price groups for sport courses
*/
export interface SCSportCoursePriceGroup extends SCAcademicPriceGroup {
export interface SCSportCoursePriceGroup
extends SCAcademicPriceGroup {
/**
* Price for alumnis
*/
@@ -39,7 +40,8 @@ export interface SCSportCoursePriceGroup extends SCAcademicPriceGroup {
/**
* A date without references
*/
export interface SCDateSeriesWithoutReferences extends SCThingThatCanBeOfferedWithoutReferences {
export interface SCDateSeriesWithoutReferences
extends SCThingThatCanBeOfferedWithoutReferences {
/**
* Dates of the date series that are initially planned to be held
*/
@@ -76,9 +78,10 @@ export interface SCDateSeriesWithoutReferences extends SCThingThatCanBeOfferedWi
*
* @validatable
*/
export interface SCDateSeries extends SCDateSeriesWithoutReferences,
SCThingInPlace,
SCThingThatCanBeOffered<SCSportCoursePriceGroup> {
export interface SCDateSeries
extends SCDateSeriesWithoutReferences,
SCThingInPlace,
SCThingThatCanBeOffered<SCSportCoursePriceGroup> {
/**
* Event to which the date series belongs
*/
@@ -104,7 +107,9 @@ export interface SCDateSeries extends SCDateSeriesWithoutReferences,
/**
* Meta information about a date series
*/
export class SCDateSeriesMeta extends SCThingMeta implements SCMetaTranslations<SCDateSeries> {
export class SCDateSeriesMeta
extends SCThingMeta
implements SCMetaTranslations<SCDateSeries> {
/**
* Translations of fields
*/

View File

@@ -14,14 +14,15 @@
*/
import * as jsonpatch from 'json-patch';
import {SCThingsWithoutDiff} from '../Classes';
import {SCThing, SCThingMeta, SCThingType} from '../Thing';
import {SCThing, SCThingMeta, SCThingType, SCThingWithoutReferences} from '../Thing';
import {SCMetaTranslations} from '../types/i18n';
import {SCISO8601Date} from '../types/Time';
/**
* A diff without references
*/
export interface SCDiffWithoutReferences extends SCThing {
export interface SCDiffWithoutReferences
extends SCThingWithoutReferences {
/**
* Action of the diff
*/
@@ -48,7 +49,8 @@ export interface SCDiffWithoutReferences extends SCThing {
*
* @validatable
*/
export interface SCDiff extends SCDiffWithoutReferences {
export interface SCDiff
extends SCDiffWithoutReferences, SCThing {
/**
* Original object the diff was generated on
*/
@@ -63,32 +65,34 @@ export interface SCDiff extends SCDiffWithoutReferences {
/**
* Meta information about a diff
*/
export class SCDiffMeta extends SCThingMeta implements SCMetaTranslations<SCDiff> {
export class SCDiffMeta
extends SCThingMeta
implements SCMetaTranslations<SCDiff> {
/**
* Translations of fields
*/
fieldTranslations = {
de: {
... SCThingMeta.getInstance().fieldTranslations.de,
...SCThingMeta.getInstance().fieldTranslations.de,
action: 'Aktion',
changes: 'Änderungen',
dateCreated: 'Erstellungsdatum',
},
en: {
... SCThingMeta.getInstance().fieldTranslations.en,
...SCThingMeta.getInstance().fieldTranslations.en,
},
};
/**
* Translations of values of fields
*/
fieldValueTranslations = {
fieldValueTranslations = {
de: {
... SCThingMeta.getInstance().fieldValueTranslations.de,
...SCThingMeta.getInstance().fieldValueTranslations.de,
type: 'Unterschied',
},
en: {
... SCThingMeta.getInstance().fieldValueTranslations.en,
...SCThingMeta.getInstance().fieldValueTranslations.en,
type: SCThingType.Diff,
},
};

View File

@@ -19,6 +19,7 @@ import {
SCThingThatCanBeOfferedWithoutReferences,
} from '../base/ThingThatCanBeOffered';
import {
SCThingWithCategories,
SCThingWithCategoriesSpecificValues,
SCThingWithCategoriesTranslatableProperties,
SCThingWithCategoriesWithoutReferences,
@@ -30,8 +31,9 @@ import {SCMetaTranslations, SCTranslations} from '../types/i18n';
/**
* A dish without references
*/
export interface SCDishWithoutReferences extends SCThingThatCanBeOfferedWithoutReferences,
SCThingWithCategoriesWithoutReferences<SCDishCategories, SCThingWithCategoriesSpecificValues> {
export interface SCDishWithoutReferences
extends SCThingThatCanBeOfferedWithoutReferences,
SCThingWithCategoriesWithoutReferences<SCDishCategories, SCThingWithCategoriesSpecificValues> {
/**
* Additives of the dish
*/
@@ -68,8 +70,9 @@ export interface SCDishWithoutReferences extends SCThingThatCanBeOfferedWithoutR
*
* @validatable
*/
export interface SCDish extends SCDishWithoutReferences,
SCThingThatCanBeOffered<SCAcademicPriceGroup> {
export interface SCDish
extends SCDishWithoutReferences, SCThingThatCanBeOffered<SCAcademicPriceGroup>,
SCThingWithCategories<SCDishCategories, SCThingWithCategoriesSpecificValues> {
/**
* Dishes ("Beilagen") that are served with the dish (if only certain supplement dishes can be taken with a dish)
*/
@@ -165,7 +168,9 @@ export interface SCNutritionInformation {
/**
* Meta information about a dish
*/
export class SCDishMeta extends SCThingMeta implements SCMetaTranslations<SCDish> {
export class SCDishMeta
extends SCThingMeta
implements SCMetaTranslations<SCDish> {
/**
* Translations of fields
*/

View File

@@ -40,8 +40,9 @@ export type SCFavoriteDataTypes = SCAcademicEventWithoutReferences
/**
* A favorite without references
*/
export interface SCFavoriteWithoutReferences extends SCSaveableThingWithoutReferences {
export interface SCFavoriteWithoutReferences
extends SCSaveableThingWithoutReferences {
// noop
}
/**
@@ -49,7 +50,8 @@ export interface SCFavoriteWithoutReferences extends SCSaveableThingWithoutRefer
*
* @validatable
*/
export interface SCFavorite extends SCSaveableThing<SCFavoriteDataTypes> {
export interface SCFavorite
extends SCSaveableThing<SCFavoriteDataTypes>, SCFavoriteWithoutReferences {
/**
* Type of a favorite
*/
@@ -59,5 +61,6 @@ export interface SCFavorite extends SCSaveableThing<SCFavoriteDataTypes> {
/**
* Meta information about a favorite
*/
export class SCFavoriteMeta extends SCThingMeta {
export class SCFavoriteMeta
extends SCThingMeta {
}

View File

@@ -14,7 +14,7 @@
*/
import {Feature, FeatureCollection, GeometryObject, LineString} from 'geojson';
import {SCThingInPlace, SCThingInPlaceMeta} from '../base/ThingInPlace';
import {SCThing, SCThingMeta, SCThingTranslatableProperties, SCThingType} from '../Thing';
import {SCThingMeta, SCThingTranslatableProperties, SCThingType, SCThingWithoutReferences} from '../Thing';
import {SCMetaTranslations, SCTranslations} from '../types/i18n';
import {SCPointOfInterestWithoutReferences} from './PointOfInterest';
import {SCRoomWithoutReferences} from './Room';
@@ -22,7 +22,8 @@ import {SCRoomWithoutReferences} from './Room';
/**
* A floor without references
*/
export interface SCFloorWithoutReferences extends SCThing {
export interface SCFloorWithoutReferences
extends SCThingWithoutReferences {
/**
* Floor name in the place it is in e.g. "first floor", "ground floor". This doesn't reference the building name.
*/
@@ -49,7 +50,8 @@ export interface SCFloorWithoutReferences extends SCThing {
*
* @validatable
*/
export interface SCFloor extends SCFloorWithoutReferences, SCThingInPlace {
export interface SCFloor
extends SCFloorWithoutReferences, SCThingInPlace {
/**
* Translated fields of a floor
*/
@@ -86,7 +88,8 @@ export interface SCFloorFeatureWithPlace<T extends GeometryObject, P = any>
/**
* Translatable properties of a floor
*/
export interface SCFloorTranslatableProperties extends SCThingTranslatableProperties {
export interface SCFloorTranslatableProperties
extends SCThingTranslatableProperties {
/**
* Translation of the floor name
*/
@@ -96,29 +99,31 @@ export interface SCFloorTranslatableProperties extends SCThingTranslatableProper
/**
* Meta information about floors
*/
export class SCFloorMeta extends SCThingMeta implements SCMetaTranslations<SCFloor> {
export class SCFloorMeta
extends SCThingMeta
implements SCMetaTranslations<SCFloor> {
/**
* Translations of fields
*/
fieldTranslations = {
de: {
... SCThingInPlaceMeta.getInstance().fieldTranslations.de,
...SCThingInPlaceMeta.getInstance().fieldTranslations.de,
},
en: {
... SCThingInPlaceMeta.getInstance().fieldTranslations.en,
...SCThingInPlaceMeta.getInstance().fieldTranslations.en,
},
};
/**
* Translations of values of fields
*/
fieldValueTranslations = {
fieldValueTranslations = {
de: {
... SCThingInPlaceMeta.getInstance().fieldValueTranslations.de,
...SCThingInPlaceMeta.getInstance().fieldValueTranslations.de,
type: 'Etage',
},
en: {
... SCThingInPlaceMeta.getInstance().fieldValueTranslations.en,
...SCThingInPlaceMeta.getInstance().fieldValueTranslations.en,
type: SCThingType.Floor,
},
};

View File

@@ -26,7 +26,8 @@ import {SCISO8601Date} from '../types/Time';
/**
* A message without references
*/
export interface SCMessageWithoutReferences extends SCCreativeWorkWithoutReferences {
export interface SCMessageWithoutReferences
extends SCCreativeWorkWithoutReferences {
/**
* Audience of the message
*/
@@ -58,7 +59,8 @@ export interface SCMessageWithoutReferences extends SCCreativeWorkWithoutReferen
*
* @validatable
*/
export interface SCMessage extends SCCreativeWork, SCMessageWithoutReferences {
export interface SCMessage
extends SCCreativeWork, SCMessageWithoutReferences {
/**
* Translated fields of a message
*/
@@ -92,29 +94,31 @@ export interface SCMessageTranslatableProperties
/**
* Meta information about messages
*/
export class SCMessageMeta extends SCThingMeta implements SCMetaTranslations<SCMessage> {
export class SCMessageMeta
extends SCThingMeta
implements SCMetaTranslations<SCMessage> {
/**
* Translations of fields
*/
fieldTranslations = {
de: {
... SCCreativeWorkMeta.getInstance().fieldTranslations.de,
...SCCreativeWorkMeta.getInstance().fieldTranslations.de,
},
en: {
... SCCreativeWorkMeta.getInstance().fieldTranslations.en,
...SCCreativeWorkMeta.getInstance().fieldTranslations.en,
},
};
/**
* Translations of values of fields
*/
fieldValueTranslations = {
fieldValueTranslations = {
de: {
... SCCreativeWorkMeta.getInstance().fieldValueTranslations.de,
...SCCreativeWorkMeta.getInstance().fieldValueTranslations.de,
type: 'Nachricht',
},
en: {
... SCCreativeWorkMeta.getInstance().fieldValueTranslations.en,
...SCCreativeWorkMeta.getInstance().fieldValueTranslations.en,
type: SCThingType.Message,
},
};

View File

@@ -13,12 +13,13 @@
* this program. If not, see <https://www.gnu.org/licenses/>.
*/
import {SCThingInPlace} from '../base/ThingInPlace';
import {SCThing, SCThingMeta, SCThingType} from '../Thing';
import {SCThingMeta, SCThingType, SCThingWithoutReferences} from '../Thing';
/**
* An organization without references
*/
export interface SCOrganizationWithoutReferences extends SCThing {
export interface SCOrganizationWithoutReferences
extends SCThingWithoutReferences {
/**
* Type of an organization
*/
@@ -30,7 +31,8 @@ export interface SCOrganizationWithoutReferences extends SCThing {
*
* @validatable
*/
export interface SCOrganization extends SCOrganizationWithoutReferences, SCThingInPlace {
export interface SCOrganization
extends SCOrganizationWithoutReferences, SCThingInPlace {
/**
* Type of an organization
*/

View File

@@ -12,7 +12,7 @@
* 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 {SCThing, SCThingMeta, SCThingType} from '../Thing';
import {SCThing, SCThingMeta, SCThingType, SCThingWithoutReferences} from '../Thing';
import {SCMetaTranslations, SCNationality} from '../types/i18n';
import {SCISO8601Date} from '../types/Time';
import {SCBuildingWithoutReferences} from './Building';
@@ -23,7 +23,8 @@ import {SCRoomWithoutReferences} from './Room';
/**
* A person without references
*/
export interface SCPersonWithoutReferences extends SCThing {
export interface SCPersonWithoutReferences
extends SCThingWithoutReferences {
/**
* Additional first names of the person.
*/
@@ -102,7 +103,8 @@ export interface SCPersonWithoutReferences extends SCThing {
*
* @validatable
*/
export interface SCPerson extends SCPersonWithoutReferences {
export interface SCPerson
extends SCPersonWithoutReferences, SCThing {
/**
* Organization the person works for
*/
@@ -129,29 +131,31 @@ export interface SCPerson extends SCPersonWithoutReferences {
/**
* Meta information about a person
*/
export class SCPersonMeta extends SCThingMeta implements SCMetaTranslations<SCPerson> {
export class SCPersonMeta
extends SCThingMeta
implements SCMetaTranslations<SCPerson> {
/**
* Translations of fields
*/
fieldTranslations = {
de: {
... SCThingMeta.getInstance().fieldTranslations.de,
...SCThingMeta.getInstance().fieldTranslations.de,
},
en: {
... SCThingMeta.getInstance().fieldTranslations.en,
...SCThingMeta.getInstance().fieldTranslations.en,
},
};
/**
* Translations of values of fields
*/
fieldValueTranslations = {
fieldValueTranslations = {
de: {
... SCThingMeta.getInstance().fieldValueTranslations.de,
...SCThingMeta.getInstance().fieldValueTranslations.de,
type: 'Person',
},
en: {
... SCThingMeta.getInstance().fieldValueTranslations.en,
...SCThingMeta.getInstance().fieldValueTranslations.en,
type: SCThingType.Person,
},
};

View File

@@ -12,9 +12,10 @@
* 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 {SCPlaceWithoutReferences, SCPlaceWithoutReferencesMeta} from '../base/Place';
import {SCPlace, SCPlaceWithoutReferences, SCPlaceWithoutReferencesMeta} from '../base/Place';
import {SCThingInPlace} from '../base/ThingInPlace';
import {
SCThingWithCategories,
SCThingWithCategoriesSpecificValues,
SCThingWithCategoriesTranslatableProperties,
SCThingWithCategoriesWithoutReferences,
@@ -27,8 +28,7 @@ import {SCMetaTranslations, SCTranslations} from '../types/i18n';
* A point of interest without references
*/
export interface SCPointOfInterestWithoutReferences
extends SCThingWithCategoriesWithoutReferences<SCPointOfInterestCategories,
SCThingWithCategoriesSpecificValues>,
extends SCThingWithCategoriesWithoutReferences<SCPointOfInterestCategories, SCThingWithCategoriesSpecificValues>,
SCPlaceWithoutReferences {
/**
* Translated properties of a point of interest
@@ -46,7 +46,9 @@ export interface SCPointOfInterestWithoutReferences
*
* @validatable
*/
export interface SCPointOfInterest extends SCPointOfInterestWithoutReferences, SCThingInPlace {
export interface SCPointOfInterest
extends SCPointOfInterestWithoutReferences, SCThingInPlace, SCPlace,
SCThingWithCategories<SCPointOfInterestCategories, SCThingWithCategoriesSpecificValues> {
/**
* Translated properties of a point of interest
*/
@@ -71,39 +73,41 @@ export type SCPointOfInterestCategories =
/**
* Meta information about points of interest
*/
export class SCPointOfInterestMeta extends SCThingMeta implements SCMetaTranslations<SCPointOfInterest> {
export class SCPointOfInterestMeta
extends SCThingMeta
implements SCMetaTranslations<SCPointOfInterest> {
/**
* Translations of fields
*/
fieldTranslations = {
de: {
// tslint:disable-next-line:max-line-length
... SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCPointOfInterestCategories,
SCThingWithCategoriesSpecificValues>().fieldTranslations.de,
... SCPlaceWithoutReferencesMeta.getInstance().fieldTranslations.de,
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCPointOfInterestCategories,
SCThingWithCategoriesSpecificValues>().fieldTranslations.de,
...SCPlaceWithoutReferencesMeta.getInstance().fieldTranslations.de,
},
en: {
// tslint:disable-next-line:max-line-length
... SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCPointOfInterestCategories,
SCThingWithCategoriesSpecificValues>().fieldTranslations.en,
... SCPlaceWithoutReferencesMeta.getInstance().fieldTranslations.en,
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCPointOfInterestCategories,
SCThingWithCategoriesSpecificValues>().fieldTranslations.en,
...SCPlaceWithoutReferencesMeta.getInstance().fieldTranslations.en,
},
};
/**
* Translations of values of fields
*/
fieldValueTranslations = {
fieldValueTranslations = {
de: {
... SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCPointOfInterestCategories,
SCThingWithCategoriesSpecificValues>().fieldValueTranslations.de,
... SCPlaceWithoutReferencesMeta.getInstance().fieldValueTranslations.de,
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCPointOfInterestCategories,
SCThingWithCategoriesSpecificValues>().fieldValueTranslations.de,
...SCPlaceWithoutReferencesMeta.getInstance().fieldValueTranslations.de,
type: 'Sonderziel',
},
en: {
... SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCPointOfInterestCategories,
SCThingWithCategoriesSpecificValues>().fieldValueTranslations.en,
... SCPlaceWithoutReferencesMeta.getInstance().fieldValueTranslations.en,
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCPointOfInterestCategories,
SCThingWithCategoriesSpecificValues>().fieldValueTranslations.en,
...SCPlaceWithoutReferencesMeta.getInstance().fieldValueTranslations.en,
type: SCThingType.PointOfInterest,
},
};

View File

@@ -12,13 +12,15 @@
* 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 {SCPlaceWithoutReferences, SCPlaceWithoutReferencesMeta} from '../base/Place';
import {SCPlace, SCPlaceWithoutReferences, SCPlaceWithoutReferencesMeta} from '../base/Place';
import {SCThingInPlace, SCThingInPlaceMeta} from '../base/ThingInPlace';
import {
SCThingThatAcceptsPayments,
SCThingThatAcceptsPaymentsWithoutReferences,
SCThingThatAcceptsPaymentsWithoutReferencesMeta,
} from '../base/ThingThatAcceptsPayments';
import {
SCThingWithCategories,
SCThingWithCategoriesSpecificValues,
SCThingWithCategoriesTranslatableProperties,
SCThingWithCategoriesWithoutReferences,
@@ -81,7 +83,9 @@ export interface SCRoomWithoutReferences
*
* @validatable
*/
export interface SCRoom extends SCRoomWithoutReferences, SCThingInPlace {
export interface SCRoom
extends SCRoomWithoutReferences, SCThingInPlace, SCThingThatAcceptsPayments, SCPlace,
SCThingWithCategories<SCRoomCategories, SCRoomSpecificValues> {
/**
* Translations of specific values of the object
*
@@ -98,7 +102,8 @@ export interface SCRoom extends SCRoomWithoutReferences, SCThingInPlace {
/**
* Category specific values of a room
*/
export interface SCRoomSpecificValues extends SCThingWithCategoriesSpecificValues {
export interface SCRoomSpecificValues
extends SCThingWithCategoriesSpecificValues {
/**
* Category specific opening hours of the room
*/
@@ -108,37 +113,39 @@ export interface SCRoomSpecificValues extends SCThingWithCategoriesSpecificValue
/**
* Meta information about a place
*/
export class SCRoomMeta extends SCThingMeta implements SCMetaTranslations<SCRoom> {
export class SCRoomMeta
extends SCThingMeta
implements SCMetaTranslations<SCRoom> {
/**
* Translations of fields
*/
fieldTranslations = {
de: {
... SCPlaceWithoutReferencesMeta.getInstance().fieldTranslations.de,
... SCThingThatAcceptsPaymentsWithoutReferencesMeta.getInstance().fieldTranslations.de,
... SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCRoomCategories,
SCRoomSpecificValues>().fieldTranslations.de,
... SCThingInPlaceMeta.getInstance().fieldTranslations.de,
...SCPlaceWithoutReferencesMeta.getInstance().fieldTranslations.de,
...SCThingThatAcceptsPaymentsWithoutReferencesMeta.getInstance().fieldTranslations.de,
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCRoomCategories,
SCRoomSpecificValues>().fieldTranslations.de,
...SCThingInPlaceMeta.getInstance().fieldTranslations.de,
},
en: {
... SCPlaceWithoutReferencesMeta.getInstance().fieldTranslations.en,
... SCThingThatAcceptsPaymentsWithoutReferencesMeta.getInstance().fieldTranslations.en,
... SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCRoomCategories,
SCRoomSpecificValues>().fieldTranslations.en,
... SCThingInPlaceMeta.getInstance().fieldTranslations.en,
...SCPlaceWithoutReferencesMeta.getInstance().fieldTranslations.en,
...SCThingThatAcceptsPaymentsWithoutReferencesMeta.getInstance().fieldTranslations.en,
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCRoomCategories,
SCRoomSpecificValues>().fieldTranslations.en,
...SCThingInPlaceMeta.getInstance().fieldTranslations.en,
},
};
/**
* Translations of values of fields
*/
fieldValueTranslations = {
fieldValueTranslations = {
de: {
... SCPlaceWithoutReferencesMeta.getInstance().fieldValueTranslations.de,
... SCThingThatAcceptsPaymentsWithoutReferencesMeta.getInstance().fieldValueTranslations.de,
... SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCRoomCategories,
SCRoomSpecificValues>().fieldValueTranslations.de,
... SCThingInPlaceMeta.getInstance().fieldValueTranslations.de,
...SCPlaceWithoutReferencesMeta.getInstance().fieldValueTranslations.de,
...SCThingThatAcceptsPaymentsWithoutReferencesMeta.getInstance().fieldValueTranslations.de,
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCRoomCategories,
SCRoomSpecificValues>().fieldValueTranslations.de,
...SCThingInPlaceMeta.getInstance().fieldValueTranslations.de,
categories: {
'cafe': 'Café',
'canteen': 'Kantine',
@@ -157,11 +164,11 @@ export class SCRoomMeta extends SCThingMeta implements SCMetaTranslations<SCRoom
type: 'Raum',
},
en: {
... SCPlaceWithoutReferencesMeta.getInstance().fieldValueTranslations.en,
... SCThingThatAcceptsPaymentsWithoutReferencesMeta.getInstance().fieldValueTranslations.en,
... SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCRoomCategories,
SCRoomSpecificValues>().fieldValueTranslations.en,
... SCThingInPlaceMeta.getInstance().fieldValueTranslations.en,
...SCPlaceWithoutReferencesMeta.getInstance().fieldValueTranslations.en,
...SCThingThatAcceptsPaymentsWithoutReferencesMeta.getInstance().fieldValueTranslations.en,
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCRoomCategories,
SCRoomSpecificValues>().fieldValueTranslations.en,
...SCThingInPlaceMeta.getInstance().fieldValueTranslations.en,
type: SCThingType.Room,
},
};

View File

@@ -12,14 +12,19 @@
* 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 {SCAcademicTermWithoutReferences, SCAcademicTermWithoutReferencesMeta} from '../base/AcademicTerm';
import {
SCAcademicTerm,
SCAcademicTermWithoutReferences,
SCAcademicTermWithoutReferencesMeta,
} from '../base/AcademicTerm';
import {SCThingMeta, SCThingType} from '../Thing';
import {SCMetaTranslations} from '../types/i18n';
/**
* A semester without references
*/
export interface SCSemesterWithoutReferences extends SCAcademicTermWithoutReferences {
export interface SCSemesterWithoutReferences
extends SCAcademicTermWithoutReferences {
/**
* The short name of the semester, using the given pattern.
*
@@ -38,7 +43,8 @@ export interface SCSemesterWithoutReferences extends SCAcademicTermWithoutRefere
*
* @validatable
*/
export interface SCSemester extends SCSemesterWithoutReferences {
export interface SCSemester
extends SCSemesterWithoutReferences, SCAcademicTerm {
/**
* Type of the semester
*/
@@ -48,13 +54,15 @@ export interface SCSemester extends SCSemesterWithoutReferences {
/**
* Meta information about a semester
*/
export class SCSemesterMeta extends SCThingMeta implements SCMetaTranslations<SCSemester> {
export class SCSemesterMeta
extends SCThingMeta
implements SCMetaTranslations<SCSemester> {
/**
* Translations of fields
*/
fieldTranslations = {
de: {
... SCAcademicTermWithoutReferencesMeta.getInstance().fieldTranslations.de,
...SCAcademicTermWithoutReferencesMeta.getInstance().fieldTranslations.de,
acronym: 'Abkürzung',
endDate: 'Ende',
eventsEndDate: 'Vorlesungsschluss',
@@ -62,20 +70,20 @@ export class SCSemesterMeta extends SCThingMeta implements SCMetaTranslations<SC
startDate: 'Beginn',
},
en: {
... SCAcademicTermWithoutReferencesMeta.getInstance().fieldTranslations.en,
...SCAcademicTermWithoutReferencesMeta.getInstance().fieldTranslations.en,
},
};
/**
* Translations of values of fields
*/
fieldValueTranslations = {
fieldValueTranslations = {
de: {
... SCAcademicTermWithoutReferencesMeta.getInstance().fieldValueTranslations.de,
...SCAcademicTermWithoutReferencesMeta.getInstance().fieldValueTranslations.de,
type: 'Semester',
},
en: {
... SCAcademicTermWithoutReferencesMeta.getInstance().fieldValueTranslations.en,
...SCAcademicTermWithoutReferencesMeta.getInstance().fieldValueTranslations.en,
type: SCThingType.Semester,
},
};

View File

@@ -13,12 +13,13 @@
* this program. If not, see <https://www.gnu.org/licenses/>.
*/
import {
SCThingWithCategories,
SCThingWithCategoriesSpecificValues,
SCThingWithCategoriesTranslatableProperties,
SCThingWithCategoriesWithoutReferences,
SCThingWithCategoriesWithoutReferencesMeta,
} from '../base/ThingWithCategories';
import {SCThingMeta, SCThingType} from '../Thing';
import {SCThing, SCThingMeta, SCThingType} from '../Thing';
import {SCMetaTranslations, SCTranslations} from '../types/i18n';
export type SCSettingCategories = string;
@@ -74,7 +75,13 @@ export enum SCSettingInputType {
*
* @validatable
*/
export interface SCSetting extends SCSettingWithoutReferences {
export interface SCSetting
extends SCSettingWithoutReferences, SCThing,
SCThingWithCategories<SCSettingCategories, SCThingWithCategoriesSpecificValues> {
/**
* Translated fields of a setting
*/
translations?: SCTranslations<SCSettingValueTranslatableProperties>;
/**
* The type of this model
*/
@@ -111,8 +118,8 @@ export class SCSettingMeta extends SCThingMeta implements SCMetaTranslations<SCS
fieldTranslations = {
de: {
// tslint:disable-next-line:max-line-length
... SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCSettingCategories,
SCThingWithCategoriesSpecificValues>().fieldTranslations.de,
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCSettingCategories,
SCThingWithCategoriesSpecificValues>().fieldTranslations.de,
defaultValue: 'Standard Wert',
inputType: 'Eingabetyp',
value: 'Wert',
@@ -120,8 +127,8 @@ export class SCSettingMeta extends SCThingMeta implements SCMetaTranslations<SCS
},
en: {
// tslint:disable-next-line:max-line-length
... SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCSettingCategories,
SCThingWithCategoriesSpecificValues>().fieldTranslations.en,
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCSettingCategories,
SCThingWithCategoriesSpecificValues>().fieldTranslations.en,
defaultValue: 'default value',
inputType: 'input type',
},
@@ -130,24 +137,24 @@ export class SCSettingMeta extends SCThingMeta implements SCMetaTranslations<SCS
/**
* Translations of values of fields
*/
fieldValueTranslations = {
fieldValueTranslations = {
de: {
// tslint:disable-next-line:max-line-length
... SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCSettingCategories,
SCThingWithCategoriesSpecificValues>().fieldValueTranslations.de,
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCSettingCategories,
SCThingWithCategoriesSpecificValues>().fieldValueTranslations.de,
inputType: {
'multiple choice': 'mehrfach Auswahl',
number: 'Zahl',
password: 'Passwort',
'single choice': 'einfache Auswahl',
text: 'Text',
},
},
type: 'Einstellung',
},
en: {
// tslint:disable-next-line:max-line-length
... SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCSettingCategories,
SCThingWithCategoriesSpecificValues>().fieldValueTranslations.en,
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<SCSettingCategories,
SCThingWithCategoriesSpecificValues>().fieldValueTranslations.en,
type: SCThingType.Setting,
},
};

View File

@@ -19,7 +19,8 @@ import {SCMetaTranslations} from '../types/i18n';
/**
* A sport course without references
*/
export interface SCSportCourseWithoutReferences extends SCEventWithoutReferences {
export interface SCSportCourseWithoutReferences
extends SCEventWithoutReferences {
/**
* Type of a sport course
*/
@@ -31,7 +32,8 @@ export interface SCSportCourseWithoutReferences extends SCEventWithoutReferences
*
* @validatable
*/
export interface SCSportCourse extends SCEvent, SCSportCourseWithoutReferences {
export interface SCSportCourse
extends SCEvent, SCSportCourseWithoutReferences {
/**
* Type of a sport course
*/
@@ -41,33 +43,35 @@ export interface SCSportCourse extends SCEvent, SCSportCourseWithoutReferences {
/**
* Meta information about a sport course
*/
export class SCSportCourseMeta extends SCThingMeta implements SCMetaTranslations<SCSportCourse> {
export class SCSportCourseMeta
extends SCThingMeta
implements SCMetaTranslations<SCSportCourse> {
/**
* Translations of fields
*/
fieldTranslations = {
de: {
... SCThingMeta.getInstance().fieldTranslations.de,
... SCEventMeta.getInstance().fieldTranslations.de,
...SCThingMeta.getInstance().fieldTranslations.de,
...SCEventMeta.getInstance().fieldTranslations.de,
},
en: {
... SCThingMeta.getInstance().fieldTranslations.en,
... SCEventMeta.getInstance().fieldTranslations.en,
...SCThingMeta.getInstance().fieldTranslations.en,
...SCEventMeta.getInstance().fieldTranslations.en,
},
};
/**
* Translations of values of fields
*/
fieldValueTranslations = {
fieldValueTranslations = {
de: {
... SCThingMeta.getInstance().fieldValueTranslations.de,
... SCEventMeta.getInstance().fieldValueTranslations.de,
...SCThingMeta.getInstance().fieldValueTranslations.de,
...SCEventMeta.getInstance().fieldValueTranslations.de,
type: 'Sportkurs',
},
en: {
... SCThingMeta.getInstance().fieldValueTranslations.en,
... SCEventMeta.getInstance().fieldValueTranslations.en,
...SCThingMeta.getInstance().fieldValueTranslations.en,
...SCEventMeta.getInstance().fieldValueTranslations.en,
type: SCThingType.SportCourse,
},
};

View File

@@ -12,9 +12,12 @@
* 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 {SCAcademicPriceGroup,
SCThingThatCanBeOffered,
SCThingThatCanBeOfferedTranslatableProperties} from '../base/ThingThatCanBeOffered';
import {
SCAcademicPriceGroup,
SCThingThatCanBeOffered,
SCThingThatCanBeOfferedTranslatableProperties,
SCThingThatCanBeOfferedWithoutReferences,
} from '../base/ThingThatCanBeOffered';
import {SCThingMeta, SCThingType} from '../Thing';
import {SCLanguage, SCMetaTranslations, SCTranslations} from '../types/i18n';
import {SCMap} from '../types/Map';
@@ -25,8 +28,8 @@ import {SCPersonWithoutReferences} from './Person';
/**
* A study module without references
*/
export interface SCStudyModuleWithoutReferences extends
SCThingThatCanBeOffered<SCAcademicPriceGroup> {
export interface SCStudyModuleWithoutReferences
extends SCThingThatCanBeOfferedWithoutReferences {
/**
* ECTS points (European Credit Transfer System)
@@ -61,10 +64,11 @@ export interface SCStudyModuleWithoutReferences extends
/**
* A study module
*
*
* @validatable
*/
export interface SCStudyModule extends SCStudyModuleWithoutReferences {
export interface SCStudyModule
extends SCStudyModuleWithoutReferences, SCThingThatCanBeOffered<SCAcademicPriceGroup> {
/**
* Academic events that make up a study module
*/
@@ -86,14 +90,24 @@ export interface SCStudyModule extends SCStudyModuleWithoutReferences {
requiredModules?: SCStudyModuleWithoutReferences[];
/**
* The secretary that administers requests and
* The secretary that administers requests and
* questions concerning the study module by eg. students
*/
secretary: SCOrganizationWithoutReferences | SCPersonWithoutReferences;
/**
* Translated fields of a study module
*/
translations?: SCTranslations<SCStudyModuleTranslatableProperties>;
/**
* Type of the study module
*/
type: SCThingType.StudyModule;
}
export interface SCStudyModuleTranslatableProperties
extends SCThingThatCanBeOfferedTranslatableProperties {
extends SCThingThatCanBeOfferedTranslatableProperties {
/**
* Translations of the majors that this study module is meant for
*/
@@ -105,8 +119,8 @@ export interface SCStudyModuleTranslatableProperties
necessity: SCMap<SCStudyModuleNecessity>;
}
/**
* Represents a modules necessity (in a major) as it may be required, optional or
/**
* Represents a modules necessity (in a major) as it may be required, optional or
* is in a pool of n optional modules were m out of them have to be taken/completed.
* Hence the elective option.
*/
@@ -119,13 +133,15 @@ export enum SCStudyModuleNecessity {
/**
* Study module meta data
*/
export class SCStudyModuleMeta extends SCThingMeta implements SCMetaTranslations<SCStudyModule> {
export class SCStudyModuleMeta
extends SCThingMeta
implements SCMetaTranslations<SCStudyModule> {
/**
* Translations of fields
*/
fieldTranslations = {
de: {
... SCThingMeta.getInstance().fieldTranslations.de,
...SCThingMeta.getInstance().fieldTranslations.de,
academicEvents: 'Veranstaltungen',
ects: 'ECTS-Punkte',
faculty: 'Fachbereich',
@@ -137,7 +153,7 @@ export class SCStudyModuleMeta extends SCThingMeta implements SCMetaTranslations
secretary: 'Sekretariat',
},
en: {
... SCThingMeta.getInstance().fieldTranslations.en,
...SCThingMeta.getInstance().fieldTranslations.en,
academicEvents: 'academic events',
ects: 'ECTS points',
faculty: 'faculty',
@@ -153,18 +169,18 @@ export class SCStudyModuleMeta extends SCThingMeta implements SCMetaTranslations
/**
* Translations of values of fields
*/
fieldValueTranslations = {
fieldValueTranslations = {
de: {
... SCThingMeta.getInstance().fieldValueTranslations.de,
...SCThingMeta.getInstance().fieldValueTranslations.de,
necessity: {
'elective' : 'Wahlfach',
'optional' : 'optional',
'required' : 'benötigt',
'elective': 'Wahlfach',
'optional': 'optional',
'required': 'benötigt',
},
type: 'Studiengangmodul',
},
en: {
... SCThingMeta.getInstance().fieldValueTranslations.en,
...SCThingMeta.getInstance().fieldValueTranslations.en,
type: SCThingType.StudyModule,
},
};

View File

@@ -13,14 +13,15 @@
* this program. If not, see <https://www.gnu.org/licenses/>.
*/
import {SCThingInPlace, SCThingInPlaceMeta} from '../base/ThingInPlace';
import {SCThing, SCThingMeta, SCThingType} from '../Thing';
import {SCThingMeta, SCThingType, SCThingWithoutReferences} from '../Thing';
import {SCMetaTranslations} from '../types/i18n';
import {SCISO8601Duration} from '../types/Time';
/**
* A ticket without references
*/
export interface SCTicketWithoutReferences extends SCThing {
export interface SCTicketWithoutReferences
extends SCThingWithoutReferences {
/**
* Approximate wait time
*/
@@ -47,7 +48,8 @@ export interface SCTicketWithoutReferences extends SCThing {
*
* @validatable
*/
export interface SCTicket extends SCTicketWithoutReferences, SCThingInPlace {
export interface SCTicket
extends SCTicketWithoutReferences, SCThingInPlace {
/**
* Type of a ticket
*/
@@ -57,29 +59,31 @@ export interface SCTicket extends SCTicketWithoutReferences, SCThingInPlace {
/**
* Meta information about a ticket
*/
export class SCTicketMeta extends SCThingMeta implements SCMetaTranslations<SCTicket> {
export class SCTicketMeta
extends SCThingMeta
implements SCMetaTranslations<SCTicket> {
/**
* Translations of fields
*/
fieldTranslations = {
de: {
... SCThingInPlaceMeta.getInstance().fieldTranslations.de,
...SCThingInPlaceMeta.getInstance().fieldTranslations.de,
},
en: {
... SCThingInPlaceMeta.getInstance().fieldTranslations.en,
...SCThingInPlaceMeta.getInstance().fieldTranslations.en,
},
};
/**
* Translations of values of fields
*/
fieldValueTranslations = {
fieldValueTranslations = {
de: {
... SCThingInPlaceMeta.getInstance().fieldValueTranslations.de,
...SCThingInPlaceMeta.getInstance().fieldValueTranslations.de,
type: 'Ticket',
},
en: {
... SCThingInPlaceMeta.getInstance().fieldValueTranslations.en,
...SCThingInPlaceMeta.getInstance().fieldValueTranslations.en,
type: SCThingType.Ticket,
},
};

View File

@@ -13,11 +13,14 @@
* this program. If not, see <https://www.gnu.org/licenses/>.
*/
import {
SCThingWithCategories,
SCThingWithCategoriesSpecificValues,
SCThingWithCategoriesTranslatableProperties,
SCThingWithCategoriesWithoutReferences,
SCThingWithCategoriesWithoutReferencesMeta} from '../base/ThingWithCategories';
import {SCThingMeta, SCThingType} from '../Thing';
import {SCMetaTranslations} from '../types/i18n';
SCThingWithCategoriesWithoutReferencesMeta,
} from '../base/ThingWithCategories';
import {SCThing, SCThingMeta, SCThingType} from '../Thing';
import {SCMetaTranslations, SCTranslations} from '../types/i18n';
import {SCISO8601Date} from '../types/Time';
/**
@@ -51,7 +54,17 @@ export interface SCToDoWithoutReferences
*
* @validatable
*/
export interface SCToDo extends SCToDoWithoutReferences {
export interface SCToDo
extends SCToDoWithoutReferences, SCThing, SCThingWithCategories<string, SCThingWithCategoriesSpecificValues> {
/**
* Translated fields of a thing with categories
*/
translations?: SCTranslations<SCThingWithCategoriesTranslatableProperties>;
/**
* Type of the "to do"
*/
type: SCThingType.ToDo;
}
/**
@@ -72,27 +85,27 @@ export class SCToDoMeta extends SCThingMeta implements SCMetaTranslations<SCToDo
*/
fieldTranslations = {
de: {
... SCThingWithCategoriesWithoutReferencesMeta.getInstance<string,
SCThingWithCategoriesSpecificValues>().fieldTranslations.de,
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<string,
SCThingWithCategoriesSpecificValues>().fieldTranslations.de,
},
en: {
... SCThingWithCategoriesWithoutReferencesMeta.getInstance<string,
SCThingWithCategoriesSpecificValues>().fieldTranslations.en,
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<string,
SCThingWithCategoriesSpecificValues>().fieldTranslations.en,
},
};
/**
* Translations of values of fields
*/
fieldValueTranslations = {
fieldValueTranslations = {
de: {
... SCThingWithCategoriesWithoutReferencesMeta.getInstance<string,
SCThingWithCategoriesSpecificValues>().fieldValueTranslations.de,
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<string,
SCThingWithCategoriesSpecificValues>().fieldValueTranslations.de,
type: 'ToDo',
},
en: {
... SCThingWithCategoriesWithoutReferencesMeta.getInstance<string,
SCThingWithCategoriesSpecificValues>().fieldValueTranslations.en,
...SCThingWithCategoriesWithoutReferencesMeta.getInstance<string,
SCThingWithCategoriesSpecificValues>().fieldValueTranslations.en,
type: SCThingType.ToDo,
},
};

View File

@@ -12,13 +12,14 @@
* 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 {SCThing, SCThingMeta, SCThingType} from '../Thing';
import {SCThing, SCThingMeta, SCThingType, SCThingWithoutReferences} from '../Thing';
import {SCMetaTranslations} from '../types/i18n';
/**
* A tour without references
*/
export interface SCTourWithoutReferences extends SCThing {
export interface SCTourWithoutReferences
extends SCThingWithoutReferences {
/**
* Init script for the tour
*/
@@ -40,7 +41,8 @@ export interface SCTourWithoutReferences extends SCThing {
*
* @validatable
*/
export interface SCTour extends SCTourWithoutReferences {
export interface SCTour
extends SCTourWithoutReferences, SCThing {
/**
* Type of a tour
*/
@@ -50,7 +52,9 @@ export interface SCTour extends SCTourWithoutReferences {
/**
* Meta information about a tour
*/
export class SCTourMeta extends SCThingMeta implements SCMetaTranslations<SCTour> {
export class SCTourMeta
extends SCThingMeta
implements SCMetaTranslations<SCTour> {
}
/**

View File

@@ -21,7 +21,8 @@ import {SCPersonWithoutReferences} from './Person';
/**
* A video without references
*/
export interface SCVideoWithoutReferences extends SCCreativeWorkWithoutReferences {
export interface SCVideoWithoutReferences
extends SCCreativeWorkWithoutReferences {
/**
* The Duration of the Video
*/
@@ -102,7 +103,8 @@ export interface SCVideoTrack {
*
* @validatable
*/
export interface SCVideo extends SCCreativeWork, SCVideoWithoutReferences {
export interface SCVideo
extends SCCreativeWork, SCVideoWithoutReferences {
/**
* Persons acting in the Video
*/
@@ -117,29 +119,31 @@ export interface SCVideo extends SCCreativeWork, SCVideoWithoutReferences {
/**
* Meta information about a video
*/
export class SCVideoMeta extends SCThingMeta implements SCMetaTranslations<SCVideo> {
export class SCVideoMeta
extends SCThingMeta
implements SCMetaTranslations<SCVideo> {
/**
* Translations of fields
*/
fieldTranslations = {
de: {
... SCCreativeWorkMeta.getInstance().fieldTranslations.de,
...SCCreativeWorkMeta.getInstance().fieldTranslations.de,
},
en: {
... SCCreativeWorkMeta.getInstance().fieldTranslations.en,
...SCCreativeWorkMeta.getInstance().fieldTranslations.en,
},
};
/**
* Translations of values of fields
*/
fieldValueTranslations = {
fieldValueTranslations = {
de: {
... SCCreativeWorkMeta.getInstance().fieldValueTranslations.de,
...SCCreativeWorkMeta.getInstance().fieldValueTranslations.de,
type: 'Video',
},
en: {
... SCCreativeWorkMeta.getInstance().fieldValueTranslations.en,
...SCCreativeWorkMeta.getInstance().fieldValueTranslations.en,
type: SCThingType.Video,
},
};

View File

@@ -12,16 +12,16 @@
* 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 {SCThingWithTranslations} from '../base/ThingWithTranslations';
import {SCBulkResponse} from '../protocol/routes/bulk/BulkResponse';
import {SCMultiSearchResponse} from '../protocol/routes/search/MultiSearchResponse';
import {SCSearchResponse} from '../protocol/routes/search/SearchResponse';
import {SCThing, SCThingType} from '../Thing';
import {SCThing, SCThingTranslatableProperties, SCThingType, SCThingWithoutReferences} from '../Thing';
import {SCTranslations} from './i18n';
/**
* Type guard to check if something is a SCThing
*
* @param {any} something Something to check
* @param something Something to check
*/
export function isThing(something: any): something is SCThing {
return (
@@ -34,16 +34,17 @@ export function isThing(something: any): something is SCThing {
/**
* Type guard to check if translations exist
*
* @param {SCThing} thing Thing to check
* @param thing Thing to check
*/
export function isThingWithTranslations(thing: SCThing): thing is SCThingWithTranslations {
export function isThingWithTranslations(thing: SCThingWithoutReferences)
: thing is SCThingWithoutReferences & { translations: SCTranslations<SCThingTranslatableProperties> } {
return typeof thing.translations !== 'undefined';
}
/**
* Type guard to check if something is a bulk response
*
* @param {any} something Something to check
* @param something Something to check
*/
export function isBulkResponse(something: any): something is SCBulkResponse {
return typeof something.expiration === 'string'
@@ -56,7 +57,7 @@ export function isBulkResponse(something: any): something is SCBulkResponse {
/**
* Type guard to check if something is a search response
*
* @param {any} something Something to check
* @param something Something to check
*/
export function isSearchResponse(something: any): something is SCSearchResponse {
return Array.isArray(something.data)