issue #
- Scheduler-type export 변경
This commit is contained in:
@@ -13,4 +13,4 @@ export * from './scheduler/http/HttpApiUrl';
|
||||
|
||||
export * as SchedulerDTO from './scheduler/http/dto';
|
||||
|
||||
export * as ScheduleType from './scheduler/type/schedule';
|
||||
export * as Type from './scheduler/type/schedule';
|
||||
@@ -1,6 +1,6 @@
|
||||
import { BaseRequestDTO } from '@BaseRequestDTO';
|
||||
import { IsArray, IsDateString, IsIn, IsString } from 'class-validator';
|
||||
import { ScheduleTypeArray } from 'src/scheduler/type/schedule/ScheduleType';
|
||||
import { TypeArray } from 'src/scheduler/type/schedule/ScheduleType';
|
||||
|
||||
export class ScheduleCreateRequestDTO extends BaseRequestDTO {
|
||||
@IsString()
|
||||
@@ -12,7 +12,7 @@ export class ScheduleCreateRequestDTO extends BaseRequestDTO {
|
||||
@IsDateString()
|
||||
endDate!: string;
|
||||
|
||||
@IsIn(ScheduleTypeArray)
|
||||
@IsIn(TypeArray)
|
||||
type!: string;
|
||||
|
||||
@IsString()
|
||||
|
||||
@@ -1,15 +1,16 @@
|
||||
import type { BaseResponseDTO } from '@BaseResponseDTO';
|
||||
import type { ScheduleType } from 'src/scheduler/type/schedule/ScheduleType';
|
||||
import type { Status } from 'src/scheduler/type/schedule/ScheduleStatus';
|
||||
import type { Type } from 'src/scheduler/type/schedule/ScheduleType';
|
||||
|
||||
export type ScheduleDetail = {
|
||||
id: string;
|
||||
name: string;
|
||||
startDate: Date;
|
||||
endDate: Date;
|
||||
status: string;
|
||||
status: Status;
|
||||
content?: string;
|
||||
isDeleted: boolean;
|
||||
type: ScheduleType;
|
||||
type: Type;
|
||||
createdAt: string;
|
||||
owner: string;
|
||||
style: string;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { BaseRequestDTO } from '@BaseRequestDTO';
|
||||
import { IsArray, IsDateString, IsIn, IsNumberString, IsString, ValidateIf } from 'class-validator';
|
||||
import { ScheduleStatusArray } from 'src/scheduler/type/schedule/ScheduleStatus';
|
||||
import { ScheduleTypeArray } from 'src/scheduler/type/schedule/ScheduleType';
|
||||
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)
|
||||
@@ -22,12 +22,12 @@ export class ScheduleListRequestDTO extends BaseRequestDTO {
|
||||
|
||||
@ValidateIf(o => o.typeList !== undefined)
|
||||
@IsArray()
|
||||
@IsIn(ScheduleTypeArray, { each: true})
|
||||
@IsIn(TypeArray, { each: true})
|
||||
typeList?: string[];
|
||||
|
||||
@ValidateIf(o => o.status !== undefined)
|
||||
@IsString()
|
||||
@IsIn(ScheduleStatusArray)
|
||||
@IsIn(StatusArray)
|
||||
status?: string;
|
||||
|
||||
@ValidateIf(o => o.name !== undefined)
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
import type { BaseResponseDTO } from '@BaseResponseDTO';
|
||||
import type { ScheduleStatus } from "src/scheduler/type/schedule/ScheduleStatus";
|
||||
import type { ScheduleType } from "src/scheduler/type/schedule/ScheduleType";
|
||||
import type { Status } from "src/scheduler/type/schedule/ScheduleStatus";
|
||||
import type { Type } from "src/scheduler/type/schedule/ScheduleType";
|
||||
|
||||
export type ScheduleList = {
|
||||
name: string;
|
||||
id: string;
|
||||
startDate: Date;
|
||||
endDate: Date;
|
||||
type: ScheduleType;
|
||||
type: Type;
|
||||
style: string;
|
||||
status: ScheduleStatus;
|
||||
status: Status;
|
||||
}
|
||||
|
||||
export type ScheduleListResponseDTO = BaseResponseDTO<ScheduleList>;
|
||||
@@ -1,4 +1,4 @@
|
||||
export const ScheduleDay: Record<string, string> = {
|
||||
export const Day: Record<string, string> = {
|
||||
1: '일',
|
||||
2: '월',
|
||||
3: '화',
|
||||
@@ -8,6 +8,6 @@ export const ScheduleDay: Record<string, string> = {
|
||||
7: '토'
|
||||
} as const;
|
||||
|
||||
export const ScheduleDayArray = '1234567'.split('');
|
||||
export const DayArray = '1234567'.split('');
|
||||
|
||||
export const ScheduleDayLabelArray = '일월화수목금토'.split('');
|
||||
export const DayLabelArray = '일월화수목금토'.split('');
|
||||
@@ -1,8 +1,8 @@
|
||||
export type ScheduleStatus = 'yet' | 'completed';
|
||||
export type Status = 'yet' | 'completed';
|
||||
|
||||
export const ScheduleStatusLabel: Record<ScheduleStatus, string> = {
|
||||
export const StatusLabel: Record<Status, string> = {
|
||||
'yet': '미완료',
|
||||
'completed': '완료'
|
||||
} as const;
|
||||
|
||||
export const ScheduleStatusArray = ['yet', 'completed'] as const;
|
||||
export const StatusArray = ['yet', 'completed'] as const;
|
||||
@@ -1,6 +1,6 @@
|
||||
export type ScheduleType = 'once' | 'daily' | 'weekly' | 'monthly' | 'annual';
|
||||
export type Type = 'once' | 'daily' | 'weekly' | 'monthly' | 'annual';
|
||||
|
||||
export const ScheduleTypeLabel: Record<ScheduleType, string> = {
|
||||
export const TypeLabel: Record<Type, string> = {
|
||||
'once': '반복없음',
|
||||
'daily': '매일',
|
||||
'weekly': '매주',
|
||||
@@ -8,4 +8,4 @@ export const ScheduleTypeLabel: Record<ScheduleType, string> = {
|
||||
'annual': '매년'
|
||||
} as const;
|
||||
|
||||
export const ScheduleTypeArray = ['once', 'daily', 'weekly', 'monthly', 'annual'] as const;
|
||||
export const TypeArray = ['once', 'daily', 'weekly', 'monthly', 'annual'] as const;
|
||||
@@ -1,3 +1,3 @@
|
||||
export * as Day from './ScheduleDay';
|
||||
export * as Status from './ScheduleStatus';
|
||||
export * as Type from './ScheduleType';
|
||||
export * from './ScheduleDay';
|
||||
export * from './ScheduleStatus';
|
||||
export * from './ScheduleType';
|
||||
Reference in New Issue
Block a user