/* * 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 { SCPlace, SCPlaceWithoutReferences, SCPlaceWithoutReferencesMeta, SCPlaceWithoutReferencesTranslatableProperties, } from './abstract/place'; import {SCThingMeta, SCThingType} from './abstract/thing'; import { SCThingWithCategories, SCThingWithCategoriesSpecificValues, SCThingWithCategoriesTranslatableProperties, SCThingWithCategoriesWithoutReferences, SCThingWithCategoriesWithoutReferencesMeta, } from './abstract/thing-with-categories'; export type SCBuildingCategories = 'cafe' | 'education' | 'library' | 'office' | 'canteen' | 'student canteen' | 'restaurant' | 'restroom'; export interface SCBuildingWithoutReferences extends SCThingWithCategoriesWithoutReferences, SCPlaceWithoutReferences { /** * List of floor names of the place * * @filterable * @keyword */ floors?: string[]; /** * Translated fields of a building */ translations?: SCTranslations; /** * Type of the building */ type: SCThingType.Building; } /** * A building * * @validatable * @indexable */ export interface SCBuilding extends SCBuildingWithoutReferences, SCPlace, SCThingWithCategories { /** * Translated fields of a building */ translations?: SCTranslations; /** * Type of the building */ type: SCThingType.Building; } export interface SCBuildingTranslatableProperties extends SCPlaceWithoutReferencesTranslatableProperties, SCThingWithCategoriesTranslatableProperties { /** * @see SCBuilding.floors */ floors?: string[]; } /** * Meta information about a place */ export class SCBuildingMeta extends SCThingMeta implements SCMetaTranslations { /** * Translations of fields */ fieldTranslations = { de: { ...SCThingWithCategoriesWithoutReferencesMeta.getInstance().fieldTranslations.de, ...SCPlaceWithoutReferencesMeta.getInstance().fieldTranslations.de, floors: 'Etagen', }, en: { ...SCThingWithCategoriesWithoutReferencesMeta.getInstance().fieldTranslations.en, ...SCPlaceWithoutReferencesMeta.getInstance().fieldTranslations.en, floors: 'floors', }, }; /** * Translations of values of fields */ fieldValueTranslations = { de: { ...SCThingWithCategoriesWithoutReferencesMeta.getInstance().fieldValueTranslations.de, ...SCPlaceWithoutReferencesMeta.getInstance().fieldValueTranslations.de, categories: { 'cafe': 'Café', 'canteen': 'Kantine', 'education': 'Bildung', 'library': 'Bibliothek', 'office': 'Büro', 'restaurant': 'Restaurant', 'restroom': 'Toilette', 'student canteen': 'Mensa', }, type: 'Gebäude', }, en: { ...SCThingWithCategoriesWithoutReferencesMeta.getInstance().fieldValueTranslations.en, ...SCPlaceWithoutReferencesMeta.getInstance().fieldValueTranslations.en, type: SCThingType.Building, }, }; }