-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[TM-1531] update attrib to delayed job, change tests and update jobs …
…endpoint
- Loading branch information
1 parent
2a1a911
commit ed8a7ff
Showing
6 changed files
with
200 additions
and
98 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { ApiProperty } from '@nestjs/swagger'; | ||
import { IsArray, IsBoolean, IsUUID, ValidateNested } from 'class-validator'; | ||
import { Type } from 'class-transformer'; | ||
|
||
class JobAttributes { | ||
@IsBoolean() | ||
@ApiProperty({ description: 'Value to set for isAcknowledged', example: true }) | ||
isAcknowledged: boolean; | ||
} | ||
|
||
export class JobData { | ||
@ApiProperty({ enum: ['jobs'], description: 'Type of the resource', example: 'jobs' }) | ||
type: 'jobs'; | ||
|
||
@IsUUID() | ||
@ApiProperty({ format: 'uuid', description: 'UUID of the job', example: 'uuid-1' }) | ||
uuid: string; | ||
|
||
@ValidateNested() | ||
@Type(() => JobAttributes) | ||
@ApiProperty({ description: 'Attributes to update for the job', type: JobAttributes }) | ||
attributes: JobAttributes; | ||
} | ||
|
||
export class JobBulkUpdateBodyDto { | ||
@IsArray() | ||
@ValidateNested({ each: true }) | ||
@Type(() => JobData) | ||
@ApiProperty({ description: 'List of jobs to update', type: [JobData] }) | ||
data: JobData[]; | ||
} |
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
Oops, something went wrong.