Files
dkala-api/src/modules/pager/entities/pager.entity.ts
T
2026-02-08 09:18:20 +03:30

31 lines
866 B
TypeScript

import { Entity, ManyToOne, Property, Enum } from '@mikro-orm/core';
import { BaseEntity } from '../../../../common/entities/base.entity';
import { User } from '../../../users/entities/user.entity';
import { Shop } from ../../..shops/entities/shop.entity';
import { PagerStatus } from '../interface/pager';
import { Admin } from 'src/modules/admin/entities/admin.entity';
@Entity({ tableName: 'pagers' })
export class Pager extends BaseEntity {
@Property({ type: 'string' })
cookieId!: string;
@ManyToOne(() => Shop)
shop!: Shop;
@Property({ type: 'string' })
tableNumber!: string;
@ManyToOne(() => User, { nullable: true })
user?: User;
@ManyToOne(() => Admin, { nullable: true })
staff?: Admin;
@Property({ type: 'string', nullable: true })
message?: string;
@Enum(() => PagerStatus)
status: PagerStatus = PagerStatus.Pending;
}