-- Venue Events Manager — Database update v1.000.010
-- Invoice Due status (confirmed booking, unpaid, not past due);
-- Create Quote/Invoice forms sectioned (Information, Spaces, Additional Charges).
-- No schema changes. Import via phpMyAdmin → Import (MySQL / MariaDB).

SET NAMES utf8mb4;

INSERT INTO `settings` (`key`, `value`, `is_encrypted`, `created_at`, `updated_at`)
VALUES ('schema_version', '1.000.010', 0, NOW(), NOW())
ON DUPLICATE KEY UPDATE `value` = '1.000.010', `updated_at` = NOW();

INSERT INTO `settings` (`key`, `value`, `is_encrypted`, `created_at`, `updated_at`)
VALUES ('app_version', '1.000.010', 0, NOW(), NOW())
ON DUPLICATE KEY UPDATE `value` = '1.000.010', `updated_at` = NOW();

INSERT INTO `settings` (`key`, `value`, `is_encrypted`, `created_at`, `updated_at`)
VALUES (
  'release_notes',
  'v1.000.010: New Invoice status Due (issued invoice, booking confirmed, no payment, not overdue); Create Quotation/Invoice forms split into Information, Spaces, and Additional Charges; Guest Count removed from Information (uses space guests).',
  0, NOW(), NOW()
)
ON DUPLICATE KEY UPDATE `value` = VALUES(`value`), `updated_at` = NOW();

SELECT 'Update v1.000.010 applied successfully' AS result;
