Skip to content

feat(cost): add GetInvoiceReadiness RPC for billing readiness check - #888

Merged
kitkatchoco2002 merged 3 commits into
mainfrom
export-report
Aug 20, 2026
Merged

feat(cost): add GetInvoiceReadiness RPC for billing readiness check#888
kitkatchoco2002 merged 3 commits into
mainfrom
export-report

Conversation

@kitkatchoco2002

Copy link
Copy Markdown
Contributor

Description:

Summary

  • Adds a new synchronous GetInvoiceReadiness RPC on the Cost service so callers
    (e.g. ripple-ui) can check whether billing is finalized for a given vendor +
    month before triggering a reserveshield export — no export job, email, or
    long-running operation is created by this call.
  • vendor / month request fields mirror ExportReportRequest. msp_id is
    intentionally omitted — like ExportReportRequest, it's derived server-side
    from the caller's session, so a client can't request another MSP's data.
  • Regenerated openapiv2/apidocs.swagger.json to include the new endpoint.

Why

The existing readiness signal (invoice_id_check) only ever ran as a side effect
of an actual export job, so there was no way to show a "is this month ready?"
banner before a user committed to exporting. This adds the missing synchronous
check, reusing the same underlying BigQuery query/parser the export pipeline
already relies on — no new readiness semantics introduced.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new synchronous Cost service RPC (GetInvoiceReadiness) intended to let clients check whether billing is finalized for a given vendor + month without triggering an export job, and updates the generated OpenAPI spec accordingly.

Changes:

  • Adds GetInvoiceReadiness RPC to cost/v1/cost.proto with HTTP GET mapping at /v1/{vendor}/reports/invoicereadiness.
  • Introduces GetInvoiceReadinessRequest / GetInvoiceReadinessResponse messages.
  • Regenerates openapiv2/apidocs.swagger.json to expose the new endpoint and response schema.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
cost/v1/cost.proto Adds the new unary readiness-check RPC and request/response messages.
openapiv2/apidocs.swagger.json Updates generated OpenAPI paths/definitions to include the new endpoint.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread cost/v1/cost.proto Outdated
Comment thread cost/v1/cost.proto Outdated
@kitkatchoco2002
kitkatchoco2002 merged commit 07881cc into main Aug 20, 2026
2 checks passed
@kitkatchoco2002
kitkatchoco2002 deleted the export-report branch August 20, 2026 01:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants