CREATE TABLE `partner_ampere_accounts` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `partner_id` int(10) unsigned NOT NULL COMMENT 'Customer ID (partner type)',
  `brand_id` int(10) unsigned NOT NULL COMMENT 'Brand this account belongs to',
  `balance_ampere` int(11) NOT NULL DEFAULT 0 COMMENT 'Current ampere balance (can be negative)',
  `credit_limit_ampere` int(10) unsigned NOT NULL DEFAULT 0 COMMENT 'Maximum credit allowed',
  `is_blocked` tinyint(1) NOT NULL DEFAULT 0,
  `created_at` datetime NOT NULL DEFAULT current_timestamp(),
  `updated_at` datetime NULL DEFAULT NULL ON UPDATE current_timestamp(),
  PRIMARY KEY (`id`),
  UNIQUE KEY `uniq_partner_brand` (`partner_id`,`brand_id`),
  KEY `idx_partner_id` (`partner_id`),
  KEY `idx_brand_id` (`brand_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
