feat(contracts): add GET /rate-cards/{id} for single rate-card fetch #244

Merged
nrupard merged 1 commit from feat/PMS-327-get-rate-card into main 2026-06-15 18:32:38 +02:00
Owner

The rate-card routes had no GET /rate-cards/{id} for a single card's metadata, so the client detail page fell back to fetching the first list page and find()-ing the row by id, which silently fails for any card past per_page=100. Add a tenant-scoped get_rate_card(tenant, id) service method that selects WHERE tenant_id = $1 AND id = $2 and returns the same RateCardResponse shape as the list, or AppError::NotFound when the card is absent or owned by another tenant. Wire it onto the existing /rate-cards/{id} route with get(get_rate_card) alongside the current put/delete, gated by RequireContracts only (a read, no finance gate) to match GET /rate-cards and GET /rate-cards/{id}/items. Service-level tests cover the in-tenant happy path, a missing id, and a card owned by another tenant.

#PMS-327

The rate-card routes had no GET /rate-cards/{id} for a single card's metadata, so the client detail page fell back to fetching the first list page and find()-ing the row by id, which silently fails for any card past per_page=100. Add a tenant-scoped get_rate_card(tenant, id) service method that selects WHERE tenant_id = $1 AND id = $2 and returns the same RateCardResponse shape as the list, or AppError::NotFound when the card is absent or owned by another tenant. Wire it onto the existing /rate-cards/{id} route with get(get_rate_card) alongside the current put/delete, gated by RequireContracts only (a read, no finance gate) to match GET /rate-cards and GET /rate-cards/{id}/items. Service-level tests cover the in-tenant happy path, a missing id, and a card owned by another tenant. #PMS-327
feat(contracts): add GET /rate-cards/{id} for single rate-card fetch
All checks were successful
E2E / Playwright against staging (pull_request) Successful in 38s
Check / fmt + clippy + compile + unit/doc tests (pull_request) Successful in 1m3s
Integration / integration tests (pull_request) Successful in 2m37s
Create release / Create release from merged PR (pull_request) Has been skipped
28075215ce
The rate-card routes had no GET /rate-cards/{id} for a single card's metadata, so the client detail page fell back to fetching the first list page and find()-ing the row by id, which silently fails for any card past per_page=100. Add a tenant-scoped get_rate_card(tenant, id) service method that selects WHERE tenant_id = $1 AND id = $2 and returns the same RateCardResponse shape as the list, or AppError::NotFound when the card is absent or owned by another tenant. Wire it onto the existing /rate-cards/{id} route with get(get_rate_card) alongside the current put/delete, gated by RequireContracts only (a read, no finance gate) to match GET /rate-cards and GET /rate-cards/{id}/items. Service-level tests cover the in-tenant happy path, a missing id, and a card owned by another tenant.

#PMS-327
nrupard deleted branch feat/PMS-327-get-rate-card 2026-06-15 18:32:38 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
psa-systems/mokosh-server!244
No description provided.