Blüdhaven Pets domain model
The Blüdhaven Pets platform coordinates companion animal intake, statutory municipal licensing, veterinary health clearances, and retail inventory across three physical branches and an online adoption catalog.
This document specifies the business logic, state machines, and regulatory invariants behind the Blüdhaven Pets OpenAPI 3.1 contract.
Core entities
+-------------------+
| Retail Branch |
+-------------------+
|
v
+------------------+ +-------------------+ +--------------------+
| Health Record |<--->| Animal |<--->| Adoption Hold |
+------------------+ +-------------------+ +--------------------+
| |
v v
+-------------------+ +--------------------+
| Inventory | | Applicant |
+-------------------+ +--------------------+
Branch
Three facilities serve Blüdhaven, and the contract declares their identifiers as the BranchId enum. Every intake record, adoption hold, and supply order names one.
| Field | Type | Constraint | Description |
|---|---|---|---|
id | string | BranchId enum | loc_harbor_04, loc_downtown_01, or loc_westend_08. |
name | string | - | Trading name of the facility. |
kind | string | Enum | intake, retail, or transitional. |
city | string | - | Municipality the facility serves. |
address | string | - | Street address for client visits. |
phone | string | +1 country code | Front desk number. |
services | array of strings | Free text | Bookable services, such as spay-neuter. |
Animal
The central entity tracking an individual companion animal across municipal intake, veterinary care, and adoption.
| Field | Type | Constraint | Description |
|---|---|---|---|
id | string | Prefix pet_ | Unique platform identifier. |
name | string | Max 60 chars | Assigned companion name. |
species | string | Enum | Allowed values include dog, cat, rabbit, bird, or small_mammal. |
breed | string | Max 100 chars | Primary recognized breed or mixed lineage. |
age_months | integer | 0 or greater | Age in whole months at intake. |
sex | string | Enum | male or female. |
weight_kg | number | Float | Body weight in kilograms at the last exam. |
microchip_id | string | Exactly 15 digits | Statutory ISO 11784 and 11785 compliant microchip identifier. |
status | string | Enum | State machine stage. |
intake_branch_id | string | BranchId enum | Originating facility from the three in Branch. |
intake_date | string (date) | ISO 8601 | Official surrender or rescue intake timestamp. |
adoption_fee_cents | integer | Cents | Placement fee. The Harbor branch charges 15000 cents ($150) for a dog. |
temperament_tags | array of strings | Free text | Traits the adoption floor filters on, such as good-with-cats. |
health_record | object | AnimalHealthRecord | Nested clinical record for the animal. |
photo_urls | array of URIs | Absolute URLs | Gallery images served from the media host. |
Health record
Stores clinical evaluations, regulatory immunization logs, and mandatory quarantine milestones.
| Field | Type | Constraint | Description |
|---|---|---|---|
rabies_tag_number | string | Format RB-YYYY-XXXX | Mandatory municipal certificate code for rabies vaccinations. |
rabies_expiration_date | string (date) | ISO 8601, required | Expiry of the rabies certificate. A lapsed date blocks a hold. |
spay_neuter_certified | boolean | Required | Legal prerequisite for adoption finalization in municipal code. |
quarantine_release_date | string date-time | Nullable | Mandatory 14-day observation release for bite or intake cases. |
veterinarian_license | string | Format DVM-XXXXX | State board license number of certifying practitioner. |
last_exam_date | string (date) | ISO 8601 | Date of the most recent clinical exam. |
Adoption hold
An exclusive reservation locking an animal during in-person interviews and background verification.
| Field | Type | Constraint | Description |
|---|---|---|---|
id | string | Prefix hld_ | Unique hold record identifier. |
animal_id | string | Foreign key | References target animal. |
applicant_id | string | Prefix usr_ | References verified adopter profile. |
branch_id | string | Foreign key | Branch where the interview happens. |
expires_at | string date-time | ISO 8601 | Enforced 30-minute expiration timestamp from creation. |
seconds_remaining | integer | Computed | Countdown the read route returns, so a client needn't parse timestamps. |
status | string | Enum | State can be ACTIVE, EXPIRED, RELEASED, or CONVERTED. |
Animal state lifecycle
Every animal advances through a strict state machine. Unregistered or uncertified state jumps return 422 Unprocessable Content.
[INTAKE]
│
▼
[VET_CLEARANCE] ──(Fails quarantine / illness)──► [MEDICAL_QUARANTINE]
│ │
│ (Passes exam & rabies log) │ (Cured & certified)
▼ │
[AVAILABLE] ◄────────────────────────────────────────────┘
│
▼
[RESERVED_HOLD] ──(30-min TTL expires / cancelled)──► [AVAILABLE]
│
│ (Adoption fee paid & license filed)
▼
[ADOPTED]
Lifecycle states
INTAKE: animal admitted through municipal shelter surrender or stray rescue. Catalog visibility stays off.VET_CLEARANCE: animal undergoing clinical intake examination and statutory microchipping.MEDICAL_QUARANTINE: animal isolated due to infectious conditions or bite observation. Clients can't view or hold the record.AVAILABLE: animal cleared by a licensed veterinarian withspay_neuter_certified: true. Listed on web catalog and retail floor.RESERVED_HOLD: exclusive 30-minute reservation lock created by store associate or client app. Prevents double-booking.ADOPTED: adoption completed with municipal pet license fee collected and microchip registry transferred.
Concurrency rules and 30-minute holds
To prevent race conditions where an in-store customer and an online applicant attempt to reserve the same animal simultaneously:
- Atomic hold placement checks that the target animal stores
status: "AVAILABLE"before writing the lock record withPOST /adoptions/holds. - Conflict response returns an HTTP
409 Conflictusing RFC 9457ProblemDetailswhenever an active hold already exists for the animal. - Automated expiration returns the animal to
AVAILABLEstatus whenever the applicant doesn't submit payment within 1,800 seconds. Anadoption.hold.expiredwebhook dispatches to partner feeds.
Regulatory and municipal compliance
Blüdhaven municipal animal ordinances mandate three immutable constraints:
- Intact restrictions prevent animals from entering
AVAILABLEorADOPTEDstatus without verifiedspay_neuter_certified: true. - Statutory microchip format requires that
microchip_idconform to ISO standards with exactly 15 numeric digits. - Rabies tag validation requires dogs and cats older than 12 weeks to record a validated
rabies_tag_numberbefore leavingVET_CLEARANCE.