import { BaseEntity, Column, Entity, JoinColumn, ManyToOne, OneToOne, PrimaryGeneratedColumn, Relation, } from 'typeorm'; import { BranchMenuEntity } from './branch-menu.entity.js'; import { OrderEntity } from './order.entity.js'; import { PaymentMethod } from '../common/enums/PaymentMethod.enum.js'; @Entity('payments') export class PaymentEntity extends BaseEntity { @PrimaryGeneratedColumn() id: number; @OneToOne(() => OrderEntity, (a) => a.payment) order: Relation; @Column({ type: 'enum', enum: PaymentMethod, default: PaymentMethod.CASH }) payment_method: PaymentMethod; // E.g., 'Cash', 'Credit Card', 'Online Payment' @Column() value: number; }