Schema Architecture

Veterinary Service Schema

How 130+ services, reusable components, multi-dimensional pricing, and CMA compliance infrastructure connect in practice. Every entity shown here is live in production.

Core Schema Map

The schema connects a canonical service catalog to reusable components via explicit mappings, then layers multi-dimensional pricing and CMA compliance infrastructure on top. Every relationship shown here is active in production.

Serviceslug, label, categoryserviceKind (GROUP / COURSE / ATOMIC)animals[] (open array — unlimited species)parentServiceId → self-referential hierarchydisplayOrder, status130+ canonical services13 clinical categories46 surgical proceduresGROUP = container / ATOMIC+COURSE = pricing endpointscontains childrenService HierarchyparentServiceId links GROUP → child servicespreserves package/course/dose variantsmaps toServiceComponentMappingserviceId → ServicecomponentId → ServiceComponentdefaultInclusionStatusisRequired, defaultQuantityStructured defaults per service-component pairresolvesServiceComponentslug, label, categorydefaultPricingMethod (Fixed/From/Range/PerUnit)unitType (per tooth/night/day/dose/kg/...)isVariableReusable across services (anaesthetic, hosp, lab...)priced atPrice Rows & DimensionsMulti-dimensional pricing on rows — not by duplicating service slugs.Dimensions:weightBand: S / M / L / XL / G (5-tier canonical banding)hospitalisationTimeWindow: DAY / NIGHT / H24 / PACKAGEpricingMode: HEADLINE / ITEMIZEDpricingContext: STANDARD / PLAN / WITH_OTHER_SERVICEpricingMethod: FIXED / FROM / RANGE / PER_UNITinclusionStatus: INCLUDED / OPTIONAL_EXTRA / SEPARATELY_CHARGED / NOT_OFFEREDCMA Compliance LayerClinicComplianceProfilePer-clinic compliance state: NOT_STARTED → ... → COMPLIANTComplianceProofTyped evidence: Generation / Approval / Publication / AttestationStrength: PRIMARY / SUPPORTING / INFORMATIONALPublicationTargetMANAGED_SITE / VM_CLINIC_PROFILE / HOSTED_FALLBACKCmaPriceListRevisionVersioned price list snapshots with payload hashingClinic Price StructureClinicServicePricePer-clinic published price for a canonical serviceCarries weightBand, pricingMode, pricingContextClinicServicePriceBreakdownComponent-level line items within a clinic priceMaps to ServiceComponent with per-clinic overridesServicePriceBreakdownCanonical baseline breakdown for comparisonHeadline and itemised pricing coexist per service.Any bundling model accurately represented.

Example A: Vaccination Hierarchy

GROUP containers with ATOMIC and COURSE children — preserving package comparability

GROUP: VAC_PUPPYATOMIC: VAC_PUPPY_DOSE_1ATOMIC: VAC_PUPPY_DOSE_2ATOMIC: VAC_PUPPY_DOSE_3COURSE: VAC_PUPPY_COURSEGROUP: VAC_KITTENATOMIC: DOSE_1ATOMIC: DOSE_2COURSE: KITTEN_COURSE

Example B: Weight-Banded Pricing

One service, five price rows — weight is a dimension, not a duplicate slug

DOG_CASTRATIONATOMIC · animals: [dog]One canonical serviceS (Small, ≤10kg)£180M (Medium, 10–25kg)£220L (Large, 25–40kg)£280XL (Extra Large, 40–60kg)£340G (Giant, 60kg+)£400Why this matters:Consumers compare at matching bands.Clinics express real pricing variation.No slug duplication — 1 service, 5 rows.Works across all species & procedures.

Example C: Surgery Component Mapping

Component-level granularity — every inclusion explicitly modelled

ATOMIC: BITCH_SPAYanimals: [dog]GENERAL_ANAESTHETICINCLUDEDSURGICAL_PROCEDUREINCLUDEDPAIN_RELIEFINCLUDEDHOSPITALISATION (DAY)INCLUDEDPOST_OP_CHECKOPTIONAL_EXTRAClinic A: headline £320All above INCLUDED in priceClinic B: headline £260Anaesthetic SEPARATELY_CHARGED (+£80)Hospitalisation NOT_OFFEREDBoth accurately represented.Both comparable at component level.

Example D: Hospitalisation Care Levels

Time window × care level — full matrix without slug duplication

HOSPITALISATIONServiceComponentTime Windows:DAYNIGHTH24 (24-hour)PACKAGEStandard CareDAY: £35/dayNIGHT: £55/nightH24: £80/24hrsMedical CareDAY: £60/dayNIGHT: £90/nightH24: £140/24hrsIntensive CareDAY: £120/dayNIGHT: £180/nightH24: £280/24hrsFull pricing matrix modelled without creating separate services per time/care combination.

Example E: CMA Compliance State Machine

From first data entry to verified compliant — every step evidenced

NOTSTARTEDDRAFT INPROGRESSREADY FORREVIEWPARTIALLYPUBLISHEDFULLYPUBLISHEDCOMPLIANTSTALEBROKEN SINCENON-COMPLIANTDrift detection auto-detects staleness.Every state transition creates auditable proof.

Example F: ServiceKind Boundaries

Clear separation of taxonomy, packages, and pricing endpoints

ATOMICSingle clinical unitDirect pricing endpointCOURSEPackaged multi-step pathwayVariant retained for comparabilityGROUPTaxonomy/navigation containerChild services hold mappings/prices
Data Schema Diagram