MMS43 changes
This commit is contained in:
@@ -4,6 +4,7 @@ import (
|
||||
"fmt"
|
||||
"io"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"git.coopgo.io/coopgo-apps/parcoursmob/core/utils/identification"
|
||||
"git.coopgo.io/coopgo-platform/groups-management/storage"
|
||||
@@ -18,11 +19,31 @@ func (h *Handler) VehiclesSearchHTTPHandler() http.HandlerFunc {
|
||||
|
||||
// Extract parameters
|
||||
beneficiaryID := r.FormValue("beneficiaryid")
|
||||
startDate := r.FormValue("startdate")
|
||||
endDate := r.FormValue("enddate")
|
||||
startDateStr := r.FormValue("startdate")
|
||||
endDateStr := r.FormValue("enddate")
|
||||
startTimeStr := r.FormValue("starttime")
|
||||
endTimeStr := r.FormValue("endtime")
|
||||
vehicleType := r.FormValue("type")
|
||||
automatic := r.FormValue("automatic") == "on"
|
||||
|
||||
// Default times if not provided
|
||||
if startTimeStr == "" {
|
||||
startTimeStr = "00:00"
|
||||
}
|
||||
if endTimeStr == "" {
|
||||
endTimeStr = "23:59"
|
||||
}
|
||||
|
||||
// Parse dates and times in Europe/Paris timezone
|
||||
paris, _ := time.LoadLocation("Europe/Paris")
|
||||
var startDate, endDate time.Time
|
||||
if startDateStr != "" {
|
||||
startDate, _ = time.ParseInLocation("2006-01-02 15:04", startDateStr+" "+startTimeStr, paris)
|
||||
}
|
||||
if endDateStr != "" {
|
||||
endDate, _ = time.ParseInLocation("2006-01-02 15:04", endDateStr+" "+endTimeStr, paris)
|
||||
}
|
||||
|
||||
// Call business logic
|
||||
result, err := h.applicationHandler.SearchVehicles(r.Context(), beneficiaryID, startDate, endDate, vehicleType, automatic)
|
||||
if err != nil {
|
||||
@@ -58,8 +79,23 @@ func (h *Handler) BookVehicleHTTPHandler() http.HandlerFunc {
|
||||
}
|
||||
|
||||
// Extract form data
|
||||
startDate := r.FormValue("startdate")
|
||||
endDate := r.FormValue("enddate")
|
||||
startDateStr := r.FormValue("startdate")
|
||||
endDateStr := r.FormValue("enddate")
|
||||
startTimeStr := r.FormValue("starttime")
|
||||
endTimeStr := r.FormValue("endtime")
|
||||
|
||||
// Default times if not provided
|
||||
if startTimeStr == "" {
|
||||
startTimeStr = "00:00"
|
||||
}
|
||||
if endTimeStr == "" {
|
||||
endTimeStr = "23:59"
|
||||
}
|
||||
|
||||
// Parse dates and times in Europe/Paris timezone
|
||||
paris, _ := time.LoadLocation("Europe/Paris")
|
||||
startDate, _ := time.ParseInLocation("2006-01-02 15:04", startDateStr+" "+startTimeStr, paris)
|
||||
endDate, _ := time.ParseInLocation("2006-01-02 15:04", endDateStr+" "+endTimeStr, paris)
|
||||
|
||||
// Extract documents
|
||||
documents := make(map[string]io.Reader)
|
||||
|
||||
Reference in New Issue
Block a user