add filter in export fleets
This commit is contained in:
parent
ddb08cf671
commit
b717be9b99
|
@ -5,12 +5,14 @@ import (
|
|||
"fmt"
|
||||
"net/http"
|
||||
|
||||
"git.coopgo.io/coopgo-apps/parcoursmob/utils/identification"
|
||||
fleets "git.coopgo.io/coopgo-platform/fleets/grpcapi"
|
||||
fleetsstorage "git.coopgo.io/coopgo-platform/fleets/storage"
|
||||
groupsmanagement "git.coopgo.io/coopgo-platform/groups-management/grpcapi"
|
||||
groupsstorage "git.coopgo.io/coopgo-platform/groups-management/storage"
|
||||
accounts "git.coopgo.io/coopgo-platform/mobility-accounts/grpcapi"
|
||||
accountsstorage "git.coopgo.io/coopgo-platform/mobility-accounts/storage"
|
||||
"git.coopgo.io/coopgo-platform/groups-management/storage"
|
||||
"github.com/xuri/excelize/v2"
|
||||
)
|
||||
|
||||
|
@ -18,7 +20,6 @@ func (h *ExportsHandler) Bookings(w http.ResponseWriter, r *http.Request) {
|
|||
|
||||
vehicles := map[string]fleetsstorage.Vehicle{}
|
||||
bookings := []fleetsstorage.Booking{}
|
||||
|
||||
reequest := &fleets.GetVehiclesRequest{
|
||||
Namespaces: []string{"parcoursmob"},
|
||||
}
|
||||
|
@ -123,21 +124,14 @@ func (h *ExportsHandler) Bookings(w http.ResponseWriter, r *http.Request) {
|
|||
}
|
||||
}
|
||||
}
|
||||
fmt.Println("\n"+bookedbygroup+"\n")
|
||||
|
||||
// for _, a := range vehicle.Administrators {
|
||||
// if a == bookedbygroup {
|
||||
// fmt.Println("\n"+a+"\n")
|
||||
// }
|
||||
// }
|
||||
// filter by group
|
||||
g := r.Context().Value(identification.GroupKey)
|
||||
group := g.(storage.Group)
|
||||
|
||||
// group := ""
|
||||
|
||||
// fmt.Printf("\n"+group+"\n")
|
||||
|
||||
// if bookedbygroup == group {
|
||||
// continue
|
||||
// }
|
||||
if bookedbygroup != group.ID {
|
||||
continue
|
||||
}
|
||||
|
||||
beneficiary := beneficiaries_map[b.Driver]
|
||||
adminunavailability := false
|
||||
|
|
Loading…
Reference in New Issue