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