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,83 @@
/*
* 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 {SCPlaceWithoutReferences} from '../base/Place';
import {
SCThingWithCategoriesSpecificValues,
SCThingWithCategoriesTranslatableProperties,
SCThingWithCategoriesWithoutReferences,
} from '../base/ThingWithCategories';
import {SCThingMeta} from '../Thing';
import {SCTranslations} from '../types/i18n';
export type SCBuildingType = 'building';
export type SCBuildingCategories =
'cafe'
| 'education'
| 'library'
| 'office'
| 'canteen'
| 'student canteen'
| 'restaurant'
| 'restroom';
export interface SCBuildingWithoutReferences
extends SCThingWithCategoriesWithoutReferences<SCBuildingCategories,
SCThingWithCategoriesSpecificValues>,
SCPlaceWithoutReferences {
/**
* Categories of a building
*/
categories: SCBuildingCategories[];
/**
* List of floor names of the place
*/
floors?: string[];
/**
* Translated fields of a building
*/
translations?: SCTranslations<SCThingWithCategoriesTranslatableProperties>;
/**
* Type of the building
*/
type: SCBuildingType;
}
export interface SCBuilding extends SCBuildingWithoutReferences {
}
/**
* Meta information about a place
*/
export class SCBuildingMeta extends SCThingMeta {
static fieldValueTranslations = {
...SCThingMeta.fieldValueTranslations,
de: {
categories: {
'cafe': 'Café',
'canteen': 'Kantine',
'education': 'Bildung',
'library': 'Bibliothek',
'office': 'Büro',
'restaurant': 'Restaurant',
'restroom': 'Toilette',
'student canteen': 'Mensa',
},
},
};
}