feat: download product report
All checks were successful
Spell Check / Spell Check with Typos (push) Successful in 8s

This commit is contained in:
Methapon2001 2025-03-06 10:09:35 +07:00
parent 64884875b3
commit d6f7c34331

View file

@ -167,6 +167,19 @@ export class StatsController extends Controller {
}));
}
@Get("receipt/download")
async downloadProductReport(
@Request() req: RequestWithUser,
@Query() limit?: number,
@Query() startDate?: Date,
@Query() endDate?: Date,
) {
this.setHeader("Content-Type", "text/csv");
return json2csv(await this.productReport(req, limit, startDate, endDate), {
useDateIso8601Format: true,
});
}
@Get("product")
async productReport(
@Request() req: RequestWithUser,