UPDATE billing_records
SET billing_mode = 'SOFT'
WHERE billing_mode IS NULL
   OR billing_mode = ''
   OR LOWER(billing_mode) IN ('true', 'false');

UPDATE billing_records
SET modality = 'RECHARGE'
WHERE modality IS NULL
  AND operation = 'recharge';

UPDATE billing_records
SET success = TRUE
WHERE success IS NULL
  AND (operation = 'recharge' OR modality = 'RECHARGE');

UPDATE billing_records
SET unit_count = 1
WHERE unit_count IS NULL;
