feat(purchase
This commit is contained in:
@@ -120,6 +120,20 @@ func (s *PurchaseOrderServiceImpl) ListPurchaseOrders(ctx context.Context, apctx
|
||||
if modelReq.TeamCategoryID != nil {
|
||||
filters["team_category_id"] = *modelReq.TeamCategoryID
|
||||
}
|
||||
// team spells out the same two filters in one value; the validator has already
|
||||
// ruled out sending it together with them.
|
||||
switch modelReq.Team {
|
||||
case "":
|
||||
case constants.PurchaseTeamNone:
|
||||
filters["team_unassigned"] = true
|
||||
case constants.PurchaseTeamScopeCentral:
|
||||
filters["team_scope"] = constants.PurchaseTeamScopeCentral
|
||||
default:
|
||||
if teamCategoryID, err := uuid.Parse(modelReq.Team); err == nil {
|
||||
filters["team_scope"] = constants.PurchaseTeamScopeCategory
|
||||
filters["team_category_id"] = teamCategoryID
|
||||
}
|
||||
}
|
||||
if modelReq.StartDate != nil {
|
||||
filters["start_date"] = *modelReq.StartDate
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user