Update product receipe

This commit is contained in:
Aditya Siregar
2025-08-10 21:46:44 +07:00
parent 265248ba49
commit b72ab4ef3d
14 changed files with 1287 additions and 12 deletions
-3
View File
@@ -19,7 +19,6 @@ func NewReportHandler(reportService service.ReportService, userService UserServi
return &ReportHandler{reportService: reportService, userService: userService}
}
// GET /api/v1/outlets/:outlet_id/reports/daily-transaction.pdf?date=YYYY-MM-DD
func (h *ReportHandler) GetDailyTransactionReportPDF(c *gin.Context) {
ctx := c.Request.Context()
ci := appcontext.FromGinContext(ctx)
@@ -32,11 +31,9 @@ func (h *ReportHandler) GetDailyTransactionReportPDF(c *gin.Context) {
}
}
// Get user name for "Dicetak Oleh"
user, err := h.userService.GetUserByID(ctx, ci.UserID)
var genBy string
if err != nil {
// Fallback to user ID if name cannot be retrieved
genBy = ci.UserID.String()
} else {
genBy = user.Name