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