storage/service_line/
boarding.rs1use serde::{Deserialize, Serialize};
8
9use domain::operations::lodging_offer;
10#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
12#[serde(transparent)]
13pub struct ContractRecord(pub domain::boarding::Contract);
14
15impl From<domain::boarding::Contract> for ContractRecord {
16 fn from(value: domain::boarding::Contract) -> Self {
17 Self(value)
18 }
19}
20
21impl From<ContractRecord> for domain::boarding::Contract {
22 fn from(record: ContractRecord) -> Self {
23 record.0
24 }
25}
26
27#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
28#[serde(rename_all = "snake_case")]
29pub enum AccommodationCode {
31 ClassicSuite,
33 LuxurySuite,
35 CatCondo,
37}
38
39#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
40#[serde(rename_all = "snake_case")]
41pub enum CareFeatureCode {
43 DailyHousekeeping,
45 PottyWalks,
47 Bedding,
49 PawgressReport,
51 FeedingSupport,
53 MedicationSupport,
55}
56
57#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
58#[serde(rename_all = "snake_case")]
59pub enum AddOnCode {
61 Playtime,
63 ExitBath,
65 PremiumSuite,
67 Grooming,
69 TrainingSession,
71}
72
73impl From<AccommodationCode> for lodging_offer::Accommodation {
74 fn from(value: AccommodationCode) -> Self {
75 match value {
76 AccommodationCode::ClassicSuite => Self::ClassicSuite,
77 AccommodationCode::LuxurySuite => Self::LuxurySuite,
78 AccommodationCode::CatCondo => Self::CatCondo,
79 }
80 }
81}
82
83impl From<lodging_offer::Accommodation> for AccommodationCode {
84 fn from(value: lodging_offer::Accommodation) -> Self {
85 match value {
86 lodging_offer::Accommodation::ClassicSuite => Self::ClassicSuite,
87 lodging_offer::Accommodation::LuxurySuite => Self::LuxurySuite,
88 lodging_offer::Accommodation::CatCondo => Self::CatCondo,
89 }
90 }
91}
92
93impl From<CareFeatureCode> for lodging_offer::CareFeature {
94 fn from(value: CareFeatureCode) -> Self {
95 match value {
96 CareFeatureCode::DailyHousekeeping => Self::DailyHousekeeping,
97 CareFeatureCode::PottyWalks => Self::PottyWalks,
98 CareFeatureCode::Bedding => Self::Bedding,
99 CareFeatureCode::PawgressReport => Self::PawgressReport,
100 CareFeatureCode::FeedingSupport => Self::FeedingSupport,
101 CareFeatureCode::MedicationSupport => Self::MedicationSupport,
102 }
103 }
104}
105
106impl From<lodging_offer::CareFeature> for CareFeatureCode {
107 fn from(value: lodging_offer::CareFeature) -> Self {
108 match value {
109 lodging_offer::CareFeature::DailyHousekeeping => Self::DailyHousekeeping,
110 lodging_offer::CareFeature::PottyWalks => Self::PottyWalks,
111 lodging_offer::CareFeature::Bedding => Self::Bedding,
112 lodging_offer::CareFeature::PawgressReport => Self::PawgressReport,
113 lodging_offer::CareFeature::FeedingSupport => Self::FeedingSupport,
114 lodging_offer::CareFeature::MedicationSupport => Self::MedicationSupport,
115 }
116 }
117}
118
119impl From<AddOnCode> for lodging_offer::AddOn {
120 fn from(value: AddOnCode) -> Self {
121 match value {
122 AddOnCode::Playtime => Self::Playtime,
123 AddOnCode::ExitBath => Self::ExitBath,
124 AddOnCode::PremiumSuite => Self::PremiumSuite,
125 AddOnCode::Grooming => Self::Grooming,
126 AddOnCode::TrainingSession => Self::TrainingSession,
127 }
128 }
129}
130
131impl From<lodging_offer::AddOn> for AddOnCode {
132 fn from(value: lodging_offer::AddOn) -> Self {
133 match value {
134 lodging_offer::AddOn::Playtime => Self::Playtime,
135 lodging_offer::AddOn::ExitBath => Self::ExitBath,
136 lodging_offer::AddOn::PremiumSuite => Self::PremiumSuite,
137 lodging_offer::AddOn::Grooming => Self::Grooming,
138 lodging_offer::AddOn::TrainingSession => Self::TrainingSession,
139 }
140 }
141}