Admit To Clinic Queue
Idempotent by construction: the instance’s id is the row’s primary key, so a
redelivered admission returns the existing row untouched rather than
rewinding one the operator has since advanced. There is no body — every
column is read off the benefit_entities row, so a caller cannot plant a row
in another provider’s tenant.
Authorizations
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
The benefit instance to queue
Response
The instance is queued — newly admitted, or already there and returned unchanged
"9876543210"
Kind of benefit offered by a provider. Stored as TEXT — deliberately not a PostgreSQL enum, so adding a kind needs no migration.
CONSULTATION, INSURANCE_POLICY, HEALTH_CHECKUP Where a member sits in the clinic front-desk workflow, for any benefit type. CREATED = admitted to the queue, not yet arrived. IN_PROGRESS = arrived at the clinic and being seen. COMPLETED = terminal. Deliberately not insurance vocabulary — the queue spans every benefit type, so it does not borrow PolicyStatus's verification. Distinct from BenefitEntityStatus, which tracks the entitlement rather than the visit: one is written by the clinic operator, the other by the benefit pipeline.
CREATED, IN_PROGRESS, COMPLETED A validated 12-digit numeric user identifier.
Every external entry point validates:
- JSON
Deserializeruns [UserId::parse] (outer whitespace trimmed, length and digit-only enforced) via#[serde(try_from = "String")]. - DB
FromSqlruns [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.
"012345678901"
"+91"