This commit is contained in:
2025-12-02 22:57:30 +03:30
parent 40442686be
commit f193266235
19 changed files with 219 additions and 404 deletions
@@ -1,30 +1,31 @@
import { Entity, Property } from '@mikro-orm/core';
import { Entity, Enum, ManyToOne, Property } 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' })
export class PaymentMethod extends BaseEntity {
@Property()
name!: string;
@ManyToOne(() => Restaurant)
restaurant!: Restaurant;
@Property()
keyName!: string;
title!: string;
@Enum(() => PaymentMethodEnum)
method!: PaymentMethodEnum;
@Enum(() => PaymentGatewayEnum)
gateway: PaymentGatewayEnum | null = null;
@Property({ nullable: true })
description?: string;
@Property({ nullable: true })
icon?: string;
@Property({ default: true })
isActive: boolean = true;
@Property({ default: true })
isOnline: boolean = true;
@Property({ type: 'int', nullable: true })
order?: number;
enabled: boolean = true;
@Property({ type: 'integer', default: 0 })
order: number = 0;
@Property({ nullable: true })
paymentUrl?: string;
merchantId?: string;
}