import { TABLE_NAME } from 'src/core/strings/constants/table.constants'; import { ItemQueueEntity } from '../../domain/entities/item-queue.entity'; import { Column, Entity, OneToMany } from 'typeorm'; import { BaseStatusModel } from 'src/core/modules/data/model/base-status.model'; import { ItemType } from '../../constants'; import { ItemModel } from 'src/modules/item-related/item/data/models/item.model'; @Entity(TABLE_NAME.ITEM_QUEUE) export class ItemQueueModel extends BaseStatusModel implements ItemQueueEntity { @Column('int', { default: 100 }) max_peak_level: number; @Column('int', { default: 5 }) call_preparation: number; @Column('varchar', { name: 'name' }) name: string; @Column('varchar', { name: 'information', nullable: true }) information: string; @Column('enum', { name: 'item_type', enum: ItemType, default: ItemType.TIKET_MASUK, }) item_type: ItemType; @OneToMany(() => ItemModel, (model) => model.item_queue, { onUpdate: 'CASCADE', }) items: ItemModel[]; @Column('boolean', { default: true }) use_notification: boolean; @Column('boolean', { default: false }) requiring_notification: boolean; }