Get Goal
No authorization gate. Authentication still applies (the route sits behind
AuthNMiddleware), but any authenticated actor may read any goal. Gating is
deferred to a dedicated PR.
Path Parameters
Goal UUID
Response
The goal
ISO 4217 three-letter currency codes.
Currently INR only; add variants as the product expands.
INR Represents a monetary amount with its associated currency
What a goal is for. The DB stores this as a single purpose VARCHAR(64) column
URN-encoded as <kind>:<payload>:
category:<GoalCategory>— a closed category (e.g.category:healthcare).specific:<benefit_entity_id>— one benefit instance; the payload is thebenefit_entities.entity_id(validated at create, no DB FK — likeSource).
Every kind carries a payload, so a bare kind is always a parse error.
Every entry point (JSON Deserialize, diesel FromSql, FromStr)
re-validates so corrupt rows fail loudly.
- Option 1
- Option 2
Represents a monetary amount with its associated currency
Represents a monetary amount with its associated currency
Represents a monetary amount with its associated currency
Represents a monetary amount with its associated currency
Goal lifecycle — terminal-vs-live only. ACTIVE from creation; CLOSED = ended at its natural end (term elapsed, e.g. policy expiry); CANCELLED = never went live (e.g. the funding policy was rejected). Whether a goal is running right now is answered by its term (start_time..end_time), not by this status — a goal is ACTIVE even when its term starts in the future. Target-met and spend outcomes are computed, not stored on status.
ACTIVE, CLOSED, CANCELLED Represents a monetary amount with its associated currency
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"
"2027-01-15"
"2026-01-15"