-- ===================================================================
-- MARS-828 Comprehensive Test Suite
-- ===================================================================
-- Purpose: Test all installation steps and archival strategies
-- Author: Grzegorz Michalski
-- Date: 2026-01-28
-- ===================================================================

SET SERVEROUTPUT ON SIZE UNLIMITED
SET FEEDBACK ON
SET ECHO ON

PROMPT ===================================================================
PROMPT MARS-828 COMPREHENSIVE TEST - START
PROMPT ===================================================================

-- STEP 1: Add Columns
PROMPT
PROMPT STEP 1: Adding Archival Strategy Columns
PROMPT ===================================================================
ALTER TABLE CT_MRDS.A_SOURCE_FILE_CONFIG ADD (
    ARCHIVAL_STRATEGY  VARCHAR2(30) DEFAULT 'THRESHOLD_BASED' NOT NULL,
    MINIMUM_AGE_MONTHS NUMBER(3) DEFAULT NULL
);

ALTER TABLE CT_MRDS.A_SOURCE_FILE_CONFIG ADD CONSTRAINT 
    CHK_ARCHIVAL_STRATEGY CHECK (ARCHIVAL_STRATEGY IN ('THRESHOLD_BASED', 'CURRENT_MONTH_ONLY', 'MINIMUM_AGE_MONTHS', 'HYBRID'));

SELECT column_name, data_type, nullable FROM all_tab_columns 
WHERE owner = 'CT_MRDS' AND table_name = 'A_SOURCE_FILE_CONFIG'
AND column_name IN ('ARCHIVAL_STRATEGY', 'MINIMUM_AGE_MONTHS');

PROMPT STEP 1 - COMPLETE

-- STEP 2: Verify FILE_ARCHIVER version
PROMPT
PROMPT STEP 2: Checking Current FILE_ARCHIVER Version
PROMPT ===================================================================
SELECT CT_MRDS.FILE_ARCHIVER.GET_VERSION() AS current_version FROM DUAL;

PROMPT ===================================================================
PROMPT TEST SUITE PARTIAL EXECUTION COMPLETE
PROMPT Next: Execute package updates manually
PROMPT ===================================================================
