feat: add deterministic schedules to lodging cancellation policies - #808
Conversation
Implements Universal-Commerce-Protocol#807 as a stacked draft on Universal-Commerce-Protocol#780.
Addresses pre-PR review findings for Universal-Commerce-Protocol#807.
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
|
@googlebot rescan |
|
@jingyli, could you point me to an engineer implementing a UCP Lodging consumer who might be open to a small interoperability test of the schedule proposed in #807 and this draft? I can help adapt one synthetic or publicly shareable lodging policy fixture and contribute a focused integration patch to select the applicable cancellation terms at a supplied instant, including cutoff boundaries and fallback behavior. This would remain pre-purchase disclosure only, with no payment/refund execution or inferred monetary bases. The aim is to test the proposal against a consumer implementation beyond the executable vectors here. A pointer to the right contact or venue would be appreciated. This is exploratory feedback, not a dependency for #780. |
Description
Adds an optional cancellation
scheduleto the Lodging policy introduced by#780, so a Platform can select the applicable cancellation terms at an explicit
instant. For example, a booking can offer a full refund before its 48-hour
cutoff and select a one-night penalty exactly at that cutoff.
The schedule contains an absolute anchor, ordered relative cutoffs, and
percentage, fixed-fee, or shared-measure outcomes. The required
refundabilitysnapshot and human-readable
descriptionremain. The change implements #807and is limited to buyer-initiated, pre-purchase policy disclosure.
Stacked PR status
lodging/bookingmainand re-verify the diffBehavior and compatibility
scheduleis optional and response-only; existing classification-onlypayload shapes remain valid.
refundabilityis the Business's authoritative response-generation summary;explicit-instant evaluation selects a schedule outcome without extrapolating
that snapshot or guessing a monetary basis.
and 86400-second days. Calendar validity and ordering are checked before
selection; unsupported timestamps and invalid schedules fall back to prose.
unambiguous monetary basis. Fixed fees use the root Booking currency.
Policy targeting alone does not imply multiplication by matched-room count.
purchase-relative cooling-off periods, or calendar-based durations.
Executable vectors
scripts/fixtures/lodging_cancellation_schedule.jsoncontains portable inputsand expected selection/fallback metadata. The test-only oracle in
scripts/test_cancellation_schedule.pychecks 44 evaluation vectors and 22schema expectations using the official schema tool and exact arithmetic.
Coverage includes cutoff equality, offsets/DST, fractional instants, equivalent
and reversed durations, invalid calendar dates, malformed unselected outcomes,
unknown selected/unselected kinds, trailing newlines, and a POSIX leap-boundary
case. It does not calculate money, infer refundability, or resolve targeting.
The suite is wired into
docs.ymland the local pre-commit configuration.Review questions
repository before merge?
measurethe preferred shape for positive whole lodging-unitpenalties such as
night?follow-up required for this stacked Draft?
Category (Required)
Related Issues
Checklist
Validation
Validation for
7b4e654:ucp-schema lint source/: 139 files pass; existing W002 warnings onlypass; independently reviewed and rerun
Local Super-Linter could not run because the Docker daemon is unavailable. There is
no
sdk/python/generate_models.shin this repository checkout; SDK follow-upis an explicit review question.
The CLA check passes. Existing PR workflow triggers target
mainandrelease/**, so these local validation results are necessary while thisstacked Draft targets
lodging/booking.