change entity names
This commit is contained in:
@@ -1,17 +1,17 @@
|
||||
import { Entity, Index, ManyToOne, Property, Enum, Unique } from '@mikro-orm/core';
|
||||
import { BaseEntity } from '../../../common/entities/base.entity';
|
||||
import { Restaurant } from '../../restaurants/entities/restaurant.entity';
|
||||
import { normalizePhone } from '../../utils/phone.util';
|
||||
import { BaseEntity } from '../../../../common/entities/base.entity';
|
||||
import { Shop } from ../../..shops/entities/shop.entity';
|
||||
import { normalizePhone } from '../../../utils/phone.util';
|
||||
import { CouponType } from '../interface/coupon';
|
||||
|
||||
@Entity({ tableName: 'coupons' })
|
||||
@Unique({ properties: ['code', 'restaurant'] })
|
||||
@Index({ properties: ['restaurant', 'code', 'isActive'] })
|
||||
@Index({ properties: ['restaurant', 'isActive'] })
|
||||
@Unique({ properties: ['code', 'shop'] })
|
||||
@Index({ properties: ['shop', 'code', 'isActive'] })
|
||||
@Index({ properties: ['shop', 'isActive'] })
|
||||
@Index({ properties: ['code'] })
|
||||
export class Coupon extends BaseEntity {
|
||||
@ManyToOne(() => Restaurant)
|
||||
restaurant!: Restaurant;
|
||||
@ManyToOne(() => Shop)
|
||||
shop!: Shop;
|
||||
|
||||
@Property()
|
||||
code!: string;
|
||||
@@ -56,7 +56,7 @@ export class Coupon extends BaseEntity {
|
||||
foodCategories?: string[]; // Array of category IDs
|
||||
|
||||
@Property({ type: 'json', nullable: true })
|
||||
foods?: string[]; // Array of food IDs
|
||||
products?: string[]; // Array of product IDs
|
||||
|
||||
private _userPhone?: string;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user