-
Notifications
You must be signed in to change notification settings - Fork 482
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c02b317
commit 5f0e700
Showing
6 changed files
with
124 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
export * from './create-daily-plan.dto'; | ||
export * from './update-daily-plan.dto'; |
27 changes: 27 additions & 0 deletions
27
packages/core/src/tasks/daily-plan/dto/update-daily-plan.dto.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { ApiProperty } from '@nestjs/swagger'; | ||
import { Type } from 'class-transformer'; | ||
import { IsDate, IsEnum, IsNumber, IsOptional } from 'class-validator'; | ||
import { DailyPlanStatusEnum, IDailyPlanUpdateInput } from '@gauzy/contracts'; | ||
import { TenantBaseDTO } from '../../../core/dto'; | ||
|
||
/** | ||
* Update Daily Plan DTO validation | ||
*/ | ||
|
||
export class UpdateDailyPlanDTO extends TenantBaseDTO implements IDailyPlanUpdateInput { | ||
@ApiProperty({ type: () => Date }) | ||
@Type(() => Date) | ||
@IsOptional() | ||
@IsDate() | ||
readonly date?: Date; | ||
|
||
@ApiProperty({ type: () => Number }) | ||
@IsOptional() | ||
@IsNumber() | ||
readonly workTimePlanned?: number; | ||
|
||
@ApiProperty({ type: () => String, enum: DailyPlanStatusEnum }) | ||
@IsOptional() | ||
@IsEnum(DailyPlanStatusEnum, { message: 'status `$value` must be a valid enum value' }) | ||
readonly status?: DailyPlanStatusEnum; | ||
} |