-- Enable syncFilters for Payroll module's time_clock_aggregates table
-- This allows automatic backend sync when date filters change

UPDATE modules
SET config = jsonb_set(
    config,
    '{body,0,tabs,0,elements,0,options,syncFilters}',
    'true'::jsonb
)
WHERE name = 'Payroll'
  AND module_id = '018e3f0a-12d3-7c45-b89a-2f3c4e1d5b6c'::uuid;

-- Verify the update
SELECT 
    name,
    config->'body'->0->'tabs'->0->'elements'->0->'options'->>'syncFilters' as sync_filters_enabled,
    config->'body'->0->'tabs'->0->'elements'->0->'options'->>'tableName' as table_name
FROM modules
WHERE name = 'Payroll';
