populate order with payments

This commit is contained in:
2025-12-20 13:01:26 +03:30
parent 31a786b4d7
commit 48524542f2
2 changed files with 9 additions and 1 deletions
@@ -1,4 +1,4 @@
import { Entity, ManyToOne, Property, Enum } from '@mikro-orm/core';
import { Entity, ManyToOne, Property, Enum, Index } from '@mikro-orm/core';
import { BaseEntity } from '../../../common/entities/base.entity';
import { Order } from '../../orders/entities/order.entity';
import { PaymentGatewayEnum, PaymentMethodEnum, PaymentStatusEnum } from '../interface/payment';
@@ -6,6 +6,7 @@ import { PaymentGatewayEnum, PaymentMethodEnum, PaymentStatusEnum } from '../int
@Entity({ tableName: 'payments' })
export class Payment extends BaseEntity {
@ManyToOne(() => Order)
@Index()
order!: Order;
@Property({ type: 'decimal', precision: 10, scale: 0 })