add holiday test and tweak services
This commit is contained in:
@@ -318,7 +318,15 @@ func GetAvailableHours(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
// Load bookings
|
||||
bookingRows, _ := db.DB.Query(r.Context(), `
|
||||
SELECT b.start_time, COALESCE(SUM(s.duration_minutes),0) as total_duration
|
||||
SELECT
|
||||
b.start_time,
|
||||
COALESCE(SUM(
|
||||
CASE
|
||||
WHEN bs.override_duration_minutes IS NOT NULL AND bs.override_duration_minutes > 0
|
||||
THEN bs.override_duration_minutes
|
||||
ELSE s.duration_minutes
|
||||
END
|
||||
), 0) AS total_duration
|
||||
FROM bookings b
|
||||
LEFT JOIN booking_services bs ON b.id = bs.booking_id
|
||||
LEFT JOIN services s ON bs.service_id = s.id
|
||||
|
||||
Reference in New Issue
Block a user