class Text { constructor(readonly $de: string, readonly $en: string) {} } class Price { readonly text: Text constructor(readonly from: number) { this.text = new Text( `Ab ${this.from},- pro Tag`, `Starting at ${this.from},- per day`, ) } } class Capacity { readonly text: Text constructor(readonly from: number, readonly to: number) { this.text = new Text( `${this.from} bis ${this.to} Personen`, `${this.from} to ${this.to} persons`, ) } } class Apartment { readonly id: string readonly title: string readonly price: Price readonly capacity: Capacity constructor(number: number, readonly size: number, price: number, from: number, to: number) { this.id = `apartment-${number}` this.title = `Apartment ${number}` this.price = new Price(price) this.capacity = new Capacity(from, to) } } export default { apartments: [ new Apartment(1, 38, 98, 2, 4), new Apartment(2, 50, 155, 2, 5), new Apartment(3, 50, 155, 2, 6) ] }