Skip to content

fix(ledger): lock accrued account postings - #4476

Merged
GAlexIHU merged 1 commit into
mainfrom
codex/fix-ledger-accrued-posting-lock
Jun 3, 2026
Merged

GAlexIHU merged 1 commit into
mainfrom
codex/fix-ledger-accrued-posting-lock

Conversation

@GAlexIHU

@GAlexIHU GAlexIHU commented Jun 3, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • include customer accrued accounts in ledger posting advisory locks
  • keeps accrued-to-earnings recognition serialized through the existing posting lock path

Verification

  • nix develop --impure .#ci -c go vet ./openmeter/ledger/account/service
  • nix develop --impure .#ci -c go test -tags=dynamic ./openmeter/ledger/account/service

Summary by CodeRabbit

  • Bug Fixes
    • Improved account locking behavior during posting operations to handle additional account types consistently.

@GAlexIHU
GAlexIHU requested a review from a team as a code owner June 3, 2026 12:47
@coderabbitai

coderabbitai Bot commented Jun 3, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 948738cd-199e-4a13-875b-6c169238c390

📥 Commits

Reviewing files that changed from the base of the PR and between d839096 and 0ee9829.

📒 Files selected for processing (1)
  • openmeter/ledger/account/service/service.go

📝 Walkthrough

Walkthrough

This PR extends the account locking logic to include customer accrued accounts. The LockAccountsForPosting function now locks AccountTypeCustomerAccrued alongside the existing CustomerFBO and CustomerReceivable account types during posting operations.

Changes

Customer Account Type Locking

Layer / File(s) Summary
Add CustomerAccrued to locked account types
openmeter/ledger/account/service/service.go
The switch case in LockAccountsForPosting now includes ledger.AccountTypeCustomerAccrued in the set of customer account types selected for locking.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Possibly related PRs

  • openmeterio/openmeter#4286: Introduces the LockAccountsForPosting locking logic that this PR extends to cover the new account type.

Suggested labels

release-note/misc

Suggested reviewers

  • turip
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main change: adding customer accrued accounts to the ledger posting advisory locks.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/fix-ledger-accrued-posting-lock

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 and usage tips.

@GAlexIHU GAlexIHU added the release-note/bug-fix Release note: Bug Fixes label Jun 3, 2026
@GAlexIHU
GAlexIHU enabled auto-merge (squash) June 3, 2026 12:52
@GAlexIHU
GAlexIHU merged commit b23e908 into main Jun 3, 2026
29 of 30 checks passed
@GAlexIHU
GAlexIHU deleted the codex/fix-ledger-accrued-posting-lock branch June 3, 2026 13:31

This branch was previously deployed

1 inactive deployment
dev — 0ee9829d Deployed Jun 3, 2026 by GAlexIHU via Migration Checks #14799
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release-note/bug-fix Release note: Bug Fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants