This commit is contained in:
2026-01-10 15:55:05 +03:30
parent aa23bf5614
commit 984b889587
5 changed files with 11 additions and 14 deletions
@@ -1,7 +1,8 @@
import { Entity, Index, ManyToOne, Property } from '@mikro-orm/core';
import { Entity, Enum, Index, ManyToOne, Property } from '@mikro-orm/core';
import { BaseEntity } from '../../../common/entities/base.entity';
import { Order } from './order.entity';
import { product } from 'src/modules/product/entities/product.entity';
import { OrderItemStatus } from '../interface/order.interface';
@Entity({ tableName: 'order_items' })
@Index({ properties: ['order'] })
@@ -27,4 +28,7 @@ export class OrderItem extends BaseEntity {
@Property({ nullable: true })
description?: string;
@Enum(() => OrderItemStatus)
status!: OrderItemStatus;
}
@@ -7,4 +7,7 @@ export enum OrderStatus {
}
export enum OrderItemStatus {
PENDING = 'pending',
VERIFIED = 'verified',
}
@@ -1,14 +1,9 @@
import { Entity, Enum, Index, ManyToOne, Property, Unique } from '@mikro-orm/core';
import { BaseEntity } from '../../../common/entities/base.entity';
import { Restaurant } from 'src/modules/restaurants/entities/restaurant.entity';
import { PaymentGatewayEnum, PaymentMethodEnum } from '../interface/payment';
@Entity({ tableName: 'payment_methods' })
@Unique({ properties: ['restaurant', 'method'] })
@Index({ properties: ['restaurant', 'enabled'] })
export class PaymentMethod extends BaseEntity {
@ManyToOne(() => Restaurant)
restaurant!: Restaurant;
@Enum(() => PaymentMethodEnum)
method!: PaymentMethodEnum;
@@ -13,7 +13,7 @@ export class Payment extends BaseEntity {
amount!: number;
@Property({ unique: true, nullable: true })
referenceId?: string | null;
token?: string | null;
@Enum(() => PaymentMethodEnum)
method!: PaymentMethodEnum;
@@ -27,9 +27,6 @@ export class Payment extends BaseEntity {
@Enum(() => PaymentStatusEnum)
status!: PaymentStatusEnum;
@Property({ nullable: true })
cardPan?: string | null = null;
@Property({ type: 'json', nullable: true })
verifyResponse?: Record<string, any> | null = null;
@@ -39,6 +36,4 @@ export class Payment extends BaseEntity {
@Property({ nullable: true })
failedAt?: Date | null = null;
@Property({ nullable: true })
description?: string | null = null;
}
+1 -1
View File
@@ -33,7 +33,7 @@ export class Ticket extends BaseEntity {
user: User;
@ManyToOne(() => Ticket)
parent: Ticket[];
parent: Ticket|null;
@Property({ type: 'json' })
attachments: string[]