import { Entity } from "../../../core/entity/model/entity" ; import { DatabaseEntity } from "../../../core/entity/database-entity.decorator" ; import { DatabaseField } from "../../../core/entity/database-field.decorator" ; import { ConfigurableEnumValue } from "../../../core/configurable-enum/configurable-enum.interface" ; @ DatabaseEntity ( "EducationalMaterial" ) export class EducationalMaterial extends Entity { static create ( params ) { return Object . assign ( new EducationalMaterial ( ) , params ) ; } @ DatabaseField ( ) child : string ; @ DatabaseField ( { label : $localize `:Date on which the material has been borrowed:Date` , } ) date : Date ; @ DatabaseField ( { label : $localize `:The material which has been borrowed:Material` , dataType : "configurable-enum" , innerDataType : "materials" , required : true , } ) materialType : ConfigurableEnumValue ; @ DatabaseField ( { label : $localize `:The amount of the material which has been borrowed:Amount` , required : true , } ) materialAmount : number ; @ DatabaseField ( { label : $localize `:An additional description for the borrowed material:Description` , } ) description = "" ; public getColor ( ) { return this . materialType ?. color || "white" ; } }