Skip to content

feat: expose billing summary route - #22

Merged
senamakel merged 2 commits into
mainfrom
billing-summary-route
Sep 11, 2026
Merged

feat: expose billing summary route#22
senamakel merged 2 commits into
mainfrom
billing-summary-route

Conversation

@senamakel

@senamakel senamakel commented Sep 11, 2026

Copy link
Copy Markdown
Member

Summary

  • add the deployed GET /payments/summary route to the public payments namespace and generated route registry
  • expose PaymentsApi::get_summary for typed route access
  • cover envelope unwrapping and manifest synchronization

Validation

  • cargo test
  • cargo clippy --all-targets -- -D warnings
  • cargo package (run after commit)
  • deployed Swagger reachability

Summary by CodeRabbit

  • New Features

    • Added access to payment summaries through an authenticated API request.
    • Added the GET /payments/summary endpoint, returning billing details such as credits, plan information, and related links.
  • Tests

    • Added coverage verifying that payment summary responses are returned correctly.
    • Updated API route synchronization checks for the expanded endpoint set.

Co-authored-by: Medulla <medulla@tinyhumans.ai>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 11, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-11T08:33:35.440651Z 4b99336 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Sep 11, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

Warning

Review limit reached

  • Run on-demand review

On-demand reviews are free for the next 9 days. After that, they cost $0.25 per reviewed file.

Or wait 54 minutes for your next included review.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: ab4c8f93-be6b-4a4e-9b16-6d7aa6234d02

📥 Commits

Reviewing files that changed from the base of the PR and between 4b99336 and 5b44a33.

📒 Files selected for processing (1)
  • src/api/payments.rs

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 9abf3d0a-f4ce-4771-9007-3d97a4f4b45a

📥 Commits

Reviewing files that changed from the base of the PR and between ecefb6a and 4b99336.

📒 Files selected for processing (5)
  • api/tinyhumans.backend.json
  • src/api/payments.rs
  • src/generated_public_routes.rs
  • tests/openapi_sync.rs
  • tests/payments.rs

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The SDK adds PaymentsApi::get_summary for authenticated billing summaries. The API manifest and generated route list include GET /payments/summary. Tests update operation counts and validate the returned summary payload.

Changes

Payments summary support

Layer / File(s) Summary
Route registration and API metadata
api/tinyhumans.backend.json, src/generated_public_routes.rs
The manifest and generated route list register GET /payments/summary. Operation counts increase from 229 to 230.
Payments API method
src/api/payments.rs
PaymentsApi::get_summary sends an authenticated request and returns a DynamicResponse.
Route and response validation
tests/openapi_sync.rs, tests/payments.rs
Tests validate the updated operation counts and the billing summary response payload.

Priority: ⚪ Not assessed

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant TinyHumansClient
  participant PaymentsApi
  participant PaymentsEndpoint
  participant MockServer
  TinyHumansClient->>PaymentsApi: get_summary()
  PaymentsApi->>MockServer: authenticated GET /payments/summary
  MockServer-->>PaymentsApi: billing summary JSON
  PaymentsApi-->>TinyHumansClient: DynamicResponse
Loading

Suggested reviewers: codeghost21

Merge Risk: ⚪ Minimal · up to 4b993

The payments summary endpoint is consistently registered and covered by route synchronization and response tests, with no actionable merge risk identified.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the primary change: exposing the billing summary route.
Docstring Coverage ✅ Passed Docstring coverage is 83.33% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 4 files. (1 skipped: 1 u…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

A rabbit hops through payment lanes
A summary blooms with credits and gains
The route is listed, the counts align
Tests catch the payload, crisp and fine
The SDK now follows the billing sign

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

@tinysweeper tinysweeper Bot 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.

tinysweeper found nothing blocking. Approving.

             $0.0154 · 135,178 in / 7,715 out · 10,134 cached (7%) · deepseek/deepseek-v4-flash, openrouter/openai/text-embedding-3-small, z-ai/glm-5.2 · 184 embedded
critique:    $0.0062 · 60,217 in  / 5,517 out · 2,048 cached (3%)  · deepseek/deepseek-v4-flash
security:    $0.0073 · 56,423 in  / 478 out   · 8,086 cached (14%) · deepseek/deepseek-v4-flash, z-ai/glm-5.2
tests:       $0.0011 · 12,499 in  / 104 out   · 0 cached (0%)      · deepseek/deepseek-v4-flash
description: $0.0004 · 3,922 in   / 71 out    · 0 cached (0%)      · deepseek/deepseek-v4-flash

Comment thread src/api/payments.rs
@tinysweeper

tinysweeper Bot commented Sep 11, 2026

Copy link
Copy Markdown

How this change flows

0 changed behaviours across 8 relationships. 6 surrounding behaviours are shown (60 graph nodes walked). 45 further behaviours left out to keep the diagram readable.

flowchart LR
  n0["DynamicResponse"]:::impacted
  n1["Error"]:::impacted
  n2["create_coinbase_charge"]:::impacted
  n3["create_credit_top_up"]:::impacted
  n4["create_auto_recharge_card_setup_intent"]:::impacted
  n5["create_stripe_portal_session"]:::impacted
  n2 -->|uses| n0
  n2 -->|uses| n1
  n3 -->|uses| n0
  n3 -->|uses| n1
  n4 -->|uses| n0
  n4 -->|uses| n1
  n5 -->|uses| n0
  n5 -->|uses| n1
  classDef changed fill:#0d4429,stroke:#238636,color:#e6edf3
  classDef impacted fill:#161b22,stroke:#6e7681,color:#c9d1d9
  classDef flagged fill:#5a1e02,stroke:#d93f0b,color:#ffffff
  classDef blocking fill:#67060c,stroke:#f85149,color:#ffffff
Loading

Green: changed behaviour. Grey: surrounding behaviour. Arrows name the call, use, implementation, or test relationship. Orange: has findings. Red: has a finding that blocks the merge.

tinysweeper 0.1.0

@tinysweeper tinysweeper Bot added the priority: p2 Soon. Real but survivable — a rough edge, a gap, a thing that will bite later. label Sep 11, 2026
Co-authored-by: Medulla <medulla@tinyhumans.ai>
@tinysweeper tinysweeper Bot added priority: p3 Whenever. Cosmetic, a nicety, or a cleanup with no user visible effect. and removed priority: p2 Soon. Real but survivable — a rough edge, a gap, a thing that will bite later. labels Sep 11, 2026
@senamakel
senamakel merged commit 1805d3b into main Sep 11, 2026
8 checks passed
@senamakel
senamakel deleted the billing-summary-route branch September 11, 2026 08:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority: p3 Whenever. Cosmetic, a nicety, or a cleanup with no user visible effect.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant