shift
deploy to danak / build_and_deploy (push) Has been cancelled

This commit is contained in:
2026-07-14 19:59:20 +03:30
parent b9d7a4adc3
commit 13f21d4d3f
9 changed files with 115 additions and 153 deletions
@@ -73,10 +73,16 @@ export class CashShiftRepository extends EntityRepository<CashShift> {
};
}
findOpenShift(restId: string): Promise<CashShift | null> {
return this.findOne(
{ restaurant: { id: restId }, status: CashShiftStatus.OPEN },
{ populate: ['admin'] },
);
findOpenShift(restId: string, adminId?: string): Promise<CashShift | null> {
const where: FilterQuery<CashShift> = {
restaurant: { id: restId },
status: CashShiftStatus.OPEN,
};
if (adminId) {
where.admin = { id: adminId };
}
return this.findOne(where, { populate: ['admin'] });
}
}