-- KYN POS Phase 6 Payment and Daily Close Workflows
-- Purpose: Phase 6 uses the existing Phase 2 financial tables and adds no mandatory schema changes.
-- This marker migration lets the installer/ledger record that the payment/daily-close workflow package was applied.

CREATE TABLE IF NOT EXISTS pos_phase_markers (
    id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
    marker_key VARCHAR(80) NOT NULL,
    marker_note VARCHAR(255) NULL,
    created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
    PRIMARY KEY (id),
    UNIQUE KEY uq_pos_phase_markers_key (marker_key)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO pos_phase_markers (marker_key, marker_note)
VALUES ('phase_6_payment_daily_close', 'Payment ledger, discounts, voids/comps, close check, and daily close draft workflows installed.')
ON DUPLICATE KEY UPDATE marker_note = VALUES(marker_note);
