import { Attr } from 'ts-framework' import { MobilityCategoryResponseDTO } from './mobility-category' export class CreateMobilityDTO { @Attr({ type: String }) categoryId: string @Attr({ type: String }) name: string @Attr({ type: Boolean, optional: true }) isTransferableSeat?: boolean } export class UpdateMobilityDTO { @Attr({ type: String }) id: string @Attr({ type: String, optional: true }) categoryId?: string @Attr({ type: String, optional: true }) name?: string @Attr({ type: Boolean, optional: true }) isTransferableSeat?: boolean } export class MobilityResponseDTO { id: string name: string isTransferableSeat?: boolean category?: MobilityCategoryResponseDTO constructor(model: MobilityResponseDTO) { this.id = model.id this.name = model.name if (model.isTransferableSeat) { this.isTransferableSeat = model.isTransferableSeat } if (model.category) { this.category = MobilityCategoryResponseDTO.of(model.category) } } static of(model: MobilityResponseDTO): MobilityResponseDTO { return new MobilityResponseDTO(model) } }