mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-09 11:12:52 +00:00
91 lines
2.2 KiB
TypeScript
91 lines
2.2 KiB
TypeScript
/*
|
|
* 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, SCThingType} from '../Thing';
|
|
import {SCTranslations} from '../types/i18n';
|
|
|
|
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: SCThingType.Building;
|
|
}
|
|
|
|
/**
|
|
* A building
|
|
*
|
|
* @validatable
|
|
*/
|
|
export interface SCBuilding extends SCBuildingWithoutReferences {
|
|
/**
|
|
* Type of the building
|
|
*/
|
|
type: SCThingType.Building;
|
|
}
|
|
|
|
/**
|
|
* 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',
|
|
},
|
|
},
|
|
};
|
|
}
|