-- Crypto deposit methods from external API (spin-passim.tech). Synced on Store open.
-- Single row: hash for future cache; minimum_deposit = min of all methods' min_deposit_sum.
CREATE TABLE `crypto_deposit_config` (
  `id` INT NOT NULL DEFAULT 1,
  `methods_hash` VARCHAR(255) NULL COMMENT 'Future: skip sync when unchanged',
  `minimum_deposit` DECIMAL(10,2) NOT NULL DEFAULT 2.50,
  `updated_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `crypto_deposit_config` (`id`, `minimum_deposit`) VALUES (1, 2.50);

-- One row per active deposit method (PID = icon filename, e.g. 235.png).
CREATE TABLE `crypto_deposit_methods` (
  `id` BIGINT NOT NULL AUTO_INCREMENT,
  `pid` INT NOT NULL COMMENT 'External API PID; equals icon filename without extension',
  `name` VARCHAR(100) NOT NULL,
  `network` VARCHAR(50) NOT NULL,
  `example` VARCHAR(255) NULL,
  `min_deposit_sum` DECIMAL(10,2) NOT NULL,
  `updated_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `uk_pid` (`pid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
