|
| 1 | +export interface VeilProps { |
| 2 | + id: string; |
| 3 | + name: string; |
| 4 | + description: string; |
| 5 | + price: number; |
| 6 | + rentalPrice: number; |
| 7 | + images: string[]; |
| 8 | + category: string; |
| 9 | + isAvailable?: boolean; |
| 10 | + sku?: string; |
| 11 | + silhouette?: string; |
| 12 | + neckline?: string; |
| 13 | + fabric?: string; |
| 14 | + trainLength?: string; |
| 15 | + stock?: number; |
| 16 | + createdAt?: Date; |
| 17 | + updatedAt?: Date; |
| 18 | +} |
| 19 | + |
1 | 20 | export class Veil { |
2 | | - constructor( |
3 | | - public readonly id: string, |
4 | | - public readonly name: string, |
5 | | - public readonly description: string, |
6 | | - public readonly price: number, |
7 | | - public readonly rentalPrice: number, |
8 | | - public readonly images: string[], |
9 | | - public readonly category: string, |
10 | | - public readonly isAvailable: boolean = true, |
11 | | - public readonly sku?: string, |
12 | | - public readonly silhouette?: string, |
13 | | - public readonly neckline?: string, |
14 | | - public readonly fabric?: string, |
15 | | - public readonly trainLength?: string, |
16 | | - public readonly stock?: number, |
17 | | - public readonly createdAt: Date = new Date(), |
18 | | - ) {} |
| 21 | + public readonly id: string; |
| 22 | + public readonly name: string; |
| 23 | + public readonly description: string; |
| 24 | + public readonly price: number; |
| 25 | + public readonly rentalPrice: number; |
| 26 | + public readonly images: string[]; |
| 27 | + public readonly category: string; |
| 28 | + public readonly isAvailable: boolean; |
| 29 | + public readonly sku?: string; |
| 30 | + public readonly silhouette?: string; |
| 31 | + public readonly neckline?: string; |
| 32 | + public readonly fabric?: string; |
| 33 | + public readonly trainLength?: string; |
| 34 | + public readonly stock?: number; |
| 35 | + public readonly createdAt: Date; |
| 36 | + public readonly updatedAt: Date; |
| 37 | + |
| 38 | + constructor(props: VeilProps) { |
| 39 | + this.id = props.id; |
| 40 | + this.name = props.name; |
| 41 | + this.description = props.description; |
| 42 | + this.price = props.price; |
| 43 | + this.rentalPrice = props.rentalPrice; |
| 44 | + this.images = props.images; |
| 45 | + this.category = props.category; |
| 46 | + this.isAvailable = props.isAvailable ?? true; |
| 47 | + this.sku = props.sku; |
| 48 | + this.silhouette = props.silhouette; |
| 49 | + this.neckline = props.neckline; |
| 50 | + this.fabric = props.fabric; |
| 51 | + this.trainLength = props.trainLength; |
| 52 | + this.stock = props.stock; |
| 53 | + this.createdAt = props.createdAt ?? new Date(); |
| 54 | + this.updatedAt = props.updatedAt ?? new Date(); |
| 55 | + } |
19 | 56 | } |
0 commit comments