wip: queue bucket
parent
dea9989914
commit
492a4ca2ba
|
@ -92,6 +92,7 @@ import {
|
|||
} from './modules/queue/data/models/queue.model';
|
||||
import { ItemQueueModule } from './modules/item-related/item-queue/item-queue.module';
|
||||
import { ItemQueueModel } from './modules/item-related/item-queue/data/models/item-queue.model';
|
||||
import { QueueBucketModel } from './modules/queue/data/models/queue-bucket.model';
|
||||
|
||||
@Module({
|
||||
imports: [
|
||||
|
@ -151,6 +152,7 @@ import { ItemQueueModel } from './modules/item-related/item-queue/data/models/it
|
|||
QueueTicketModel,
|
||||
QueueItemModel,
|
||||
QueueModel,
|
||||
QueueBucketModel,
|
||||
],
|
||||
synchronize: false,
|
||||
}),
|
||||
|
|
|
@ -41,4 +41,5 @@ export enum TABLE_NAME {
|
|||
QUEUE_ORDER = 'queue_orders',
|
||||
QUEUE_TICKET = 'queue_tickets',
|
||||
QUEUE_ITEM = 'queue_items',
|
||||
QUEUE_BUCKET = 'queue_bucket',
|
||||
}
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
import { Column, Entity, PrimaryGeneratedColumn } from 'typeorm';
|
||||
import { QueueBucket } from '../../domain/entities/queue-bucket.entity';
|
||||
import { TABLE_NAME } from 'src/core/strings/constants/table.constants';
|
||||
|
||||
@Entity(TABLE_NAME.QUEUE_BUCKET)
|
||||
export class QueueBucketModel implements QueueBucket {
|
||||
@PrimaryGeneratedColumn('uuid')
|
||||
id: string;
|
||||
|
||||
@Column('varchar')
|
||||
queue_item_id: string;
|
||||
|
||||
@Column({ type: 'bigint', nullable: false })
|
||||
date: number;
|
||||
|
||||
@Column('int')
|
||||
regular: number;
|
||||
|
||||
@Column('int')
|
||||
vip: number;
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
import { Injectable } from '@nestjs/common';
|
||||
|
||||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
import { CONNECTION_NAME } from 'src/core/strings/constants/base.constants';
|
||||
import { Repository } from 'typeorm';
|
||||
import { BaseReadService } from 'src/core/modules/data/service/base-read.service';
|
||||
import { QueueBucketModel } from '../models/queue-bucket.model';
|
||||
|
||||
@Injectable()
|
||||
export class QueueBucketReadService extends BaseReadService<QueueBucketModel> {
|
||||
constructor(
|
||||
@InjectRepository(QueueBucketModel, CONNECTION_NAME.DEFAULT)
|
||||
private repo: Repository<QueueBucketModel>,
|
||||
) {
|
||||
super(repo);
|
||||
}
|
||||
|
||||
getQueue(item_id: string): Promise<QueueBucketModel> {
|
||||
return this.repo.findOne({
|
||||
where: {
|
||||
queue_item_id: item_id,
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
|
@ -18,12 +18,19 @@ import { QueueTransactionHandler } from './infrastructure/handlers/transaction.h
|
|||
import { TransactionDataService } from '../transaction/transaction/data/services/transaction-data.service';
|
||||
import { TransactionModel } from '../transaction/transaction/data/models/transaction.model';
|
||||
import { TicketDataService } from './data/services/ticket.service';
|
||||
import { QueueDataService, QueueService } from './data/services/queue.service';
|
||||
import {
|
||||
QueueDataService,
|
||||
QueueOrderService,
|
||||
QueueService,
|
||||
} from './data/services/queue.service';
|
||||
import { QueueAdminController } from './infrastructure/controllers/queue-admin.controller';
|
||||
import { QueueAdminOrchestrator } from './domain/queue-admin.orchestrator';
|
||||
import { IndexQueueManager } from './domain/usecases/index-queue.manager';
|
||||
import { CallQueueManager } from './domain/usecases/call-queue.manager';
|
||||
import { RegisterQueueManager } from './domain/usecases/register-queue.manager';
|
||||
import { QueueBucketModel } from './data/models/queue-bucket.model';
|
||||
import { QueueBucketReadService } from './data/services/queue-bucket';
|
||||
import { SplitQueueManager } from './domain/usecases/split-queue.manager';
|
||||
|
||||
@Module({
|
||||
imports: [
|
||||
|
@ -34,6 +41,7 @@ import { RegisterQueueManager } from './domain/usecases/register-queue.manager';
|
|||
QueueTicketModel,
|
||||
QueueItemModel,
|
||||
QueueModel,
|
||||
QueueBucketModel,
|
||||
ItemModel,
|
||||
TransactionModel,
|
||||
],
|
||||
|
@ -52,10 +60,13 @@ import { RegisterQueueManager } from './domain/usecases/register-queue.manager';
|
|||
TicketDataService,
|
||||
QueueDataService,
|
||||
QueueService,
|
||||
QueueBucketReadService,
|
||||
QueueOrderService,
|
||||
|
||||
IndexQueueManager,
|
||||
CallQueueManager,
|
||||
RegisterQueueManager,
|
||||
SplitQueueManager,
|
||||
],
|
||||
})
|
||||
export class QueueModule {}
|
||||
|
|
Loading…
Reference in New Issue