← All projects

Finance

eRev

Modular revenue collection counties, hospitals, hotels, bars, parking. Cashier till, field agent, mobile-money, all reconciled nightly. Cuts revenue leakage 25–40%.

Visit project

What it does

eRev is a modular revenue collection platform counties, hospitals, parking, hotels, bars all run different bill structures, and eRev hosts each one as a configurable revenue stream. Cashiers issue receipts at till; field agents collect on the move; mobile-money customers settle on STK push.

Highlights

  • Configurable revenue streams define a new stream (line items, taxes, age-based rebates, cancellation rules) in admin without code. New revenue mode goes live the same day.
  • Multi-channel collection counter till, field tablet, web portal, M-Pesa STK, Paybill push, and bank PesaLink all land into the same ledger.
  • Real-time reconciliation every M-Pesa transaction is matched to a receipt within seconds. Orphan transactions surface to the finance officer with a one-click "attach to receipt" action.
  • Automatic refund pipeline duplicate-payment detection plus a maker-checker refund flow (powered by moffhub/maker-checker).
  • Receipts via SMS + thermal printer payer gets a confirmation SMS in under 30 seconds (uses moffhub/sms-handler with provider fallback).
  • Per-officer dashboards collectors see their daily target vs cleared, with an end-of-shift cash-up summary that pre-fills the deposit slip.
  • Audit-grade exports every report exports to CSV / Excel / PDF with the actor + timestamp watermark required for county auditor handover.

How we built it

A single Laravel core powers every revenue stream. Each tenant has its own bill schema (line items, taxes, age-based discounts) defined in admin. The tax-engine and rebate-engine are pure functions on the bill easy to test, easy to audit. Reconciliation runs nightly: every M-Pesa transaction is matched to a receipt and any orphan is surfaced for action.

The architecture is multi-tenant single-DB with a tenant_id discriminator on every domain table. Cuts deploy cost, makes report aggregation across counties trivial.

Behind the scenes

  • Idempotency keys on every charge Daraja replays don't double-bill.
  • Hot finance dashboards back to ten-minute Redis caches; cold reports hit the warehouse copy.
  • All write paths through the activity log; the audit team's "who changed this receipt's amount?" question is a single query.
  • Maker-checker for any manual override of a system-calculated total.

What changed for the client

Counties using eRev cut leakage by 25–40% in their first year mostly from closing the gap between cashed-out collections and what reached the treasury. The modular streams design lets us onboard a new tenant in a week, not a quarter.

Stack

  • Laravel
  • Vue
  • PostgreSQL
  • M-Pesa
  • Daraja
  • STK
  • B2B