Skip to content
Small robot workers connecting catalog data, purchase documents, a reservation plan, candidate times, and a confirmed visit promise on one workbench
A purchase fact and an agreement to visit at a specific time are different data. The business decision between them needs its own boundary.

It is tempting to describe an event product as “a product for one visit.” The reservation service has a harder job: it must reproduce which care obligation and which visit promise the purchase can create without turning the purchase into a calendar slot.

Suppose Patient A buys an event product. The payment does not automatically confirm a doctor and a time on the clinic calendar. The service first checks the catalog source and purchase source, calculates eligible availability, and creates a confirmed visit only after the customer consents to a proposal.

Purchase fact ≠ availability conditions ≠ confirmed commitment

This article follows the first booking commitment for an event product on Patient A’s timeline. N-visit and package products appear only as comparisons that show why the boundary matters. Full repeated-visit calculation, package migration, no-show penalties, and VIP priority remain separate product and operating policy work.

Why is an event product not a visit commitment yet?

Section titled “Why is an event product not a visit commitment yet?”

Patient A may make three kinds of purchases in sequence.

TimePatient A action or eventProduct and purchase meaningWhat the reservation service preserves first
T1Buys an event productA one-use product contractPurchase ID and purchase-time product version
T2Adds an N-visit productAn obligation fulfilled across several visitsPer-visit PlannedTreatment and repeat interval
T3Buys a package of treatment itemsAn execution BOM with item, dependency, and resource requirementsPer-item version source and dependency
T4Requests a date, or provides no preferenceCustomer scheduling inputImmutable BookingPreferenceSnapshot
T5Consents to a candidate timeA commitment for a specific time, item, and resourceCONFIRMED state and policy snapshot
T6Arrives and receives careVisit facts connect to clinical factsVisit/completion event and unfinished item state

The important boundary is that the three purchases do not become one Appointment row. One use of an event product, the third visit in an N-visit product, and one package item have different remaining obligations and dependency rules. Items from several purchases may be handled in the same visit, but the agreed AppointmentItem and each purchase’s AppointmentPlan remain separately traceable.

A purchase is the commercial fact about what the patient contracted to use. An AppointmentPlan is the reservation service’s interpretation of that contract as executable obligations. A confirmed visit is an agreement to fulfill specific items with specific time and resources. Treating all three as one record lets a product or schedule change silently rewrite a past promise.

The minimum catalog contract entering the reservation service

Section titled “The minimum catalog contract entering the reservation service”

The reservation service must not read a product name and guess that it means “a 30-minute appointment.” The product management service publishes versioned source-of-record data, and the reservation service keeps the definition as an immutable purchase-time input.

The current ProductCatalogDefinition carries scheduling interpretation data such as:

Source dataMeaning for the reservation service
catalogVersion and schemaVersionWhich product contract and decoder were interpreted
repeatCount on itemsHow many PlannedTreatment records can be created
durationMinutesExpected resource occupancy per visit
minimumIntervalDays, preferredIntervalDays, maximumIntervalDaysHard and soft intervals between repeated visits
Practitioner, equipment, and room typesSkills and resources needed for a candidate time
dependenciesWhich later item waits for a predecessor
initialBookingRuleA limited fallback for the first proposal when no customer preference exists

Product names and prices cannot replace this contract. sourceAuthority identifies the source of record that published the catalog data, while catalogVersion identifies the immutable revision published by that source. This is source ownership for interpretation, not an authentication or authorization field.

The purchase event also needs a purchase source and purchase ID. When the source’s PurchaseCompletedEvent arrives, the reservation service checks the tenant, clinic, purchase source, and purchase ID scope before creating a plan. It uses the catalog snapshot only when the purchase has not already been planned; receiving the same event again is not evidence of a new purchase.

From a purchase fact to an AppointmentPlan

Section titled “From a purchase fact to an AppointmentPlan”

In the current implementation, one purchase expands to one AppointmentPlan. The plan retains the following source history:

  • sourcePurchaseAuthority and sourcePurchaseId: the source of record and original purchase identifier for the purchase fact
  • catalogSourceAuthority, productId, and catalogVersion: which catalog definition was used
  • catalogPayloadHash: a hash for checking whether replay uses the same catalog snapshot
  • bookingPreference: the immutable customer preference submitted with the purchase
  • PlannedTreatment: repeated BOM items with duration, resources, and intervals
  • TreatmentDependency: directed constraints between predecessor and successor visits

The product BOM is not a list the reservation service is free to redefine. It reads a validated snapshot, expands it into an execution plan, and preserves enough information to reproduce the result. If the catalog changes later, old plan items are not expanded again from the latest catalog.

PurchaseCompleted
└─> AppointmentPlan
└─> PlannedTreatment 1..N ── dependency/DAG
│ fulfills / attempts
Appointment ──> AppointmentItem 1..N ──> ResourceAllocation 1..N

The lower Appointment is the actual visit unit. A single visit can group AppointmentItem records from several plans, but each item must still identify which purchase and which PlannedTreatment it fulfills. Resource allocation is a fact of an agreed visit; receiving a purchase event does not automatically occupy a resource.

Separate customer preference from the first-proposal fallback

Section titled “Separate customer preference from the first-proposal fallback”

“Next Tuesday morning” is a preference, not a confirmed time. The current BookingPreferenceSnapshot keeps four immutable input forms:

InputMeaning
ExactDateTimeA local date-time preference normalized with the clinic time zone and UTC instant
DateRangeAn allowed range of local clinic dates
PreferredWeekdaysAndWindowsAllowed weekdays and local time windows
NotProvidedAn explicit marker that no preference was supplied

The product’s initialBookingRule is considered as a fallback only when the value is NotProvided. For example, WithinDaysAfterPurchase(maximumDays) limits when the first provisional proposal may be calculated after the original purchase date. It does not authorize automatic confirmation or override a preference the customer submitted.

Do not confuse the first-proposal horizon with the product benefit expiration date. The first is a reservation calculation rule. The second is a commercial contract owned by product management. The current ProductCatalogDefinition has the former as initialBookingRule; it does not automatically imply the latter.

From candidate time to confirmed commitment

Section titled “From candidate time to confirmed commitment”

Candidate calculation reads product source data together with clinic operating data. Duration, practitioner, equipment, room, repeat intervals, and predecessor constraints may all be satisfied while clinic hours or capacity still rule out a candidate.

The current source contains plan, preference, and policy models. The visit commitment design defines the proposal, hold, and consent flow. Read the labels in the table as a deliberate separation between current implementation and approved design.

StepStateWhat happens for Patient AEvidence label
Candidate calculatedcandidateProduct eligibility and a concrete time candidate are both calculatedApproved design
Proposal generatedPROPOSEDA time, item, and resource combination the customer can reviewApproved design
Resource held brieflyHELDA policy-specific short hold, still before consentApproved design
Customer consents to the exact proposalCONFIRMEDThe clinic and patient agree on a specific visit commitmentApproved design
Plan item moves into careSCHEDULED · IN_PROGRESS · COMPLETEDVisit commitment and clinical completion progress as separate statesCurrent plan model

PROPOSED and HELD represent a candidate or provisional capacity visible to the customer. If the patient wants a different time, calculate a new proposal. Do not move an existing CONFIRMED visit silently. A confirmed change keeps the existing commitment, creates a new proposal, and waits for new customer consent.

Patient A's event product purchase moves through a catalog snapshot, AppointmentPlan, candidate time, PROPOSED or HELD, customer consent, CONFIRMED, and visit/completion facts with four separate exception branches
Validate purchase and catalog source data, calculate candidates, and create a confirmed commitment only after customer consent. No candidate, expiry, patient change, and hospital change are different business exceptions.

An exception is not one generic reservation failure

Section titled “An exception is not one generic reservation failure”

If the reservation service stores every exception as FAILED, counseling and operations cannot choose the next action. The same event product can produce four different facts for Patient A.

SituationWhat the reservation service preservesNext business action
No candidate timeConditions, calculation time, reason, and whether review is possibleRecalculate with changed conditions, offer an alternative, or hand off to counseling
PROPOSED or HELD expiresThe expired offer/hold and the fact that it never became a commitmentCalculate a new candidate and create a new proposal, or review operationally
Patient cancels or declinesCustomer intent and prior state historyHand the fact to the source of record that decides product, refund, or counseling action
Clinic-side changeAffected resource, time, plan item, and operating changeCreate a new proposal and obtain customer consent with operations/counseling

When a clinic-side change affects a confirmed visit, do not delete the existing CONFIRMED state first. Preserve what changed and when, record that a new proposal is needed, and let counseling and operations explain the change and obtain consent.

The same separation is why this article does not promise no-show penalties or VIP priority as implemented features. A clinic may require extra review on the next request or define an explainable priority policy. The source data and decision owner for that policy must remain separate from the reservation service’s time and resource facts. Automatic cancellation of an existing commitment or a permanent blacklist is outside this article’s scope.

Source-of-record and responsibility boundaries

Section titled “Source-of-record and responsibility boundaries”

The reservation service does not own every fact about Patient A. Each service keeps its source-of-record data and responsibility, while the reservation service publishes objective scheduling facts.

Business areaSource of recordFact sent to the reservation serviceReservation service responsibility
Product management/developmentProduct version, BOM, duration, resource requirements, first-booking ruleCatalog projection or synchronization eventValidate and snapshot the purchase-time product definition
CommercePurchase contract and original purchase IDPurchaseCompletedCreate one plan per purchase and retain purchase source history
ReservationAppointmentPlan, candidate/proposal/hold/confirmation states, policy snapshot, and historyObjective reservation event and durable outboxPreserve availability conditions, visit commitments, and state history
Clinical careActual start, completion, and partial completionCompletion/fulfillment factReflect plan-item state and downstream scheduling impact
Counseling/CRMCustomer profile, counseling, complaints, and compensation decisionsObjective delay, cancellation, or rescheduling proposal factsProvide reservation facts and handoff for counseling decisions
NotificationContact, language, consent, and delivery historyReservation event and outbox resultKeep channel delivery separate from the reservation transaction
Analytics/external consumersProjections and metricsReservation event and schema contractDo not transfer ownership of the source reservation state

“Source of record” is not just a storage location. Product management explains what the product is, commerce explains what was bought, clinical care explains what was performed, and CRM explains which counseling or compensation decision was made. The reservation service connects only the parts needed to explain availability and the visit commitment.

Current implementation, approved design, awaiting operations, and roadmap

Section titled “Current implementation, approved design, awaiting operations, and roadmap”
Evidence labelScope in this articleQuestion for the reader
Current implementationVersioned catalog projection, one AppointmentPlan per purchase, PlannedTreatment, preference snapshot, and plan statesCan the contract be found in current source and tests?
Approved designPROPOSED · HELD · CONFIRMED after candidate calculation, consent-based change, and four exception branchesIs a design document being overstated as a current API or operating feature?
Awaiting operationsBroker delivery, notification outbox canary, analytics backfill, and production readinessHas delivery and recovery been verified outside the source tree?
RoadmapA public patient channel for reviewing and consenting to a proposal, plus concrete no-show/VIP policyAre undecided policies being promised as current behavior?

These labels continue the distinction from the product-version article. The existence of an AppointmentPlan model does not mean every clinic confirms a time immediately after purchase. Conversely, an approved visit commitment design does not mean candidate calculation, notifications, and counseling channels are all deployed in production.

This article followed the first booking commitment created by one event product and fixed the boundary between catalog source data, purchase source data, a reservation plan, and customer consent. The next article, Why an N-Visit Product Is Not One Appointment, expands to a multi-visit product and examines how repeated PlannedTreatment items preserve remaining rights while visit commitments are created one at a time.

These companions supplement the source design; they do not replace it. They show how product source data expands into a product BOM and a reservation plan.

Comments

Leave a note or reaction with your GitHub account.