diff --git a/docs/admin-backend-spec.md b/docs/admin-backend-spec.md index f9678a6..3835bfd 100644 --- a/docs/admin-backend-spec.md +++ b/docs/admin-backend-spec.md @@ -21,6 +21,7 @@ | 2026-08-06 | Data migration import jobs | | 2026-08-06 | Deployed Admin SPA: https://gishen-admin.vercel.app | | 2026-08-06 | List UX: filters + create pages for orders, Rx, orgs, stock, team, procurement; `POST` create sketches below | +| 2026-08-06 | Finance: gateway enable/disable moved to `/admin/finance/gateways` UI route `/finance/gateways` | ## Conventions diff --git a/src/app/AppRoutes.tsx b/src/app/AppRoutes.tsx index d65e28c..a8a2a65 100644 --- a/src/app/AppRoutes.tsx +++ b/src/app/AppRoutes.tsx @@ -12,6 +12,7 @@ import { CreateStockPage } from '@/pages/stock/CreateStockPage' import { ProcurementPage } from '@/pages/procurement/ProcurementPage' import { CreateProcurementRequestPage } from '@/pages/procurement/CreateProcurementRequestPage' import { FinancePage } from '@/pages/finance/FinancePage' +import { PaymentGatewaysPage } from '@/pages/finance/PaymentGatewaysPage' import { OrganisationsPage } from '@/pages/organisations/OrganisationsPage' import { CreateOrganisationPage } from '@/pages/organisations/CreateOrganisationPage' import { MarketingPage } from '@/pages/marketing/MarketingPage' @@ -53,6 +54,7 @@ export function AppRoutes() { } /> } /> } /> + } /> } /> } /> } /> diff --git a/src/pages/finance/FinancePage.tsx b/src/pages/finance/FinancePage.tsx index b519edc..8e2b84c 100644 --- a/src/pages/finance/FinancePage.tsx +++ b/src/pages/finance/FinancePage.tsx @@ -1,28 +1,31 @@ -import { useState } from 'react' +import { Link } from 'react-router-dom' import { useTranslation } from 'react-i18next' import { toast } from 'sonner' +import { Settings2 } from 'lucide-react' import { PageShell } from '@/layouts/PageShell' import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card' import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from '@/components/ui/table' import { Badge } from '@/components/ui/badge' import { Button } from '@/components/ui/button' -import { SwitchRow } from '@/pages/finance/SwitchRow' import { settlements } from '@/mocks/data' import { formatEtb } from '@/lib/utils' -const gateways = [ - { id: 'chapa', label: 'Chapa', enabled: true }, - { id: 'arifpay', label: 'ArifPay', enabled: true }, - { id: 'telebirr', label: 'Telebirr', enabled: false }, - { id: 'mpesa', label: 'M-Pesa', enabled: false }, -] - export function FinancePage() { const { t } = useTranslation() - const [gw, setGw] = useState(gateways) return ( - + + + + Manage gateways + + + } + >
@@ -55,26 +58,27 @@ export function FinancePage() { - Payment gateways + Operations - {gw.map((g) => ( - { - setGw((prev) => prev.map((x) => (x.id === g.id ? { ...x, enabled: !x.enabled } : x))) - toast.success(`${g.label} ${g.enabled ? 'disabled' : 'enabled'} (no code release)`) - }} - /> - ))}
Loyalty points liability (Aug): {formatEtb(182400)}
- +

+ Gateway enable / disable lives on a dedicated settings page so day-to-day finance work stays focused on + settlements and refunds. +

+
+ + +
diff --git a/src/pages/finance/PaymentGatewaysPage.tsx b/src/pages/finance/PaymentGatewaysPage.tsx new file mode 100644 index 0000000..0fe1ba3 --- /dev/null +++ b/src/pages/finance/PaymentGatewaysPage.tsx @@ -0,0 +1,67 @@ +import { useState } from 'react' +import { Link } from 'react-router-dom' +import { toast } from 'sonner' +import { ArrowLeft } from 'lucide-react' +import { PageShell } from '@/layouts/PageShell' +import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card' +import { Button } from '@/components/ui/button' +import { Badge } from '@/components/ui/badge' +import { SwitchRow } from '@/pages/finance/SwitchRow' + +const initialGateways = [ + { id: 'chapa', label: 'Chapa', enabled: true, type: 'Aggregator' }, + { id: 'arifpay', label: 'ArifPay', enabled: true, type: 'Aggregator' }, + { id: 'telebirr', label: 'Telebirr', enabled: false, type: 'Direct wallet' }, + { id: 'mpesa', label: 'M-Pesa', enabled: false, type: 'Direct wallet' }, +] + +export function PaymentGatewaysPage() { + const [gw, setGw] = useState(initialGateways) + + return ( + + + + Back to Finance + + + } + > + + + Channel controls + + Changes apply immediately in the demo. Telebirr / M-Pesa may require INSA clearance before go-live. + + + + {gw.map((g) => ( +
+
+
+

{g.label}

+

{g.type}

+
+ {g.enabled ? 'Live' : 'Off'} +
+ { + setGw((prev) => + prev.map((x) => (x.id === g.id ? { ...x, enabled: !x.enabled } : x)), + ) + toast.success(`${g.label} ${g.enabled ? 'disabled' : 'enabled'} (no code release)`) + }} + /> +
+ ))} +
+
+
+ ) +}