import { Attr } from 'ts-framework' import { AssistanceResponseDTO } from './assistance' export class CreateAssistanceCategoryDTO { @Attr({ type: String }) name: string } export class AssistanceCategoryResponseDTO { id: string name: string assistances?: AssistanceResponseDTO[] constructor(model: AssistanceCategoryResponseDTO) { this.id = model.id this.name = model.name if (model.assistances) { this.assistances = model.assistances.map((it) => AssistanceResponseDTO.of(it)) } } static of(model: AssistanceCategoryResponseDTO): AssistanceCategoryResponseDTO { return new AssistanceCategoryResponseDTO(model) } }