Implement commercial calendars: booking_open, specialists, expire without type downgrade.
Refs EventHub/EventHubBack#54
This commit is contained in:
Regular → Executable
+7
-1
@@ -443,7 +443,8 @@ calendar_to_json(Calendar) ->
|
||||
settings => Calendar#calendar.settings,
|
||||
tags => Calendar#calendar.tags,
|
||||
type => Calendar#calendar.type,
|
||||
confirmation => Calendar#calendar.confirmation,
|
||||
confirmation => confirmation_to_json(Calendar#calendar.confirmation),
|
||||
booking_open => logic_calendar:booking_open(Calendar),
|
||||
rating_avg => Calendar#calendar.rating_avg,
|
||||
rating_count => Calendar#calendar.rating_count,
|
||||
status => Calendar#calendar.status,
|
||||
@@ -452,6 +453,11 @@ calendar_to_json(Calendar) ->
|
||||
updated_at => datetime_to_iso8601(Calendar#calendar.updated_at)
|
||||
}.
|
||||
|
||||
confirmation_to_json(auto) -> <<"auto">>;
|
||||
confirmation_to_json(manual) -> <<"manual">>;
|
||||
confirmation_to_json({timeout, N}) when is_integer(N) -> #{<<"timeout">> => N};
|
||||
confirmation_to_json(Other) -> Other.
|
||||
|
||||
%% @doc Преобразует #subscription{} в JSON-карту.
|
||||
-spec subscription_to_json(#subscription{}) -> map().
|
||||
subscription_to_json(Subscription) ->
|
||||
|
||||
Reference in New Issue
Block a user