Skip to content

Double entry accounting milestone 4 - #83

Merged
chongfun merged 2 commits into
double_entry_accounting_milestone_3from
double_entry_accounting_milestone_4
Aug 24, 2026
Merged

Double entry accounting milestone 4#83
chongfun merged 2 commits into
double_entry_accounting_milestone_3from
double_entry_accounting_milestone_4

Conversation

@chongfun

Copy link
Copy Markdown
Owner

Replace the temporary TenantPayment domain with the permanent Receipt domain.

At the end of this milestone:

Party (payer)
    │
    ▼
Receipt
├── Tenancy
├── amount_cents
├── received_on
├── payment_method
├── external_reference
└── memo
    │
    ▼
JournalEntry
├── Dr Cash
└── Cr Tenant Receivable

A Receipt must preserve:

who paid
which tenancy received the credit
how much was received
when it was received
how it was received
external transaction identity
correction/void history

Tenant balance remains:

SUM(Tenant Receivable postings for tenancy)

@chongfun chongfun self-assigned this Aug 16, 2026
…versals

- Replace legacy TenantPayment with Receipt model featuring positive amount check constraint, partial unique index on (user_id, payment_method, external_reference), and strict posting immutability
- Post balanced Dr Cash / Cr Tenant Receivable journal entries tagged with both tenancy and payer party dimensions
- Implement Receipts::CreateService with automatic payer party resolution for single-tenant and guarantor tenancies
- Implement Receipts::VoidService and Receipts::CorrectService using row-level locking and accounting reversals dated at original received_on for bookkeeping restatement
- Retarget PaymentIngestion to Receipt and update PaymentIngestions::ConfirmService
- Update financial queries and Schedule E generator to aggregate from active receipts
- Build full ReceiptsController and UI with PDF receipt generation
- Remove all legacy TenantPayment models, controllers, views, routes, specs, and RBS definitions
@chongfun
chongfun force-pushed the double_entry_accounting_milestone_4 branch from 8874ec5 to 1c7fa75 Compare August 21, 2026 06:03
@chongfun
chongfun merged commit ef67fb5 into main Aug 24, 2026
5 checks passed
@chongfun
chongfun deleted the double_entry_accounting_milestone_4 branch August 24, 2026 00:59
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.

1 participant