-
Notifications
You must be signed in to change notification settings - Fork 152
fix: populate invoice at #2783
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: populate invoice at #2783
Conversation
📝 WalkthroughWalkthroughA conditional update was added to set the invoice issuance timestamp during finalization in the billing service. A corresponding test assertion checks that this timestamp is set when an invoice reaches the paid state. Additionally, a new SQL migration backfills missing issuance timestamps for certain invoice statuses, with a no-op down migration. Changes
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 golangci-lint (1.64.8)Error: you are using a configuration file for golangci-lint v2 with golangci-lint v1: please use golangci-lint v2 📜 Recent review detailsConfiguration used: CodeRabbit UI ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (4)
🚧 Files skipped from review as they are similar to previous changes (4)
⏰ Context from checks skipped due to timeout of 90000ms (11)
✨ Finishing Touches
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
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 details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
tools/migrate/migrations/atlas.sumis excluded by!**/*.sum
📒 Files selected for processing (4)
openmeter/billing/service/invoicestate.go(1 hunks)test/app/custominvoicing/invocing_test.go(1 hunks)tools/migrate/migrations/20250506182753_backfill-invoice-at.down.sql(1 hunks)tools/migrate/migrations/20250506182753_backfill-invoice-at.up.sql(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (13)
- GitHub Check: Artifacts / Benthos Collector Container image
- GitHub Check: Artifacts / Container image
- GitHub Check: Test
- GitHub Check: Quickstart
- GitHub Check: Migration Checks
- GitHub Check: Lint
- GitHub Check: E2E
- GitHub Check: Developer environment
- GitHub Check: CI
- GitHub Check: Commit hooks
- GitHub Check: Build
- GitHub Check: Analyze (javascript)
- GitHub Check: Analyze (go)
🔇 Additional comments (3)
tools/migrate/migrations/20250506182753_backfill-invoice-at.down.sql (1)
1-1: Empty down migration is appropriateThis no-op down migration is appropriate since the backfill operation adds missing timestamp data that doesn't need to be reversed.
test/app/custominvoicing/invocing_test.go (1)
313-313: Good validation of invoice timestampThis assertion ensures that invoices have their issuance timestamp properly set when they reach the paid state, which aligns with the PR objective.
tools/migrate/migrations/20250506182753_backfill-invoice-at.up.sql (1)
1-6: Comprehensive backfill for invoice timestampsThis migration properly updates the
issued_atfield for all relevant invoice statuses where the timestamp is missing. Usingupdated_atas the backfill value provides a reasonable approximation of when the invoice was issued.
d7d0853 to
459b971
Compare
Overview
Make sure we populate invoice_at.
Let's add testcases, let's have a basic backfill.
Summary by CodeRabbit
Bug Fixes
Tests
Chores