37 lines
1.0 KiB
TypeScript
37 lines
1.0 KiB
TypeScript
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<ItemQueueEntity>
|
|
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[];
|
|
}
|