-- phpMyAdmin SQL Dump
-- version 5.2.2
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Mar 02, 2026 at 04:39 PM
-- Server version: 10.6.25-MariaDB
-- PHP Version: 8.4.17

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";


/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;

--
-- Database: `cidapayc_solution`
--

-- --------------------------------------------------------

--
-- Table structure for table `border_payments`
--

CREATE TABLE `border_payments` (
  `id` int(11) NOT NULL,
  `user_id` varchar(50) NOT NULL,
  `reference` varchar(100) NOT NULL,
  `yellowcard_reference` varchar(100) DEFAULT NULL,
  `channel_id` varchar(50) NOT NULL,
  `network_id` varchar(50) NOT NULL,
  `destination_country` varchar(3) NOT NULL,
  `recipient_type` enum('bank','mobile') NOT NULL,
  `amount_usd` decimal(15,2) NOT NULL,
  `amount_ngn` decimal(15,2) NOT NULL,
  `fee_ngn` decimal(15,2) DEFAULT 0.00,
  `total_ngn` decimal(15,2) NOT NULL,
  `provider_fee_usd` decimal(15,2) DEFAULT 0.00,
  `service_fee_usd` decimal(15,2) DEFAULT 0.00,
  `recipient_data` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`recipient_data`)),
  `status` enum('pending','completed','failed') DEFAULT 'pending',
  `yellowcard_status` varchar(50) DEFAULT NULL,
  `transaction_type` enum('send','receive') DEFAULT 'send',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Indexes for dumped tables
--

--
-- Indexes for table `border_payments`
--
ALTER TABLE `border_payments`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `reference` (`reference`),
  ADD KEY `idx_user_id` (`user_id`),
  ADD KEY `idx_reference` (`reference`),
  ADD KEY `idx_status` (`status`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `border_payments`
--
ALTER TABLE `border_payments`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
COMMIT;

/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
