[
  {
    "type": "update",
    "description": "Add resyncRules and resyncPersistentThresholdDays to pos-data-catchup job config for stale data detection",
    "database": "kiosk_buykiosk",
    "check_query": "SELECT 1 FROM task_job_definitions WHERE name = 'pos-data-catchup' AND JSON_EXTRACT(config, '$.resyncRules') IS NOT NULL",
    "sql": "UPDATE `task_job_definitions` SET config = JSON_SET(config, '$.resyncRules', JSON_ARRAY(JSON_OBJECT('id', 'sfile_payment_columns_2026', 'table', 'drsDailySFileData', 'dataType', 'dailyClose', 'dateColumn', 'closingDate', 'staleCriteria', JSON_OBJECT('columns', JSON_ARRAY('buyPaidDigital', 'buyPaidGiftCard', 'paidOutGiftCard'), 'condition', 'all_zero'), 'enabled', true)), '$.resyncPersistentThresholdDays', 14) WHERE name = 'pos-data-catchup'"
  }
]
