feat(contracts): add GET /rate-cards/{id} for single rate-card fetch #244
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/PMS-327-get-rate-card"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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