numerus/pkg
jordi fita mas 90982b49ff Move the product_id field from invoice_product to a separate table
We are going to allow invoices with products that are not (yet) inserted
into the products table.

We always allowed to have products in invoices with a totally different
name, description, price, and whatnot, but until now we had the product
id in these invoice lines for statistics purposes.

However, Oriol raised the concern that this requires for the products
to be inserted before we can create an invoice with them, and we do not
plan to have a “create product while invoicing” feature, thus it would
mean that people would need to cancel the new invoice, create the new
product, and then start the invoice again from scratch.

The compromise is to allow products in the invoice that do not have a
product_id, meaning that at the time the invoice was created they were
not (yet) in the products table.  Oriol sees this stop-invoice-create-
product issue more important than the accurate statistics of product
sales, as it will probably be only one or two units off, anyway.

I did not want to allow NULL values to the invoice product’s product_id
field, because NULL means “dunno” instead of “no product”, so i had to
split that field to a separate table that relates an invoice product
with a registered product.
2023-04-19 19:30:12 +02:00
..
company.go Create constants for the HTMX request and response headers used 2023-04-06 12:07:20 +02:00
contacts.go Add validation for minimum length of contact’s name 2023-04-18 21:01:29 +02:00
db.go Properly register array and composite PostgreSQL types with pgtype 2023-02-20 11:42:21 +01:00
form.go Add validation for minimum length of contact’s name 2023-04-18 21:01:29 +02:00
htmx.go Create constants for the HTMX request and response headers used 2023-04-06 12:07:20 +02:00
invoices.go Move the product_id field from invoice_product to a separate table 2023-04-19 19:30:12 +02:00
locale.go Add currency_pattern to language relation 2023-02-23 12:12:33 +01:00
logger.go Move source file to the root of pkg 2023-01-17 10:40:22 +01:00
login.go Replace default router with github.com/julienschmidt/httprouter 2023-02-03 12:30:56 +01:00
pgtypes.go Replace tag relations with array attributes 2023-04-07 21:31:35 +02:00
products.go Replace tag relations with array attributes 2023-04-07 21:31:35 +02:00
profile.go Create constants for the HTMX request and response headers used 2023-04-06 12:07:20 +02:00
recover.go Gofmt recover.go 2023-01-22 20:37:34 +01:00
router.go Allow editing invoice tags inline from the index table 2023-04-11 10:46:27 +02:00
template.go Allow editing invoice tags inline from the index table 2023-04-11 10:46:27 +02:00