feat(billing): include company_name on invoice and payment responses (PMS-186) #149

Merged
longjacksonle merged 1 commit from feat/pms-186-billing-company-name into main 2026-06-10 01:22:57 +02:00

What

Add company_name to InvoiceResponse and PaymentResponse (PMS-186). The billing surfaces showed the company only as a raw company_id UUID because the API returned the FK but no name.

How

  • company_name_map(tenant_id, ids) resolves a batch of company ids to names in one tenant-scoped query.
  • enrich_invoices / enrich_payments attach company_name in place.
  • Wired into list_invoices, get_invoice, list_payments, and the create_payment response (payments have no detail page, so its create response is user-visible). Create / update invoice responses are intentionally not enriched: the client navigates to the invoice detail, which is.

Test

billing_responses_carry_company_name asserts the name flows through the invoice list, invoice detail, the create-payment response, and the payment list. All 3 billing tests pass; 115 lib tests, clippy --all-targets -- -D warnings, and cargo fmt --check clean.

Companion

mokosh-apps PR (to follow) shows the name and replaces the "Company ID (UUID)" inputs with a company-name dropdown.

🤖 Generated with Claude Code

## What Add `company_name` to `InvoiceResponse` and `PaymentResponse` (PMS-186). The billing surfaces showed the company only as a raw `company_id` UUID because the API returned the FK but no name. ## How - `company_name_map(tenant_id, ids)` resolves a batch of company ids to names in one tenant-scoped query. - `enrich_invoices` / `enrich_payments` attach `company_name` in place. - Wired into `list_invoices`, `get_invoice`, `list_payments`, and the `create_payment` response (payments have no detail page, so its create response is user-visible). Create / update invoice responses are intentionally not enriched: the client navigates to the invoice detail, which is. ## Test `billing_responses_carry_company_name` asserts the name flows through the invoice list, invoice detail, the create-payment response, and the payment list. All 3 billing tests pass; 115 lib tests, `clippy --all-targets -- -D warnings`, and `cargo fmt --check` clean. ## Companion mokosh-apps PR (to follow) shows the name and replaces the "Company ID (UUID)" inputs with a company-name dropdown. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
feat(billing): include company_name on invoice and payment responses (PMS-186)
All checks were successful
E2E (staging) / Playwright against staging (pull_request) Successful in 56s
Check / fmt + clippy + compile + tests (pull_request) Successful in 2m20s
Build OCI container / Build and push mokosh-api image (push) Successful in 3m18s
Create release / Create release from merged PR (pull_request) Has been skipped
6bbe7ff3f8
Invoice and payment surfaces showed the company only as a raw company_id UUID because the API returned the FK but no name. Add company_name to InvoiceResponse and PaymentResponse, resolved on read so the client can display a human name instead of a UUID.

A small tenant-scoped company_name_map helper resolves a batch of company ids to names in one query; enrich_invoices / enrich_payments attach the name in place. Wired into list_invoices, get_invoice, list_payments, and the create_payment response (payments have no detail page, so the create response is user-visible). Create/update invoice responses are unchanged because the client navigates to the invoice detail, which is enriched.

Test: billing_responses_carry_company_name asserts the name flows through the invoice list, invoice detail, the create-payment response, and the payment list. All 3 billing tests pass; 115 lib tests, clippy --all-targets, and fmt clean.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
longjacksonle deleted branch feat/pms-186-billing-company-name 2026-06-10 01:22:57 +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!149
No description provided.