internal.accounting.IntegrationConfig
configcreated_atdisplay_nameidis_enabledorganization_idproviderupdated_atdto.ActivePromotionDTO
discount_valueeffect_typeexpires_atnamepromotion_iddto.AddInvoiceLineRequestDTO
amountdescriptionline_typemarkup_percentperiod_endperiod_startproduct_idquantitytax_rateunit_pricedto.BillingMilestoneDTO
created_atdescriptionidinvoice_idis_overduenameorganization_idpercentageproduct_idstatussubscription_idtrigger_datetrigger_typetriggered_atupdated_atdto.CreateManualInvoiceRequestDTO
billing_period_endbilling_period_startbuyer_referencecurrencycustomer_iddelivery_datedue_datelocaledto.CreditNoteApplicationDTO
amountapplied_atcreated_atcredit_note_ididinvoice_idorganization_iddto.CreditNoteDTO
created_atcredit_note_numbercurrencycustomer_iddeleted_atidinvoice_idissued_atorganization_idreasonreason_codestatusupdated_atvoided_atdto.CreditNoteLineDTO
created_atcredit_note_iddescriptionidinvoice_line_idline_typeorganization_idperiod_endperiod_startproduct_idquantitytax_category_codetax_exemption_reasontax_ratetax_typedto.InvoiceDTO
billing_period_endbilling_period_startbuyer_referencecreated_atcurrencycustomer_iddeleted_atdelivery_datedue_dateidinvoice_numberinvoice_typeissued_atlast_dunning_step_atlast_dunning_step_indexlocaleorganization_idpaid_atstatussubscription_idsupplier_tax_numbersupplier_vat_idsupply_typetax_category_codetax_exemption_reasontax_point_dateupdated_atdto.InvoiceLineAtomDTO
atom_indexexchange_rate_idfx_policy_appliedidperiod_endperiod_startprice_keyprice_key_display_nameprice_version_idquantitysubtotaltax_amounttax_ratetax_rule_idunit_pricedto.InvoiceLineDTO
created_atcurrencydescriptionidinvoice_idline_typeorganization_idperiod_endperiod_startprice_keyprice_key_display_nameproduct_idquantitytax_category_codetax_exemption_reasontax_ratetax_typedto.MeterBindingMeterSummary
functionidkeynameunit_labeldto.MeterDTO
created_atdedup_key_pathdimensionsevent_schemafunctionidkeylate_event_policymetric_keynamenegative_allowedorganization_idunique_by_fieldunit_currency_fieldunit_labelupdated_atvalue_fieldworkspace_iddto.ProductMeterBindingDTO
created_athead_version_ididincluded_quantity_sourcemeter_idorganization_idoverlay_dimensions_keyedpricing_var_nameproduct_idrolerollover_eligibleupdated_atworkspace_iddto.PromotionDTO
application_timingarchetypearchived_atbudget_behaviorcodecondition_modecreated_atcurrent_budget_usedcurrent_redemptionsdeleted_atderived_statusdescriptionhead_version_ididis_phasedmax_budgetmax_redemptionsmax_redemptions_per_customernameorganization_idpopulated when is_phased=true; single Default phase otherwise
prioritypublic_descriptionpublished_atpublished_byremaining_budgetremaining_redemptionsrequires_continuous_coveragestackablestatusupdated_atvalid_fromvalid_toversionvisibilitydto.ProrationLedgerDTO
appliedchange_datecurrencydescriptionidinvoice_line_idperiod_endperiod_startproration_typedto.ProrationRecordDTO
appliedchange_datecreated_atcurrencydays_remainingidinvoice_idnew_quantityold_quantityorganization_idperiod_endperiod_startproration_typesubscription_idsubscription_item_iddto.SubscriptionDTO
allowed_transitionsauto_renewbilling_anchor_daybilling_interval_countbilling_interval_unitbilling_timingcancellation_reasoncancelled_atcreated_atcurrent_period_endcurrent_period_startcustomer_iddeleted_atdescriptionDrift is populated only when the operator passes ?include=drift on the List endpoint (versioning-ux workstream 05). Computed per-row from plan_versions / product_versions — no storage cost, no schema change.
idnamenext_billing_dateorganization_idpayment_terms_daysplan_idplan_versionpublic_descriptionstarted_atstatusupdated_atdto.SubscriptionItemDTO
created_atcurrent_term_endcurrent_term_startidorganization_idoverride_appliedoverride_idoverride_sourceOverrideSource: "PHASE" when the resolved CUSTOMER_OVERRIDE had phase_id set; "CUSTOMER" when it didn't; empty when no override.
pricing_modelproduct_idproduct_nameproduct_typeproduct_version_idProductVersionID surfaces version pinning. nil = follow head.
quantityrenewal_anchor_atsubscription_idterm_auto_renewterm_countterm_unitPer-item commitment term (R2/R4). All nil ⇒ the item follows the subscription's cadence (no explicit term). Surfaced read-side so the items tab can show "committed N units · auto-renews · renews <current_term_end>" instead of the term being write-only.
updated_atdto.SubscriptionPhaseDTO
auto_transitioncompleted_atdunning_stagedunning_stage_atduration_unitduration_valueend_atend_kindends_atidorganization_idphase_kindphase_orderstarted_atstatussubscription_iddto.WalletDTO
auto_topup_enabledcreated_atcurrencycustomer_ididis_primarymodeorganization_idpromotional_balance_expires_atupdated_atinternal.approval.ApprovalDecision
approval_request_idcommentdecided_atdecided_bydecisionidstep_numberinternal.approval.ApprovalRequest
created_atcurrent_stepentity_identity_typeidinitiated_byorganization_idpayloadprevious_stateresolved_atstatusstep_started_attrigger_actionupdated_atworkflow_template_idinternal.approval.ApprovalStep
approver_rolesapprover_user_idsmin_approvalsnamenotify_on_startstep_numbertimeout_hoursinternal.approval.ApprovalWorkflowTemplate
created_atdescriptionentity_typeidis_activenameon_rejectionon_timeoutorganization_idstatustrigger_actionupdated_atinternal.approval.CreateWorkflowTemplateRequest
descriptionentity_typenameon_rejectionon_timeouttrigger_actioninternal.approval.TriggerAction
internal.approval.UpdateWorkflowTemplateRequest
descriptionis_activenameon_rejectionon_timeoutinternal.audit.AuditEventRetentionPolicy
created_atevent_typeidorganization_idretention_daysupdated_atinternal.audit_dto.Actor
emailkey_idkey_prefixlabelnamepicturetypeuser | api_key | system | job | webhook | unknown
user_idinternal.audit_dto.AuditEvent
actor_emailactor_key_idactor_key_prefixactor_labelactor_nameactor_pictureactor_typeLegacy flat actor fields — duplicated from Actor so FE consumers
that still read actor_email / actor_type keep working through
Phase 1. Removed in Phase 5 once the renderer-registry rewrite
(Phase 2) migrates them onto the nested actor object.
actor_user_idcausation_idcorrelation_idCascade chain. correlation_id ties together every event in one top-level operation; causation_id points at the immediate parent. Both nil for legacy rows and standalone operations.
customer_iddiffdomainCatalog metadata. Denormed onto every response so the FE renderer registry doesn't have to ship a parallel descriptor table. When the EventType is unregistered (legacy / forward-compat) these are omitted and the FE falls back to a generic row.
entityentity_identity_typeSubject — the entity the event is "about", plus parent refs the recorder denormalised so the parent-scoped Audit tab surfaces it.
event_typeEventType is the canonical wire name (e.g. "subscription.phase.added").
idoccurred_atorganization_idpayloadplan_idproduct_idrequest_idseveritysubscription_idsummaryContent. Summary is the human one-liner shown verbatim in the table; Payload is event-type-specific JSON the per-event renderer parses; Diff is the typed change-set jsonb for mutation events.
trace_idverbvisibilityinternal.audit_dto.CustomerAuditEvent
domainentityentity_identity_typeevent_typeidoccurred_atpayloadverbinternal.credit_note.CreateCreditNoteLineRequest
descriptioninvoice_line_idline_typeperiod_endperiod_startproduct_idquantitytax_ratetax_typeunit_priceinternal.credit_note.CreateCreditNoteRequest
currencycustomer_idinvoice_idreasonreason_codetemplate_idinternal.credit_note.CreditNoteReasonCode
internal.credit_note.CreditNoteStatus
domain.AddInvoiceLineRequest
amountdescriptionline_typemarkup_percentperiod_endperiod_startproduct_idquantitytax_rateunit_pricedomain.AddItemRequest
auto_reneweffective_atEffectiveAt (Pass B) — when the new item starts being billed. nil → now (immediate add). Future timestamp queues the row for activation at that boundary; the segmenter splits the period at T so [T, periodEnd) includes the new item. Past timestamps are rejected.
price_keyproduct_idproration_modequantityterm_countterm_unitOptional per-item term (R2/R4). When set, the item bills the whole term upfront on the invoice covering term start and emits no line on subsequent invoices inside the term. See SubscriptionItemInput for the field semantics.
domain.AddProductRequest
included_quantityproduct_idrollover_enabledrollover_expiry_periodsrollover_maxdomain.AdjustRequest
amountpositive or negative
reasonreferencesourcedomain.AllowanceStateResponse
current_period_endcurrent_period_startsubscription_iddomain.AppliedPromotion
adjustment_kindadjustment_valueAdjustmentValue is kind-dependent: rate for percentage_discount, amount for fixed_discount / price_override, periods for free_periods, quantity for free_product. The cents impact is in AppliedAmountMinor and is the only field the replay path reads.
applied_amount_minorAppliedAmountMinor is the cents removed from the line subtotal. Positive = discount. The replay path applies this directly to the rebuilt line, bypassing the live simulator entirely.
created_atidinvoice_idinvoice_line_idorganization_idpromotion_idpromotion_version_iddomain.BillingAddress
citycountryISO 3166-1 alpha-2
line1line2postal_codestatedomain.BreakdownAdjustment
labeltypedomain.CaptureHoldRequest
amountnil = capture full hold amount
referenceoptional capture reference
domain.ChangeCustomerTypeRequest
customer_typereasondomain.ChangeQuantityPreviewRequest
effective_atnew_quantitysubscription_item_iddomain.ChangeQuantityPreviewResult
currencydays_remainingnew_quantityold_quantityperiod_endperiod_startdomain.ChangeSubscriptionVersionRequest
strategytarget_latesttrue → resolve to head version
target_versionnil → use TargetLatest
update_track_modeoptional — flip pinned↔latest as part of the change
domain.ComputePriceResponse
debug_traceexpressionformula_idformula_versionresultdomain.ConditionPreview
applies_atpassedsummarytypedomain.Cost
archived_atcreated_atdescriptionhead_version_ididkeyorganization_idproduct_idrequires_continuous_coveragescopestatusupdated_atversiondomain.CostVersion
cost_iddescriptionidorganization_idpublished_atpublished_byversiondomain.CreateCustomFieldDefinitionRequest
auditabledefault_valuedescriptiondisplay_nameentity_typesfield_groupfield_typekeyshow_in_tablesort_ordervisibilitywrite_accessdomain.CreateCustomerRequest
auto_validate_vatAutoValidateVAT is a per-request hint controlling whether the handler kicks off an async VAT validation after creation. nil = default behavior (auto-validate when otherwise eligible). false = skip the auto-trigger even if eligible (useful for bulk imports / automation). Workspace-level verification.vat.enabled and per-customer VatValidationDisabled both still take precedence - this flag only suppresses the optional handler-side dispatch.
billing_modelcustomer_typedefault_auto_topup_amountdefault_auto_topup_enableddefault_credit_limitdefault_low_balance_thresholddefault_max_balancedefault_max_single_creditdisabled_providerseinvoice_emailemailexternal_idlocalemodenamepayment_terms_dayspeppol_idprefer_einvoicepreferred_currencypreferred_providervat_validation_disabledvat_validation_disabled_reasondomain.CreateFXOverrideRequest
reasonsnapshot_datesource_currencytarget_currencyvalid_fromnil → now()
valid_tonil → open-ended
domain.CreateMeterRequest
dedup_key_pathdimensionsevent_schemafunctionkeylate_event_policymetric_keynamenegative_allowedunique_by_fieldunit_currency_fieldunit_labelvalue_fieldnil → DefaultWindow()
domain.CreatePaymentMethodRequest
customer_idis_defaultproviderprovider_idtypedomain.CreatePhaseRequest
auto_transitionduration_unitduration_valueend_atend_kindEnd policy (M103+).
phase_kindPhases are billing-mode markers (M118 trim) — they carry just
phase_kind + an end policy + auto_transition. Operator-facing
metadata (name / description / translations) and per-phase
setting overrides used to ride this struct; they've been removed
in favour of subscription-level fields.
start_atdomain.CreatePlanRequest
descriptionexternal_idnamepublic_descriptiondomain.CreatePriceRequest
country_codecurrencycustomer_iddisplay_nameM186 - customer-facing label
effective_fromeffective_tokindlist_priceplan_idplan_versionprice_keyproduct_idvalid_fromValidFrom / ValidTo are the customer-facing time bounds for an override ("this negotiated price applies until 2026-12-31"). Distinct from EffectiveFrom/EffectiveTo which are price-version publish/archive timestamps.
valid_todomain.CreatePriceTierRequest
flat_amountstatic flat fee
formula_idFormulaID + FormulaDefaults are the structured alternative to RateExpression — see PriceTier docs above. When both are set, FormulaID wins; the runtime evaluator looks up the formula and merges defaults at eval time rather than baking everything into a string at create time.
rate_expressionad-hoc expression; overrides unit_amount when present
unit_amountstatic rate
up_tonil means infinity
domain.CreateProductMeterBindingRequest
included_quantity_sourcemeter_idoverlay_dimensions_keyedpricing_var_namerolerollover_eligibledomain.CreateProductRequest
descriptionexternal_idinvoiceable_standaloneInvoiceableStandalone opts the product into the manual-invoice picker on create. Defaults to false (subscription-only).
namepricing_modelpublic_descriptionrequires_product_idstax_categoryDEFAULT, REDUCED, ZERO, EXEMPT (defaults to DEFAULT)
typedomain.CreatePromotionPhase
allow_regressiondefaults to true
is_terminaldefaults to false
min_dwell_daysnamephase_transition_timingdomain.CreatePromotionRequest
application_timingarchetypebudget_behaviorcodecondition_modedescriptionis_phasedmax_budgetmax_redemptionsmax_redemptions_per_customernamerequired when archetype is loyalty_ladder / growth_ladder
prioritypublic_descriptionstackablevalid_fromvalid_tovisibilitydomain.CreateRateTableRequest
default_valuedescriptionnameon_missing_keyrequires_continuous_coverageslugtable_typedomain.CreateSubscriptionRequest
auto_renewbilling_anchor_daybilling_interval_countbilling_interval_unitbilling_timingBillingTiming defaults to in_arrears when unset - matches the effective behavior every legacy / public-checkout subscription has today (no first invoice on activation; renewal tick picks up the closed period at period_end).
currencycustomer_iddescriptionItems defines the products/quantities/prices billed by this subscription (M116+). When omitted and the subscription is plan-based, items default from the plan-version snapshot.
namepayment_terms_daysPhases must contain at least one entry. The first entry is the initial ACTIVE phase; subsequent entries are pre-planned PENDING phases. M116+: phases are pure billing-mode markers — items live on the subscription, not the phase.
plan_idPlan-or-product XOR (M102+). When PlanID is set the plan template drives initial phase config; when ProductID is set the subscription is a single-product setup. Exactly one of these may be non-null. PlanID may also be inferred from Phases[0].PlanID for backward- compat — the service prefers the top-level field if set.
product_idproduct_versionpublic_descriptionstart_atstart_triggerStartTrigger picks the activation path. Defaults to "immediate". "start_date" requires StartAt to be set.
version_change_strategyversion_track_modeVersion pin/track and change strategy. Defaults: pinned + null strategy (no auto upgrades).
domain.CreateTagRequest
colordescriptionentity_typenamedomain.CreateTaxRuleRequest
applies_to_customer_typesapplies_to_product_categoriesapplies_to_supply_typesapply_orderinclusiveis_compoundjurisdiction_countryjurisdiction_regionraterequires_continuous_coveragetax_typevalid_fromvalid_todomain.CreateTestPaymentSimulationRequest
outcomepayment_method_iddomain.CreateVerificationRequest
check_typecustomer_idproviderverification_typedomain.CreateVersionRequest
clone_from_version_ideffective_fromeffective_tonotedomain.CreateWalletRequest
auto_topup_amountauto_topup_enabledcredit_limitcurrencycustomer_idlow_balance_thresholdmax_balancemax_single_creditdomain.CreateWorkspaceCurrencyRequest
billing_enabledcatalog_enabledcurrency_codedomain.CreditRequest
amountexpires_atreasonreferencesourcedomain.CurrencyReferences
costscredit_notescustomersinvoicespricessubscriptionstotalwalletsdomain.CustomFieldDefinition
auditablecreated_atdefault_valuedeleted_atdeprecated_atdescriptiondisplay_nameentity_typesfield_groupfield_typeidkeyorganization_idshow_in_tablesort_orderstatusupdated_atversionvisibilitywrite_accessdomain.Customer
billing_modelcreated_atcustomer_typedefault_auto_topup_amountdefault_auto_topup_enableddefault_credit_limitdefault_low_balance_thresholddefault_max_balancedefault_max_single_creditdeleted_atdisabled_providerseinvoice_emailemailexternal_ididlocalemodenameorganization_idpayment_terms_dayspeppol_idprefer_einvoicepreferred_currencypreferred_providerstatusupdated_atvat_validation_disabledvat_validation_disabled_reasonvat_validation_statusdomain.CustomerVerification
actor_idcheck_typecreated_atcustomer_idexpires_atidlast_checked_atorganization_idproviderprovider_referencereasonresult_payloadstatusupdated_atverification_typeverified_atdomain.DebitRequest
amountreasonreferencesourcedomain.DependsOn
conditionequals, not_equals, is_set, is_not_set
effectrequired, hidden
field_keyvaluedomain.EUVATRate
country_codeISO 3166-1 alpha-2
country_nameeffective_fromeffective_toparking_rateparking rate (0 if none)
reduced_rateprimary reduced rate
reduced_rate_2second reduced rate (0 if none)
standard_ratee.g. 0.19 for 19%
super_reducedsuper-reduced rate (0 if none)
domain.EffectScope
charge_kindsexcluded_product_idsproduct_typestarget_product_idsdomain.EnrichedPlanProduct
Costs + MeterBindings are HEAD-state summaries (no pin table exists for either today), letting the FE plan-details sheet show what the operator currently has configured per product without an extra round-trip per row. Empty slices when the product has nothing attached, so the FE can render conditionally on length > 0 without nil checks.
created_atidincluded_quantityorganization_idplan_idpricing_modelproduct_head_version_idProductHeadVersionID is the product's CURRENT live head
(products.head_version_id). Surfaced alongside ProductVersionID
so the FE plan-stage UI can compute drift / "use latest" without
an extra per-row fetch: when ProductHeadVersionID !==
ProductVersionID the plan's pin trails the product's live head.
Always present once the product is loaded; nullable only for
defensive serialization.
product_idproduct_nameproduct_typeproduct_version_idProductVersionID is the product_version_id pinned for THIS product by the plan's current head plan_version. Phase 2.E surfaces this on the wire so the FE can show, per row, "v3 is what the live plan version uses for this product" — without it every chip falls back to the product's own live head, defeating the operator's "see what the plan pins" intent. Nullable: an unpinned row (legacy data, in-progress draft) renders the chip in its plain head-fallback state.
rollover_enabledrollover_expiry_periodsrollover_maxdomain.FXOverride
created_atdeleted_atidorganization_idreasonsnapshot_dateSnapshotDate pins the override to a specific calendar day's rate snapshot — plain-date semantic, mirrors FXSnapshot.SnapshotDate. ValidFrom / ValidTo are TIMESTAMPTZ instants (the activation window of the override itself, which legitimately has wall-clock semantics — "this override kicks in at 09:00 Friday Berlin").
source_currencytarget_currencyupdated_atvalid_fromvalid_toworkspace_iddomain.FXPolicy
domain.FXSnapshot
created_atidratedecimal string for precision
snapshot_dateSnapshotDate is the calendar day this rate snapshot represents. One snapshot per (date, source, target) — the rate is what the configured source (ECB, etc.) published for that day. Plain-date semantic: no clock, no zone. Postgres column type is DATE.
sourcesource_currencytarget_currencydomain.FilterNode
fieldLeaf-only: Field is a dotted JSON path into the event's metadata jsonb, e.g. "tier" or "request.region". Empty for group nodes.
opvalueValue is the comparison RHS. For "in" / "not_in" it must be a JSON array; for "exists" / "not_exists" it is unused; for the other ops it is a scalar.
domain.FixedDiscountEffect
amountapply_per_linecap_per_invoicecap_per_perioddomain.GenerateInvoiceRequest
billing_period_endbilling_period_startlocalesubscription_iddomain.HoldRequest
amountcurrencyCurrency is optional on the public hold API: when empty the wallet's currency is used. Reserve and other internal callers always pass it explicitly so a mismatch with the wallet's currency fails loudly.
expires_atmetric_keyreasonreference_idreference_typereverse_chargesubscription_idSubscriptionID and MetricKey are populated by the reserve service so the (subscription_id, metric_key) pair becomes queryable. The public hold API leaves them nil - those holds are not subject to the ingest-overlap check.
tax_ratetax_rule_iddomain.IngestEventRequest
customer_idexternal_cost_amountexternal_cost_currencyhold_ididempotency_keymetric_keyprice_keyM186 - required for keyed products
product_idquantitysubscription_idtimestampTimestamp is the moment the event occurred (when the customer consumed the unit). Optional — when absent or zero, the server stamps it from time.Now() at ingest. Backfill / historical imports set this explicitly to whatever the source recorded. Distinct from UsageEvent.IngestedAt, which is always the server-side ingestion instant.
wallet_currencyWalletCurrency optionally pins the event to a specific wallet. Shape parity with /reserve's wallet_currency. Validated at ingest: the wallet must exist for (customer_id, wallet_currency). NULL falls back to the customer's preferred-currency cascade at finalize — the pre-040 single-wallet path.
domain.Invoice
amount_dueamount_paidbilling_period_endbilling_period_startbuyer_referenceLeitweg-ID / PO number
created_atcurrencycustomer_idcustomer_profile_at_issueCustomerProfileAtIssue pins the buyer's CustomerType profile (BUSINESS / CONSUMER / UNKNOWN) at finalize time. Regenerate uses this snapshot (NOT live customer.CustomerType) so a later profile flip cannot retroactively re-classify a closed invoice's supply type or reverse-charge gating. Audit-layer addition for ADR-0004 Decision 4 (billing-audit workstream 11).
Nil for legacy invoices written before migration 007.
deleted_atdelivery_dateLeistungsdatum (§14 Abs. 4 Nr. 6)
due_dateidinvoice_numberinvoice_typeINVOICE, CREDIT_NOTE, CORRECTIVE
issue_exchange_rate_idissued_atlast_dunning_step_atlast_dunning_step_indexlocaleorganization_idpaid_atperiod_start_exchange_rate_idplan_idPlanID / PlanVersion stamp the plan-version snapshot pinned at finalize. Regenerate uses these (NOT live sub.PlanID/PlanVersion) to reproduce historical invoices byte-for-byte, satisfying ADR-0004 rule 4: "plan-version snapshot is immutable post-publish."
Sourced from the active subscription_plan_version_history row at the invoice's billing_period_start (or first segment's start - see pipeline_finalize.stampPlanSnapshot for the chosen anchor).
Nil for plan-less subscriptions (item-only billing).
plan_versionstatussubscription_idsubtotalsupplier_tax_numberDenormalized for rendering
supplier_vat_idDenormalized for rendering
supply_typeDOMESTIC, INTRA_EU_B2B, etc.
tax_category_codeEN 16931 BT-151
tax_exemption_reason"Reverse Charge §13b UStG" etc.
tax_point_dateSteuerentstehung
tax_totaltotalupdated_atdomain.InvoiceLine
AppliedPromotions holds the audit-layer snapshot of every promotion that touched this line's subtotal at finalize. Regenerate reads these (NOT the live promotion catalog) and replays the cents verbatim. Per ADR-0004 Decision 4 and billing-audit workstream 10: voiding or editing a promotion does not change historical totals.
charge_ledger_idChargeLedgerID back-references the single charge_ledger row that produced this line when no collapse happened. Nil for lines built by the resolver-at-invoice-time path (still the default for SEAT / USAGE / ADD_ON / proration as of PR 2), for lines that merged multiple ledger rows, or for manually edited lines. Persisted in invoice_lines.charge_ledger_id; the authoritative reverse mapping is charge_ledger.invoice_line_id (set inside the same tx as the invoice insert).
created_atdescriptionfx_policy_appliedidinvoice_idline_typeorganization_idperiod_endperiod_startprice_keyprice_key_display_nameprice_version_idproduct_idquantitysegment_exchange_rate_idsubtotaltax_amounttax_category_codeEN 16931 BT-151: S, Z, E, AE, K, G, O
tax_exemption_reasonBT-120: per-line reason text
tax_ratetax_rule_idtax_typeunit_pricedomain.InvoiceLineAtom
atom_indexbinding_version_idcreated_atexchange_rate_idfx_policy_appliedidinvoice_line_idmeter_version_idMeterVersionID + BindingVersionID pin the meter and product-meter binding shapes (function, filter_tree, window_spec, pricing_var_name, overlay_filters) used at finalize time. On Regenerate the BindingResolver short-circuits to these versions so a later mutation of the meter or binding cannot retroactively reinterpret historical usage. Nil for non-usage atoms. See ADR-0004 Decision 4 and billing-audit workstream 02.
organization_idperiod_endperiod_startprice_keyprice_key_display_nameprice_version_idquantitysubtotaltax_amounttax_ratetax_rule_idunit_pricedomain.InvoiceLineAtomTaxComponent
amountatom_idbasecomponent_indexidis_compoundorganization_idratetax_rule_idtax_typedomain.InvoiceLineAtomTier
amountatom_ididlower_boundorganization_idquantitytier_indextier_labelunit_priceupper_bounddomain.InvoiceLineType
domain.MergeCustomerRequest
source_customer_idstrategytarget_customer_iddomain.MergeResult
customer_scoped_prices_countinvoices_countpayment_methods_countpromotion_redemptions_countsource_customer_idsubscriptions_counttarget_customer_idusage_events_countwallets_merged_countwallets_moved_countdomain.MeterBreach
action_event_typeaction_kindaction_targetcomparatordelivered_atidmeter_idmeter_keyobserved_valueoccurred_atorganization_idproduct_idsubscription_idthreshold_namethreshold_valuewindow_endwindow_startdomain.MigrateSubscribersRequest
modeproration_strategyscheduled_attarget_versiondomain.MinimumSpendCondition
amountmax_amountscopedomain.OrgTaxProfile
Registered office address
legal_nameFull registered company name
oss_countryISO 3166-1 alpha-2 of OSS registration
tax_numberSteuernummer (DE: XXX/XXX/XXXXX)
tax_regimeSTANDARD, KLEINUNTERNEHMER, OSS, NON_EU
vat_idUSt-IdNr (DE: DE123456789)
domain.PaymentMethod
account_last4bank_namecreated_atcustomer_iddisplay_brandDisplay fields populated by the provider sync (card brand / last4 / expiry for card methods, bank name / account_last4 for DD methods). All optional - cards leave bank_* nil and vice versa. Carried as pointers so the JSON omits the key entirely when the column is NULL.
exp_monthexp_yearidis_defaultlast4organization_idproviderprovider_idstatustypeupdated_atdomain.PaymentMethodType
domain.PaymentOutcome
domain.PercentageDiscountEffect
apply_per_linecap_per_invoicecap_per_periodmax_discountratedomain.Plan
archived_atcreated_atdeleted_atdeprecated_atdescriptionexternal_idhead_version_ididnameorganization_idpublic_descriptionpublished_atpublished_byrequires_continuous_coveragestatusupdated_atversiondomain.PlanPricePreviewLine
currencyerrorincluded_quantityIncludedQuantity is the operator-configured floor that's bundled into the base subscription price. Non-zero only for SEAT products with included_quantity set. The line displays the TOTAL quantity (Quantity above) but TotalAmount is computed from (Quantity - IncludedQuantity) so the customer doesn't pay for seats they already get with the base price.
pricing_modelproduct_idproduct_nameproduct_typequantitytax_ratedomain.PlanPricePreviewRequest
billing_interval_unitcurrencyCurrency forces price resolution into a specific currency when the plan exposes prices in multiple ones. Nil falls back to the resolver's implicit pick (customer preferred currency → first available). When set, the field flows verbatim into the per-line ResolvePriceRequest the preview service builds.
customer_idplan_iddomain.PlanProduct
created_atidincluded_quantityorganization_idplan_idproduct_idrollover_enabledrollover_expiry_periodsrollover_maxdomain.PlanProductCostSummary
cost_iddescriptionkeyrequires_continuous_coveragescopedomain.PlanProductMeterBindingSummary
binding_idmeter_idmeter_keymeter_namepricing_var_namerolerollover_eligibledomain.PlanProductPriceSummary
country_codecurrencydisplay_nameM186 - customer-facing label for the price_key
list_priceprice_idprice_keyprice_version_idPriceVersionID pins this summary entry to the exact PriceVersion row that was active when the plan was published. Without this pin the plan's "snapshot" only captured price values (list_price etc.) — a later head-version change on the same price would invalidate the snapshot's intent silently. Nullable for back-compat with pre-Step-8 plan_version_products rows.
domain.PlanVersion
idorganization_idplan_idpublished_atversiondomain.PlanVersionProduct
included_quantitypricing_modelproduct_idproduct_nameproduct_typeproduct_version_idProductVersionID pins the ProductVersion row in force when the plan was published — closes the "plans pin products" invariant. Nullable for back-compat with rows written before Step 8.
rollover_enabledrollover_expiry_periodsrollover_maxdomain.Price
archived_atcountry_codecreated_atcurrencycustomer_iddeleted_atdisplay_nameeffective_fromeffective_tohead_version_ididkindlist_priceorganization_idplan_idplan_versionprice_keyproduct_idrequires_continuous_coveragestatusupdated_atvalid_fromvalid_toversiondomain.PriceFormula
created_atexpressionhead_version_idHeadVersionID points at the currently-active row in
price_formula_versions. Nil only during a brief window between
INSERT INTO price_formulas and the auto-publish of v1.
idis_systemnameorganization_idupdated_atversiondomain.PriceTier
created_atflat_amountflat fee (STAIRCASE)
FormulaDefaults supplies per-tier overrides of the formula's
declared variable defaults. Numeric values; the JSON column is
{} by default. Empty map ⇒ "use formula defaults / require at
runtime" — the evaluator never silently substitutes 0 here.
formula_idFormulaID points to a price_formulas row. When set, the runtime evaluator uses formula.expression and merges variables from (transaction context > FormulaDefaults > formula declared defaults), erroring with MissingFormulaVariablesError if any variable lands unresolved. Either FormulaID or RateExpression drives the tier rate; UnitAmount is the fallback when both are nil.
idprice_idrate_expressionsimple arithmetic: "cost * 1.15 + 200"
tier_orderunit_amountper-unit rate (TIERED, VOLUME)
up_tonil means infinity (last tier)
updated_atdomain.PriceVersion
CostVersionPins maps each cost.
country_codecurrencycustomer_iddisplay_namesnapshot of prices.display_name at publish (M186)
effective_fromeffective_toFormulaVersionPins maps each tier.FormulaID referenced by this price-version's tiers to the price_formula_version_id active at publish time. Phase 2 of formula versioning (Phase 1 deref'd FormulaID to the current head; this lets replay use the historical formula version instead). Map key is formula_id stringified — same shape as cost_version_pins. Empty when no tier references a formula.
idkindlist_priceorganization_idplan_idprice_idprice_keyproduct_idpublished_atpublished_byversiondomain.Product
archived_atnamed cost variants (eager-loaded)
created_atdeleted_atdeprecated_atdescriptionexternal_idhead_version_ididinvoiceable_standaloneInvoiceableStandalone is the Phase 2.5 curation flag. When true, the product is eligible to appear in the manual-invoice product picker and the Phase 2 line resolver accepts it. When false (the default), the product is subscription-only / off-catalog and the resolver rejects attempts to put it on a manual invoice line. Edited live on the parent (Bucket-A); no version bump.
nameorganization_idpricing_modelpublic_descriptionpublished_atpublished_byrequires_continuous_coveragerequires_product_idsstatustax_categoryDEFAULT, REDUCED, ZERO, EXEMPT
typeupdated_atversiondomain.ProductAllowanceState
billable_usageconsumed_allowancecredit_allowanceplan_allowanceproduct_idproduct_nameremaining_allowancerollover_allowancetotal_allowancetotal_usagedomain.ProductCombinationCondition
grace_period_daysnil/0 = strict; N = allow N-day window
product_idsdomain.ProformaInvoice
billing_period_endbilling_period_startcurrencycustomer_idsubscription_idsubtotaltax_totaltotaldomain.ProformaInvoiceLine
descriptionline_typeperiod_endperiod_startproduct_idquantitysubtotaltax_amounttax_ratetax_typeunit_pricedomain.Promotion
application_timingarchetypearchived_atbudget_behaviorcodecondition_modecreated_atcurrent_budget_usedcurrent_redemptionsdeleted_atdescriptionhead_version_ididis_phasedmax_budgetmax_redemptionsmax_redemptions_per_customernameorganization_idpopulated when is_phased=true; single Default phase otherwise
prioritypublic_descriptionpublished_atpublished_byrequires_continuous_coveragestackablestatusupdated_atvalid_fromvalid_toversionvisibilitydomain.PromotionArchetype
domain.PromotionPhase
allow_regressioncreated_atidis_terminalmin_dwell_daysnameorganization_idphase_orderphase_transition_timingpromotion_idupdated_atdomain.PromotionPreviewResponse
effect_summaryeligiblepromotion_idpromotion_namereasondomain.PromotionRedemption
applied_atarchetypecreated_atcurrent_phase_idWelle 4: which phase the redemption is in
customer_iddormant_reasonbrief reason text, e.g. "eligibility_lost"
dormant_sincepopulated when status=dormant
expires_atfree_periods_remainingnil = unused; DECIMAL so mid-cycle pro-rated invoices consume fractional amounts (e.g. 0.5 for a half-period line)
grace_period_expires_atfor pending redemptions
idorganization_idphase_entered_atwhen the current phase was entered
promotion_idpromotion_namepromotion_versionstatussubscription_idupdated_atdomain.RateTable
created_atdefault_valuedeleted_atdescriptionhead_version_ididlifecycle_statusdraft | active | archived
nameon_missing_keyerror | zero | default_value
organization_idrequires_continuous_coverageslugtable_typelookup | bracket
updated_atdomain.RateTableVersion
archived_atcreated_ateffective_fromeffective_toidnotepublished_atpublished_byrate_table_idstatusdraft | active | archived
versiondomain.RegenerateInvoiceResult
missing_product_idsnew_product_idsoriginal_invoice_idsubtotal_deltatax_deltatotal_deltadomain.RemoveItemRequest
effective_atEffectiveAt (Pass B) — when this item stops being billed. nil → now (immediate close). Future timestamp queues a clean effective_to set at that boundary; segmenter excludes the row from [T, periodEnd) but keeps it for [periodStart, T). Past timestamps are rejected.
proration_modesubscription_item_iddomain.ResolvePriceRequest
at_price_version_idat_timecountry_codecurrencycustomer_idplan_idplan_versionPlanVersion narrows PLAN_OVERRIDE matching to overrides created for this exact plan version. Required when PlanID is set — the resolver returns an error otherwise. Sub-scoped callers pass sub.PlanVersion; catalog callers passing PlanID also pass the plan's current head version.
price_keyproduct_idquantitysubscription_iddomain.SetVersionTrackRequest
modestrategydomain.SimulateRequest
billing_period_endbilling_period_startcustomer_idpromotion_idssubscription_iddomain.Subscription
auto_renewbilling_anchor_daybilling_interval_countbilling_interval_unitbilling_timingcancellation_reasonDiscriminates how the subscription reached CANCELLED. Nil unless status == CANCELLED. See CancellationReason constants.
cancelled_atcreated_atcurrencycurrent_period_endcurrent_period_startcurrent_phase_idCurrentPhaseID is the cached pointer to the ACTIVE phase row; derivable but kept hot for the invoice path. Set during ActivatePhase, cleared during Cancel.
customer_iddeleted_atdescriptionidItems is the canonical product list for this subscription. Populated by GetByID / List from subscription_items (M116+).
nameorganization_idpayment_terms_daysPhases is the chain of phase records (M116+: pure billing-mode markers — items don't live on phases anymore).
plan_idPlan-or-product XOR (M102+). Exactly one of PlanID/ProductID set (or both null while DRAFT and undecided). PlanVersion/ProductVersion pin the snapshot; VersionTrackMode/VersionChangeStrategy govern auto upgrades when a new version of the plan or product is published.
plan_versionproduct_idproduct_versionpublic_descriptionSettings overrides - NULL = inherit from the next layer (customer → org → default). See subscription_settings.go for the resolver.
start_atStartAt is required when StartTrigger == start_date; null otherwise.
start_triggerStartTrigger says what activates a DRAFT subscription. See StartTrigger constants. Default for legacy rows is "immediate".
started_atStartedAt is the zero time while in DRAFT; populated on first transition into ACTIVE. Use !StartedAt.IsZero() to test "started".
statusupdated_atversion_change_strategyversion_track_modedomain.SubscriptionAddOn
added_atcreated_atidorganization_idproduct_idquantityremoved_atsubscription_idupdated_atdomain.SubscriptionItem
auto_renewcreated_atcurrent_term_endcurrent_term_starteffective_fromEffectiveFrom / EffectiveTo: the temporal window this row is billable for (Pass B). EffectiveTo NULL = open-ended / currently billable. Quantity changes and item add/remove are append-only — the prior row gets EffectiveTo=T, a new row covers [T, NULL).
effective_toidorganization_idprice_keyproduct_idproduct_version_idProductVersionID pins the item to a specific product version. nil = follow products.head_version_id (default).
quantityrenewal_anchor_atsubscription_idterm_countterm_unitTerm* fields make item-level commitment first-class. All optional; NULL means "follows the subscription's cadence" (the pre-R2 default). When set, the invoice pipeline amortizes the item's charges over the term instead of treating it as a normal per-period recurring line.
updated_atdomain.SubscriptionItemInput
auto_renewAutoRenew is only meaningful when term_* is set. nil = inherit the BillingIntervalUnit default ("auto-renew at term_end"). false = one-shot purchase (domain registration, perpetual licence).
price_keyproduct_idproduct_version_idProductVersionID pins the item to a specific product version. nil = follow product head version (default).
quantityterm_countterm_unitOptional per-item term. When set, the invoice pipeline bills the term upfront (R4) and the segmenter splits at term edges (R2's subscriptionItemTermBoundarySource). Leave nil for items that follow the subscription's invoice cadence — today's default.
term_unit + term_count are an XOR: both set or both nil. The constraint subscription_items_term_pair_check enforces the same at the DB layer.
domain.SubscriptionPhase
auto_transitioncompleted_atcreated_atdunning_stageDunning stage tracking (M115+). Populated only when phase_kind = 'dunning'; the WARNED → GRACED → SUSPENDED progression doesn't re-enter the lifecycle FSM, it just advances on the phase row.
dunning_stage_atduration_unitduration_valueend_atend_kindEnd policy (M103+). When the phase reaches this boundary the AutoTransition flag (above) decides whether the next pending phase starts automatically.
ends_atderived; mirrors EndAt for end_kind=date or computed from duration
idorganization_idphase_kindA phase is purely a billing-mode marker: which condition is the
subscription operating under right now (trial / standard / paused /
dunning / setup) + when does it end. Operator-facing chrome (name,
translations, descriptions), per-phase setting overrides, arbitrary
metadata, and the legacy duration_days / phase_type fields all
lived here once and have been dropped — phases handle conditions and
nothing else (M118 trim).
phase_orderstarted_atstatussubscription_iddomain.SubscriptionSettings
auto_finalize_invoicesdefault_proration_modeline_groupingprice_resolution_policysend_payment_reminderstax_inclusivedomain.Tag
archived_atcolorcreated_atdeleted_atdescriptionentity_typeidnameorganization_idupdated_atusage_countdomain.TaggableEntityType
domain.TaxRule
applies_to_customer_typesOptional discriminators. Empty/nil means "applies to all" - wildcard semantics let EU VAT rules (which leave these unset) keep working while non-EU sales-tax rules can scope themselves to specific buyer types, product categories, or supply types.
applies_to_product_categoriesapplies_to_supply_typesapply_orderarchived_atcreated_atidinclusiveis_compoundjurisdiction_countryjurisdiction_regionorganization_idpublished_atpublished_byraterequires_continuous_coveragestatustax_typeupdated_atvalid_fromValidFrom / ValidTo are plain dates (no clock, no zone). Tax law boundaries land on calendar days in the relevant jurisdiction; attaching a time-of-day to "this rate applies from 2024-06-15" silently shifts the day in non-UTC zones (Unified Date/Time plan, Layer 10). Postgres column type is DATE.
valid_toversiondomain.TestClock
created_atfrozen_atidnamestatusupdated_atworkspace_iddomain.TestPaymentSimulation
created_atidoutcomepayment_method_idworkspace_iddomain.ThresholdAction
event_typefor emit_event
kindtargetURL or channel
domain.Transaction
customer_iddirectionidinvoice_idkindoccurred_atraw_idreferencesourcestatussubscription_idsummarywallet_iddomain.TransactionKind
domain.UpdateCostRequest
descriptioneffective_atADR-0006 edit-as-publish controls.
requires_continuous_coverageBucket-A: policy flag stored on the parent costs row. Edits
propagate live; no cost_versions row is created. Pointer so we
can distinguish "not provided" from "set to false".
save_as_draftdomain.UpdateCustomFieldDefinitionRequest
auditabledefault_valuedescriptiondisplay_nameexpected_versionfield_groupshow_in_tablesort_orderstatusvisibilitywrite_accessdomain.UpdateCustomerRequest
auto_validate_vatAutoValidateVAT - see CreateCustomerRequest.AutoValidateVAT. Same semantics on update: nil = default behavior, false = skip the auto-trigger after update, true = request it (still gated by org and per-customer disable flags).
billing_modelcustomer_typedefault_auto_topup_amountdefault_auto_topup_enableddefault_credit_limitdefault_low_balance_thresholddefault_max_balancedefault_max_single_creditdisabled_providerseinvoice_emailemailexternal_idlocalenamepayment_terms_dayspeppol_idprefer_einvoicepreferred_currencypreferred_providerstatusvat_validation_disabledvat_validation_disabled_reasondomain.UpdateInvoiceLineRequest
descriptionperiod_endperiod_startquantitytax_rateunit_pricedomain.UpdateInvoiceRequest
billing_period_endbilling_period_startdue_datelocaledomain.UpdateMeterRequest
dedup_key_pathdimensionseffective_atADR-0006 edit-as-publish controls.
event_schemafunctionlate_event_policynamenegative_allowedsave_as_draftunique_by_fieldunit_currency_fieldunit_labelvalue_fielddomain.UpdateOrgTaxProfileRequest
legal_nameoss_countrytax_numbertax_regimevat_iddomain.UpdatePaymentMethodRequest
is_defaultproviderprovider_idstatusdomain.UpdatePhaseRequest
auto_transitionduration_unitduration_valueend_atend_kinddomain.UpdatePlanRequest
descriptioneffective_atADR-0006 edit-as-publish controls.
expected_versionexternal_idnameProductVersionPins lets the operator override which product version each attached product is pinned to when this publish snapshots the plan. Map shape: product_id → product_version_id. Missing products (i.e. attached but not in the map) snap at the product's current head as before — so this field is purely additive: nil ≡ today's behaviour, non-nil applies the override per entry. Mirrors the products-page ChildVersionPins payload. The publish path validates every entry against the plan's attached products and the referenced product_versions row.
public_descriptionsave_as_draftstatusdomain.UpdatePriceRequest
country_codecurrencydisplay_nameM186 - customer-facing label
effective_atADR-0006 edit-as-publish controls. effective_at and save_as_draft are mutually exclusive (400 on both).
effective_fromEffectiveFrom, when set, lands as the new price version's effective_from (and the prior head's effective_to). The scheduler injects scheduled_at here on release so a future-dated change produces a future-effective version row. Unset = now().
ADR-0006: EffectiveAt is the unified API name across all versioned entities. For the price entity it aliases EffectiveFrom — handlers fold EffectiveAt into EffectiveFrom before calling repo.Update so the scheduler-internal hot path keeps a single source of truth.
expected_versionlist_pricesave_as_draftTiers, when non-nil, replaces the tier set on the new price version. nil means "carry the previous version's tiers forward"; an empty slice means "this version has no tiers".
domain.UpdateProductMeterBindingRequest
effective_atADR-0006 edit-as-publish controls.
included_quantity_sourceoverlay_dimensions_keyedpricing_var_namerolerollover_eligiblesave_as_draftdomain.UpdateProductRequest
ChildVersionPins, when non-nil, requests a new product_versions row whose pin maps embed the supplied child-version selections. Phase 2.D stage-mode publish path: the operator reviews drift in stage mode, picks a version per child (or accepts head), and the FE ships the resulting map here. Treated as a Bucket-B trigger by the repo — any non-nil value bumps products.version and inserts a fresh product_versions row. Missing children fall back to their heads via insertProductVersionTxWithPins's merge.
descriptioneffective_atADR-0006 edit-as-publish controls. effective_at and save_as_draft are mutually exclusive (400 on both). When both are nil/false, a versioned change publishes ACTIVE immediately; a bookkeeping-only change updates the header in-place.
expected_versionexternal_idinvoiceable_standaloneInvoiceableStandalone is the Phase 2.5 curation flag. Pointer so nil means "leave unchanged"; a non-nil bool flips the flag.
namepricing_modelpublic_descriptionrequires_product_idssave_as_draftstatustax_categorydomain.UpdatePromotionRequest
application_timingarchetypebudget_behaviorcodecondition_modedescriptioneffective_atADR-0006 edit-as-publish controls.
expected_versionis_phasedmax_budgetmax_redemptionsmax_redemptions_per_customernamefull replacement when non-nil; draft-only
prioritypublic_descriptionsave_as_draftstackablevalid_fromvalid_tovisibilitydomain.UpdateRateTableRequest
default_valuedescriptioneffective_atADR-0006 edit-as-publish controls.
nameon_missing_keyrequires_continuous_coveragesave_as_draftdomain.UpdateSubscriptionRequest
descriptionnamepublic_descriptiondomain.UpdateTaxRuleRequest
applies_to_customer_typesnil means "no change". Empty slice means "clear filter / wildcard".
applies_to_product_categoriesapplies_to_supply_typesapply_ordereffective_atADR-0006 edit-as-publish controls.
inclusiveis_compoundjurisdiction_countryjurisdiction_regionraterequires_continuous_coveragesave_as_draftstatustax_typevalid_fromvalid_todomain.UpdateVerificationStatusRequest
statusdomain.UpdateWalletSettingsRequest
auto_topup_amountauto_topup_enabledauto_topup_payment_method_idcredit_limitlow_balance_thresholdmax_balancemax_single_creditdomain.UsageAggregateBucket
bucketSumQuantity totals are decimal; we send them as strings so a 20,8 numeric round-trips without f64 loss.
domain.UsageAggregateResponse
bucketgroup_bymetricseriessinceuntildomain.UsageEvent
customer_idexternal_cost_amountexternal_cost_currencyididempotency_keyingested_atmetric_keyorganization_idprice_keyproduct_idquantitysubscription_idtimestampwallet_currencyWalletCurrency, when non-nil, pins the event to a specific wallet at finalize time: the meter evaluator groups by this column and the resulting invoice routes to wallet (customer_id, *WalletCurrency). NULL falls back to the customer's preferred-currency cascade — identical to pre-040 behaviour, so legacy events keep working.
domain.ValidatePromotionRequest
coupon_codecustomer_idinvoice_subtotalsubscription_iddomain.ValidationRules
max_lengthmax_valuemin_lengthmin_valueregex_messageregex_patternrequiredunique_per_orgdomain.VatValidationStatus
domain.Wallet
auto_topup_enabledcreated_atcurrencycustomer_ididis_primarymodeorganization_idpromotional_balance_expires_atupdated_atdomain.WalletHold
captured_atcreated_atcurrencyexpires_atidmetric_keyorganization_idreasonreference_idreference_typeresolved_atreverse_chargestatussubscription_idSubscriptionID and MetricKey identify the usage stream this hold reserves capacity for. Set by the reserve service so the usage event ingest path can detect overlap (Phase D dedup); nil for non-subscription holds like deposits.
tax_ratetax_rule_idvoided_atwallet_iddomain.WalletTransaction
created_atcreated_byidorganization_idreasonreferencereverse_chargesourcetax_ratetax_rule_idtypewallet_iddomain.WalletTransactionSource
domain.Window
durationSLIDING / TUMBLING
kindsession_gapSESSION
domain.WindowKind
domain.Workspace
active_test_clock_idcreated_atidmodenameorganization_idslugstatusupdated_atdomain.WorkspaceCurrency
billing_enabledcatalog_enabledcreated_atcurrency_codeupdated_atworkspace_idinternal.dunning.DunningPolicy
created_atdeleted_atidis_activenameorganization_idplan_idupdated_atinternal.dunning.DunningStep
actiondays_after_dueemail_eventevent name for send_email action
einvoicing.Finding
messagerule_idseverityxpathinternal.invoice_template.Branding
company_namelogo_heightmm
logo_urllogo_widthmm
internal.invoice_template.CreateInvoiceTemplateRequest
descriptiondocument_typesnameinternal.invoice_template.InvoiceTemplate
created_atdeleted_atdescriptiondocument_typesidis_defaultis_systemnameorganization_idstatusupdated_atversioninternal.invoice_template.TemplateBlock
idpropertiesshow_ontypevisibleinternal.invoice_template.TemplateDocument
schema_versioninternal.invoice_template.Theme
accent_colorhex
background_colorcurrency_codefont_familyfont_sizept
line_heightlocalemargin_bottommargin_leftmargin_rightmargin_topmm
monochrome_on_printpage_orientationpage_sizeprimary_colorhex
secondary_colorhex
text_colorhex
internal.invoice_template.UpdateInvoiceTemplateRequest
descriptiondocument_typesexpected_versionnamestatusinternal.milestone.BillingMilestone
created_atdescriptionidinvoice_idnameorganization_idpercentageproduct_idstatussubscription_idtrigger_datetrigger_typetriggered_atupdated_atinternal.milestone.CreateBillingMilestoneRequest
descriptionnamepercentageproduct_idsubscription_idtrigger_datetrigger_typeinternal.organization.CreateOrganizationRequest
billing_emaildefault_currencydefault_localenamesluginternal.organization.Invitation
created_atemailidinvited_byorganization_idrole_namesworkspace_idinternal.organization.UpdateOrganizationRequest
billing_emailbusiness_addressdefault_countryDefaultCountry: ISO 3166-1 alpha-2 (two uppercase letters) or empty string to clear. Mirrors the public-checkout cascade described on Organization.DefaultCountry.
default_currencydefault_date_formatdefault_first_day_of_weekdefault_languageLocale & formatting cascade defaults — feed the per-field cascade users see in the dashboard. Each nullable; empty payload leaves the stored value untouched (COALESCE in UPDATE below).
default_localedefault_number_formatdefault_timezonelegal_namenamephonesupport_emailtax_inclusiveTaxInclusive: tenant default for the public checkout page's tax-display toggle. Same nullable-pointer convention as the rest of this struct; pass NULL on the wire (i.e. omit the field) to leave the stored value unchanged.
tax_registration_numberinternal.organization_security.IDPSummary
aliasdisplay_nameenabledhide_on_loginprovider_idinternal.organization_security.OrgSecuritySettings
allowed_email_domainsallowed_idpscreated_atjit_default_rolejit_enabledorganization_idrequire_mfasession_timeout_secondsupdated_atinternal.organization_security.UpdateOrgSecuritySettingsRequest
allowed_email_domainsallowed_idpsjit_default_rolejit_enabledrequire_mfasession_timeout_secondsinternal.organization_team.Member
emailnamerolesstatusorganization_members.status: "active", "invited", ...
user_idinternal.organization_team.Role
assigned_countdescriptionidis_default_for_new_joinersis_systemnamepermissionsinternal.payment.CreatePaymentGatewayConfigRequest
config{ "api_key": "sk_...", "webhook_secret": "whsec_..." }
display_namemodeprovidersupported_currenciessupported_methodsinternal.payment.PaymentGatewayConfig
configencrypted provider config
created_atdisplay_nameidis_defaultis_enabledmodetest, live
organization_idproviderstripe, gocardless, mollie, adyen
supported_currenciessupported_methodsupdated_atinternal.payment.UpdatePaymentGatewayConfigRequest
configdisplay_nameis_defaultis_enabledmodesupported_currenciessupported_methodsinternal.payment_manual.ManualPaymentSource
internal.payment_manual.RecordManualPaymentRequest
amountnotereceived_atreferencesourceinternal.payment_settlement.GenerateSettlementLine
amountdescriptionline_typereference_idinternal.payment_settlement.GenerateSettlementRequest
currencycustomer_idperiod_endperiod_startinternal.payment_settlement.Settlement
created_atcurrencycustomer_iddeleted_atfinalized_atgross_earningsidnet_payoutorganization_idpaid_atperiod_endperiod_startsettlement_numberstatustotal_fee_taxtotal_feesupdated_atinternal.payment_settlement.SettlementLine
amountcreated_atdescriptionidline_typeorganization_idreference_idreverse_chargesettlement_idtax_amounttax_category_codetax_ratetax_rule_idinternal.payment_settlement.SettlementLineType
internal.preferences.UpdateUserPreferencesRequest
currencydate_formatfirst_day_of_weeklanguagelocalenumber_formatthemetimezoneinternal.preferences.UserPreferences
created_atcurrencyCurrency: per-user override of the org's default_currency. ISO 4217
code, e.g. "EUR". Drives
date_formatfirst_day_of_weeklanguageLanguage: UI translation key (e.g. "de", "en"). Distinct from Locale, which drives number/date format grammar — a user may legitimately want German UI with Swiss number formatting.
localenumber_formatthemetimezoneupdated_atuser_idinternal.reserve.ReserveRequest
customer_idexternal_cost_amountExternalCostAmount + ExternalCostCurrency feed the resolver's
cost.* formula-variable namespace. Required when the resolved
price's tier expression references cost.
external_cost_currencyhold_expires_atHoldExpiresAt is the TTL of the hold the reserve creates. If
the caller doesn't capture the hold by this instant the wallet
auto-releases it. Renamed from expires_at in the shape
cleanup — the old name was ambiguous about what expires.
idempotency_keymetric_keyprice_keyproduct_idquantitysubscription_idwallet_currencyWalletCurrency optionally pins the hold to the customer's wallet in this currency. The one-wallet-per-(customer, currency) invariant (idx_wallets_customer_currency) makes the lookup unambiguous. When unset the reserve falls back to the customer's primary wallet (the row with is_primary=true). Either lookup fails with a clear DomainError when the wallet doesn't exist — no auto-routing across currencies.
internal.reserve.ReserveResponse
blocked_reasonscan_proceedexpires_atfx_rate_idhold_idresolved_currencytax_ratetax_rule_idwallet_idPhase F: cross-flow reconciliation handles. Callers persist these alongside their internal record so preview/reserve/invoice numbers can be tied back to the same tax rule and FX rate snapshot.
internal.scheduler.CreateScheduledChangeRequest
change_payloadchange_typecreated_bydepends_on_change_identity_identity_typeentity_version_at_scheduleimmediatenotification_configrelease_strategyrollback_windowscheduled_atinternal.scheduler.ScheduledChange
change_payloadchange_typecreated_atcreated_bydepends_on_change_identity_identity_typeentity_version_at_scheduleidnotification_configorganization_idprevious_staterelease_strategyreleased_atrollback_windowrolled_back_atscheduled_atstatusupdated_atinternal.scheduler.ScheduledChangeDiff
afterbeforechanged_fieldsentity_identity_typeinternal.scheduler.ScheduledChangeStatus
internal.scheduler.ScheduledEntityType
internal.scheduler.UpdateScheduledChangeRequest
change_payloadnotification_configrelease_strategyrollback_windowscheduled_atinternal.segmentation.CreateSegmentRuleRequest
applied_tag_idevaluation_schedulemetricoperatorvalueinternal.segmentation.Metric
internal.segmentation.SegmentRule
applied_tag_idcreated_atdeleted_atevaluation_scheduleidis_activemetricoperatororganization_idupdated_atvalueinternal.subscription.DriftCandidateVersion
effective_fromeffective_tolifecycleversioninternal.subscription.SubscriptionDrift
current_versionlatest_published_atlatest_scheduled_atlatest_versionplan_idproduct_idsub_idtrack_modeversions_behindinternal.webhook.CreateWebhookEndpointRequest
descriptionevent_typessecret_idurlinternal.webhook.CreateWebhookSecretRequest
descriptionentity_identity_typesigning_methodinternal.webhook.UpdateWebhookEndpointRequest
clear_secretdescriptionevent_typessecret_idstatusurlhandler.AttachIDPRequest
aliasdisplay_nameenabledhide_on_loginprovider_idhandler.BindingVersionSnapshot
binding_idcreated_ateffective_fromeffective_toidorganization_idoverlay_filterspricing_var_nameversionworkspace_idhandler.BulkUpgradeRequest
forcescheduled_atstrategysubscription_idstarget_plan_versiontarget_product_versionhandler.KeycloakEvent
clientIderroripAddressorganizationIdrealmIdsessionIdtimetypeuserIdhandler.MeResponse
active_orgactive_workspacerealm_roleshandler.MeterVersionSnapshot
created_ateffective_fromeffective_tofilter_treefunctionidmeter_idorganization_idvalue_fieldversionwindowworkspace_idhandler.OrganizationResponse
billing_emailbusiness_addresscreated_atdefault_currencydefault_date_formatdefault_first_day_of_weekdefault_languagedefault_localedefault_number_formatdefault_timezoneidlegal_namenamephoneslugstatussupport_emailtax_registration_numberhandler.ProductVersionSnapshot
descriptioneffective_fromeffective_toexternal_ididmetadatanameproduct_idproduct_statusproduct_typepublished_atpublished_byrelease_strategystatusversionhandler.PromotionVersionSnapshot
application_timingbudget_behaviorcodedescriptioneffective_fromeffective_toidmax_budgetmax_redemptionsnameprioritypromotion_idpromotion_statuspublished_atpublished_byrelease_strategystackablestatusvalid_fromvalid_toversionvisibilityhandler.SCIMListResponse
itemsPerPageschemasstartIndextotalResultshandler.SCIMUser
activedisplayNameidschemasuserNamehandler.SubscriptionPlanVersionHistoryRow
change_reasoncreated_ateffective_fromeffective_toidplan_idplan_versionproduct_idproduct_versionsubscription_idhandler.UpdateIDPRequest
display_nameenabledhide_on_loginprovider_idhandler.UserProfileResponse
emailidnamepictureroleRole is the comma-joined list of org-scoped role names the user holds in the caller's active org (bc.OrganizationID). Empty when the target user has no active membership there.
statushandler.VersionRow
archived_reasoncreated_atcreated_byeffective_fromeffective_toidID is the *_versions.id UUID. Phase 2.D needs it so the FE stage-mode chip can wire selection→pin map without a separate number→ID lookup; older clients can ignore the field.
published_atstatususage_countversionhandler.chargeInvoiceResponse
attempt_idattempt_numbercheckout_urlCheckoutURL is the provider's hosted-checkout URL the frontend must redirect the customer to in order to complete the payment. Empty for providers that don't support a hosted flow (callers should branch on this and surface a different "add payment method first" UX instead).
invoice_idproviderscheduled_forhandler.createAPIKeyRequest
allowed_ipsnil/empty = unrestricted
expires_atnil = non-expiring
key_typesk_live | sk_test; defaults to mode
namescopesnil/empty = all-access
handler.createAPIKeyResponse
allowed_ipscreated_atexpires_atidkeykey_prefixkey_typenamescopeshandler.documentResponse
byte_sizecontent_hashcontent_typecreated_atcredit_note_ididinvoice_idjurisdictionprofilequarantine_reasonsignedsyntaxhandler.findingResponse
found_atidmessageresolution_notesresolved_atrule_idrule_setseverityxpathhandler.generateResponse
byte_sizecontent_hashcreated_atdocument_idprofilequarantinedstorage_bucketstorage_keysyntaxhandler.updateProviderSettingsRequest
disabled_providerspreferred_providerhandler.walletTopupRequest
modepayment_method_idhandler.walletTopupResponse
client_secretdecline_codefailure_codefailure_messagemodenext_actionpayment_intent_idOff-session fields - populated when Mode == off_session.
session_idHosted Checkout fields - populated when Mode == hosted_checkout.
stateurl