This commit is contained in:
2025-11-21 18:37:09 +03:30
parent e2a04e6a50
commit 2c0ab601f3
22 changed files with 669 additions and 2 deletions
@@ -0,0 +1,26 @@
import { Entity, ManyToOne, Unique, Property } from '@mikro-orm/core';
import { BaseEntity } from '../../../common/entities/base.entity';
import { Restaurant } from '../../restaurants/entities/restaurant.entity';
import { PaymentMethod } from './payment-method.entity';
import { ObjectType, Field } from '@nestjs/graphql';
@ObjectType()
@Entity({ tableName: 'restaurant_payment_methods' })
@Unique({ properties: ['restaurant', 'paymentMethod'] })
export class RestaurantPaymentMethod extends BaseEntity {
@ManyToOne(() => Restaurant)
restaurant!: Restaurant;
@Field(() => PaymentMethod, { nullable: true })
@ManyToOne(() => PaymentMethod)
paymentMethod!: PaymentMethod;
// Add merchant ID for payment gateway providers (e.g., ZarinPal)
@Field({ nullable: true })
@Property({ nullable: true })
merchantId?: string;
@Field({ nullable: true })
@Property({ type: 'boolean', default: true })
isActive: boolean = true;
}