summaryrefslogtreecommitdiffstats
path: root/server/src/database/schema.cpp
blob: addc1f8d21284887ad73c1599bec79a468a3c3d1 (about) (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
module routemon:database.schema$impl;

import :database.schema;

namespace routemon::database::schema {

auto try_to_string(rwgps_notification_cause c) -> std::optional<std::string>
{
  switch (c)
  {
  case rwgps_notification_cause::unknown:
    return std::nullopt;
  case rwgps_notification_cause::created:
    return "created";
  case rwgps_notification_cause::updated:
    return "updated";
  case rwgps_notification_cause::deleted:
    return "deleted";
  case rwgps_notification_cause::added:
    return "added";
  case rwgps_notification_cause::removed:
    return "removed";
  }
}

auto try_to_string(rwgps_notification_item_type t) -> std::optional<std::string>
{
  switch (t)
  {
  case rwgps_notification_item_type::unknown:
    return std::nullopt;
  case rwgps_notification_item_type::trip:
    return "trip";
  case rwgps_notification_item_type::route:
    return "route";
  case rwgps_notification_item_type::event:
    return "event";
  case rwgps_notification_item_type::event_participant:
    return "event_participant";
  case rwgps_notification_item_type::club_member:
    return "club_member";
  case rwgps_notification_item_type::authorization:
    return "authorization";
  }
}

auto try_to_string(rwgps_notification_target_collection_type t)
    -> std::optional<std::string>
{
  switch (t)
  {
  case rwgps_notification_target_collection_type::unknown:
    return std::nullopt;
  case rwgps_notification_target_collection_type::pinned:
    return "pinned";
  }
};

} // namespace routemon::database::schema