diff --git a/src/controllers/00-stats-controller.ts b/src/controllers/00-stats-controller.ts index eb3988f..a9060a1 100644 --- a/src/controllers/00-stats-controller.ts +++ b/src/controllers/00-stats-controller.ts @@ -154,6 +154,7 @@ export class StatsController extends Controller { by: "productId", where: { quotation: { + createdAt: { gte: startDate, lte: endDate }, registeredBranch: { OR: permissionCondCompany(req.user) }, }, productId: { in: record.map((v) => v.id) }, @@ -187,4 +188,12 @@ export class StatsController extends Controller { updatedAt: v.updatedAt, })); } + + @Get("sale") + async saleReport( + @Request() req: RequestWithUser, + @Query() limit?: number, + @Query() startDate?: Date, + @Query() endDate?: Date, + ) {} }