/* * 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} from './abstract/place'; import {SCThingMeta, SCThingType} from './abstract/thing'; import {SCThingInPlace, SCThingInPlaceMeta} from './abstract/thing-in-place'; import { SCThingWithCategories, SCThingWithCategoriesSpecificValues, SCThingWithCategoriesTranslatableProperties, SCThingWithCategoriesWithoutReferences, SCThingWithCategoriesWithoutReferencesMeta, } from './abstract/thing-with-categories'; /** * A point of interest without references */ export interface SCPointOfInterestWithoutReferences extends SCThingWithCategoriesWithoutReferences, SCPlaceWithoutReferences { /** * Translated properties of a point of interest */ translations?: SCTranslations; /** * Type of a point of interest */ type: SCThingType.PointOfInterest; } /** * A point of interest * * @validatable * @indexable */ export interface SCPointOfInterest extends SCPointOfInterestWithoutReferences, SCThingInPlace, SCPlace, SCThingWithCategories { /** * Translated properties of a point of interest */ translations?: SCTranslations; /** * Type of a point of interest */ type: SCThingType.PointOfInterest; } /** * Categories of a point of interest */ export type SCPointOfInterestCategories = 'computer' | 'validator' | 'card charger' | 'printer' | 'disabled access'; /** * Meta information about points of interest */ export class SCPointOfInterestMeta extends SCThingMeta implements SCMetaTranslations { /** * Translations of fields */ fieldTranslations = { de: { ...SCThingWithCategoriesWithoutReferencesMeta.getInstance().fieldTranslations.de, ...SCPlaceWithoutReferencesMeta.getInstance().fieldTranslations.de, ...SCThingInPlaceMeta.getInstance().fieldTranslations .de, }, en: { ...SCThingWithCategoriesWithoutReferencesMeta.getInstance().fieldTranslations.en, ...SCPlaceWithoutReferencesMeta.getInstance().fieldTranslations.en, ...SCThingInPlaceMeta.getInstance().fieldTranslations .en, }, }; /** * Translations of values of fields */ fieldValueTranslations = { de: { ...SCThingWithCategoriesWithoutReferencesMeta.getInstance().fieldValueTranslations.de, ...SCPlaceWithoutReferencesMeta.getInstance().fieldValueTranslations.de, categories: { 'card charger': 'Kartenaufwerter', 'computer': 'Computer', 'disabled access': 'barrierefreier Zugang', 'printer': 'Drucker', 'validator': 'Validierer', }, type: 'Sonderziel', }, en: { ...SCThingWithCategoriesWithoutReferencesMeta.getInstance().fieldValueTranslations.en, ...SCPlaceWithoutReferencesMeta.getInstance().fieldValueTranslations.en, type: SCThingType.PointOfInterest, }, }; }