-- Step 1: Insert test transactions
INSERT INTO transactions 
(
    transaction_ref_number,
    transaction_amount,
    inserted_at,
    updated_at,
    status,
    merchant_id,
    device_id,
    provider_name
) 
VALUES 
(
    'TEST_20231016_001',
    100.00,
    '2023-10-16 04:29:00',
    '2023-10-16 04:29:00',
    'success',
    'MERCH001',
    'TERM001',
    'TEST_PROVIDER'
);

-- Step 2: Verify the inserted transaction
SELECT 
    transaction_ref_number,
    transaction_amount,
    DATE_FORMAT(inserted_at, '%Y-%m-%d %H:%i:%s') as transaction_time,
    TIME(inserted_at) as time_only,
    CASE 
        WHEN TIME(inserted_at) <= '04:30:00' THEN 'Include ✅'
        ELSE 'Exclude ❌'
    END as settlement_status
FROM transactions 
WHERE transaction_ref_number = 'TEST_20231016_001';
