Skip to content

feat(frontier): add SearchOrgInvoices RPC#471

Open
paanSinghCoder wants to merge 4 commits intomainfrom
feat/frontier-search-org-invoices
Open

feat(frontier): add SearchOrgInvoices RPC#471
paanSinghCoder wants to merge 4 commits intomainfrom
feat/frontier-search-org-invoices

Conversation

@paanSinghCoder
Copy link
Copy Markdown
Contributor

@paanSinghCoder paanSinghCoder commented Apr 13, 2026

Summary

  • add SearchOrgInvoices RPC to FrontierService
  • add SearchOrgInvoicesRequest with org_id, query (RQLRequest), and nonzero_amount_only
  • add SearchOrgInvoicesResponse with invoices and pagination

Related: PR-1536

Test plan

  • generate protobuf artifacts in dependent repos
  • verify new RPC appears in generated client/server bindings
  • verify existing ListInvoices clients are unaffected

Sample Request:

{
  "org_id": "f83d54a2-823a-47d1-a2a2-5b14624f3cb3",
  "nonzero_amount_only": false,
  "query": {
    "group_by": ["state"],
    "limit": 20,
    "offset": 0
  }
}

Sample Response:

{
    "invoices": [
        {
            "id": "bac24dff-ad6a-477b-92a7-e29fa2eb7b1e",
            "customer_id": "05f2a6da-bc32-4d91-8306-7ce2be5ceeef",
            "provider_id": "in_1TLg4CKssuVG5PZwztSK3t03",
            "state": "paid",
            "currency": "usd",
            "amount": "20000",
            "hosted_url": "https://invoice.stripe.com/i/acct_1OVBg5KssuVG5PZw/test_YWNjdF8xT1ZCZzVLc3N1Vkc1UFp3LF9VS0tqN0VzRjVoNGtDcE9YU0FpWW9IcFZPRWNVYldLLDE2NjY4ODY3Nw0200RhTt9n34?s=ap",
            "due_date": null,
            "effective_at": "2026-04-13T08:44:06.000Z",
            "period_start_at": "2026-03-13T08:41:18.000Z",
            "period_end_at": "2026-04-13T08:41:18.000Z",
            "metadata": {
                "reconciled": true
            },
            "created_at": "2026-04-13T08:44:13.040Z",
            "customer": null
        },
        {
            "id": "87d2f000-065b-4d65-a31f-9315cadc8db0",
            "customer_id": "05f2a6da-bc32-4d91-8306-7ce2be5ceeef",
            "provider_id": "in_1TJgBRKssuVG5PZwl171vAuD",
            "state": "paid",
            "currency": "usd",
            "amount": "400",
            "hosted_url": "https://invoice.stripe.com/i/acct_1OVBg5KssuVG5PZw/test_YWNjdF8xT1ZCZzVLc3N1Vkc1UFp3LF9VSUdpeG45dHYxTVlKS3dpNXRuRHZkaU5PNGhOU0lPLDE2NjY4ODM5OQ0200uMkfwAZe?s=ap",
            "due_date": "2026-04-07T20:25:12.000Z",
            "effective_at": "2026-04-07T20:25:12.000Z",
            "period_start_at": "2026-04-07T20:25:12.000Z",
            "period_end_at": "2026-04-07T20:25:12.000Z",
            "metadata": {
                "reconciled": true
            },
            "created_at": "2026-04-07T20:25:19.388Z",
            "customer": null
        },
    ],
    "pagination": {
        "offset": 0,
        "limit": 50,
        "total_count": 28
    }
}

Add a dedicated org-scoped invoice search endpoint that accepts RQLRequest and returns paginated invoice results, while keeping ListInvoices unchanged for existing clients.

Made-with: Cursor
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 13, 2026

📝 Walkthrough

Walkthrough

This pull request adds a new RPC endpoint SearchOrgInvoices to the FrontierService in the protobuf API definition. The addition includes two new message types: SearchOrgInvoicesRequest containing an organization ID and RQL query criteria, and SearchOrgInvoicesResponse containing a list of invoices and pagination metadata for the search results.

Suggested reviewers

  • rohilsurana
  • whoAbhishekSah
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: adding a new SearchOrgInvoices RPC to the FrontierService.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description check ✅ Passed The PR description clearly outlines the changes: adding SearchOrgInvoices RPC with request/response messages, includes sample payloads, and provides a test plan.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 13, 2026

The latest Buf updates on your PR. Results from workflow Validate / validate (pull_request).

BuildFormatLintBreakingUpdated (UTC)
✅ passed⏩ skipped✅ passed✅ passedApr 16, 2026, 8:36 AM

@paanSinghCoder paanSinghCoder marked this pull request as ready for review April 13, 2026 11:36
@paanSinghCoder paanSinghCoder self-assigned this Apr 14, 2026
Comment thread raystack/frontier/v1beta1/frontier.proto Outdated
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.

2 participants