Skip to content

Commit

Permalink
updated fields notes on ticket and component on device
Browse files Browse the repository at this point in the history
  • Loading branch information
alxford45 committed Nov 29, 2020
1 parent b03a0db commit 74231e7
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 3 deletions.
1 change: 1 addition & 0 deletions api/src/ticket/dto/create-ticket.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ export class CreateTicketDTO extends Omit(TicketDTO, [
'ticket_id',
'status',
'submission_date',
'notes',
]) {}
3 changes: 2 additions & 1 deletion api/src/ticket/dto/device.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ export class DeviceDTO {
description: 'physical hardware part that is damaged',
example: 'screen',
nullable: true,
default: null,
})
component: string;
component: string | null;

@ApiProperty({ description: 'manufacturer of device', example: 'dell' })
manufacturer: string;
Expand Down
10 changes: 9 additions & 1 deletion api/src/ticket/dto/ticket.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ export class TicketDTO {
})
description: string;

// Not sure of difference between description and problem
@ApiProperty({
description: 'label of problem student is facing',
example: 'computer slowdown',
Expand All @@ -50,4 +49,13 @@ export class TicketDTO {
example: '2020-07-21 12:44:22',
})
submission_date: string;

@ApiProperty({
description: 'notes for admin to add',
example: 'TODO: some note',
maxLength: 500,
default: null,
nullable: true,
})
notes: string | null;
}
4 changes: 3 additions & 1 deletion api/src/ticket/ticket.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -502,17 +502,19 @@ export class TicketService {
problem_category,
status,
priority,
notes,
} = updateTicket;
const updateTicketQuery = {
name: 'update_ticket',
text:
'UPDATE ticket SET core_issue = $1, description = $2, problem_category = $3, status = $4, priority = $5 WHERE ticket_id = $6 RETURNING *',
'UPDATE ticket SET core_issue = $1, description = $2, problem_category = $3, status = $4, priority = $5, notes = $6 WHERE ticket_id = $7 RETURNING *',
values: [
core_issue,
description,
problem_category,
status,
priority,
notes,
ticket_id,
],
};
Expand Down

0 comments on commit 74231e7

Please sign in to comment.