Schema Draft Package For Top Critical Events — Первый полуформальный schema-layer для критичных async событий
Версия: 1.0
Дата: 24.04.2026
Статус: Готов к обсуждению
Назначение документа
Этот документ фиксирует первый полуформальный schema-draft package для наиболее критичных async событий платформы.
Его задача — определить:
- какие event schemas должны получить первичную полуформальную структуру раньше других;
- как разделяются
envelope,payload,required fields,optional fieldsиevolution notes; - какие compatibility boundaries уже нужно удерживать;
- как перейти от examples и payload outlines к будущему formal AsyncAPI/JSON Schema пакету без premature hard freeze.
Документ не является финальным schema registry и не утверждает окончательные serialisation contracts. Он является bounded drafting layer между examples и formal schema package.
Опорные документы
- Payload Examples For Top Critical Events — Первые example payloads для ключевых async событий
- Payload Family Outlines For High-Value Channels — Первые bounded payload shapes для ключевых async channels
- Channel Catalog Drafts By Release Unit — Первые channel families, producers, consumers и delivery expectations
- AsyncAPI Skeletons And Event Envelopes — Первый bounded asynchronous contract artifact
- Initial Contract Package — Первый implementation-ready пакет контрактов платформы
- Offer Pricing Booking Semantics — Семантика предложения, цены и бронирования
- Commercial Model — Коммерческая модель, цена, settlement и канальные условия
- Post-Booking Lifecycle — Изменения, отмены, инциденты и сопровождение после продажи
- Partner Finance And Clearing — Балансы, лимиты, взаиморасчёты и финансовая дисциплина партнёров
- Version Evolution Policy For Async Event Contracts — Правила версии, совместимости и replay-дисциплины
- Retry DLQ Replay Matrix By Schema Family — Исполнительная матрица доставки, повторов и восстановления
- JSON Schema Like Field Catalogs For Top Critical Events — Полуформальные field catalogs для критичных async событий
Почему Этот Документ Нужен Отдельно
После появления:
- payload family outlines;
- example payloads;
уже недостаточно иметь только narrative descriptions и illustrative JSON examples.
Нужен следующий bounded слой, который отвечает:
- какие поля уже считаются
required; - какие поля допустимы как
optional; - какие enum/value classes уже стабилизируются первыми;
- где schema evolution должна быть особенно осторожной;
- какие schemas реально worth drafting first.
Без этого examples остаются полезными, но всё ещё слишком свободными для implementation discipline.
Главный Принцип
Первый schema-draft package должен быть:
- explicit about required vs optional fields;
- strict on identifiers and correlation;
- cautious about enums and value freeze;
- compatible with replay and support needs;
- narrow enough to avoid freezing undeveloped contours.
Scope Первой Волны
Первая волна schema drafts должна покрывать только high-value события, где ошибка контракта особенно дорога:
quote.createdquote.invalidatedoffer.publication.suppressedbooking.confirmedbooking.unknown.external.statesettlement.event.postedusage.quota.exhausted
Draft Structure Pattern
Для каждого event schema draft ниже фиксируются:
event schema familyrequired envelope fieldsrequired payload fieldsoptional payload fieldsvalue-class notesevolution notes
Draft 1. quote.created
Event Schema Family
quote-lifecycle.v1
Required Envelope Fields
event_nameevent_versionevent_idoccurred_atproducercorrelation_idtenant_iddelivery_classreplay_sensitivityschema_familypayload
Required Payload Fields
quote_idoffer_idquote_stateprice_basis_refcurrency_codecommercial_context_ref
Optional Payload Fields
quote_valid_untilworkspace_idactor_context_idprice_view_classquote_visibility_scope
Value-Class Notes
quote_statefirst-wave values:activeexpiredinvalidated
delivery_classshould remaindomain-eventfor this family.
Evolution Notes
- do not freeze detailed monetary breakdown in this schema family yet;
price_view_classmay evolve with surface strategy;- adding optional visibility/context fields is safe if existing required fields remain stable.
Draft 2. quote.invalidated
Event Schema Family
quote-lifecycle.v1
Required Envelope Fields
- all
quote.createdrequired envelope fields causation_id
Required Payload Fields
quote_idoffer_idquote_stateinvalidated_by_event_refrepricing_reason_code
Optional Payload Fields
workspace_idactor_context_idprice_view_class
Value-Class Notes
quote_statefor this event should be fixed toinvalidated;repricing_reason_codeshould remain code-based, not free-text.
Evolution Notes
- keep
invalidated_by_event_refreference-shaped, not expanded into full upstream snapshot; - additional optional reason-context fields may be added later.
Draft 3. offer.publication.suppressed
Event Schema Family
offer-publication.v1
Required Envelope Fields
event_nameevent_versionevent_idoccurred_atproducercorrelation_iddelivery_classreplay_sensitivityschema_familypayload
Required Payload Fields
offer_idoffer_revisionproperty_idpublication_stateintegrity_statefreshness_statepublication_scope
Optional Payload Fields
suppression_reason_codesaffected_surface_classes
Value-Class Notes
publication_statefor this event should be fixed tosuppressed;integrity_stateshould remain code-like and bounded;affected_surface_classesshould be treated as a bounded list, not arbitrary labels.
Evolution Notes
- do not freeze full governance snapshot into this schema;
- suppression reason catalog can expand, but existing codes should remain backward meaningful.
Draft 4. booking.confirmed
Event Schema Family
booking-transitions.v1
Required Envelope Fields
event_nameevent_versionevent_idoccurred_atproducercorrelation_idtenant_iddelivery_classreplay_sensitivityschema_familypayload
Required Payload Fields
booking_idbooking_statequote_idbooking_reference_scopesupplier_confirmation_statetransactional_outcome_classsupport_visibility_classmanual_intervention_required
Optional Payload Fields
workspace_idactor_context_idsupplier_booking_ref
Value-Class Notes
booking_statefor this event should be fixed toconfirmed;transactional_outcome_classfirst-wave value should besuccess;manual_intervention_requiredshould remain explicit boolean.
Evolution Notes
- do not add full booking item arrays or traveller snapshots to this event family yet;
- partner-facing derived events may need later surface-specific variants, but not in this first schema draft.
Draft 5. booking.unknown.external.state
Event Schema Family
booking-transitions.v1
Required Envelope Fields
- all required
booking.confirmedenvelope fields causation_id
Required Payload Fields
booking_idbooking_statequote_idbooking_reference_scopesupplier_confirmation_statetransactional_outcome_classsupport_visibility_classmanual_intervention_requiredrecovery_path_refunknown_state_reason_code
Optional Payload Fields
workspace_idactor_context_id
Value-Class Notes
booking_statefor this event should be fixed tounknown_external_state;transactional_outcome_classshould remain bounded to uncertainty semantics;support_visibility_classshould remain escalation-oriented code, not prose.
Evolution Notes
- keep uncertainty explanation code-based;
- if richer supplier context appears later, add it as optional bounded references, not vendor-specific blob fields.
Draft 6. settlement.event.posted
Event Schema Family
settlement-reconciliation.v1
Required Envelope Fields
event_nameevent_versionevent_idoccurred_atproducercorrelation_idtenant_iddelivery_classreplay_sensitivityschema_familypayload
Required Payload Fields
financial_event_idbooking_idfinancial_state_classcurrency_codeamount_scope_classfinancial_counterparty_scopesettlement_basis_ref
Optional Payload Fields
workspace_idclearing_context_ref
Value-Class Notes
delivery_classshould remain financial-domain-oriented;financial_state_classfirst-wave value may start withinitial-posted;amount_scope_classshould remain code-like and bounded.
Evolution Notes
- do not freeze invoice/ledger-specific semantics here;
- additional financial references can be added later if kept reference-based.
Draft 7. usage.quota.exhausted
Event Schema Family
usage-governance.v1
Required Envelope Fields
event_nameevent_versionevent_idoccurred_atproducercorrelation_idtenant_iddelivery_classreplay_sensitivityschema_familypayload
Required Payload Fields
tenant_idusage_profile_idgovernance_stateaffected_surface_scopeenforcement_class
Optional Payload Fields
quota_window_refthrottle_policy_ref
Value-Class Notes
governance_statefor this event should be fixed toquota_exhausted;enforcement_classshould remain bounded to policy/action classes.
Evolution Notes
- do not turn this event into low-level metrics schema;
- richer usage metrics belong in reporting or aggregation layers, not in this event family.
Cross-Draft Compatibility Rules
Для всей первой schema-draft wave должны действовать:
- adding new optional fields is allowed;
- removing required fields is disallowed;
- changing identifier semantics is disallowed;
- changing bounded code meaning requires version evolution note;
- replacing reference fields with embedded heavy snapshots should be treated as breaking change risk.
What Must Stay Out Of Scope
Пока не нужно:
- писать full JSON Schema syntax for every field;
- фиксировать transport serialization quirks;
- нормализовывать all future event families into this package;
- обещать public external compatibility for all drafts;
- моделировать vendor-specific extensions.
Что Должно Появиться Следом
Следующий практический слой после этого документа:
- JSON Schema Like Field Catalogs For Top Critical Events — Полуформальные field catalogs для критичных async событий
- Version Evolution Policy For Async Event Contracts — Правила версии, совместимости и replay-дисциплины
- first JSON-Schema-like field catalogs for these drafts;
- retry/DLQ/replay matrix tied to schema families;
- webhook payload policy and external async compatibility notes;
- version-evolution policy for async event contracts.
Этот документ создаёт первый полуформальный schema-layer и переводит payload examples в более контролируемый contract drafting stage.
Уточнение под Фазы 4–6 (28.04.2026)
Schema drafts для критичных async событий теперь опираются на каноничные структуры из reference-документов фаз 4–6:
- Booking → booking-state-machine.md
- Payment → payment-domain.md
- Tour saga → tour-builder-operational-model.md
- Notifications → notification-and-communication.md
- Tenant isolation → multi-tenant-isolation-strength.md
- Security audit → security-architecture.md
- DR / capacity / SLA / incident → disaster-recovery-and-capacity.md, sla-and-on-call-model.md, runbooks-incident-playbooks.md
- Compliance → compliance-and-legal.md
Сводный каталог — initial-event-taxonomy.md. 6 классов событий с guarantees — eventing-and-queue-baseline.md. При новых schema drafts использовать OpenAPI 3.1 / AsyncAPI 3 согласно proposal-openapi-first-polyglot-codegen.md.
Уточнение выполнено через no-destruction.