-
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.
refactored DTO object names to be consistent
- Loading branch information
Showing
14 changed files
with
92 additions
and
84 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,11 @@ | ||
import { IntersectionType } from '@nestjs/swagger'; | ||
import { Ticket } from './ticket.dto'; | ||
import { User } from 'src/user/dto/user.dto'; | ||
import { Device } from './device.dto'; | ||
import { TicketDTO } from './ticket.dto'; | ||
import { UserDTO } from 'src/user/dto/user.dto'; | ||
import { DeviceDTO } from './device.dto'; | ||
|
||
class TicketAndDevice extends IntersectionType(Ticket, Device) {} | ||
class TicketAndDeviceDTO extends IntersectionType(TicketDTO, DeviceDTO) {} | ||
|
||
export class Combined extends IntersectionType(TicketAndDevice, User) {} | ||
export class CombinedDTO extends IntersectionType( | ||
TicketAndDeviceDTO, | ||
UserDTO, | ||
) {} |
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,14 +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'; | ||
import { CreateUserDTO } from 'src/user/dto/create-user.dto'; | ||
import { CreateTicketDTO } from './create-ticket.dto'; | ||
import { CreateDeviceDTO } from './create-device.dto'; | ||
|
||
class createTicketAndDevice extends IntersectionType( | ||
CreateTicket, | ||
Omit(CreateDevice, ['ticket_id']), | ||
class createTicketAndDeviceDTO extends IntersectionType( | ||
CreateTicketDTO, | ||
Omit(CreateDeviceDTO, ['ticket_id']), | ||
) {} | ||
|
||
export class CreateCombined extends IntersectionType( | ||
createTicketAndDevice, | ||
Omit(CreateUser, ['admin']), | ||
export class CreateCombinedDTO extends IntersectionType( | ||
createTicketAndDeviceDTO, | ||
Omit(CreateUserDTO, ['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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import { OmitType as Omit } from '@nestjs/swagger'; | ||
import { Device } from './device.dto'; | ||
import { DeviceDTO } from './device.dto'; | ||
|
||
export class CreateDevice extends Omit(Device, ['device_id']) {} | ||
export class CreateDeviceDTO extends Omit(DeviceDTO, ['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
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
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,3 +1,3 @@ | ||
import { User } from './user.dto'; | ||
import { UserDTO } from './user.dto'; | ||
|
||
export class CreateUser extends User {} | ||
export class CreateUserDTO extends UserDTO {} |
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,3 +1,3 @@ | ||
import { User } from './user.dto'; | ||
import { UserDTO } from './user.dto'; | ||
|
||
export class UpdateUser extends User {} | ||
export class UpdateUserDTO extends UserDTO {} |
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.