Expire past-pending bookings to expired status. Fixes EventHub/EventHubBack#60
CI / test (push) Successful in 7m14s
CI / deploy-ift (push) Successful in 3m40s
CI / e2e-ift (push) Successful in 1m43s
CI / deploy-stage (push) Successful in 3m8s
CI / e2e-stage (push) Successful in 1m12s

This commit is contained in:
2026-07-27 16:45:30 +03:00
parent 1d9752bb69
commit edb7c20f70
6 changed files with 181 additions and 36 deletions
+5 -1
View File
@@ -88,7 +88,7 @@ booking_schema() ->
id => #{type => string},
event_id => #{type => string},
user_id => #{type => string},
status => #{type => string, enum => [<<"pending">>, <<"confirmed">>, <<"cancelled">>]},
status => #{type => string, enum => [<<"pending">>, <<"confirmed">>, <<"cancelled">>, <<"expired">>]},
notes => #{type => string, nullable => true},
reminder_sent => #{type => boolean},
confirmed_at => #{type => string, format => <<"date-time">>, nullable => true},
@@ -143,6 +143,10 @@ update_booking(Req) ->
handler_utils:send_json(Req2, 200, booking_to_json(Booking));
{error, access_denied} ->
handler_utils:send_error(Req2, 403, <<"Access denied">>);
{error, expired} ->
handler_utils:send_error(Req2, 409, <<"Booking expired">>);
{error, full} ->
handler_utils:send_error(Req2, 409, <<"Event is full">>);
{error, not_found} ->
handler_utils:send_error(Req2, 404, <<"Booking not found">>);
{error, _} ->
+1 -1
View File
@@ -92,7 +92,7 @@ booking_schema() ->
id => #{type => string},
event_id => #{type => string},
user_id => #{type => string},
status => #{type => string, enum => [<<"pending">>, <<"confirmed">>, <<"cancelled">>]},
status => #{type => string, enum => [<<"pending">>, <<"confirmed">>, <<"cancelled">>, <<"expired">>]},
notes => #{type => string, nullable => true},
reminder_sent => #{type => boolean},
confirmed_at => #{type => string, format => <<"date-time">>, nullable => true},
+1 -1
View File
@@ -45,7 +45,7 @@ booking_schema() ->
id => #{type => string},
event_id => #{type => string},
user_id => #{type => string},
status => #{type => string, enum => [<<"pending">>, <<"confirmed">>, <<"cancelled">>]},
status => #{type => string, enum => [<<"pending">>, <<"confirmed">>, <<"cancelled">>, <<"expired">>]},
notes => #{type => string, nullable => true},
reminder_sent => #{type => boolean},
confirmed_at => #{type => string, format => <<"date-time">>, nullable => true},