-
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.
Merge pull request #14 from cdalton713/backend
Backend
- Loading branch information
Showing
9 changed files
with
327 additions
and
111 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { IntersectionType } from '@nestjs/swagger'; | ||
import { Ticket } from './ticket.dto'; | ||
import { User } from 'src/user/dto/user.dto'; | ||
import { Device } from './device.dto'; | ||
|
||
class TicketAndDevice extends IntersectionType(Ticket, Device) {} | ||
|
||
export class Combined extends IntersectionType(TicketAndDevice, User) {} |
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,14 @@ | ||
import { IntersectionType, OmitType as Omit } from '@nestjs/swagger'; | ||
import { CreateUser } from 'src/user/dto/create-user.dto'; | ||
import { CreateTicket } from './create-ticket.dto'; | ||
import { CreateDevice } from './create-device.dto'; | ||
|
||
class createTicketAndDevice extends IntersectionType( | ||
CreateTicket, | ||
Omit(CreateDevice, ['ticket_id']), | ||
) {} | ||
|
||
export class CreateCombined extends IntersectionType( | ||
createTicketAndDevice, | ||
Omit(CreateUser, ['admin']), | ||
) {} |
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,4 @@ | ||
import { OmitType as Omit } from '@nestjs/swagger'; | ||
import { Device } from './device.dto'; | ||
|
||
export class CreateDevice extends Omit(Device, ['device_id']) {} |
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,8 +1,4 @@ | ||
import { Ticket } from './ticket.dto'; | ||
import { OmitType as Omit } from '@nestjs/swagger'; | ||
|
||
export class CreateTicket extends Omit(Ticket, [ | ||
'ticket_id', | ||
'priority', | ||
'status', | ||
]) {} | ||
export class CreateTicket extends Omit(Ticket, ['ticket_id', 'status']) {} |
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,36 @@ | ||
import { ApiProperty } from '@nestjs/swagger'; | ||
|
||
export class Device { | ||
@ApiProperty({ description: 'id of device', example: 1 }) | ||
device_id: number; | ||
|
||
@ApiProperty({ description: 'id of associated ticket', example: 1 }) | ||
ticket_id: number; | ||
|
||
@ApiProperty({ | ||
minLength: 1, | ||
description: 'model of device', | ||
example: '15', | ||
}) | ||
model: string; | ||
|
||
@ApiProperty({ | ||
description: 'physical hardware part that is damaged', | ||
example: 'screen', | ||
nullable: true, | ||
}) | ||
component: string; | ||
|
||
@ApiProperty({ description: 'manufacturer of device', example: 'dell' }) | ||
manufacturer: string; | ||
|
||
@ApiProperty({ | ||
minLength: 1, | ||
description: 'operating system', | ||
example: 'windows', | ||
}) | ||
operating_system: string; | ||
|
||
@ApiProperty({ description: 'operating system version', example: 'version1' }) | ||
operating_system_version: string; | ||
} |
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
Oops, something went wrong.