Add grouping by outlet_id

This commit is contained in:
2026-06-24 16:30:40 +07:00
parent 9b0fc9a63b
commit fbc65c5606
10 changed files with 263 additions and 51 deletions
+5 -4
View File
@@ -196,10 +196,11 @@ func (s *AnalyticsServiceImpl) validatePurchasingAnalyticsRequest(req *models.Pu
if req.GroupBy != "" {
validGroupBy := map[string]bool{
"day": true,
"hour": true,
"week": true,
"month": true,
"day": true,
"hour": true,
"week": true,
"month": true,
"outlet_id": true,
}
if !validGroupBy[req.GroupBy] {
return fmt.Errorf("invalid group_by value: %s", req.GroupBy)