storage/service_line/
daycare.rs1use serde::{Deserialize, Serialize};
8
9#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
11#[serde(transparent)]
12pub struct ContractRecord(pub domain::daycare::Contract);
13
14impl From<domain::daycare::Contract> for ContractRecord {
15 fn from(value: domain::daycare::Contract) -> Self {
16 Self(value)
17 }
18}
19
20impl From<ContractRecord> for domain::daycare::Contract {
21 fn from(record: ContractRecord) -> Self {
22 record.0
23 }
24}
25
26#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
27#[serde(rename_all = "snake_case")]
28pub enum FormatCode {
30 AllDayPlay,
32 HalfDayPlay,
34 DayBoarding,
36 DayPlayPlusRoom,
38 CatIndividualPlaytime,
40}
41
42#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
43#[serde(rename_all = "snake_case")]
44pub enum EligibilityRuleCode {
46 TemperamentReviewRequired,
48 SpayNeuterRequiredForGroupPlay,
50 VaccineProofRequired,
52 StaffToPetRatioRequired,
54}
55
56impl From<FormatCode> for domain::operations::DaycareFormat {
57 fn from(value: FormatCode) -> Self {
58 match value {
59 FormatCode::AllDayPlay => Self::AllDayPlay,
60 FormatCode::HalfDayPlay => Self::HalfDayPlay,
61 FormatCode::DayBoarding => Self::DayBoarding,
62 FormatCode::DayPlayPlusRoom => Self::DayPlayPlusRoom,
63 FormatCode::CatIndividualPlaytime => Self::CatIndividualPlaytime,
64 }
65 }
66}
67
68impl From<domain::operations::DaycareFormat> for FormatCode {
69 fn from(value: domain::operations::DaycareFormat) -> Self {
70 match value {
71 domain::operations::DaycareFormat::AllDayPlay => Self::AllDayPlay,
72 domain::operations::DaycareFormat::HalfDayPlay => Self::HalfDayPlay,
73 domain::operations::DaycareFormat::DayBoarding => Self::DayBoarding,
74 domain::operations::DaycareFormat::DayPlayPlusRoom => Self::DayPlayPlusRoom,
75 domain::operations::DaycareFormat::CatIndividualPlaytime => Self::CatIndividualPlaytime,
76 }
77 }
78}
79
80impl From<EligibilityRuleCode> for domain::operations::DaycareEligibilityRule {
81 fn from(value: EligibilityRuleCode) -> Self {
82 match value {
83 EligibilityRuleCode::TemperamentReviewRequired => Self::TemperamentReviewRequired,
84 EligibilityRuleCode::SpayNeuterRequiredForGroupPlay => {
85 Self::SpayNeuterRequiredForGroupPlay
86 }
87 EligibilityRuleCode::VaccineProofRequired => Self::VaccineProofRequired,
88 EligibilityRuleCode::StaffToPetRatioRequired => Self::StaffToPetRatioRequired,
89 }
90 }
91}
92
93impl From<domain::operations::DaycareEligibilityRule> for EligibilityRuleCode {
94 fn from(value: domain::operations::DaycareEligibilityRule) -> Self {
95 match value {
96 domain::operations::DaycareEligibilityRule::TemperamentReviewRequired => {
97 Self::TemperamentReviewRequired
98 }
99 domain::operations::DaycareEligibilityRule::SpayNeuterRequiredForGroupPlay => {
100 Self::SpayNeuterRequiredForGroupPlay
101 }
102 domain::operations::DaycareEligibilityRule::VaccineProofRequired => {
103 Self::VaccineProofRequired
104 }
105 domain::operations::DaycareEligibilityRule::StaffToPetRatioRequired => {
106 Self::StaffToPetRatioRequired
107 }
108 }
109 }
110}