-- Sample data for local database testing
-- Run these queries to populate your local MySQL database with test data

-- First, let's insert data into the application table
INSERT INTO application (id, platform, name, instance_id, active, created_at, updated_at) VALUES
(1, 'desktop', 'Sage', '1-054d7020D97948f7a', 1, '2025-08-01 10:31:19', '2025-08-11 13:19:32'),
(2, 'desktop', 'Sage', '1-054d7020D97948f7a', 1, '2025-08-01 10:31:19', '2025-08-11 13:19:32'),
(3, 'desktop', 'QuickBooks', '1-054d7020D97948f7a', 1, '2025-08-01 10:31:19', '2025-08-11 13:19:32'),
(4, 'desktop', 'Freeagent', '1-054d7020D97948f7a', 1, '2025-08-01 10:31:19', '2025-08-11 13:19:32'),
(5, 'desktop', 'Dynamic Table', '1-054d7020D97948f7a', 1, '2025-08-01 10:31:19', '2025-08-11 13:19:32'),
(6, 'web', 'Xero', '1-054d7020D97948f7a', 1, '2025-08-01 10:31:19', '2025-08-11 13:19:32'),
(7, 'web', 'Zoho', '1-054d7020D97948f7a', 1, '2025-08-01 10:31:19', '2025-08-11 13:19:32'),
(8, 'web', 'Hive', '1-054d7020D97948f7a', 1, '2025-08-01 10:31:19', '2025-08-11 13:19:32'),
(9, 'web', 'QuickBooks', '1-054d7020D97948f7a', 1, '2025-08-01 10:31:19', '2025-08-11 13:19:32');

-- Now insert data into direct_integration_uploads table
INSERT INTO direct_integration_uploads (
    id, filename, original_filename, s3_bucket, s3_key, application_id, 
    playlist_id, playlist_mode, playlist_name, error_message, processed, 
    extracted_data, step_details, created_at, updated_at, user_id, company_id
) VALUES
(1, 'Test.playlist-intent', 'Test.playlist-intent', 'big-pond-openai', 'directintegration/placeholder', NULL, NULL, 'new', 'test1', 'An error occurred (404) when calling the HeadObject operation: Not Found', 0, NULL, NULL, '2025-08-15 09:10:53', '2025-08-15 09:24:02', 'irfan1', NULL),

(2, 'rf0-43ba-b73d-b031b6f1d5b8_upload.xlsx', '50', 'directintegration', 'directintegration/ap-southeast-2:1ff2f478-rf0-43ba-b73d-b031b6f1d5b8/invoice_upload.xlsx', NULL, NULL, 'existing', 'Sage', 'TypeError("Please Select Document Type", "listError"): "#*#", "sublistRow": "#-#", "placeholder": ["type"], ["altText": "Please Select Document Type"], ["placeholderText"]: null', 1, NULL, NULL, '2025-08-15 09:32:21', '2025-08-15 09:32:21', 'irfan1', NULL),

(3, 'test2.playlist-intent', 'test2.playlist-intent', 'big-pond-openai', 'directintegration/placeholder', NULL, NULL, 'new', 'test2', 'An error occurred (404) when calling the HeadObject operation: Not Found', 0, NULL, NULL, '2025-08-15 09:55:03', '2025-08-15 10:02:34', 'irfan1', NULL),

(4, 'invoice_upload.xlsx', 'invoice_upload.xlsx', 'directintegration', 'directintegration/ap-southeast-2:1ff2f478-rf0-43ba-b73d-b031b6f1d5b8/invoice_upload.xlsx', NULL, NULL, 'existing', 'Sage', NULL, 0, NULL, '{"type": "Please Select Document Type", "listError": "#*#", "sublistRow": "#-#", "placeholder": ["type"], ["altText": "Please Select Document Type"], ["placeholderText"]: null}', '2025-08-15 10:07:21', '2025-08-15 10:07:21', 'irfan1', NULL),

(5, 'Action test.playlist-intent', 'Action test.playlist-intent', 'big-pond-openai', 'directintegration/placeholder', NULL, NULL, 'new', 'Action test', 'An error occurred (404) when calling the HeadObject operation: Not Found', 0, NULL, NULL, '2025-08-15 10:24:45', '2025-08-15 10:27:28', 'irfan1', NULL),

(6, 'Test Xero-playlist-intent', 'Test Xero-playlist-intent', 'big-pond-openai', 'directintegration/placeholder', NULL, NULL, 'new', 'Test Xero', 'An error occurred (404) when calling the HeadObject operation: Not Found', 0, NULL, NULL, '2025-08-15 11:06:20', '2025-08-15 11:07:46', 'irfan1', NULL);

-- Optional: Create some sample playlists to reference
INSERT INTO playlists (id, name, created_date, application_id, user_id, company_id) VALUES
(1, 'Test.playlist-intent', '2025-08-15 09:10:53', 1, 'irfan1', NULL),
(2, 'Sage Invoice Upload', '2025-08-15 09:32:21', 1, 'irfan1', NULL),
(3, 'test2.playlist-intent', '2025-08-15 09:55:03', 1, 'irfan1', NULL),
(4, 'Action test.playlist-intent', '2025-08-15 10:24:45', 1, 'irfan1', NULL),
(5, 'Test Xero-playlist-intent', '2025-08-15 11:06:20', 6, 'irfan1', NULL);

-- Optional: Add some sample actions for the playlists
INSERT INTO actions (playlist_id, action_type, x, y, key_name, timestamp, playlist_name) VALUES
(1, 'click', 100, 200, NULL, '2025-08-15 09:11:00', 'Test.playlist-intent'),
(1, 'key', 0, 0, 'Enter', '2025-08-15 09:11:05', 'Test.playlist-intent'),
(2, 'click', 150, 300, NULL, '2025-08-15 09:32:30', 'Sage Invoice Upload'),
(3, 'click', 200, 400, NULL, '2025-08-15 09:55:10', 'test2.playlist-intent'),
(5, 'click', 250, 500, NULL, '2025-08-15 11:06:30', 'Test Xero-playlist-intent');
