feat(events): "Create invoice" action on the event detail page
Add a bills-gated button that opens the bill editor pre-filled with the event (eventId FK + name/date snapshot) and the linked customer (when exactly one). BillEditorPage gains eventId state + query-param prefill + sends eventId on create; backend validates eventId (already forwarded + persisted). Reuses the editor — no empty drafts. Does not auto-pull hours.
This commit is contained in:
@@ -240,6 +240,9 @@ const INVOICE_BODY_VALIDATORS = [
|
||||
body('skontoDisabled').optional().isBoolean(),
|
||||
// Inline event snapshot (migration 123). Mirrors quotes — kept
|
||||
// optional because standalone invoices may not have an event yet.
|
||||
// eventId links the invoice to a gallery event (FK) when created from
|
||||
// the event detail page; persisted by createInvoice (event_id).
|
||||
body('eventId').optional({ values: 'falsy' }).isInt({ min: 1 }),
|
||||
body('eventName').optional({ values: 'falsy' }).isString().isLength({ max: 255 }),
|
||||
body('eventDate').optional({ values: 'falsy' }).isISO8601(),
|
||||
body('eventTimeStart').optional({ values: 'falsy' }).isString().isLength({ max: 8 }),
|
||||
|
||||
Reference in New Issue
Block a user