update payment
This commit is contained in:
@@ -24,6 +24,7 @@ export class PaymentMethod extends BaseEntity {
|
||||
@Property({ type: 'int', nullable: true })
|
||||
order?: number;
|
||||
|
||||
|
||||
@Property({ nullable: true })
|
||||
callbackUrl?: string;
|
||||
paymentUrl?: string;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,37 @@
|
||||
export class Payment {
|
||||
exampleField: number;
|
||||
import { Entity, ManyToOne, Property, Enum } from '@mikro-orm/core';
|
||||
import { BaseEntity } from '../../../common/entities/base.entity';
|
||||
import { Order } from '../../orders/entities/order.entity';
|
||||
import { PaymentStatus } from '../interface/payment-status';
|
||||
|
||||
@Entity({ tableName: 'payments' })
|
||||
export class Payment extends BaseEntity {
|
||||
@ManyToOne(() => Order)
|
||||
order!: Order;
|
||||
|
||||
@Property({ type: 'decimal', precision: 10, scale: 0 })
|
||||
amount!: number;
|
||||
|
||||
@Property({ unique: true })
|
||||
authority!: string;
|
||||
|
||||
@Property()
|
||||
gateway!: string;
|
||||
|
||||
@Property({ nullable: true })
|
||||
refId?: string;
|
||||
|
||||
@Enum(() => PaymentStatus)
|
||||
status!: PaymentStatus;
|
||||
|
||||
@Property({ nullable: true })
|
||||
cardPan?: string;
|
||||
|
||||
@Property({ type: 'json' })
|
||||
verifyResponse?: Record<string, any>;
|
||||
|
||||
@Property({ nullable: true })
|
||||
paidAt: Date;
|
||||
|
||||
@Property({ nullable: true })
|
||||
failedAt: Date;
|
||||
}
|
||||
|
||||
@@ -16,6 +16,9 @@ export class RestaurantPaymentMethod extends BaseEntity {
|
||||
@Property({ nullable: true })
|
||||
merchantId?: string;
|
||||
|
||||
@Property({ nullable: true })
|
||||
callbackUrl?: string;
|
||||
|
||||
@Property({ type: 'boolean', default: true })
|
||||
isActive: boolean = true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user