Double entry accounting milestone 3 - #82
Merged
chongfun merged 2 commits intoAug 24, 2026
Merged
Conversation
…cked balances
- Introduce the unified Charge model replacing ScheduledRent and TenantCharge:
- Add kind enum ('rent', 'late_fee', 'utility', 'reimbursement', 'other')
- Enforce positive amount_cents, service period validations, and posting immutability
- Add partial unique index on [tenancy_id, service_period_start] for active rent charges
- Implement charge accounting and lifecycle services:
- Add other_tenant_income to Accounting::ChartOfAccounts
- Implement Charges::PostService (Dr Tenant Receivable / Cr Income Account)
- Implement Charges::CreateService, Charges::CreateFeeService, and Charges::CreateReimbursementService
- Implement Charges::VoidService using Accounting::ReverseEntryService
- Automate rent charge generation:
- Implement RentCharges::GenerateService and RentCharges::GenerateThroughService
- Add GenerateDueRentChargesJob on daily Solid Queue schedule in config/recurring.yml
- Hook generation into Tenancies::CreateService and RentTerms::ChangeService
- Add retroactive change protection and month-start constraints in RentTerms::ChangeService
- Add active charge protection in Tenancies::UpdateService
- Replace and remove ScheduledRent and TenantCharge tables, models, controllers, views, and specs
- Implement transitional payment bridge in TenantPayments::CreateService (Dr Cash / Cr Tenant Receivable)
- Rewrite Tenancies::BalanceQuery to calculate balances strictly from ledger postings
- Update UI views and partials to follow standard double-entry sign conventions
chongfun
force-pushed
the
double_entry_accounting_milestone_3
branch
from
August 21, 2026 06:03
4c880f0 to
7c1504a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implement Milestone 3 of the Rental Domain and Double-Entry Accounting Architecture.
At the end of this milestone:
and:
and:
must all work through the accounting foundation established in Milestone 2.
ScheduledRentandTenantChargemust be removed.Tenancy balance must become:
rather than a reconstruction from domain tables.