Compare commits

..

2 Commits

Author SHA1 Message Date
geonhee-min
adec968612 1.0.20 2025-12-16 16:25:11 +09:00
geonhee-min
290d87ff1c issue #
- class-transform 적용
2025-12-16 16:25:02 +09:00
6 changed files with 50 additions and 35 deletions

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{
"name": "@baekyangdan/core-utils",
"version": "1.0.19",
"version": "1.0.20",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "@baekyangdan/core-utils",
"version": "1.0.19",
"version": "1.0.20",
"license": "ISC",
"dependencies": {
"@swc/core": "^1.15.5",

View File

@@ -1,6 +1,6 @@
{
"name": "@baekyangdan/core-utils",
"version": "1.0.19",
"version": "1.0.20",
"description": "Common Repo",
"main": "dist/index.js",
"types": "dist/index.d.ts",

View File

@@ -1,4 +1,5 @@
import { BaseRequestDTO } from '@BaseRequestDTO';
import { Type as TransformType } from 'class-transformer';
import { IsArray, IsDateString, IsIn, IsString } from 'class-validator';
import { TypeArray, type Type } from 'src/scheduler/type/schedule/ScheduleType';
@@ -9,11 +10,11 @@ export class ScheduleCreateRequestDTO extends BaseRequestDTO {
@IsString()
content!: string;
@IsDateString()
startDate!: string;
@TransformType(() => Date)
startDate!: Date;
@IsDateString()
endDate!: string;
@TransformType(() => Date)
endDate!: Date;
@IsIn(TypeArray)
type!: Type;

View File

@@ -1,23 +1,28 @@
import type { BaseResponseDTO } from '@BaseResponseDTO';
import type { Status } from 'src/scheduler/type/schedule/ScheduleStatus';
import type { Type } from 'src/scheduler/type/schedule/ScheduleType';
import { Type as TransformType } from 'class-transformer';
export type ScheduleDetail = {
id: string;
name: string;
startDate: Date;
endDate: Date;
status: Status;
export class ScheduleDetail {
id!: string;
name!: string;
status!: Status;
content?: string;
isDeleted: boolean;
type: Type;
createdAt: string;
owner: string;
style: string;
startTime: string;
endTime: string;
isDeleted!: boolean;
type!: Type;
createdAt!: string;
owner!: string;
style!: string;
startTime!: string;
endTime!: string;
dayList?: string;
participantList?: string;
@TransformType(() => Date)
startDate!: Date;
@TransformType(() => Date)
endDate!: Date;
}
export type ScheduleDetailResponseDTO = BaseResponseDTO<ScheduleDetail>;

View File

@@ -1,20 +1,24 @@
import { BaseRequestDTO } from '@BaseRequestDTO';
import { IsArray, IsDateString, IsIn, IsNumberString, IsString, ValidateIf } from 'class-validator';
import { Type } from 'class-transformer';
import { IsArray, IsDate, IsIn, IsNumberString, IsString, ValidateIf } from 'class-validator';
import { StatusArray } from 'src/scheduler/type/schedule/ScheduleStatus';
import { TypeArray } from 'src/scheduler/type/schedule/ScheduleType';
export class ScheduleListRequestDTO extends BaseRequestDTO {
@ValidateIf(o => o.date !== undefined)
@IsDateString()
date?: string;
@Type(() => Date)
@IsDate()
date?: Date;
@ValidateIf(o => o.startDate !== undefined)
@IsDateString()
startDate?: string;
@Type(() => Date)
@IsDate()
startDate?: Date;
@ValidateIf(o => o.endDate !== undefined)
@IsDateString()
endDate?: string;
@Type(() => Date)
@IsDate()
endDate?: Date;
@ValidateIf(o => o.styleList !== undefined)
@IsArray()

View File

@@ -1,15 +1,20 @@
import type { BaseResponseDTO } from '@BaseResponseDTO';
import type { Status } from "src/scheduler/type/schedule/ScheduleStatus";
import type { Type } from "src/scheduler/type/schedule/ScheduleType";
import { Type as TransformType } from 'class-transformer';
export type ScheduleList = {
name: string;
id: string;
startDate: Date;
endDate: Date;
type: Type;
style: string;
status: Status;
export class ScheduleList {
name!: string;
id!: string;
type!: Type;
style!: string;
status!: Status;
@TransformType(() => Date)
startDate!: Date;
@TransformType(() => Date)
endDate!: Date;
}
export type ScheduleListResponseDTO = BaseResponseDTO<ScheduleList[]>;