Architecture & System Blueprint

Developer Specification · Domain Models · Revenue Architecture · Regulatory Engine

API Management
Production Specification v2.4

Ghana Hire Purchase Management System

A comprehensive, enterprise-ready technical specification and architectural blueprint for the Bridgeway Technologies Ltd platform. Powers the complete hire purchase lifecycle, identity verification (NIA/DVLA), payments, credit risk scoring, government worker (CAGD IPPD2) salary deductions, and statutory GRA compliance across Ghana.

34
Platform Modules
8
Domain Subsystems
5 Tiers
Role Access Matrix
100%
Blockchain & Audit Trace

1. System Overview & Architecture

Core multi-tenant operating model and role hierarchy
Core Architecture

The Ghana Hire Purchase Management System (GHP) is a financial technology operating system developed by Bridgeway Technologies Ltd. It standardizes and governs credit-based retail sales, collateral verification, government employee deductions, debt recovery, and tax administration across accredited merchants in Ghana.

Primary Operating Purpose: Provide shops and enterprise merchants with an immutable, audited platform for responsible credit origination, biometrics-backed KYC, structured installments, and real-time revenue collection.
Architecture Layer Blueprint Decision Production Engineering Notes
Frontend Framework Single-Page Architecture with Vanilla JS IIFE & Tailwind/CSS Tokens Modular page routing, instantaneous client-side calculations, zero heavy bundler lock-in.
Backend REST Engine Django 5 + Django REST Framework + DRF Spectacular (OpenAPI 3.0) Full type safety, MultiPart file upload parser classes, robust role-based middleware.
Data & Persistence PostgreSQL (Relational + JSONB) + Redis Cache ACID transaction guarantees for ledger, automated indexes on Ghana Card & Contract IDs.
Payment Gateway PCI-DSS Level 1 Compliant Native MoMo & Card Processing Supports MTN Mobile Money, Telecel Cash, AT Money, Visa, Mastercard, and Bank Cheque.
Identity & Biometrics NIA Ghana Card API, DVLA Gateway, Face ID Verification Sub-2 second verification latency with automated fallback and audit logging.

Role-Based Access Control (RBAC) Hierarchy

RBAC MATRIX
# Minimum role enforcement level (0 to 4):
Staff(0) < Shop Manager(1) < Regional Manager(2) < CEO(3) < System Admin(4)

Every navigation link, API endpoint, and dashboard action enforces minimum role permissions both on the client and server side.

2. Module Inventory (34 Modules)

Complete interactive registry of all 34 system modules across 8 functional business domains
34 Modules 8 Subsystems

Filter modules by functional business domain or search by name, role requirement, and capabilities:

Module & Direct Access Domain Subsystem Min Role Core Operational Capabilities Action
Master Overview Dashboard
/dashboard/
1. Dashboards Role 0 (Staff) Real-time operations summary, system activity feed, national sales counters, and quick HP actions. Launch
CEO Executive Portal
/ceo-dashboard/
1. Dashboards Role 3 (CEO) Nationwide revenue velocity, regional portfolio performance, delinquency heatmaps, executive approval flags. Launch
Regional Portfolio Command
/regional-manager-dashboard/
1. Dashboards Role 2 (Reg Mgr) Cross-shop regional KPI tracking, regional underwriting quotas, territory risk analytics, branch rankings. Launch
Shop Operations Hub
/shop-manager-dashboard/
1. Dashboards Role 1 (Shop Mgr) Branch daily sales, inventory levels, down payment deposits, cashier drawer balance, staff management. Launch
Branch Register & POS
/shop-dashboard/
1. Dashboards Role 1 (Shop Mgr) Point-of-sale terminal, in-store cash drawer tracking, rapid installment lookup, receipt generation. Launch
Merchant Owner Portal
/shop-owner-portal/
1. Dashboards Role 1 (Shop Owner) Merchant revenue settlements, commission tracking, store profile configuration, B2B subscription status. Launch
Staff Task & Queue Desk
/staff-dashboard/
1. Dashboards Role 0 (Staff) Assigned customer verification tasks, pending contract creation queues, payment verification desk. Launch
HP Agreement Wizard
/hire-purchase-creation/
2. HP Origination Role 0 (Staff) Four-step origination workflow: buyer verification, product assignment, PMT calculation, down payment. Launch
HP Origination Studio v4
/hire-purchase-creation-v4/
2. HP Origination Role 0 (Staff) Next-generation origination interface with live installment simulators, instant Ghana Card OCR, and digital signing. Launch
Regional Underwriting & Approval
/hp-approval/
2. HP Origination Role 2 (Reg Mgr) Credit risk scoring evaluation, guarantor debt validation, 1-click contract approval, rejection reason notes. Launch
Financial Terms Calculator
/store/calculator/
2. HP Origination Role 0 (Public/Staff) Dynamic PMT schedule modeler, weekly/monthly installment split, deposit % slider, interest rate breakdown. Launch
Digital Legal Document Vault
/legal-documents/
2. HP Origination Role 1 (Manager) Statutory hire purchase contracts (Act 1974 NRCD 292), repossession notices, SHA-256 hash validation. Launch
Client Master Dossier & Face ID
/client-profile/
3. KYC & Biometrics Role 0 (Staff) Comprehensive borrower dossier, photo biometric match %, contract history, residential digital address map. Launch
NIA Identity Compliance Centre
/kyc-nia-centre/
3. KYC & Biometrics Role 1 (Manager) Live National Identification Authority lookup, incomplete verification billing tracker, biometric portrait store. Launch
Video KYC Remote Session Hub
/video-kyc/
3. KYC & Biometrics Role 1 (Manager) Remote customer video verification, live government ID capture, biometric liveness check, recording audit. Launch
Customer Self-Service Portal
/client-self-service/
3. KYC & Biometrics Role 0 (Client/Staff) Buyer payment schedule tracker, online balance inquiry, payment receipt downloads, profile update requests. Launch
Enterprise Client Portal v3
/client-self-service-v3/
3. KYC & Biometrics Role 0 (Client/Staff) Mobile-first customer self-service, instant MoMo quick repayments, upgrade & swap calculator, push notifications. Launch
Payment Gateway & MoMo Terminal
/payment-processing/
4. Payments & Store Role 0 (Staff) MTN Mobile Money, Telecel Cash, AT Money, Visa/Mastercard processing, instant receipt generation, ledger sync. Launch
Statement of Account & Ledger
/statement-of-account/
4. Payments & Store Role 0 (Staff) Complete chronological transaction ledger, principal vs interest splits, penalty audit, PDF statement exports. Launch
Public Marketplace Storefront
/
4. Payments & Store Role 0 (Public) Customer-facing retail storefront, product discovery, live weekly/monthly installment display, brand catalogue. Launch
Product Catalogue & Stock
/product-catalogue/
4. Payments & Store Role 0 (Staff) Inventory management, cash price vs HP price configuration, minimum deposit percentages, stock alerts. Launch
Direct Checkout & Order Tracker
/store/checkout/
4. Payments & Store Role 0 (Public) Instant hire purchase application, outright cash purchase flow, mobile money deposit confirmation, order tracking. Launch
Debt Collection & Recovery Hub
/debt-collection/
5. Debt & Field Role 1 (Manager) Aging buckets (1-30, 31-60, 60+ days), field agent assignments, repossession workflow, settlement negotiations. Launch
GPS Field Agent Dispatch Desk
/field-agent/
5. Debt & Field Role 0 (Agent/Staff) Field debt recovery assignments, GPS visit logging, photographic evidence capture, field receipt issuance. Launch
Mobile Agent Recovery Terminal v2
/field-agent-v2/
5. Debt & Field Role 0 (Agent/Staff) Optimized mobile field app with offline sync capability, instant GhanaPost GPS mapping, and MoMo collection trigger. Launch
National Credit Bureau Scoring
/credit-bureau/
6. Risk & Swaps Role 1 (Manager) 300–850 credit risk scoring, historical repayment streak analytics, default risk classification, bureau API pull. Launch
Asset Swap & Trade-In Desk
/swap-management/
6. Risk & Swaps Role 0 (Staff) Used device evaluation, trade-in condition grading, valuation differential settlement, refurbished inventory. Launch
National Fraud & Ban Registry
/ban-management/
6. Risk & Swaps Role 2 (Reg Mgr) Blacklist enforcement, fraud severity tiers (3 mo, 12 mo, Permanent), automatic block on new contract origination. Launch
GRA Statutory Tax Filing Hub
/gra-integration/
7. GRA & Telecom Role 2 (Reg Mgr) Ghana Revenue Authority compliance: automated VAT (15%), NHIL (2.5%), GETFund (2.5%), WHT (3%) calculation & export. Launch
Automated SMS Trigger Rules
/sms-automation/
7. GRA & Telecom Role 1 (Manager) Configurable lifecycle SMS: payment reminders (-3 days), overdue alerts (+15 days), welcome notifications, receipt SMS. Launch
Carrier SMS Gateway Centre
/sms-centre/
7. GRA & Telecom Role 1 (Manager) Ghana Telecel / MTN SMS gateway delivery log, carrier cost ledger (GHS 0.035/SMS), broadcast campaigns, audit trace. Launch
SHA-256 Audit Ledger
/blockchain-log/
8. Governance Role 3 (CEO/Admin) Immutable cryptographic audit chain, SHA-256 block mining, previous hash validation, proof-of-audit verification. Launch
Machine Learning Predictive Hub
/analytics-ml/
8. Governance Role 3 (CEO) Default prediction models, seasonal sales forecasting, regional revenue cluster analytics, AI customer segmentation. Launch
REST API & Key Governance
/api-management/
8. Governance Role 4 (Admin) OpenAPI 3.0 documentation, API key token generation, rate limiting (120 req/min), HMAC security headers, developer gate. Launch

3. Fee Structure & Revenue Engine

Mandatory transaction fee schedule and collection rules
Revenue Rules
Collection Rule: All fees are collected directly by Bridgeway Technologies Ltd. No fees are charged to accredited merchant shops for regular transactions. Shops/companies are billed only for incomplete verification inquiries initiated without completing the required client agreement.
Fee TypeRatePayerTimingReceipt Prefix
Client Verification Fee1% of product valueClientAt registration before submissionBTL-VER-XXXXXXXX
HP Processing Fee1% of agreement amountClientAt HP creation Step 4BTL-PROC-XXXXXXXX
Swap Exchange Fee1% of top-up differenceClientAt swap submissionBTL-SWP-XXXXXXXX
Lay-By Reservation Fee1% of product priceClientAt lay-by creationBTL-LAY-XXXXXXXX
NIA Incomplete Penalty1% of product valueMerchantIf NIA lookup runs without client completionBTL-PEN-XXXXXXXX
DVLA Incomplete Penalty1% of vehicle valueDealershipIf DVLA lookup runs without HP agreementBTL-PEN-XXXXXXXX
FEE CALCULATION ALGORITHM
// Fee helper reference implementation
const calculatePlatformFees = (productPrice, hpAgreementTotal) => {
  const verificationFee = Math.round(productPrice * 0.01 * 100) / 100;
  const processingFee   = Math.round(hpAgreementTotal * 0.01 * 100) / 100;
  return {
    verificationFee,
    processingFee,
    totalDueUpfront: verificationFee + processingFee
  };
};

4. Business Rules & Domain Constraints

Statutory limits, validation rules, and business logic
Domain Constraints
DomainConstraint / RuleTechnical Implementation
DVLA AccessRestricted exclusively to car_dealership entity types.Middleware & API gate checks shop.shop_type == 'car_dealership'.
Entity Type LockOnce confirmed as 'Shop' or 'Company', type cannot be changed.Immutable field; only System Admin (Role 4) has override permission.
Lay-By Schedule0% interest; released strictly at 100% completion; 3 missed payments triggers auto-cancellation.Cron job audits delinquent lay-bys; locks stock release until zero balance.
National Ban RegistryMild = 3 months, Moderate = 12 months, Severe = Permanent.Automatic expiry calculation; blocks HP origination during active ban.
Credit Score BandsRange: 300 to 850 (Exceptional: 800+, Good: 650-799, Fair: 500-649, Poor: <500).Calculated from payment behavior, debt history, and bureau reports.
CAGD IPPD2Monthly installment must not exceed 30% of gross salary; min 12 SSNIT contributions.Form validation rejects agreements exceeding 30% debt-to-income threshold.
Ghana Tax EngineVAT (15%) + NHIL (2.5%) + GETFund (2.5%) = 20% effective tax; WHT is 3%.Automated tax breakdown on every invoice and invoice remittance schedule.

5. Verification Protocols & Regex Specs

National ID, DVLA, TIN, SSNIT, and GPS format standards
Verification Engine
Service / IdentifierExpected FormatRegex PatternSample Valid Input
Ghana Card ID (NIA)GHA-XXXXXXXXX-X^GHA-\d{9}-\d$GHA-729104821-3
GRA Taxpayer TINC/P + 10 Digits^[CP]\d{10}$C0012345678
GhanaPost GPS AddressXX-NNN-NNNN^[A-Z]{2}-\d{3}-\d{4}$GA-183-9024
CAGD Staff IDXXX/YYYY/NNNNNN^[A-Z]{3}\/\d{4}\/\d{6}$GES/2021/049182
SSNIT NumberLetter + 10 Digits^[A-Z]\d{10}$C1092837465
DVLA Number PlateRegion-Number-Year^[A-Z]{2}-\d{1,4}-\d{2}$GR-4819-24

6. Domain Data Models

Core entity schema and database relationship specifications
Schema Dictionary
Model EntityKey Database ColumnsRelationships & Constraints
Productid, sku, name, cash_price, hp_price, image, stock, activeBelongs to Category & Shop; enforces min deposit.
ClientProfileid, ghana_card_id, full_name, phone, credit_score, photo, kyc_statusUnique Ghana Card constraint; links to Contracts & KYC files.
Contractid, contract_number, client_id, product_id, total_amount, balance_remaining, statusForeignKeys to Client & Product; tracks blockchain hash.
Paymentid, contract_id, amount, payment_method, transaction_reference, receipt_imageForeignKey to Contract; validates ledger reconciliation.
NIARecordid, ghana_card_id, full_name, dob, card_image_front, card_image_backStores NIA national verification snapshots & card scans.
BlockchainBlockid, block_index, block_hash, previous_hash, event_type, payloadImmutable Merkle chain for contract & payment integrity.

7. Technology Stack & Standards

Production architecture and development baseline
Production Ready
ComponentTechnology SelectionStandard & Rationale
Application ServerDjango 5.x / Python 3.14High-performance ASGI/WSGI backend with built-in ORM security.
API InterfaceDjango REST Framework + OpenAPI 3.0Standardized JSON endpoints with Swagger UI & Redoc interactive docs.
Relational DatabasePostgreSQL 16Robust ACID compliance, foreign key constraints, and JSONB document storage.
Security & AuthDjango Session + RBAC MiddlewareRole protection middleware guarding all 36 routes against unauthorized access.
Media & File StorageDjango Static & Media EngineMultipart file parser for product images, user avatars, and KYC identity scans.

8. Design Tokens & Brand Palette

Visual design tokens and typography specifications
Visual Tokens
CSS DESIGN TOKENS
--navy:   #1a2744;  /* Primary brand navy (headers, cards) */
--blue1:  #1a5276;  /* Deep accent blue */
--blue2:  #2e86c1;  /* Vibrant interactive blue (links, active buttons) */
--amber:  #f59e0b;  /* Brand gold (KPI highlights, primary accents) */
--green:  #27ae60;  /* Success badges, verified states, credit pass */
--red:    #e74c3c;  /* Error alerts, delinquent debt, bans */
--purple: #8b5cf6;  /* Alternate finance, lay-bys, video KYC */
Typography: Sora (Headers/Body), JetBrains Mono (Numbers, IDs, Code)

9. Merchant Subscription Tiers

Shop and enterprise office billing models
Subscription Model
Subscription TierMonthly PriceIncluded Quota & Features
StarterGHS 500NIA verification, basic HP origination, 50 automated SMS alerts/month.
ProfessionalGHS 750All Starter features + 200 SMS, analytics reports, DVLA checks for auto dealers.
EnterpriseGHS 1,500All Pro features + unlimited SMS, custom API integration, multi-branch network, 24/7 support.

10. Developer Acceptance Checklist

Pre-merge verification standards and quality gates
Acceptance Gate
Verification ItemTarget StandardAutomated Test Command
Route Protection100% of internal pages redirect unauthenticated/unauthorized users.manage.py test core
OpenAPI & Swagger/api/schema/, /api/docs/, /api/redoc/ return HTTP 200 OK.manage.py test core
Full App Test SuiteAll 36 unit/integration tests pass with 0 errors.manage.py test core hire_purchase accounts kyc
Static & Media EngineProduct photos, user avatars, and KYC card scans upload & render.Automated image upload test suite