fix: queue time calculation
parent
72827aa83e
commit
ec916ab574
|
@ -41,10 +41,14 @@ export class QueueDataService extends BaseReadService<QueueModel> {
|
|||
const queues = await this.repo.find({
|
||||
where: {
|
||||
item_queue_id,
|
||||
status: 'waiting',
|
||||
},
|
||||
});
|
||||
|
||||
for (const queue of queues) {
|
||||
queueTimes[queues[0].id] = now; // first queue will be now
|
||||
|
||||
for (let i = 1; i < queues.length; i++) {
|
||||
const queue = queues[i];
|
||||
// duration will be total qty multiple by average
|
||||
const duration = queue.qty * average;
|
||||
|
||||
|
|
Loading…
Reference in New Issue