PATCH
Set the ledger row's coarsened status. The Benefit Status Updater (callback service) rings this; admins and a verification operator (own provider only) may too. Idempotent; 404 for an unknown id.

Authorizations

Authorization
string
header
required

JWT bearer token. App-user tokens are issued by POST /auth/token (the partner backend calls it as its platform service account); admin and dashboard tokens are issued via OIDC login.

Path Parameters

entity_id
string
required

Benefit entity id (the utilized policy / consultation id)

Body

application/json
status
enum<string>
required

Generic, coarsened lifecycle of a benefit_entity — a benefit-agnostic projection of each benefit's own status (mirrors ExternalMandateStatus -> MandateStatus), so goal/mandate reactions never see insurance/consultation vocabulary. CREATED = just recorded (insurance Pending, consultation Initiated). VERIFICATION = the member has reached the clinic and is being verified (insurance Verification); it is the entitlement's echo of the front desk, not the queue's own status. APPROVED = insurance Approved. ACTIVE = live (insurance Issued/renewal, consultation Active). REJECTED = never went active (insurance Rejected). COMPLETED = went active then ended (insurance Expired/Reissuance, consultation Completed/Closed). FAILED = a technical/operational failure distinct from a rejection (consultation Failed). REJECTED, COMPLETED and FAILED are terminal but drive different reactions.

Available options:
CREATED,
VERIFICATION,
APPROVED,
ACTIVE,
REJECTED,
COMPLETED,
FAILED

Response

The updated benefit entity

benefit_id
string
required
created_at
string
required
entity_id
string
required
entity_type
enum<string>
required

Kind of benefit offered by a provider. Stored as TEXT — deliberately not a PostgreSQL enum, so adding a kind needs no migration.

Available options:
CONSULTATION,
INSURANCE_POLICY,
HEALTH_CHECKUP
last_modified_at
string
required
platform_id
string
required
status
enum<string>
required

Generic, coarsened lifecycle of a benefit_entity — a benefit-agnostic projection of each benefit's own status (mirrors ExternalMandateStatus -> MandateStatus), so goal/mandate reactions never see insurance/consultation vocabulary. CREATED = just recorded (insurance Pending, consultation Initiated). VERIFICATION = the member has reached the clinic and is being verified (insurance Verification); it is the entitlement's echo of the front desk, not the queue's own status. APPROVED = insurance Approved. ACTIVE = live (insurance Issued/renewal, consultation Active). REJECTED = never went active (insurance Rejected). COMPLETED = went active then ended (insurance Expired/Reissuance, consultation Completed/Closed). FAILED = a technical/operational failure distinct from a rejection (consultation Failed). REJECTED, COMPLETED and FAILED are terminal but drive different reactions.

Available options:
CREATED,
VERIFICATION,
APPROVED,
ACTIVE,
REJECTED,
COMPLETED,
FAILED
user_id
string
required

A validated 12-digit numeric user identifier.

Every external entry point validates:

  • JSON Deserialize runs [UserId::parse] (outer whitespace trimmed, length and digit-only enforced) via #[serde(try_from = "String")].
  • DB FromSql runs [UserId::parse] on every row read.

Display / Deref<Target = str> / AsRef<str> / Into<String> are derived via derive_more — the inner String is pass-through for every read-only borrow, display, and move-out.

Example:

"012345678901"