import { Attr } from 'ts-framework' import { UserPhoneType } from '../constants' export class CreateUserPhoneDTO { @Attr({ type: String }) phoneNumber: string @Attr({ type: String }) countryCode: string @Attr({ type: Boolean }) isPrimary: boolean } export class UserPhoneNumberDTO { @Attr({ type: String }) phoneNumber: string @Attr({ type: String }) countryCode: string } export class UserPhoneRemoveDTO { @Attr({ type: Number }) id: number } export class UpdateUserPhoneDTO { @Attr({ type: String }) phoneNumber: string @Attr({ type: String }) countryCode: string @Attr({ type: Boolean }) isPrimary: boolean @Attr({ type: Number, optional: true }) id?: number } export class UserPhoneResponseDTO { id: number phoneNumber: string countryCode: string isPrimary: boolean isVerified: boolean type: string createdAt: Date updatedAt: Date constructor(model: UserPhoneResponseDTO) { this.id = model.id this.phoneNumber = model.phoneNumber this.countryCode = model.countryCode this.isPrimary = model.isPrimary this.isVerified = model.isVerified this.type = model.type this.createdAt = model.createdAt this.updatedAt = model.updatedAt } static of(model: UserPhoneResponseDTO) { return new UserPhoneResponseDTO(model) } } export interface UserPhoneWithTypeCreateDTO extends CreateUserPhoneDTO { type: UserPhoneType } export interface UserPhoneWithTypeUpdateDTO extends UpdateUserPhoneDTO { type: UserPhoneType }