🌐 US-Proxy
class="logged-out env-production page-responsive" style="word-wrap: break-word;" >
Skip to content

feat(credit): add delete of credit transactions by billing account - #1842

Merged
whoAbhishekSah merged 2 commits into
fix/checkout-delete-methodfrom
fix/credit-delete-method
Aug 5, 2026
Merged

feat(credit): add delete of credit transactions by billing account#1842
whoAbhishekSah merged 2 commits into
fix/checkout-delete-methodfrom
fix/credit-delete-method

Conversation

@whoAbhishekSah

Copy link
Copy Markdown
Member

Part of #1835. Stacked on the checkout delete PR.

Credit transactions also hold a foreign key to the billing customer row. Without a delete method, an account teardown would either orphan them or fail on the constraint.

Changes

  • DeleteByAccountID on the transactions Postgres repository.
  • DeleteByAccountID on the credit service.
  • Regenerated the transaction repository mock.

No behavior change: nothing calls these yet.

🤖 Generated with Claude Code

@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: deca7049-e9a4-4eea-96c1-a51fae3038ee

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

@rohilsurana rohilsurana left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One inline note on the doc comment. Also, the PR description says credit transactions hold a foreign key to the billing customer row. billing_transactions.account_id has no REFERENCES constraint (see 20231012175641_create_billing_tables.up.sql). The delete is still worth having, since it avoids orphaned rows, but the description overstates the constraint. Worth updating so reviewers do not take the FK claim at face value.

Comment thread billing/credit/service.go Outdated
whoAbhishekSah and others added 2 commits August 5, 2026 08:16
Credit transactions hold a foreign key to the billing customer row.
Without a way to remove them, a billing account teardown would leave
them orphaned or fail on the constraint. The method is meant for
account teardown.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@whoAbhishekSah
whoAbhishekSah force-pushed the fix/credit-delete-method branch from af60d6b to 8ac4120 Compare August 5, 2026 02:47
@vercel

vercel Bot commented Aug 5, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
frontier Ready Ready Preview Aug 5, 2026 2:47am

@coveralls

coveralls commented Aug 5, 2026

Copy link
Copy Markdown

Coverage Report for CI Build 30970356124

Coverage decreased (-0.02%) to 47.509%

Details

  • Coverage decreased (-0.02%) from the base build.
  • Patch coverage: Could not be determined — this PR's diff is too large for GitHub to return (406 error at GitHub).
  • 71 coverage regressions across 2 files.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

71 previously-covered lines in 2 files lost coverage.

File Lines Losing Coverage Coverage
internal/store/postgres/billing_transactions_repository.go 56 25.0%
billing/credit/service.go 15 63.57%

Coverage Stats

Coverage Status
Relevant Lines: 39296
Covered Lines: 18669
Line Coverage: 47.51%
Coverage Strength: 15.41 hits per line

💛 - Coveralls

@whoAbhishekSah
whoAbhishekSah merged commit 121eab0 into main Aug 5, 2026
8 checks passed
@whoAbhishekSah
whoAbhishekSah deleted the fix/credit-delete-method branch August 5, 2026 03:36
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.

3 participants