// GENERATED. Do not change this line unless the file contains project specific changes. // DO NOT EDIT THIS FILE. Changes are overwritten on the next build. // Owner command: verbund.contract.types.generate // Edit instead: packages/werkstatt-shared/src/integration/codegen/verbund-contract-types.ts // Regenerate: pnpm --filter @warpgogol/werkstatt-shared exec node src/integration/codegen/verbund-contract-types.ts // sourceHash: 3f0373c2234d5b0b411d40565b41a01e89a60d5d528a1cfb0b26728412528e7d // Source: docs/specs/verbund-integration-spec-v0.1.5/schemas/{process-hint,acquisition-context,website-ingress}.schema.yaml // Generated by: PLAN-RFC-1238-01 (RFC-1238) — types derived byte-exact from the vendored Verbund contract. Do not hand-edit. /** Which system is authoritative for this phase. */ export type IngressProcessHintSystem = "werkstatt" | "personal_agent"; /** A non-authoritative statement of where a Party stands in some system's process. Lagebild stores it as Opportunity.state (opaque) and as an Interaction; it never interprets it (VID-004, VID-005). Phase values are tenant catalog entries, never an enumeration in this contract. */ export interface IngressProcessHint { readonly schema: "process-hint/v1"; /** Which system is authoritative for this phase. */ readonly system: IngressProcessHintSystem; /** Identifies the phase catalog the value belongs to, so two systems (or two tenants) never collide. Examples: `werkstatt:visitor-funnel/v1`, `personal-agent:client-case/`. */ readonly catalog_ref: string; readonly phase: string; /** Parallel sub-state where the source process has one (Personal Agent ClientCase.branch). */ readonly branch?: string | null; readonly previous_phase?: string | null; readonly changed_at: string; readonly reason?: string | null; } /** First-party UTM acquisition context carried by a website submission (website-ingress/v1, V05). Exactly six keys, allowlist-bounded values — non-PII by construction: no spaces, no `@`, no free text, and platform click identifiers (fbclid, gclid, …) are not expressible here. Producers validate strictly (metads utm-context.schema.json); Lagebild reads tolerantly — a malformed block is stripped to an evidence note, never a rejection of the inquiry. */ export interface AcquisitionContext { readonly schema: "acquisition-context/v1"; readonly utm_source: string; readonly utm_medium: string; readonly utm_campaign: string; readonly utm_id: string; readonly utm_content: string; readonly utm_term: string; } export type IngressInteractionKind = "inquiry" | "contact_message" | "callback_request" | "appointment_request" | "other"; export type IdentityClaimType = "person_name" | "organization_name" | "email" | "phone" | "website" | "postal_address" | "other"; export interface IdentityClaim { readonly claim_type: IdentityClaimType; readonly value: string | Record; readonly label?: string | null; } export interface IngressOrigin { readonly page_uri?: string | null; readonly referrer_uri?: string | null; readonly locale?: string | null; } export type PolicyAssertionKind = "consent" | "objection" | "preference"; export interface ExplicitPolicyAssertion { readonly kind: PolicyAssertionKind; readonly purpose: string; readonly channel?: string | null; readonly value: boolean; readonly statement_ref?: string | null; } /** Legacy opaque-code attribution (Lagebild RFC-0016). Bounded-window tolerant reader for sites not yet migrated to the slug model — new sites emit referral_partner_* instead; removal condition lives in werkstatt ADR-0106. */ export interface IngressAttribution { readonly referral_code: string; readonly first_touch_at: string; } /** The Werkstatt → Lagebild ingress payload (POST /v1/ingress) — the H01/H02 carrier. Reconciled in spec v0.1.2 with the live wire contract: referral partner attribution (werkstatt RFC-1198) and the RFC-1222 receipt-provenance fields are declared here so the artifact of record can never silently reject producer payloads (AMD-WERKSTATT-02). Lagebild reads this contract tolerantly: a referral value that matches nothing warns and the conversion still lands unattributed — referral data is never a rejection reason. */ export interface WebsiteIngressPayload { readonly contract_version: 1; readonly tenant_id: string; /** The emitting Werkstatt site (site_*), distinct from consumer source systems (src_*). */ readonly source_system_id: string; readonly submission_id: string; readonly idempotency_key: string; readonly occurred_at: string; readonly interaction_kind: IngressInteractionKind; readonly identity_claims: readonly IdentityClaim[]; readonly message?: string | null; readonly origin?: IngressOrigin; readonly acquisition_refs?: readonly string[]; readonly explicit_policy_assertions?: readonly ExplicitPolicyAssertion[]; readonly correlation_id?: string | null; /** Legacy opaque-code attribution (Lagebild RFC-0016). Bounded-window tolerant reader for sites not yet migrated to the slug model — new sites emit referral_partner_* instead; removal condition lives in werkstatt ADR-0106. */ readonly attribution?: IngressAttribution; /** Server-resolved active partner slug on the emitting site (werkstatt RFC-1198). Opaque data to Lagebild: find-or-creates the partner identity; a non-pattern value warns and attaches an operator_note. */ readonly referral_partner_slug?: string | null; /** Partner's public display name — already public on the site's /r/ landing (consent-gated). */ readonly referral_partner_name?: string | null; /** Partner compensation mode resolved server-side from the site's partner-program policy (werkstatt RFC-1222). Receipt provenance, not a directive to Lagebild. */ readonly partner_mode?: string | null; /** ISO date the partner-program policy (governance.effectiveFrom) was in force for this referral. */ readonly policy_effective_from?: string | null; /** Server-stamped recommendation-receipt timestamp on the producing site. */ readonly captured_at?: string | null; /** Disclosure sentence-structure version — platform copy constant (v1 at introduction). */ readonly disclosure_version?: string | null; /** A Werkstatt funnel transition riding with the submission (Verbund H02, V04). Lagebild projects the opaque phase into Opportunity.state; a tenant terminal stage emits relationship.won (H03). */ readonly process_hint?: IngressProcessHint; /** First-party UTM acquisition context (V05, metads integration). Strict six-key shape — Lagebild stores it verbatim as first-touch attribution evidence; a malformed block is stripped and recorded as an operator_note, never a rejection of the submission. */ readonly acquisition?: AcquisitionContext | null; }