feat: bitemporal effective date (#7) #16
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/issue-7-effective-date"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Bitemporal effective date (effective_at / posted_at)
Third item of the P1 double-entry tier (#7): a transaction now has a booking/entry date (the
existing
transactions.date) and an optional effective date — when it economically takeseffect (Modern Treasury
effective_at).effective_dateis nullable; NULL means effective ==booking date.
Purely additive — booking-date behavior is untouched
Existing
currentBalance, running-balance, statements, and idempotency/content_hashareunchanged. Effective date is captured on a separate path and surfaced via a new
effective-date balance query; all pre-existing tests pass unmodified.
Surfaces
ALTER TABLE transactions ADD COLUMN effective_date TEXT(nullable).DoubleEntryTransaction.effectiveDate: String?+effectiveOrBookingDatehelper.effective_date;transactionsByAccountEffective(filtersCOALESCE(effective_date, date) <= ?);Commands.effectiveBalance(account, asOf).effective_dateon PostTransaction/EditTransaction requests, the transaction detail,and register rows; new read RPC
GetEffectiveBalance(account_id, as_of) -> {balance}.postTransaction/editTransactiongain optionaleffectiveDate;TransactionDetailand
RegisterEntryexpose it;effectiveBalance(account, asOf).effective_dateon propose/commit_post_transaction; new read toolget_effective_balance.EffectiveDateTests), gRPC (EffectiveDateRPCTests), MCP.make testgreen.⚠️ Migration version — cross-branch coordination
This branch is cut from
main(migrations 1–8). It deliberately numbers the new migrationversion 10 (leaving a gap at 9) so it does not collide with the still-open #15
(attachments), which claims version 9 off the same base. The migrator applies per-recorded-
version (
schema_migrationsset membership), not max-version, so a gap is safe: a DB that ran v10will still apply v9 when #15 lands. When merging both #15 and #16, resolve the trivial conflicts
by ordering the
Schema.migrationsarray9then10and setting the migration-count assertion inCommonsStoreTeststo10.Scope
One P1 item (does not close #7). Report/net-worth integration of effective dates is intentionally a
follow-up; this lands the capture + query + wire foundation. Remaining P1 items (budgets,
pending/cleared) stay open.
2f11436a40c76adebd42View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.