Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Torpedo's avatar

how to deal with cancelations, payment monitoring

Currently i'm rewriting my app, until now i had 3 models:

Invoice, CanceledInvoice and InvoiceReminder for overdue invoices, basically all 3 models have same data except some content, invoice nr or status, and pdf path after its created.. what disadvantages could i have when i use only the invoice model and invoice db table with added columns for canceled invoices and reminders instead of 3 tables?

or what concepts could be better?

0 likes
1 reply
martinbean's avatar

@torpedo Well an invoice is an invoice, whether it’s cancelled or not. So you should have a single invoices table, and that table should have a status column indicating the current status of the that invoice (unpaid, paid, cancelled, voided, etc).

As for reminders, that’s a separate entity. So a single Invoice model may have multiple reminders if the customer is overdue or whatever.

Please or to participate in this conversation.