feat(shared): replace settle buttons with payment ledger

- New split_payments table records actual payments between participants
- Balance = total split obligations - total payments (splits never marked settled)
- Record Payment modal per participant: direction toggle, amount pre-filled with balance, date, notes
- Payment history inline on each balance card with +/- display and delete
- Per-transaction Settle button removed; Action column removed from shared table
- Splits always show the true cost breakdown regardless of payment state
This commit is contained in:
2026-03-14 21:09:00 +11:00
parent 5206388958
commit 85e7801407
6 changed files with 383 additions and 94 deletions
@@ -0,0 +1,13 @@
CREATE TABLE split_payments (
id SERIAL PRIMARY KEY,
from_participant_id INTEGER NOT NULL REFERENCES participants(id),
to_participant_id INTEGER NOT NULL REFERENCES participants(id),
amount DECIMAL(10,2) NOT NULL CHECK (amount > 0),
payment_date DATE NOT NULL,
notes TEXT,
linked_transaction_id INTEGER REFERENCES transactions(id) ON DELETE SET NULL,
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
);
CREATE INDEX idx_split_payments_from ON split_payments(from_participant_id);
CREATE INDEX idx_split_payments_to ON split_payments(to_participant_id);