This commit is contained in:
2025-11-23 09:46:24 +03:30
parent cc28b78596
commit f196366421
11 changed files with 456 additions and 11 deletions
@@ -1,5 +1,7 @@
import { Entity, Property } from '@mikro-orm/core';
import { Collection, Entity, ManyToMany, Property } from '@mikro-orm/core';
import { BaseEntity } from '../../../common/entities/base.entity';
import { ShipmentMethod } from './shipment-method.entity';
import { RestaurantShipmentMethod } from './restaurant-shipment-method.entity';
@Entity({ tableName: 'restaurants' })
export class Restaurant extends BaseEntity {
@@ -75,4 +77,12 @@ export class Restaurant extends BaseEntity {
// --- مالیات یا VAT ---
@Property({ type: 'decimal', default: 0 })
vat?: number = 0;
// --- روش‌های ارسال ---
@ManyToMany({
entity: () => ShipmentMethod,
pivotEntity: () => RestaurantShipmentMethod,
inversedBy: sm => sm.restaurants,
})
shipmentMethods = new Collection<ShipmentMethod>(this);
}