✨ server: add account statement - #1215
Conversation
🦋 Changeset detectedLatest commit: 4db4d3c The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
WalkthroughAdds an ChangesAccount statement PDFs
Estimated code review effort: 4 (Complex) | ~45 minutes Merge Risk: 🟠 High · up to The new account-statement PDF path can still return 500 errors for unexpected activity types and may render an unbounded account history synchronously, creating slow or failed requests; long card summaries can also overflow the statement and some timestamps may display incorrectly. These current correctness and availability risks should be addressed before merging. Possibly related PRs
Suggested reviewers: Sequence Diagram(s)sequenceDiagram
participant Client
participant ActivityAPI
participant DebtManager
participant AccountStatement
Client->>ActivityAPI: request activity data with Accept header
ActivityAPI->>DebtManager: collect repayment and borrow events when installed
DebtManager-->>ActivityAPI: return debt-related activities
ActivityAPI->>AccountStatement: render account statement
AccountStatement-->>Client: return PDF response
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
✨ Simplify code
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. Comment |
0344db5 to
5b624ca
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1215 +/- ##
==========================================
+ Coverage 67.84% 68.52% +0.67%
==========================================
Files 253 254 +1
Lines 10359 10636 +277
Branches 3500 3620 +120
==========================================
+ Hits 7028 7288 +260
- Misses 3067 3069 +2
- Partials 264 279 +15
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
5b624ca to
23d70c9
Compare
There was a problem hiding this comment.
Actionable comments posted: 3
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 005ba4b9-3df3-4f7b-ae39-538fb0e067cf
⛔ Files ignored due to path filters (3)
server/assets/fonts/SplineSans-Regular.otfis excluded by!**/*.otfserver/assets/fonts/SplineSans-SemiBold.otfis excluded by!**/*.otfserver/assets/fonts/SplineSansMono-Regular.otfis excluded by!**/*.otf
📒 Files selected for processing (8)
.changeset/fine-houses-invite.mdserver/api/activity.tsserver/assets/fonts/OFL.txtserver/package.jsonserver/test/api/activity.test.tsserver/test/utils/statement.test.tsserver/utils/AccountStatement.tsxserver/utils/Statement.tsx
ab1d395 to
a85ea93
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 37986195-9794-4e98-b253-3109c8330a49
📒 Files selected for processing (5)
.github/workflows/test.yamlserver/api/activity.tsserver/package.jsonserver/test/api/activity.test.tsserver/utils/AccountStatement.tsx
a85ea93 to
09efad4
Compare
There was a problem hiding this comment.
Actionable comments posted: 2
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 174db213-b9b9-4691-be4f-7b0e115b9ab8
📒 Files selected for processing (3)
server/test/api/activity.test.tsserver/test/utils/AccountStatement.test.tsserver/utils/AccountStatement.tsx
09efad4 to
2d38998
Compare
There was a problem hiding this comment.
Actionable comments posted: 6
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 1331db9b-05e0-4801-8da9-55084a69a9d8
📒 Files selected for processing (4)
server/api/activity.tsserver/test/api/activity.test.tsserver/test/utils/AccountStatement.test.tsserver/utils/AccountStatement.tsx
2d38998 to
d46671d
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: c520a364-7d85-4ce9-9027-fce7d287ef47
📒 Files selected for processing (2)
server/test/api/activity.test.tsserver/test/utils/AccountStatement.test.ts
8e25b35 to
9507384
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9507384d92
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
9507384 to
13219ca
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 13219cac36
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
1dfc222 to
1549ce4
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1549ce40f5
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
1549ce4 to
c054f20
Compare
cad5293 to
91d046e
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 91d046eff5
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
91d046e to
5f89337
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5f89337217
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
5f89337 to
405909f
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 405909f380
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
a1e59ca to
f5ce330
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f5ce33061b
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
f5ce330 to
6d45a25
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6d45a25181
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
6d45a25 to
4998189
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4998189685
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
4998189 to
58d83d0
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 58d83d00c0
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
58d83d0 to
dbd4820
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: dbd48206ad
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
3de72a7 to
6342aff
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6342affe5e
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
6342aff to
5a0a972
Compare
5b4d28c to
3b6e32a
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3b6e32a706
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const pdf = | ||
| accepts(c, { | ||
| header: "Accept", | ||
| supports: ["application/json", "application/pdf"], | ||
| default: "application/json", |
There was a problem hiding this comment.
Describe the account-statement response in OpenAPI
Because this route still has no describeRoute() middleware, the new Accept: application/pdf account-statement variant and its validation errors are absent from the generated OpenAPI specification, so generated clients and API documentation cannot discover or model this feature. Add the PDF and JSON response variants and the new 400 responses to the route specification. .agents/rules/server.mdL25-L25
Useful? React with 👍 / 👎.
| cards: [ | ||
| ...Map.groupBy( | ||
| items.filter((item) => "merchant" in item), | ||
| ({ cardId }) => cardId, |
There was a problem hiding this comment.
Include cards with no period purchases
When an account has a card with no finalized merchant movement in the requested period, that card never appears in items, so grouping the summary from items omits the card entirely instead of reporting $0.00 under “Debit purchases in the period.” Build the summary from the queried purchases cards and merge in their movement totals so every account card remains represented.
Useful? React with 👍 / 👎.
3b6e32a to
8b81be3
Compare
8b81be3 to
4db4d3c
Compare
summary
API contract
verification
Summary by CodeRabbit
New Features
Bug Fixes