START TRANSACTION;

CREATE TABLE `tblwisetack_payouts` (
  `id` int(50) UNSIGNED NOT NULL,
  `tenant_id` int(50) NOT NULL,
  `application_transaction_id` varchar(255) NOT NULL,
  `payout_transaction_id` varchar(100) DEFAULT NULL,
  `requested_amount` decimal(15,2) DEFAULT NULL,
  `approved_amount` decimal(15,2) DEFAULT NULL,
  `payout_status` varchar(200) DEFAULT NULL,
  `date_created` timestamp NOT NULL DEFAULT current_timestamp(),
  `date_updated` timestamp DEFAULT NULL on update CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
ALTER TABLE `tblwisetack_payouts` ADD PRIMARY KEY (`id`);
ALTER TABLE `tblwisetack_payouts` MODIFY `id` int(50) UNSIGNED NOT NULL AUTO_INCREMENT;
ALTER TABLE `tblwisetack_payouts` ADD KEY `application_transaction_id` (`application_transaction_id`);
ALTER TABLE `tblwisetack_payouts` ADD KEY `payout_transaction_id` (`payout_transaction_id`);
ALTER TABLE `tblwisetack_payouts` ADD KEY `tenant_id` (`tenant_id`);


ALTER TABLE `tblinvoicepaymentrecords` CHANGE `status` `status` TINYINT NULL DEFAULT '1' COMMENT '1 = Completed | 2 = Pending | 3 = Failed | 4 = Retry | 5 = Refunded | 6 = Cancelled | 7 = Partial Refund | 8 - Processing | 9 = Dispute | 10 = Financed';

COMMIT;