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
+15
View File
@@ -24,6 +24,8 @@ model participants {
created_at DateTime @default(now())
splits transaction_splits[]
account_owner_mappings account_owner_mappings[]
payments_sent split_payments[] @relation("payments_from")
payments_received split_payments[] @relation("payments_to")
}
model account_owner_mappings {
@@ -50,6 +52,19 @@ model transaction_splits {
@@unique([transaction_id, participant_id])
}
model split_payments {
id Int @id @default(autoincrement())
from_participant_id Int
to_participant_id Int
amount Decimal @db.Decimal(10, 2)
payment_date DateTime @db.Date
notes String?
linked_transaction_id Int?
created_at DateTime @default(now())
from_participant participants @relation("payments_from", fields: [from_participant_id], references: [id])
to_participant participants @relation("payments_to", fields: [to_participant_id], references: [id])
}
model tags {
id Int @id @default(autoincrement())
name String @unique