payment
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user