Spaces:
Sleeping
Sleeping
import { | |
BaseEntity, | |
Column, | |
CreateDateColumn, | |
DeleteDateColumn, | |
Entity, | |
JoinColumn, | |
ManyToOne, | |
OneToMany, | |
OneToOne, | |
PrimaryGeneratedColumn, | |
Relation, | |
UpdateDateColumn, | |
} from 'typeorm'; | |
import { BranchEntity } from './branch.entity.js'; | |
import { UserEntity } from './user.entity.js'; | |
import { OrderType } from '../common/enums/OrderType.enum.js'; | |
import { OrderStatus } from '../common/enums/OrderStatus.enum.js'; | |
import { OrderItemEntity } from './order-item.entity.js'; | |
import { PaymentEntity } from './payment.entity.js'; | |
'orders') | (|
export class OrderEntity extends BaseEntity { | |
() | |
id: number; | |
nullable: true }) | ({|
customer_id: string; | |
() => UserEntity, { nullable: true }) | (|
name: 'customer_id' }) | ({|
customer: Relation<UserEntity>; | |
() | |
branch_id: string; | |
() => BranchEntity) | (|
name: 'branch_id' }) | ({|
branch: Relation<BranchEntity>; | |
nullable: true }) | ({|
staff_id: string; | |
() => UserEntity, { nullable: true }) | (|
name: 'staff_id' }) | ({|
staff: Relation<UserEntity>; | |
nullable: true }) | ({|
table_number: number; | |
nullable: true }) | ({|
note: string; | |
nullable: true }) | ({|
rating: number; | |
() | |
total_value: number; | |
default: 0 }) | ({|
order_type: number; | |
default: 0 }) | ({|
order_status: number; | |
() => OrderItemEntity, (a) => a.order) | (|
order_items: Relation<OrderItemEntity>[]; | |
nullable: true }) | ({|
payment_id: number; | |
() => PaymentEntity, (a) => a.order) | (|
name: 'payment_id' }) | ({|
payment: Relation<PaymentEntity>; | |
() | |
created_at: Date; | |
() | |
updated_at: Date; | |
() | |
deleted_at: Date; | |
} | |