import type { RouteDefinition } from '../../core/router.js';
import {
  checkActivationCodeRoute,
  claimCouponRoute,
  confirmManualPaymentRoute,
  createPaymentRoute,
  createOrderRoute,
  entitlementCheckRoute,
  entitlementsRoute,
  createRefundRequestRoute,
  orderDetailRoute,
  orderStatusRoute,
  ordersRoute,
  paymentNotifyRoute,
  redeemActivationCodeRoute,
  refundRequestsRoute,
  refundNotifyRoute,
  updateRefundStatusRoute,
} from './routes.js';
import {
  adjustmentVoucherEventsRoute,
  adjustmentVoucherReportRoute,
  adjustmentVouchersRoute,
  commerceOperationsAnomaliesRoute,
  createAdjustmentVoucherRoute,
  updateAdjustmentVoucherStatusRoute,
} from './adjustments.js';
import {
  createReconciliationIssueRoute,
  importReconciliationRoute,
  previewReconciliationRoute,
  providerBillDownloadJobsRoute,
  reconciliationAnomaliesRoute,
  reconciliationBatchesRoute,
  reconciliationIssueEventsRoute,
  reconciliationIssuesRoute,
  reconciliationItemsRoute,
  requestProviderBillDownloadRoute,
  updateReconciliationIssueStatusRoute,
} from './reconciliation.js';

export const commerceRoutes: RouteDefinition[] = [
  ['POST', '/api/commerce/orders', createOrderRoute],
  ['GET', '/api/commerce/orders', ordersRoute],
  ['GET', '/api/commerce/orders/detail', orderDetailRoute],
  ['GET', '/api/commerce/orders/status', orderStatusRoute],
  ['GET', '/api/commerce/entitlements', entitlementsRoute],
  ['GET', '/api/commerce/entitlements/check', entitlementCheckRoute],
  ['GET', '/api/commerce/refunds', refundRequestsRoute],
  ['POST', '/api/commerce/refunds', createRefundRequestRoute],
  ['POST', '/api/commerce/refunds/status', updateRefundStatusRoute],
  ['POST', '/api/commerce/payments/create', createPaymentRoute],
  ['POST', '/api/commerce/payments/manual-confirm', confirmManualPaymentRoute],
  ['POST', '/api/commerce/payments/notify/wechat_pay', paymentNotifyRoute],
  ['POST', '/api/commerce/payments/notify/wechat-pay', paymentNotifyRoute],
  ['POST', '/api/commerce/payments/notify/alipay', paymentNotifyRoute],
  ['POST', '/api/commerce/refunds/notify/wechat_pay', refundNotifyRoute],
  ['POST', '/api/commerce/refunds/notify/wechat-pay', refundNotifyRoute],
  ['POST', '/api/commerce/refunds/notify/alipay', refundNotifyRoute],
  ['POST', '/api/commerce/reconciliation/preview', previewReconciliationRoute],
  ['POST', '/api/commerce/reconciliation/import', importReconciliationRoute],
  ['GET', '/api/commerce/reconciliation/batches', reconciliationBatchesRoute],
  ['GET', '/api/commerce/reconciliation/items', reconciliationItemsRoute],
  ['GET', '/api/commerce/reconciliation/anomalies', reconciliationAnomaliesRoute],
  ['GET', '/api/commerce/operations/anomalies', commerceOperationsAnomaliesRoute],
  ['GET', '/api/commerce/adjustment-vouchers', adjustmentVouchersRoute],
  ['POST', '/api/commerce/adjustment-vouchers', createAdjustmentVoucherRoute],
  ['POST', '/api/commerce/adjustment-vouchers/status', updateAdjustmentVoucherStatusRoute],
  ['GET', '/api/commerce/adjustment-vouchers/events', adjustmentVoucherEventsRoute],
  ['GET', '/api/commerce/adjustment-vouchers/report', adjustmentVoucherReportRoute],
  ['POST', '/api/commerce/reconciliation/provider-bills/request', requestProviderBillDownloadRoute],
  ['GET', '/api/commerce/reconciliation/provider-bills/jobs', providerBillDownloadJobsRoute],
  ['POST', '/api/commerce/reconciliation/issues/create', createReconciliationIssueRoute],
  ['GET', '/api/commerce/reconciliation/issues', reconciliationIssuesRoute],
  ['POST', '/api/commerce/reconciliation/issues/status', updateReconciliationIssueStatusRoute],
  ['GET', '/api/commerce/reconciliation/issues/events', reconciliationIssueEventsRoute],
  ['POST', '/api/commerce/activation-codes/check', checkActivationCodeRoute],
  ['POST', '/api/commerce/activation-codes/redeem', redeemActivationCodeRoute],
  ['POST', '/api/commerce/coupons/claim', claimCouponRoute],
];
