Skip to content

Commit

Permalink
updated dtos
Browse files Browse the repository at this point in the history
  • Loading branch information
alxford45 committed Nov 29, 2020
1 parent 074c36a commit 6ff2e8f
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 18 deletions.
34 changes: 30 additions & 4 deletions api/src/assignment/dto/assignment.dto.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,32 @@
import { ApiProperty } from '@nestjs/swagger';
export enum AssignmentType {
'LSU_ID',
'TICKET_ID',
}
export class AssignmentDTO {
assignedby: string;
assignedto: string;
comment: string;
assigndate: Date;
@ApiProperty({
description: 'serial generated assignment id',
example: 1,
})
assignment_id: number;

@ApiProperty({
minLength: 9,
maxLength: 9,
description: '9-digit number starting with 89',
example: 897584512,
})
lsu_id: number;

@ApiProperty({
description: 'serial generated ticket id',
example: 1,
})
ticket_id: number;

@ApiProperty({
description: 'YYYY-MM-DD HH:MM:SS',
example: '2020-07-21 12:44:22',
})
assigned_date: string;
}
20 changes: 6 additions & 14 deletions api/src/assignment/dto/create-assignment.dto.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,7 @@
import { ApiProperty } from '@nestjs/swagger';
import { ApiProperty, OmitType as Omit } from '@nestjs/swagger';
import { AssignmentDTO } from './assignment.dto';

export class CreateAssignmentDTO {
@ApiProperty({ minLength: 3 })
assignedby: string;

@ApiProperty({ minLength: 3 })
assignedto: string;

@ApiProperty({})
comment: number;

@ApiProperty({})
assigndate: Date;
}
export class CreateAssignmentDTO extends Omit(AssignmentDTO, [
'assignment_id',
'assigned_date',
]) {}
1 change: 1 addition & 0 deletions api/src/ticket/dto/ticket.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ export class TicketDTO {

@ApiProperty({
description: 'YYYY-MM-DD HH:MM:SS',
example: '2020-07-21 12:44:22',
})
submission_date: string;
}

0 comments on commit 6ff2e8f

Please sign in to comment.