import { BaseEntity, Column, Entity, OneToOne, PrimaryGeneratedColumn, Relation, } from 'typeorm'; 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({ default: 0 }) payment_method: number; // E.g., 'Cash', 'Credit Card', 'Online Payment' @Column() value: number; }