Skip to content

Commit

Permalink
added dto for create order validation
Browse files Browse the repository at this point in the history
  • Loading branch information
flippedcoder committed Aug 23, 2023
1 parent 4d2a070 commit a38e0d2
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/orders/orders.interface.ts
Original file line number Diff line number Diff line change
@@ -1,7 1,17 @@
import { IsNotEmpty, IsNumber } from 'class-validator';

export interface Order {
id: number;
name: string;
total: number;
createdAt: Date;
updatedAt: Date;
}

export class CreateOrderDto {
@IsNotEmpty()
name: string;

@IsNumber()
total: number;
}

0 comments on commit a38e0d2

Please sign in to comment.