Commit Graph

2 Commits

Author SHA1 Message Date
jordi fita mas ebb073166a Subsume collections into payments, and record payments in negative
This is to handle refunds, which are invoices with negative amounts,
that can be both issued or received (i.e., an “expense”).

The API provided by PostgreSQL is mostly the same, and internally it
deals with negatives, so the Go package only had to change selects of
collection.
2025-01-30 23:24:16 +01:00
jordi fita mas 7f31b10cce Add payment collection
This is the same as a payment, but the user is the payee instead of the
payer.

I used a different relation than payment because i do not know any other
way to encode the constraint that only invoices can have a collection,
while expenses have only payments.

Besides the name and the fact that they are related to invoices, a
collection is pretty much the same as a payment.
2024-08-21 03:36:12 +02:00