Skip to content

feat(statements): add adjustments to the statement model - #398

Merged
michaelabbott25 merged 2 commits into
mainfrom
car-4965-billing-statements-updates-to-statements-api-with
Oct 29, 2026
Merged

michaelabbott25 merged 2 commits into
mainfrom
car-4965-billing-statements-updates-to-statements-api-with

Conversation

@michaelabbott25

Copy link
Copy Markdown
Contributor

🤖

What

  • Add Adjustments *AdjustmentFees to Statement, with the JSON key adjustments.
  • Add the AdjustmentFees type (items and total) and the BillingAdjustment type (feeName, count, amount). A BillingAdjustment amount is negative for a credit.
  • Add TestStatement_Adjustments. It decodes a statement with adjustments through the strict decoder, including a negative amount.

Why

CAR-4965: the statements API now returns an adjustments section (moovfinancial/billing-statements#92). The section is in every moov-api version since moov-api v5.0.0. The test client decodes with DisallowUnknownFields, so a statement with adjustments fails to decode without this field.

Notes

  • The types are in the shared pkg/moov package, not in a pkg/mvYYMM package, because every API version has the field.
  • The type name BillingAdjustment matches the moov-api spec. The API also has an unrelated adjustments domain, so the name Adjustment could cause a conflict later.
  • Lint passes. The new test and the existing statement unit tests pass. I did not run the live API tests, because they need sandbox credentials.

— Claude

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@moov-review-bot moov-review-bot 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.

(Superseded by a newer review below.)

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

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 adjustment fees to the statement models. It adds the AdjustmentFees and BillingAdjustment structures. It also adds a unit test to verify the new structures. We recommend that you add omitempty to the JSON tags of the new structures. This makes the code consistent and prevents the serialization of empty fields. — Gemini

Comment thread pkg/moov/statement_models.go Resolved
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@moov-review-bot moov-review-bot 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.

✅ No issues found in this review.

Trigger another review: /moov-review

@michaelabbott25
michaelabbott25 merged commit e1888dc into main Oct 29, 2026
5 checks passed
@michaelabbott25
michaelabbott25 deleted the car-4965-billing-statements-updates-to-statements-api-with branch October 29, 2026 14:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants