This commit is contained in:
2025-12-02 20:01:07 +03:30
parent e43727f1c6
commit 40442686be
24 changed files with 420 additions and 490 deletions
@@ -1,7 +1,6 @@
import { Collection, Entity, ManyToMany, Property } from '@mikro-orm/core';
import { Collection, Entity, OneToMany, Property } from '@mikro-orm/core';
import { BaseEntity } from '../../../common/entities/base.entity';
import { ShipmentMethod } from '../../shipments/entities/shipment-method.entity';
import { RestaurantShipmentMethod } from '../../shipments/entities/restaurant-shipment-method.entity';
import { Delivery } from '../../delivery/entities/delivery.entity';
@Entity({ tableName: 'restaurants' })
export class Restaurant extends BaseEntity {
@@ -79,10 +78,6 @@ export class Restaurant extends BaseEntity {
vat?: number = 0;
// --- روش‌های ارسال ---
@ManyToMany({
entity: () => ShipmentMethod,
pivotEntity: () => RestaurantShipmentMethod,
inversedBy: sm => sm.restaurants,
})
shipmentMethods = new Collection<ShipmentMethod>(this);
@OneToMany(() => Delivery, delivery => delivery.restaurant)
deliveries = new Collection<Delivery>(this);
}