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,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,
},
};