Skip to main content

domain/
operations.rs

1//! Portfolio and cross-service operating values for pet-resort automation.
2//!
3//! This module models the external source-of-truth chain at the broad operations layer:
4//! portfolio facts, Gingr/adjacent-system access patterns, service-line offerings,
5//! pain areas, and labor/capacity optimization levers become validated domain vocabulary
6//! before analytics, daily briefs, staff tasks, or agent workflows can use them.
7//!
8//! Service-specific daily brief, lead, reputation, staff, grooming, training, and retail
9//! vocabulary lives in those owner modules; this module keeps the shared operations
10//! namespace visible without flattening source facts into vague strings.
11
12use bon::Builder;
13use chrono::NaiveDate;
14use nutype::nutype;
15use serde::{Deserialize, Deserializer, Serialize};
16
17use crate::entities::LocationId;
18
19#[nutype(
20    sanitize(trim),
21    validate(not_empty, len_char_max = 160),
22    derive(
23        Debug,
24        Clone,
25        PartialEq,
26        Eq,
27        PartialOrd,
28        Ord,
29        Hash,
30        Serialize,
31        Deserialize
32    )
33)]
34/// Validated operations metric label used for KPI/read-model dimensions.
35///
36/// Metric names label provider/read-model facts such as labor-to-revenue risk,
37/// occupancy, utilization, or conversion measures without treating free text as
38/// authoritative workflow state.
39pub struct MetricName(String);
40
41/// Operating-day key used to group service-line demand, staffing, and reporting.
42pub mod operating_day {
43    use super::*;
44
45    #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Serialize, Deserialize)]
46    /// Operating-day date used when manager briefs compare booked demand against staffing and room capacity.
47    pub struct Date(NaiveDate);
48
49    impl Date {
50        /// Accepts a source/read-model operating date after the adapter has already chosen the resort business day.
51        pub const fn try_new(value: NaiveDate) -> Result<Self> {
52            Ok(Self(value))
53        }
54
55        /// Returns the operating-day date for storage records, analytics projections, or adapter output.
56        pub const fn get(self) -> NaiveDate {
57            self.0
58        }
59    }
60
61    #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Serialize, Deserialize)]
62    /// Location/service/date key that groups the demand and staffing facts a manager brief can rank.
63    pub struct Key {
64        location_id: LocationId,
65        service_line: super::service_core::ServiceLine,
66        date: Date,
67    }
68
69    impl Key {
70        /// Assembles the resort, service line, and operating day used before analytics can compare labor to demand.
71        pub const fn new(
72            location_id: LocationId,
73            service_line: super::service_core::ServiceLine,
74            date: Date,
75        ) -> Self {
76            Self {
77                location_id,
78                service_line,
79                date,
80            }
81        }
82
83        /// Returns the resort/location whose staffing or capacity queue is being evaluated.
84        pub const fn location_id(&self) -> LocationId {
85            self.location_id
86        }
87
88        /// Returns the service line whose boarding, daycare, grooming, training, or retail demand is being grouped.
89        pub const fn service_line(&self) -> super::service_core::ServiceLine {
90            self.service_line
91        }
92
93        /// Returns the business day for the manager or regional reporting workflow.
94        pub const fn date(&self) -> Date {
95            self.date
96        }
97    }
98
99    #[derive(Debug, Clone, Copy, PartialEq, Eq, thiserror::Error)]
100    /// Validation failures returned by operations domain constructors.
101    pub enum Error {}
102
103    /// Result type for operations values that must reject impossible reporting keys before automation sees them.
104    pub type Result<T> = std::result::Result<T, Error>;
105}
106
107/// Operational observations and recommendations produced from validated source facts.
108pub mod operational {
109    use super::*;
110
111    #[nutype(
112        sanitize(trim),
113        validate(not_empty, len_char_max = 500),
114        derive(
115            Debug,
116            Clone,
117            PartialEq,
118            Eq,
119            PartialOrd,
120            Ord,
121            Hash,
122            Serialize,
123            Deserialize
124        )
125    )]
126    /// Human-readable operational observation attached to evidence-backed workflows.
127    ///
128    /// Observations describe what a source/read-model chain found—such as labor
129    /// mismatch, customer-experience risk, or revenue leakage—without granting
130    /// an agent authority to act without the target workflow gate.
131    pub struct Observation(String);
132
133    #[nutype(
134        sanitize(trim),
135        validate(not_empty, len_char_max = 500),
136        derive(
137            Debug,
138            Clone,
139            PartialEq,
140            Eq,
141            PartialOrd,
142            Ord,
143            Hash,
144            Serialize,
145            Deserialize
146        )
147    )]
148    /// Human-readable recommendation proposed for staff or manager review.
149    ///
150    /// Recommendations are labor-cost levers only after the surrounding workflow
151    /// decides whether they remain drafts, become staff tasks, or require manager
152    /// approval.
153    pub struct Recommendation(String);
154
155    #[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
156    /// Portfolio pain area that can become a bounded automation or labor-improvement lane.
157    pub enum PainArea {
158        /// Labor-efficiency pain area where automation should reduce manual staffing and demand reconciliation.
159        LaborEfficiency,
160        /// Customer-communication pain area where drafting or triage may reduce phone and inbox load.
161        CustomerCommunicationLoad,
162        /// Reservation-capacity pain area where recommendations must respect room, yard, staff, and policy gates.
163        ReservationCapacityOptimization,
164        /// Data-fragmentation pain area where duplicate or missing source facts make workflows slower and less safe.
165        DataFragmentation,
166        /// Sales/retention pain area where outreach candidates can be ranked but customer contact remains reviewed.
167        SalesRetentionMarketing,
168        /// Training/standards pain area where assistants reduce lookup and documentation labor without replacing manager approval.
169        TrainingAndStandards,
170    }
171}
172
173/// Portfolio facts for the NVA Pet Resorts operating context.
174pub mod pet_resort {
175    use super::*;
176
177    #[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, Builder)]
178    /// Validated portfolio context used to scope cross-resort automation and reporting.
179    pub struct Portfolio {
180        /// Operator whose portfolio context explains why the same labor and source-governance contracts apply across resorts.
181        pub operator: Operator,
182        /// Number of resorts used to size portfolio rollups; zero resorts is rejected before outcome metrics are reported.
183        pub resort_count: ResortCount,
184        /// Portfolio structure used to decide whether a brief is local, brand-level, or cross-brand comparison context.
185        pub structure: PortfolioStructure,
186        /// Business lines that keep pet-resort automation scoped away from veterinary or equine assumptions unless explicitly modeled.
187        pub business_lines: Vec<BusinessLine>,
188        /// Pet-resort brands used for navigation and reporting filters, not as automatic permission to change local policy.
189        pub brands: Vec<Brand>,
190    }
191
192    #[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
193    /// Portfolio operator vocabulary used to scope source evidence and labor-value claims.
194    pub enum Operator {
195        /// NVA portfolio context for cross-resort reporting; it does not override local manager approval gates.
196        NationalVeterinaryAssociates,
197    }
198
199    #[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
200    /// Portfolio structure vocabulary that tells reports whether comparisons are single-brand or federated.
201    pub enum PortfolioStructure {
202        /// Multi-brand portfolio context where regional reports compare patterns without assuming one brand policy fits every site.
203        FederatedMultiBrand,
204        /// Single-brand context where comparisons can use a narrower policy and vocabulary set.
205        SingleBrand,
206        /// Provider role or status could not be mapped confidently.
207        Unknown,
208    }
209
210    #[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
211    /// NVA business-line vocabulary used to keep pet-resort labor claims separate from other NVA operating models.
212    pub enum BusinessLine {
213        /// Veterinary-hospital line of business retained as adjacent context, not a source for pet-resort policy.
214        GeneralPracticeVeterinaryHospitals,
215        /// Pet-resort line of business where boarding, daycare, grooming, training, and retail workflows are in scope.
216        PetResorts,
217        /// Equine line of business retained as out-of-scope portfolio context unless a source contract models it directly.
218        Equine,
219        /// Specialty/emergency hospital context retained so reports do not confuse medical operations with resort labor loops.
220        SpecialtyEmergencyHospitals,
221    }
222
223    #[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
224    /// Pet-resort brand vocabulary used for portfolio filtering and source reconciliation.
225    pub enum Brand {
226        /// NVA Pet Resorts portfolio label for rollups and navigation across resort brands.
227        NvaPetResorts,
228        /// PetSuites brand label used when comparing resort workflows that may carry brand-specific naming.
229        PetSuites,
230        /// Pooch Hotel brand label used for portfolio reports without inventing local policy authority.
231        PoochHotel,
232        /// Elite Suites brand label for source and reporting filters.
233        EliteSuites,
234        /// The Bark Side brand label for source and reporting filters.
235        TheBarkSide,
236        /// Woofdorf Astoria brand label for source and reporting filters.
237        WoofdorfAstoria,
238        /// Doggie District brand label for source and reporting filters.
239        DoggieDistrict,
240        /// Local or acquired brand name that staff recognize but the domain cannot classify into a known portfolio brand.
241        Other {
242            /// Display name retained so a reviewer can map the local brand before it appears in portfolio reporting.
243            name: crate::location::Name,
244        },
245    }
246
247    #[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
248    /// Operating terms from public/provider context that become labels for labor, source, and workflow discovery.
249    pub enum OperatingTerm {
250        /// Customer care-report workflow where automation may draft narrative updates but staff approve sends.
251        PawgressReports,
252        /// Boarding reservation workflow whose demand, suites, and stay dates drive capacity and labor planning.
253        BoardingReservations,
254        /// Daycare package workflow where eligibility, unused sessions, and staffed playgroups affect value and safety.
255        DaycarePackages,
256        /// Loyalty/rewards context useful for customer questions; it does not authorize point or billing changes by automation.
257        PetPointsRewards,
258        /// Gingr portal context for customer self-service evidence before source promotion.
259        GingrCustomerPortal,
260        /// Lead conversion workflow where automation may rank follow-up work but cannot book or message without approval.
261        LeadCaptureAndConversion,
262        /// Marketing/outreach source context for demand discovery and drafted responses.
263        WebsiteEmailSocialOutreach,
264        /// Local-market planning context for human-reviewed growth work, not an automatic pricing or staffing decision.
265        LocalMarketPlans,
266        /// KPI bundle used to compare revenue, labor expense, and satisfaction without treating any one metric as final authority.
267        SalesLaborExpensesCustomerSatisfactionKpis,
268        /// Compliance context that must stay human-reviewed before safety, cash-handling, or personnel actions occur.
269        OshaCashHandlingOperationalCompliance,
270        /// Staff training completion context for standards follow-up and manager coaching queues.
271        TrainingCertificationCompletion,
272        /// Resort profitability context for regional reporting; automation may summarize variance, not change budgets.
273        ResortLevelEbitdaProfitability,
274        /// Grooming rebooking cadence context for staff-reviewed outreach and schedule-fill opportunities.
275        GroomingCadence,
276        /// Daycare eligibility context where temperament, vaccine, and ratio rules remain safety gates.
277        DaycareEligibilityRules,
278        /// Guest-experience context for reputation and follow-up queues where customer contact stays review-gated.
279        GuestExperience,
280        /// Team-member engagement context for manager coaching and labor risk summaries, not personnel action automation.
281        TeamMemberEngagementRetention,
282    }
283}
284
285#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Serialize)]
286/// Nonzero count of resorts used when portfolio metrics claim regional or cross-brand labor impact.
287pub struct ResortCount(u16);
288
289impl ResortCount {
290    /// Accepts a source/read-model operating date after the adapter has already chosen the resort business day.
291    pub const fn try_new(value: u16) -> Result<Self, ResortCountError> {
292        if value == 0 {
293            return Err(ResortCountError::ZeroResorts);
294        }
295        Ok(Self(value))
296    }
297
298    /// Returns the operating-day date for storage records, analytics projections, or adapter output.
299    pub const fn get(self) -> u16 {
300        self.0
301    }
302}
303
304impl<'de> Deserialize<'de> for ResortCount {
305    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
306    where
307        D: Deserializer<'de>,
308    {
309        Self::try_new(u16::deserialize(deserializer)?).map_err(serde::de::Error::custom)
310    }
311}
312
313#[derive(Debug, Clone, Copy, PartialEq, Eq, thiserror::Error)]
314/// Resort-count validation failure that prevents meaningless portfolio reports.
315pub enum ResortCountError {
316    #[error("pet resort portfolios require at least one resort")]
317    /// Zero resorts would make labor-value and portfolio comparisons fictitious, so construction fails.
318    ZeroResorts,
319}
320
321#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
322/// Service offering whose source facts drive capacity, labor, upsell, and care workflows.
323pub enum ServiceOffering {
324    /// Overnight stay service line.
325    Boarding {
326        /// Boarding room/suite choice that drives capacity checks and room-labor expectations.
327        accommodation: lodging_offer::Accommodation,
328        /// Included boarding care features that explain kennel labor before any upsell or customer copy is drafted.
329        included_care: Vec<lodging_offer::CareFeature>,
330        /// Optional boarding add-ons that can become reviewed upsell or staffing signals.
331        add_ons: Vec<lodging_offer::AddOn>,
332    },
333    /// Daycare service offering where group-play eligibility and staffing ratios gate automation suggestions.
334    Daycare {
335        /// Daycare format used to estimate play-yard, room, and supervision needs.
336        format: DaycareFormat,
337        /// Daycare rules that must be satisfied before group-play recommendations or package value claims are shown.
338        eligibility_rules: Vec<DaycareEligibilityRule>,
339    },
340    /// Grooming service line or care-note category.
341    Grooming {
342        /// Requested service that drives scheduling and labor estimates.
343        service: crate::grooming::Service,
344        /// Grooming rebooking cadence used to explain follow-up timing; it does not send customer outreach by itself.
345        cadence: crate::grooming::rebooking::Cadence,
346    },
347    /// Training service line or care-note category.
348    Training {
349        /// Training program context used for package progress, trainer handoff, and graduation/follow-up tasks.
350        program: crate::training::Program,
351    },
352    /// Retail partner product context for inventory and recommendation workflows; purchasing and discounts stay gated.
353    RetailPartnerProduct {
354        /// Retail partner whose catalog evidence can explain recommendations but cannot override local inventory policy.
355        partner: crate::retail::Partner,
356        /// Retail category used to match checkout, inventory, and care-sensitive recommendation rules.
357        category: crate::retail::product::Category,
358    },
359}
360
361/// Boarding/lodging offer vocabulary that affects room capacity and care labor.
362pub mod lodging_offer {
363    use super::*;
364
365    #[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
366    /// Boarding accommodation vocabulary used for room capacity and housekeeping-labor math.
367    pub enum Accommodation {
368        /// Standard boarding suite option used as baseline capacity and housekeeping labor.
369        ClassicSuite,
370        /// Premium boarding suite option that may affect capacity, add-on value, and service expectations.
371        LuxurySuite,
372        /// Cat lodging option kept distinct from dog suites for capacity and care-labor planning.
373        CatCondo,
374    }
375
376    #[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
377    /// Boarding care-feature vocabulary used to explain included labor and customer-update obligations.
378    pub enum CareFeature {
379        /// Daily housekeeping care feature that contributes predictable kennel labor.
380        DailyHousekeeping,
381        /// Potty-walk care feature that affects labor scheduling and owner expectations.
382        PottyWalks,
383        /// Bedding care feature that affects room setup and cleaning labor.
384        Bedding,
385        /// Progress report shared with the customer during care.
386        PawgressReport,
387        /// Feeding-support feature that can require staff instructions and care-note evidence.
388        FeedingSupport,
389        /// Medication-support feature that stays safety-sensitive and must not be changed by automation.
390        MedicationSupport,
391    }
392
393    #[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
394    /// Boarding add-on vocabulary used for reviewed upsell, capacity, and labor signals.
395    pub enum AddOn {
396        /// Playtime add-on that creates extra yard or staff time before it can be offered or scheduled.
397        Playtime,
398        /// Bath offered before departure from boarding.
399        ExitBath,
400        /// Premium-suite add-on that changes room value and capacity expectations.
401        PremiumSuite,
402        /// Grooming service line or care-note category.
403        Grooming,
404        /// Training-session add-on that requires trainer availability and human-reviewed scheduling.
405        TrainingSession,
406    }
407}
408
409#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
410/// Daycare format whose eligibility and supervision needs affect staffing.
411pub enum DaycareFormat {
412    /// Full-day daycare format with the largest playgroup labor and ratio exposure.
413    AllDayPlay,
414    /// Half-day daycare format that changes demand units and staffing windows.
415    HalfDayPlay,
416    /// Daytime boarding care with lodging-style supervision.
417    DayBoarding,
418    /// Daycare format with both playgroup and room capacity implications.
419    DayPlayPlusRoom,
420    /// Cat playtime format kept separate from dog group-play eligibility and staffing assumptions.
421    CatIndividualPlaytime,
422}
423
424#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
425/// Daycare rule that gates group-play workflow and protects staffing/safety decisions.
426pub enum DaycareEligibilityRule {
427    /// Temperament review gate that blocks group-play automation until a human/source record supports it.
428    TemperamentReviewRequired,
429    /// Spay/neuter rule that can explain a daycare hold but cannot be bypassed by an agent recommendation.
430    SpayNeuterRequiredForGroupPlay,
431    /// Vaccine-proof rule that keeps daycare safety review ahead of package or playgroup recommendations.
432    VaccineProofRequired,
433    /// Staff-to-pet ratio rule that turns demand into a labor-capacity constraint.
434    StaffToPetRatioRequired,
435}
436
437#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, Builder)]
438/// Validated technology/source-system context for integrations and read models.
439pub struct TechnologyEcosystem {
440    /// Primary operating system whose records may feed workflows after DTO quarantine and domain promotion.
441    pub core_portal: service_core::OperatingSystem,
442    /// Access patterns that describe how source facts arrive before validation and redaction.
443    pub data_access: Vec<DataAccessPattern>,
444    /// Adjacent systems that can corroborate labor, revenue, marketing, or review evidence without becoming domain policy.
445    pub adjacent_systems: Vec<AdjacentSystem>,
446}
447
448#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
449/// Way operational source facts can enter the platform before validation.
450pub enum DataAccessPattern {
451    /// Direct API access path for source facts, subject to transport redaction and mapping contracts.
452    Api,
453    /// Webhook access path for event-driven evidence that still requires idempotent mapping and review gates.
454    Webhook,
455    /// Batch export path used for reconciliation when live API authority is unavailable or inappropriate.
456    DataExport,
457    /// Warehouse path used for aggregate reporting rather than live provider writes.
458    Warehouse,
459    /// BI dashboard source used as reporting evidence, not as a workflow authority.
460    BusinessIntelligenceDashboard,
461    /// Provider role or status could not be mapped confidently.
462    Unknown,
463}
464
465#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
466/// Adjacent enterprise system that can provide labor, revenue, marketing, or review evidence.
467pub enum AdjacentSystem {
468    /// Recruiting system context for staffing risk and hiring pipeline evidence.
469    AvatureRecruiting,
470    /// GA4 marketing/traffic evidence for demand and lead-funnel context.
471    Ga4,
472    /// Amplitude product analytics evidence for portal or app behavior.
473    Amplitude,
474    /// Google Tag Manager context for instrumentation evidence, not customer-contact authority.
475    GoogleTagManager,
476    /// HRIS context for staffing evidence; personnel actions remain outside automation authority.
477    Hris,
478    /// Labor scheduling source for staffing plans.
479    LaborScheduling,
480    /// Payroll source for labor-cost reconciliation.
481    Payroll,
482    /// Marketing automation context for campaign evidence; customer sends stay approval-gated.
483    MarketingAutomation,
484    /// Ticketing context for support workload and unresolved exception queues.
485    Ticketing,
486    /// Call-center telephony evidence for repeat-question volume and deflection opportunities.
487    CallCenterTelephony,
488    /// Review-platform evidence for reputation triage and human-approved responses.
489    Reviews,
490    /// Email/SMS marketing evidence for retention outreach; sends remain human-approved.
491    EmailSmsMarketing,
492    /// Reporting or BI data source.
493    BusinessIntelligence,
494    /// Data-lake context for aggregate evidence and historical reconciliation.
495    DataLake,
496}
497
498#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
499/// Bounded AI use case mapped to a measurable workflow and human-approval gate.
500pub enum AiUseCase {
501    /// Daily manager brief ranks source-backed exceptions so managers can avoid morning spreadsheet reconciliation.
502    ResortManagerDailyBriefing,
503    /// Regional exception reports summarize cross-site risks for review without changing local workflows automatically.
504    RegionalOpsExceptionReporting,
505    /// Inbox/call deflection drafts answers for repeat questions while customer sends remain gated.
506    CustomerInboxAndCallDeflection,
507    /// Lead conversion ranks follow-up opportunities; booking, pricing, and messages remain approval-gated.
508    LeadConversion,
509    /// Grooming rebooking identifies cadence gaps and drafts follow-up for staff review.
510    GroomingRebooking,
511    /// Post-stay Pawgress assistant drafts care summaries from evidence that staff approve before sending.
512    PostStayPawgressReportAssistant,
513    /// Reputation triage classifies review risk and drafts responses for human approval.
514    ReviewReputationTriage,
515    /// SOP knowledge assistant reduces lookup labor but does not replace manager judgment or safety policy.
516    SopKnowledgeAssistant,
517    /// Data-quality hygiene queues duplicate, stale, or missing-source records for review.
518    DataQualityOpsHygiene,
519    /// Incident report drafting organizes facts for safety review; it does not finalize incident determinations.
520    IncidentReportDrafting,
521    /// Training onboarding assistant drafts learning paths and checklists for manager review.
522    TrainingOnboardingAssistant,
523    /// Lapsed-customer winback ranks outreach candidates while customer contact remains approval-gated.
524    LapsedCustomerWinback,
525    /// Boarding pre-arrival checklist surfaces vaccine, feeding, and accommodation gaps before check-in.
526    BoardingPreArrivalChecklistAutomation,
527    /// Capacity alerts warn staff about room, yard, or service-slot pressure before accepting more demand.
528    CapacityAlerts,
529    /// Labor/revenue anomaly detection flags variance for manager review before staffing or pricing changes.
530    LaborRevenueAnomalyDetection,
531    /// Website reservation assistant can draft intake help, not commit bookings or provider writes.
532    WebsiteReservationAssistant,
533    /// Vaccination document collection reduces chase-down labor while medical/safety acceptance remains reviewed.
534    VaccinationDocumentCollection,
535    /// Demand forecasting projects service-line workload so staffing plans can be reviewed earlier.
536    DemandForecasting,
537    /// Staffing recommendations compare forecast demand with labor signals but remain manager-reviewed.
538    StaffingRecommendations,
539    /// Regional benchmarking compares sites for coaching and investigation, not automatic enforcement.
540    RegionalPerformanceBenchmarking,
541}
542
543#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
544/// Portfolio-level hygiene issue type that can explain unreliable labor/read-model signals.
545pub enum DataQualityIssue {
546    /// Missing vaccine record issue queues document follow-up and blocks unsafe eligibility assumptions.
547    MissingPetVaccinationRecords,
548    /// Incomplete pet profile issue explains why care, eligibility, or communication drafts need staff review.
549    IncompletePetProfiles,
550    /// Duplicate customer issue reduces lookup and billing confusion after a human verifies merge safety.
551    DuplicateCustomers,
552    /// Missing temperament note issue blocks group-play confidence until staff/source evidence exists.
553    MissingTemperamentNotes,
554    /// Open invoice issue surfaces checkout or payment follow-up without authorizing payment movement.
555    OpenInvoices,
556    /// Unclosed reservation issue helps staff finish stays before occupancy, billing, or labor reports drift.
557    UnclosedReservations,
558    /// Unused package issue can explain retention opportunities while outreach and account changes stay reviewed.
559    UnusedPackages,
560    /// Vague staff-note issue queues cleanup because weak evidence makes summaries and safety handoffs unreliable.
561    StaffNotesTooVague,
562    /// Inconsistent service-name issue prevents cross-site reporting from merging unlike offerings by accident.
563    InconsistentServiceNamingAcrossSites,
564}
565
566#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
567/// Resort operating function whose workload can be reduced or coordinated by automation.
568pub enum OperatingFunction {
569    /// Front desk workload includes check-in, checkout, phone, inbox, and source-correction queues.
570    FrontDesk,
571    /// Call-center workload covers repeat questions and lead routing that automation may draft or classify.
572    CallCenter,
573    /// General managers own daily review gates for staffing, capacity, exceptions, and customer-impacting actions.
574    GeneralManagers,
575    /// Assistant general managers share local exception review and handoff cleanup work.
576    AssistantGeneralManagers,
577    /// Regional operations reviews portfolio variance and coaching opportunities without bypassing site authority.
578    RegionalOperations,
579    /// Grooming service line or care-note category.
580    Grooming,
581    /// Training service line or care-note category.
582    Training,
583    /// Marketing workload includes reviewed outreach, campaign evidence, and retention queues.
584    Marketing,
585    /// IT workload includes integration, access, and source-system hygiene needed before automation can trust evidence.
586    InformationTechnology,
587}
588
589#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
590/// Training/standards workflow where AI can reduce lookup or documentation labor.
591pub enum StaffTrainingWorkflow {
592    /// New-hire onboarding workflow can draft checklists and quizzes but manager certification remains authoritative.
593    NewHireOnboarding,
594    /// SOP lookup workflow reduces policy-search time while safety-sensitive interpretation stays reviewed.
595    SopLookup,
596    /// Incident documentation workflow drafts chronology and evidence packets for safety review.
597    IncidentDocumentation,
598    /// Pet-behavior note consistency workflow helps staff rewrite vague notes into source-backed handoffs.
599    PetBehaviorNoteConsistency,
600    /// Manager coaching workflow summarizes patterns for human coaching, not personnel action automation.
601    ManagerCoaching,
602    /// Regulatory/safety policy workflow keeps compliance answers review-gated and source-cited.
603    RegulatorySafetyPolicy,
604    /// Customer complaint workflow drafts summaries and responses for manager approval.
605    CustomerComplaintHandling,
606    /// Training quiz workflow drafts knowledge checks that managers review before using for certification.
607    TrainingQuizGeneration,
608    /// Shift-lead copilot workflow summarizes tasks and risks but does not assign safety-sensitive work unsupervised.
609    ShiftLeadCopilot,
610    /// Shift summary workflow converts source-backed notes into handoffs that supervisors can verify.
611    ShiftSummary,
612}
613
614#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
615/// High-volume customer communication workflow suitable for drafting or triage.
616pub enum CustomerCommunicationWorkflow {
617    /// Availability questions can be answered from source-backed capacity only when booking remains review-gated.
618    AvailabilityQuestion,
619    /// Vaccine requirement questions need policy/source citations and cannot approve medical compliance automatically.
620    VaccineRequirementQuestion,
621    /// Multi-pet boarding questions combine room capacity, household context, and staff-reviewed booking rules.
622    MultiPetBoardingQuestion,
623    /// Group-play eligibility questions depend on temperament, vaccine, and ratio evidence before recommendations.
624    GroupPlayEligibilityQuestion,
625    /// Daycare readiness questions turn profile evidence into staff-reviewed eligibility guidance.
626    DaycareReadinessQuestion,
627    /// Add-bath requests affect grooming/exit-bath capacity and require schedule confirmation.
628    AddBathRequest,
629    /// Pet-update requests may draft from care notes, but customer-visible messages remain staff-approved.
630    PetUpdateRequest,
631    /// Checkout-time questions use reservation policy evidence and do not change stay or fee state automatically.
632    CheckoutTimeQuestion,
633    /// Cancel/change questions require human approval before schedule mutation, fee, or provider write.
634    CancelOrChangeReservation,
635    /// Loyalty-points questions can summarize account evidence but cannot adjust balances automatically.
636    LoyaltyPointsQuestion,
637    /// Training-options questions can rank programs while enrollment and scheduling remain reviewed.
638    TrainingOptionsQuestion,
639    /// Anxiety/special-handling questions stay safety-sensitive and require staff review before care commitments.
640    AnxietyOrSpecialHandlingQuestion,
641}
642
643#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
644/// Constraint that limits capacity utilization or creates labor mismatch risk.
645pub enum CapacityConstraintKind {
646    /// Room/suite availability constraint blocks overbooking and informs waitlist or staffing review.
647    RoomOrSuiteAvailability,
648    /// Play-yard availability constraint links daycare demand to space and supervision limits.
649    PlayYardAvailability,
650    /// Groomer-slot availability constraint protects schedule promises and grooming labor plans.
651    GroomerSlotAvailability,
652    /// Trainer availability constraint protects package scheduling and trainer handoff promises.
653    TrainerAvailability,
654    /// Staff-ratio constraint turns pet counts into safety and labor review requirements.
655    StaffRatio,
656    /// Pet-temperament constraint can block group play or require manager review before recommendations.
657    PetTemperament,
658    /// Holiday-peak constraint flags demand periods where minimum stays, staffing, and capacity need review.
659    HolidayPeak,
660    /// Check-in/checkout bottleneck constraint explains front-desk labor pressure and queue risk.
661    CheckInCheckoutBottleneck,
662}
663
664#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
665/// Labor, capacity, or revenue optimization lever supported by validated source facts.
666pub enum OptimizationOpportunity {
667    /// Demand forecasting projects service-line workload so staffing plans can be reviewed earlier.
668    DemandForecasting,
669    /// No-show prediction can rank follow-up or waitlist work but cannot cancel or rebook automatically.
670    NoShowPrediction,
671    /// Dynamic waitlist filling recommends candidates for human-approved booking outreach.
672    DynamicWaitlistFilling,
673    /// Capacity recommendation summarizes source-backed pressure while booking decisions stay reviewed.
674    CapacityRecommendation,
675    /// Add-on recommendation can surface relevant services but customer offers remain approved by staff.
676    AddOnRecommendation,
677    /// Holiday planning uses forecast demand to prepare staffing and capacity reviews ahead of peak periods.
678    HolidayPlanning,
679    /// Over/under-staffing alert compares demand with schedules so managers can review labor changes.
680    OverUnderStaffingAlert,
681    /// Revenue optimization is constrained by care and safety evidence before any pricing or offer change is considered.
682    RevenueOptimizationWithoutCareDegradation,
683}
684
685/// Core service-line vocabulary joining source systems to resort operating models.
686pub mod service_core {
687    use super::*;
688
689    #[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
690    /// Operating-system vocabulary that tells source adapters which provider facts need quarantine before domain promotion.
691    pub enum OperatingSystem {
692        /// Gingr reservation and pet-care operating system.
693        Gingr,
694        /// Mixed operating systems require source reconciliation before automation trusts cross-system facts.
695        MixedSystems,
696        /// Provider role or status could not be mapped confidently.
697        Unknown,
698    }
699
700    #[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, Builder)]
701    /// Service-line operating bundle for one resort/location.
702    pub struct ServiceContracts {
703        /// Location whose service contracts and outcomes are being compared in local or regional reports.
704        pub location_id: LocationId,
705        /// Boarding contract that owns stay, suite, minimum-stay, and checkout-exception rules.
706        pub boarding: crate::boarding::Contract,
707        /// Daycare contract that owns group-play eligibility, package, and ratio rules.
708        pub daycare: crate::daycare::Contract,
709        /// Grooming contract that owns service duration, rebooking cadence, add-on, and no-show rules.
710        pub grooming: crate::grooming::Contract,
711        /// Training contract that owns program progress, package, graduation, and trainer handoff rules.
712        pub training: crate::training::Contract,
713        /// Retail contract that owns catalog, inventory, POS, recommendation, and reorder gates.
714        pub retail: crate::retail::Contract,
715    }
716
717    impl ServiceContracts {
718        /// Returns the five service lines whose demand and staffing drive daily labor plans.
719        pub fn core_services(&self) -> [ServiceLine; 5] {
720            [
721                ServiceLine::Boarding,
722                ServiceLine::Daycare,
723                ServiceLine::Grooming,
724                ServiceLine::Training,
725                ServiceLine::Retail,
726            ]
727        }
728    }
729
730    #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Serialize, Deserialize)]
731    /// Core pet-resort service line used to partition demand, capacity, and labor metrics.
732    pub enum ServiceLine {
733        /// Overnight stay service line.
734        Boarding,
735        /// Daycare service offering where group-play eligibility and staffing ratios gate automation suggestions.
736        Daycare,
737        /// Grooming service line or care-note category.
738        Grooming,
739        /// Training service line or care-note category.
740        Training,
741        /// Retail service line partitions inventory, checkout, and recommendation work from care-service capacity.
742        Retail,
743    }
744}