change entity names

This commit is contained in:
2026-02-08 09:18:20 +03:30
parent 6be6a66079
commit 9a7010dcea
180 changed files with 2751 additions and 2513 deletions
@@ -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;