import { typeParser } from '@lib/utils/type-parser';
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
import { Expose, Transform } from 'class-transformer';
import { IsInt, IsOptional, IsString } from 'class-validator';

export class User {
  @Expose()
  @ApiProperty({ description: '고객id' })
  @Transform(({ value }) => typeParser.int(value))
  @IsInt()
  usrId!: number;

  @Expose()
  @ApiProperty({ description: '고객이름' })
  @IsString()
  usrName!: string;

  @Expose()
  @ApiProperty({ description: '고객연락처' })
  @IsString()
  usrPhone!: string;

  @Expose()
  @ApiProperty({ description: '고객생년월일' })
  @IsString()
  usrBirth!: string;

  @Expose()
  @ApiPropertyOptional({ description: '고객수정일시' })
  @IsString()
  @IsOptional()
  usrUpdatedAt?: string;

  @Expose()
  @ApiProperty({ description: '고객생성일시' })
  @IsString()
  usrCreatedAt!: string;
}
