order
This commit is contained in:
@@ -20,9 +20,9 @@ import { ulid } from 'ulid';
|
||||
@Index({ properties: ['user', 'status'] })
|
||||
@Index({ properties: ['status'] })
|
||||
export class Order extends BaseEntity {
|
||||
@PrimaryKey({type:'string',columnType:'char(26)'})
|
||||
id:string=ulid()
|
||||
|
||||
@PrimaryKey({ type: 'string', columnType: 'char(26)' })
|
||||
id: string = ulid()
|
||||
|
||||
@ManyToOne(() => User)
|
||||
user!: User;
|
||||
|
||||
@@ -38,8 +38,8 @@ export class Order extends BaseEntity {
|
||||
})
|
||||
items = new Collection<OrderItem>(this);
|
||||
|
||||
@Property({ nullable: true })
|
||||
userAddress?: string | null;
|
||||
// @Property({ nullable: true })
|
||||
// userAddress?: string | null;
|
||||
|
||||
@Property({ type: 'bigint', autoincrement: true })
|
||||
orderNumber: number;
|
||||
@@ -52,8 +52,8 @@ export class Order extends BaseEntity {
|
||||
subTotal!: number;
|
||||
|
||||
|
||||
@Property({ type: 'decimal', precision: 10, scale: 0, default: 0 })
|
||||
deliveryFee: number = 0;
|
||||
// @Property({ type: 'decimal', precision: 10, scale: 0, default: 0 })
|
||||
// deliveryFee: number = 0;
|
||||
|
||||
@Property({ type: 'decimal', precision: 10, scale: 0 })
|
||||
total!: number;
|
||||
@@ -64,12 +64,11 @@ export class Order extends BaseEntity {
|
||||
@Property({ type: 'decimal', precision: 10, scale: 0 })
|
||||
balance!: number;
|
||||
|
||||
@Property({ type: 'text', nullable: true })
|
||||
description?: string;
|
||||
// @Property({ type: 'text', nullable: true })
|
||||
// description?: string;
|
||||
|
||||
|
||||
@Enum(() => OrderStatus)
|
||||
status!: OrderStatus;
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user