diff options
Diffstat (limited to 'server/src/database/schema.cpp')
| -rw-r--r-- | server/src/database/schema.cpp | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/server/src/database/schema.cpp b/server/src/database/schema.cpp new file mode 100644 index 0000000..addc1f8 --- /dev/null +++ b/server/src/database/schema.cpp | |||
| @@ -0,0 +1,59 @@ | |||
| 1 | module routemon:database.schema$impl; | ||
| 2 | |||
| 3 | import :database.schema; | ||
| 4 | |||
| 5 | namespace routemon::database::schema { | ||
| 6 | |||
| 7 | auto try_to_string(rwgps_notification_cause c) -> std::optional<std::string> | ||
| 8 | { | ||
| 9 | switch (c) | ||
| 10 | { | ||
| 11 | case rwgps_notification_cause::unknown: | ||
| 12 | return std::nullopt; | ||
| 13 | case rwgps_notification_cause::created: | ||
| 14 | return "created"; | ||
| 15 | case rwgps_notification_cause::updated: | ||
| 16 | return "updated"; | ||
| 17 | case rwgps_notification_cause::deleted: | ||
| 18 | return "deleted"; | ||
| 19 | case rwgps_notification_cause::added: | ||
| 20 | return "added"; | ||
| 21 | case rwgps_notification_cause::removed: | ||
| 22 | return "removed"; | ||
| 23 | } | ||
| 24 | } | ||
| 25 | |||
| 26 | auto try_to_string(rwgps_notification_item_type t) -> std::optional<std::string> | ||
| 27 | { | ||
| 28 | switch (t) | ||
| 29 | { | ||
| 30 | case rwgps_notification_item_type::unknown: | ||
| 31 | return std::nullopt; | ||
| 32 | case rwgps_notification_item_type::trip: | ||
| 33 | return "trip"; | ||
| 34 | case rwgps_notification_item_type::route: | ||
| 35 | return "route"; | ||
| 36 | case rwgps_notification_item_type::event: | ||
| 37 | return "event"; | ||
| 38 | case rwgps_notification_item_type::event_participant: | ||
| 39 | return "event_participant"; | ||
| 40 | case rwgps_notification_item_type::club_member: | ||
| 41 | return "club_member"; | ||
| 42 | case rwgps_notification_item_type::authorization: | ||
| 43 | return "authorization"; | ||
| 44 | } | ||
| 45 | } | ||
| 46 | |||
| 47 | auto try_to_string(rwgps_notification_target_collection_type t) | ||
| 48 | -> std::optional<std::string> | ||
| 49 | { | ||
| 50 | switch (t) | ||
| 51 | { | ||
| 52 | case rwgps_notification_target_collection_type::unknown: | ||
| 53 | return std::nullopt; | ||
| 54 | case rwgps_notification_target_collection_type::pinned: | ||
| 55 | return "pinned"; | ||
| 56 | } | ||
| 57 | }; | ||
| 58 | |||
| 59 | } // namespace routemon::database::schema | ||