Skip to content

✨ server: add card and installment position to activity#1154

Merged
cruzdanilo merged 1 commit into
mainfrom
nicolas
Jul 16, 2026
Merged

✨ server: add card and installment position to activity#1154
cruzdanilo merged 1 commit into
mainfrom
nicolas

Conversation

@nfmelendez

@nfmelendez nfmelendez commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • New Features
    • Activity records now include card details (card ID and last four digits).
    • Installment activity now displays each installment’s current position and amount.
  • Bug Fixes
    • Improved maturity-filtered activity so installment position details are complete and consistent (including cryptomate data).
    • Fixed statement PDF installment aggregation to use the correct card and installment progress information.
  • Tests
    • Expanded coverage for card activity metadata, maturity filtering (including cryptomate), and PDF rendering.

@nfmelendez
nfmelendez requested a review from cruzdanilo as a code owner July 15, 2026 17:33
@changeset-bot

changeset-bot Bot commented Jul 15, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 76a9dc4

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@exactly/server Patch

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

@coderabbitai

coderabbitai Bot commented Jul 15, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@cruzdanilo, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 27 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 2af54d71-e76f-4b30-a453-7ad9aaaf1904

📥 Commits

Reviewing files that changed from the base of the PR and between d146322 and 76a9dc4.

📒 Files selected for processing (3)
  • .changeset/plain-otters-group.md
  • server/api/activity.ts
  • server/test/api/activity.test.ts

Walkthrough

The activity API now propagates card metadata, adds installment position and amount fields, tightens cryptomate maturity handling, derives PDF statement installments from normalized activity data, and adds related API coverage.

Changes

Activity enrichment

Layer / File(s) Summary
Activity response enrichment
server/api/activity.ts
Activity results now include cardId and lastFour; cryptomate maturity handling adds guards; installment entries expose amount and a one-based current position.
Statement installment aggregation
server/api/activity.ts
PDF statement grouping uses response card metadata and normalized installment progress rather than reconstructing installments from raw borrow events.
Maturity-filtered activity validation
server/test/api/activity.test.ts, .changeset/plain-otters-group.md
Tests propagate card metadata through fixtures, validate panda and cryptomate installment positions, cover mixed-borrow PDF output, and add a patch changeset.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Client
  participant ActivityEndpoint
  participant ActivityTransformers
  participant PDFStatement
  Client->>ActivityEndpoint: request activity or PDF statement
  ActivityEndpoint->>ActivityTransformers: parse purchase transactions
  ActivityTransformers-->>ActivityEndpoint: normalized activity with card metadata and installments
  ActivityEndpoint->>PDFStatement: aggregate installments by card
  PDFStatement-->>Client: activity response or PDF statement
Loading

Possibly related PRs

  • exactly/exa#770: Related card statement and activity/PDF handling.
  • exactly/exa#893: Related card metadata and maturity statement changes in the activity endpoint and tests.

Suggested reviewers: cruzdanilo, franm91

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: adding card metadata and installment position to activity.
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 unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch nicolas
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch nicolas

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.

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request adds cardId and lastFour properties to card activity responses (both for Panda and Cryptomate activities) and introduces a 1-based current index to track installment positions. It also updates the test suite to validate these new fields. The reviewer suggests a refactoring opportunity to simplify the PDF generation logic later in server/api/activity.ts by directly accessing cardId and lastFour from the activity items, which would allow removing the cardLookup map.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread server/api/activity.ts
@codecov

codecov Bot commented Jul 15, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 79.31034% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 73.27%. Comparing base (618595f) to head (76a9dc4).
⚠️ Report is 1 commits behind head on main.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
server/api/activity.ts 79.31% 4 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1154      +/-   ##
==========================================
+ Coverage   72.95%   73.27%   +0.31%     
==========================================
  Files         254      254              
  Lines       10753    10839      +86     
  Branches     3561     3598      +37     
==========================================
+ Hits         7845     7942      +97     
+ Misses       2624     2613      -11     
  Partials      284      284              
Flag Coverage Δ
e2e 73.24% <79.31%> (+0.28%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@nfmelendez

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep it up!

Reviewed commit: 99411fe95a

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@coderabbitai coderabbitai 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.

Actionable comments posted: 2


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: c3522076-3479-488d-9b3a-10c4cea16493

📥 Commits

Reviewing files that changed from the base of the PR and between 99411fe and cdd438b.

📒 Files selected for processing (3)
  • .changeset/plain-otters-group.md
  • server/api/activity.ts
  • server/test/api/activity.test.ts

Comment thread server/api/activity.ts
Comment thread server/api/activity.ts

@coderabbitai coderabbitai 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.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 9e61d978-a141-4172-b32d-0ebcd33e0454

📥 Commits

Reviewing files that changed from the base of the PR and between cdd438b and d146322.

📒 Files selected for processing (3)
  • .changeset/plain-otters-group.md
  • server/api/activity.ts
  • server/test/api/activity.test.ts

Comment thread server/test/api/activity.test.ts
@cruzdanilo
cruzdanilo merged commit 76a9dc4 into main Jul 16, 2026
13 of 14 checks passed
@cruzdanilo
cruzdanilo deleted the nicolas branch July 16, 2026 22:59
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