feat: expand client jobcard and reporting workflows

This commit is contained in:
Marco0300
2026-09-01 19:34:41 +02:00
parent 323afaf832
commit 703c3ca67d
10 changed files with 608 additions and 18 deletions
+8 -1
View File
@@ -58,11 +58,18 @@ CREATE TABLE IF NOT EXISTS client_contacts (
email VARCHAR(190) NULL,
phone VARCHAR(60) NULL,
is_primary BOOLEAN NOT NULL DEFAULT FALSE,
primary_client_id BIGINT UNSIGNED AS (IF(is_primary, client_id, NULL)) STORED,
notes TEXT NULL,
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
FOREIGN KEY (client_id) REFERENCES clients(id) ON DELETE CASCADE,
INDEX contacts_client_idx (client_id)
INDEX contacts_client_idx (client_id),
UNIQUE KEY one_primary_contact (primary_client_id)
) ENGINE=InnoDB;
CREATE TABLE IF NOT EXISTS jobcard_sequences (
sequence_year SMALLINT UNSIGNED PRIMARY KEY,
next_sequence INT UNSIGNED NOT NULL
) ENGINE=InnoDB;
CREATE TABLE IF NOT EXISTS sla_agreements (