Skip to content

feat(insurance): per-recommendation Archera quotes (blocked on an Archera API mapping) #799

Open

Description

@cristim

Goal

Show Archera insured-commitment figures per platform recommendation, as a per-rec or ladder view, instead of only the plan-wide comparison delivered by platform#785.

Blocked: needs an Archera API capability that is not documented

The documented comparison (GET /v1/org/{org_id}/commitment-plans/{plan_id}/comparison, consumed through pkg/insurance) returns:

  • plan-wide hypothetical rollups per (contract term, payment option); and
  • per-line rows keyed by Archera line_item_id.

There is no documented key linking an Archera line item to a platform recommendation (provider account, region, resource type, commitment), and no endpoint that quotes an arbitrary recommendation. pkg/insurance therefore documents the comparison as plan-wide and the plan ID as "an Archera plan identifier, not a local recommendation ID" (types.go:193-194). Any per-rec mapping invented locally would show figures for the wrong commitment.

What would unblock it

One of these, documented by Archera:

  • a line-item field that identifies the underlying cloud resource or commitment in terms we can match exactly;
  • a quote endpoint that accepts our recommendation parameters; or
  • a written mapping rule from Archera.

Scope once unblocked

  • Contract change in go pkg/insurance (decode the new field or endpoint, with tests from official samples).
  • Platform UI: per-recommendation insured columns, or a ladder view by term, behind the same default-off config.
  • Mapping must be exact. An unmatched recommendation shows "no Archera quote", never an estimate.

Acceptance criteria

  • An Archera documentation source for the mapping is cited in the go PR.
  • Exact-match tests, including the unmatched and ambiguous cases, which must fail loud.
  • Same disclosures and not-a-guarantee caveat as platform#785.

Dependencies

Requires vendor documentation (owner to raise with Archera), the real-scenario verification issue, and platform#785 merged. Tracking: #786.

Activity

  1. cristim commented on Oct 15, 2026

    @cristim
    MemberAuthor

    Schema prerequisite merged in #881 as 21910e3dfc429e010bdb0181c7d13b7e8b05796c. All PR checks passed at the independently reviewed head fa5ff70b79c7bfb9b5178dcb5a5bd3d3845ede33; merged migration blobs match the verified bytes.

    Native macOS PostgreSQL 17.11 tests exercised migration 119 → 120 → 119 → 120, payload preservation, source-key distinctions, legacy upserts and rollback guards. Independent verification also checked JSONB edge cases and killed a scratch case-folding mutation. These are synthetic local integration results, not live provider or customer database verification.

    This remains a prerequisite. Source-account transport and validation, source-aware row IDs/upserts, versioned consumer identity and conservative legacy held-capacity handling remain open. Retiring the old index requires those gates; its migration number will be reserved from the current maximum when ready. Exact Archera matching and the scoped real-account validation in #798 also remain open. Neither #799 nor #798 is resolved by this schema change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions