ADORSYS-GIS / ADORSYS-GIS/converse-frontends
[Ticket]: Rewrite wiremock fixtures from authz.cstack
- 主要语言
- TypeScript
- 星标
- 0
- 派生
- 0
- 平均合并
- 1 小时 49 分钟
- 30 天内合并 PR
- 253
描述
## Type
Bug
## Summary
We need to rewrite the wiremock fixtures from `authz.cstack` because the current fixtures encode the
client's own incorrect assumptions instead of the real schema, which is exactly why the Epic 1
data-integrity defects shipped past local development undetected.
Expected result:
> Every wiremock stub's shape and enum values derive from `authz.cstack`; reproducing the Epic 1
> defects against these fixtures makes them fail visibly, the way they would fail against the real
> backend.
## Intent
Dev fixtures exist to catch exactly the class of bug found across Epic 1 — a wrong status literal, a
pending request appearing as decided, a hardcoded billing plan, missing pagination. They currently
do the opposite: they were authored to agree with the client's bugs. This ticket makes the fixtures
an independent check against the schema again.
## Source of truth (links)
- https://github.com/ADORSYS-GIS/converse-frontends/blob/main/packages/authz-rpc/schema/authz.cstack
- https://github.com/ADORSYS-GIS/converse-frontends/blob/main/wiremock/mappings/console-budget.json
- https://github.com/ADORSYS-GIS/converse-frontends/blob/main/wiremock/mappings/mapping.json
- https://github.com/ADORSYS-GIS/converse-frontends/issues/283
## Current Behavior
`wiremock/mappings/console-budget.json:20,41` hardcodes `"status": "pending"` for refill requests —
the real schema value is `pending_review`
(`packages/authz-rpc/schema/authz.cstack:1085,1105`), which is the literal that masked the Epic 1
refill-queue bug. Decided rows are returned inside what is modeled as a pending-only list response.
There is no `listBillingPlans` stub, masking the hardcoded `'standard'` billing-plan bug (Epic 2,
Story 2.1). List responses have no `total` field, so pagination is never exercised. Stale ops are
still stubbed for operations the schema has since retired: `addAccountMember`/`removeAccountMember`
(superseded per `packages/authz-rpc/schema/authz.cstack:609-611`) and
`model.Account.update`/`model.Account.delete` (now denied unconditionally at the RBAC layer,
`authz.cstack:165-181`).
## Expected Behavior
Every wiremock stub used by a console screen has its shape and enum values derived from
`authz.cstack` (or `openapi/usage.backend.yaml` where relevant): correct status values
(`pending_review`, not `pending`), a `listBillingPlans` stub, `total` present on paged list
responses, and no stubs remaining for retired operations. Reproducing each of the Epic 1 defects
(wrong status literal, decided-inside-pending, missing billing-plan stub, missing pagination total)
against these fixtures now fails.
## Acceptance Criteria
- [ ] Given `wiremock/mappings/console-budget.json`, when refill-request stubs are inspected, then
pending requests use `status: "pending_review"`, matching the schema.
- [ ] Given the Decided-tab data path, when it is exercised against the rewritten fixtures, then
decided rows are not returned by a stub modeled as the pending-only list.
- [ ] Given `listBillingPlans` has zero stub coverage today, when the fixtures are rewritten, then a
`listBillingPlans` stub exists returning real plan ids (`free`, `pro`, `enterprise` per
`authz.cstack:547-576`'s documented purpose).
- [ ] Given paged list responses, when they are inspected, then each includes a `total` field so
pagination can be exercised in dev.
- [ ] Given `addAccountMember`/`removeAccountMember`/`model.Account.update`/`model.Account.delete`
are retired per the schema, then no stub remains for any of them.
- [ ] Error cases are handled safely — the fixture rewrite does not silently break dev for screens
not directly implicated in Epic 1.
- [ ] Existing behavior is not broken for stubs whose current shape already matches the schema.
- [ ] Relevant tests are added or updated (or a documented manual-reproduction check per defect, if
an automated test harness against wiremock does not already exist).
- [ ] Verification evidence is provided.
## Out of Scope
- Deciding or implementing the CBOR-vs-JSON codec fix (tracked separately in this story's other
ticket).
- Fixing the Epic 1 client-side bugs themselves (tracked in Epic 1) — this ticket only ensures the
fixtures would expose them.
## Technical Context
Relevant files: `wiremock/mappings/console-budget.json`, `wiremock/mappings/mapping.json`,
`packages/authz-rpc/schema/authz.cstack` (source of truth for every stub's shape/enum values). Work
through each stub systematically against the schema section it corresponds to, rather than only
fixing the specific literals named in Epic 1's tickets — the goal is fixture-schema parity, not a
patch for known bugs.
## Risks
Risk: rewriting fixtures without also addressing the CBOR/JSON codec mismatch (this story's other
ticket) means the fixtures are correct on paper but still never actually decoded by the real client
path. Mitigation: land both tickets in this story together, and cross-reference the CBOR ticket's
documented-limitation statement if that is the chosen outcome.
## Test Plan
For each Epic 1 defect named above, reproduce it against the rewritten fixtures and confirm it now
fails (e.g. the PENDING tab shows the request; the billing-plan selector resolves real plans; a 51st
row is reachable via pagination). Document each reproduction as verification evidence.
## Verification evidence
To be filled in by the implementing engineer at PR time: for each Epic 1 defect, the before/after
behavior against the rewritten fixtures.
## Human accountable owner
@stephane-segning
## AI Usage Declaration
Ticket decomposition
## Human verification completed
- [ ] I understood the intent
- [ ] I checked the source of truth
- [ ] I reviewed all AI-generated text/code
- [ ] I verified the implementation manually
- [ ] I verified the tests
- [ ] I checked for hallucinated assumptions
- [ ] I documented remaining risks
- [ ] I am the accountable owner and accept responsibility for this ticket.
贡献指南
评估
这个 Issue 还没有评估数据。