MajlinkE
Enterprise operations

MajlinkE — Supply Chain & Retail Business Platform

Complete guide to setting up and operating the MajlinkE multi-tenant supply chain platform — covering supplier organisations, retailer business management, field agents, and multi-user team features. Works for any product vertical: pharmaceuticals, FMCG, food & beverages, building materials, and more.

🚀 System Overview

MajlinkE is a multi-tenant supply chain and retail business platform built for Nigerian distributors and retailers across any product vertical. It connects distributors to their retail networks — tracking deliveries, sales, inventory, credit, and fraud detection in real time — while giving retailers a full standalone business management suite.

🏢Multi-TenantEach supplier company is a fully isolated organisation
📦Real-Time InventoryStock auto-updates on every sale and delivery
🛒Order LifecycleRetailer → Supplier → Delivery → Invoice
🔔Smart AlertsLow stock, inactivity, spikes, mismatch auto-detection
💳Credit LedgerGoods-on-credit with running balance per retailer
⚠️Fraud DetectionAuto-flags when sold qty exceeds supplied qty
📊AnalyticsRevenue trends, product rankings, geo heat map
🧾Retailer DashboardGross profit, expenses, net profit, closing stock
👥Multi-User TeamsCashiers and managers under one retailer account
🏷️Custom PricingRetailer sets their own selling price per product
🖨️Receipt PrintingThermal-style printable receipt per sale
📱Mobile APIREST API for retailer & agent mobile apps
🏭 Industry coverage: Pharmaceuticals · FMCG & Consumer Goods · Food & Beverages · Dairy & Chilled · Building Materials · Grain & Staples · Personal Care — any vertical works because the product catalogue is fully generic.

Step 1 · First Login

The first account you should use is the Super Admin. It has unrestricted access to the entire platform.

1

Go to /login and sign in with the super admin credentials below.

2

You will land on the Main Dashboard which shows platform-wide sales totals and recent transactions.

3

Navigate to Settings → System Settings to configure the company name, currency, logo, and time zone.

💡 The super admin account is the only account that can see data across all organisations simultaneously. All other roles are scoped to a single organisation.

Step 2 · Create an Organisation

Every supplier company must have its own Organisation record before any users or data can be associated with it.

1

Go to /admin/platform (Super Admin only).

2

Click Organisations in the platform menu.

3

Click New Organisation. Fill in: Name, Email, Phone, Address, Currency Code (NGN), Status (Active).

4

After saving, note the Organisation ID — you will assign it to the supplier admin user in the next step.

5

Create the Supplier Admin user account: go to User Management → Users → Add User. Set role_type = supplier_admin and select the organisation from the dropdown.

⚠️ A supplier admin with no organisation assigned will be blocked from all /supplier/* pages and redirected to the main dashboard with a warning.

💳 Self-Serve Signup (/subscribe)

Besides the manual flow above, prospective supplier organisations can sign themselves up and pay for a plan without a super admin creating anything up front. No account exists until a super admin approves the paid application — payment alone never grants access.

1

Prospect visits /subscribe (public, no login required) — or a Growth Partner's referral link, /subscribe?ref={code} — and fills in company details, their state, the admin username/email they want to log in with, and picks a plan — plans, pricing, and included user seats are all admin-configurable at /admin/platform/plans, not hardcoded.

2

They choose monthly or annual billing, optionally enter a coupon code (/admin/platform/coupons), then a payment method — Paystack or Monnify (Moniepoint) — and are redirected to that gateway's hosted checkout page to pay the discounted total.

3

Once payment succeeds, the application is automatically marked Awaiting Approval (confirmed via a browser redirect back to /subscribe/callback/{gateway} and, independently, a webhook — whichever arrives first).

4

A super admin reviews it under Platform Admin → Subscription Applications (/admin/platform/subscriptions), checks the payment proof, and clicks Approve.

5

Approving creates the Organisation and the admin User automatically, generates a secure password, and emails the applicant their login link, username, and password.

💡 Paystack and Monnify credentials are configured under Platform Admin → Payment Gateways (/admin/platform/settings/payment-gateways) — no code changes or redeploys needed to rotate keys or switch from sandbox to live.
⚠️ A rejected or still-unpaid application never creates an org or user — only Approve does.

Step 3 · Add Products & Variants

Products represent the drug catalogue. Each drug can have multiple pack-size variants (e.g. Carton, Box, Blister Pack).

Add a Simple Product

1

Go to /products/products/create.

2

Fill in: Name, Code (SKU), Category, Brand, Unit, Cost Price, Sale Price.

3

Set Stock Alert threshold — this is the reorder level that triggers a low-stock alert.

4

Toggle High Margin flag if this product should appear in the retailer's high-margin report.

5

Save. The product is now available across the system.

Add Pack-Size Variants

1

On the product edit page, toggle Has Variants.

2

Add a row for each pack size: select the unit (Carton / Box / Blister Pack / Tablet), enter cost and price.

3

Save. Retailers will see each variant as a separate line item when logging sales.

💊 Unit hierarchy: Carton → Box (×10) → Blister Pack (×10) → Tablet/Capsule (×10). Also supported: Sachet Box → Sachet (×50) and Bottle Carton → Bottle (×12).

Step 4 · Add Retailers

Retailers are the pharmacies and drug stores that the supplier supplies to. They must be linked to the supplier organisation through the supplier_retailer relationship.

1

Create a user account for the retailer: /user-management/users → Add User. Set role_type = retailer. Do not set an organisation_id on the retailer user account.

2

Log in as the Supplier Admin (or switch to their org as super admin via /supplier/select-org).

3

Go to /supplier/retailers. New retailers submitted for onboarding appear in the Pending tab.

4

Click Approve on a retailer to activate them. You can also set their Credit Limit at this stage.

5

Once approved, the retailer appears in the Active tab and can immediately log sales and place orders.

Step 5 · Set Opening Inventory

Before the system can track stock accurately, you must record the initial stock supplied to each retailer via a Stock Delivery.

1

Go to /supplier/deliveries/create.

2

Select the Retailer, set the delivery date.

3

Add each product and the quantity delivered. Click Save & Confirm.

4

The system creates or updates an inventory_snapshot record for each product: quantity_supplied increments, current_stock recalculates.

📦 current_stock = quantity_supplied − quantity_sold. It updates in real time every time a retailer logs a sale or a delivery is confirmed.

Step 6 · Configure Alert Thresholds

Alerts fire automatically when inventory conditions are met. The key threshold is the reorder level set per product.

1

Open any product: /products/products/{id}/edit.

2

Set Stock Alert to the minimum acceptable units (e.g. 20 for a fast-moving line). This becomes the reorder_level.

3

When a retailer's current_stock drops to or below this number, a low_stock alert fires automatically and appears in /supplier/alerts.

4

When stock hits zero or goes negative, an out_of_stock alert fires with critical severity.

Step 7 · Add Users

MaaZGSI has four distinct user roles. Here is how to create each type:

Supplier Admin

Create user → set role_type = supplier_admin → assign organization_id from the org dropdown. This user will manage the supplier's supply chain portal.

Retailer

Create user → set role_type = retailer → leave organization_id blank. The supplier admin then links and approves them via /supplier/retailers.

Field Agent

Create user → set role_type = field_agent → assign to the supplier organisation. Their landing page is /agent/dashboard; they log retailer visits from /agent/visits/create.

Super Admin

Create user → set role_type = super_admin → leave organization_id blank. They access all orgs via /admin/platform and can switch into any supplier's context at /supplier/select-org.

📊 Supplier Dashboard

URL: /supplier/dashboard

The command centre for a supplier admin. Shows the health of their entire retail network at a glance.

🏪 Retailers

URL: /supplier/retailers

Manage the pharmacies and drug stores in your supply network.

Status Tabs

  • Active — fully onboarded and operational
  • Pending — applied but not yet approved
  • Suspended — temporarily blocked from ordering

Actions

📋 Orders

URL: /supplier/orders

All supply orders placed by retailers. Filterable by status.

Status Flow

Retailer submits order → ⏳ Pending → Supplier reviews → ✓ Approved  or  ✗ Rejected → 📦 Delivered → Credit Issued + Invoice

🚚 Deliveries

URL: /supplier/deliveries

Record physical stock sent to retailers independently of the order system (e.g. opening stock, ad-hoc restocks, or deliveries that bypass the order workflow).

1

Click New Delivery → /supplier/deliveries/create.

2

Select the Retailer, the delivery Date, and optionally attach a reference number.

3

Add product lines: product name and quantity delivered.

4

Click Confirm Delivery. The system increments quantity_supplied on each matching inventory_snapshot row and recalculates current_stock.

5

If a matching snapshot doesn't exist (first delivery of this product to this retailer), a new row is created automatically.

📌 Use Deliveries for opening stock when onboarding a new retailer. This establishes the baseline for inventory tracking.

📦 Inventory Overview

URL: /supplier/inventory

A live view of stock levels across all retailers in your network.

Filter Tabs

  • All — every product-retailer combination tracked
  • Low Stock — current_stock > 0 but ≤ reorder_level (yellow warning)
  • Out of Stock — current_stock ≤ 0 (red critical)

Columns Explained

Retailer Inventory View

Click the eye icon on any row to see all products for that specific retailer at /supplier/inventory/{retailer_id}.

💳 Credit & Payments

URL: /supplier/credit

Tracks goods-on-credit balances for each retailer. Retailers receive stock before paying — this module manages that ledger.

🔔 Alerts

URL: /supplier/alerts

All supply chain alerts for your organisation, newest first. The bell icon in the top navigation shows the unread count in real time.

Alert Types

TypeSeverityTrigger
out_of_stockCriticalcurrent_stock drops to ≤ 0
low_stockWarningcurrent_stock ≤ reorder_level
mismatchCriticalsold qty exceeds supplied qty
inactivityWarningno sales from retailer in 7+ days
new_orderInforetailer submits a new order
payment_dueWarningpayment deadline approaching
payment_overdueCriticalpayment past due date

Actions

⚠️ Mismatches

URL: /supplier/mismatches

A mismatch is automatically created whenever a retailer's current_stock goes negative — meaning they have logged more sales than the system recorded as supplied to them. This is the primary fraud detection mechanism.

Filter Options

  • Status: Open · Investigating · Resolved
  • Severity: Critical · Warning

Severity Scale

  • Warning — discrepancy of 1–19 units
  • Critical — discrepancy of 20+ units

Investigation Workflow

1

A mismatch appears as Open as soon as the system detects negative stock.

2

Click the mismatch to open the detail view. Review: product, retailer, supplied qty, sold qty, discrepancy size, date first detected.

3

Dispatch a field agent or contact the retailer to investigate. Update status to Investigating and add notes.

4

Once resolved (counting error confirmed, stock reconciled, or escalated), click Mark Resolved and add resolution notes. The record is permanently kept for audit purposes.

⚠️ A mismatch does not automatically adjust inventory. The resolution is human — you decide whether to raise a credit note, issue replacement stock, or escalate.

📈 Analytics

URL: /supplier/analytics

Deep-dive analytics for the selected time period. Use the period buttons (7 / 30 / 90 days / 1 Year) to change the scope.

📊 Retailer Business Dashboard

URL: /retailer/dashboard

The retailer's command centre. Unlike the supplier view (which only shows supply quantities and supply costs), this dashboard shows the retailer's own financial performance — gross profit, expenses, net profit, and cash flow — data the supplier never sees.

Period Filter

Use the pill buttons at the top — Today / This Week / This Month / Custom — to scope all KPI cards and charts to a chosen date range.

Financial KPI Cards (Row 1)

Inventory KPI Cards (Row 2)

30-Day Chart

Bar chart showing daily Revenue (blue) vs Expenses (red) for the last 30 days. Hover any bar for the exact amount.

Closing Stock Table

Full product list with cost price, selling price, margin %, current units, and stock value. Products below reorder level are highlighted in amber.

Expenses by Category

Top 5 expense categories this period with amounts — gives a quick view of where money is going (rent, wages, fuel, etc.).

🔒 Privacy guarantee: The supplier's dashboard never shows the retailer's customer revenue or profit. Suppliers only see supply quantities and the costs they charged the retailer.

💸 Retailer Expenses

URL: /retailer/expenses

Record and categorise all operating costs for the store — rent, staff wages, electricity, generator fuel, logistics, etc. Expenses are isolated per retailer account (sub-users share the same expense pool as the main account owner).

Log an Expense

1

Go to /retailer/expenses/create.

2

Select an Expense Category (e.g. Store Rent, Staff Wages, Electricity Bill).

3

Enter the Amount, Date, and an optional Description.

4

Click Save Expense. The amount is immediately reflected in the dashboard's Net Profit and Cash Flow cards.

Expense History

The expenses list at /retailer/expenses is filterable by date range. Each row shows reference, category, amount, date, and a delete button. The period total is shown above the table.

📈 Retailer Sales Reports

URL: /retailer/reports/overview

Aggregated financial reports for the retailer, broken down by period (daily / weekly / monthly) and filterable by date range.

Period Breakdown Table

Each row is one day/week/month, showing: Revenue, Gross Profit, Expenses, and Net Profit. Quickly spot which periods were most profitable.

Products Sold Ranking

A table of every product sold in the period: quantity, revenue, and gross profit contribution. Sort by any column.

3-Dataset Chart

A grouped bar chart overlaying Revenue (blue), Gross Profit (green), and Expenses (red) per period for visual trend analysis.

💡 Switch between daily / weekly / monthly grouping using the tabs at the top of the report page. The same underlying data just aggregates differently.

🖨️ Receipt Printing

URL: /retailer/sales/{id}/receipt

Every sale has a printable receipt available. The receipt is a standalone page (no sidebar, no header) styled for thermal printers — typically 80mm roll paper.

Receipt Contents

  • Store name and sale reference number
  • Sale date and time
  • Line items: product name, quantity, unit price, line total
  • Grand total and amount paid
  • Payment status (PAID / PARTIAL / UNPAID)
  • Thank-you footer

How to Print

1

From the dashboard's Recent Sales table, click the Receipt link on any sale row.

2

The receipt page opens in a new tab. Click the Print Receipt button or press Ctrl/⌘ + P.

3

In the browser print dialog, select your thermal printer. The page CSS automatically hides the print button and formats the output for narrow paper.

👥 Team Management (Multi-User)

URL: /retailer/team

A retailer account owner can create sub-user accounts (cashiers, managers, viewers) for their staff. All sub-users share the owner's product catalogue and see the same inventory — but the owner can see all activity attributed to each team member.

Sub-User Roles

RoleWhat they can do
CashierLog sales, view own sales, print receipts. Cannot see financial KPIs or manage team.
ManagerEverything a cashier can do, plus: view full dashboard KPIs, log expenses, view reports.
ViewerRead-only access to dashboard, inventory, and reports. Cannot create any records.

Invite a Team Member

1

Go to /retailer/team (only available to the account owner — sub-users cannot manage team).

2

Click Add Team Member. Enter: Name, Email, Password, and Sub-User Role.

3

Click Create. The new account is created with parent_retailer_id pointing to the owner's account.

4

Share the login credentials with the team member. They log in at the normal login page — the system detects they are a sub-user and loads the correct retailer context.

🔗 All sales, expenses, and inventory reads by a sub-user are automatically attributed to the main retailer account (the owner). There is no configuration needed — it is automatic.

🏷️ Custom Selling Prices

URL: /retailer/inventory

Products are supplied by the supplier at a fixed cost price, but retailers are free to set their own selling price independently. Each retailer maintains their own price list in the retailer_product_prices table. The supplier never sees the retailer's selling price.

Set a Selling Price

1

Go to /retailer/inventory. Each product row has a price editor inline.

2

Enter either a Selling Price (absolute amount) or a Margin % (markup over supplier cost). The system computes the other automatically.

3

Click Save. The price is stored in retailer_product_prices and immediately reflected in the dashboard's stock value calculations and gross profit KPIs.

Fallback Behaviour

If a retailer has not set a custom price for a product, the system falls back to the supplier's listed products.price. This means a retailer can start recording sales immediately without setting prices first.

⚠️ Selling prices are per-retailer. Changing the supplier's product price does not override a retailer's custom price — it only affects retailers who have not set one.

🏢 How Multi-Tenancy Works

MajlinkE is fully multi-tenant. Every supplier organisation is completely isolated — one org's data is never visible to another org's users. Here is the isolation model:

organisation_id scopes all supply chain data (products, retailers, orders, deliveries, inventory, alerts, analytics)
retailer_id scopes all retailer business data (sales, expenses, inventory snapshots, team members)
parent_retailer_id links sub-users to their owner account — shared pool of data

Tenant Isolation Rules

  • A supplier admin with organization_id = 3 can only see retailers, orders, and inventory belonging to org 3
  • A retailer user can only see their own sales, expenses, and inventory — even if they receive stock from multiple supplier orgs
  • A super admin can switch between any org via /supplier/select-org — this is the only cross-tenant view
  • Field agents are scoped to one organisation and only see retailers linked to that org

Adding a New Industry Vertical

1

Create a new Organisation at /admin/platform with appropriate name, slug, and plan.

2

Create product categories and units relevant to the vertical (e.g. "FMCG & Household", "Crate", "Bag (50kg)").

3

Create a supplier admin user with organization_id set to the new org.

4

Add products with organization_id set. These products are only visible to this org's supply chain.

5

Onboard retailers by creating retailer accounts and linking them via /supplier/retailers.

✅ The platform currently hosts 8 active organisations across two verticals: Pharmaceuticals (6 orgs) and FMCG/Food & Beverages (2 demo orgs). Both verticals run identically — only the product catalogue differs.

🏭 FMCG Demo — Dangote Industries

A live demonstration of the platform applied to Fast-Moving Consumer Goods. Organisation: Dangote Industries Ltd. Products include sugar, salt, cement, flour, pasta, tomato paste, and noodles.

Demo Credentials

RoleEmailPassword
Supplier Adminadmin@dangote.ngSupplier@123
Field Agentagent@dangote.ngAgent@123
Retailer — Shoprite (Ikeja)shoprite@retailer.ngRetailer@123
Retailer — Spar (Victoria Island)spar@retailer.ngRetailer@123
Retailer — Justrite (Surulere)justrite@retailer.ngRetailer@123
Retailer — PriceLess (Abuja)priceless@retailer.ngRetailer@123
Retailer — Kano Traderskanotraders@retailer.ngRetailer@123

Sample Products (8 SKUs)

  • Dangote Sugar 50kg — DNG-SUG-50 — Grain & Staples
  • Dangote Salt 1kg — DNG-SLT-1K — Seasonings & Condiments
  • Dangote Cement 50kg — DNG-CEM-50 — Building Materials
  • Dangote Pasta 500g — DNG-PST-500 — Food & Beverages
  • Dangote Tomato Paste 800g — DNG-TMP-800 — Seasonings & Condiments
  • Dangote Flour 50kg — DNG-FLR-50 — Grain & Staples
  • Dangote Noodles (Carton) — DNG-NDL-CTN — Food & Beverages
  • Dangote Table Salt 500g — DNG-SLT-500 — Seasonings & Condiments

🥛 Food & Beverages Demo — Chi Limited

A live demonstration of the platform applied to Dairy and Juice products. Organisation: Chi Limited. Products include Chivita juices, Hollandia dairy range, and Chi ice cream.

Demo Credentials

RoleEmailPassword
Supplier Adminadmin@chifoods.ngSupplier@123
Field Agentagent@chifoods.ngAgent@123
Retailer — FoodCo (Ibadan)foodco@retailer.ngRetailer@123
Retailer — Mega Plaza (Lagos)megaplaza@retailer.ngRetailer@123
Retailer — Bim's (Abuja)bims@retailer.ngRetailer@123
Retailer — Ebeano (Lekki)ebeano@retailer.ngRetailer@123
Retailer — Goodies (PH)goodies@retailer.ngRetailer@123

Sample Products (8 SKUs)

  • Chivita Active 1L — CHI-ACT-1L — Food & Beverages
  • Chivita Exotic 1L — CHI-EXO-1L — Food & Beverages
  • Hollandia Yoghurt 500ml — CHI-HOL-500 — Dairy & Chilled
  • Hollandia Evaporated Milk — CHI-HEM-400 — Dairy & Chilled
  • Chi Cool Peak Ice Cream 2L — CHI-ICE-2L — Dairy & Chilled
  • Chivita 250ml Carton ×24 — CHI-ACT-CTN — Food & Beverages
  • Hollandia Full Cream 1L — CHI-FCM-1L — Dairy & Chilled
  • Chi Exotic Juice 250ml — CHI-EXO-250 — Food & Beverages

👑 Role Guide: Super Admin

super_admin

The platform administrator. Unrestricted access to all organisations, all data, all settings.

Daily Tasks

  • Review the main dashboard for platform-wide revenue and anomalies
  • Go to /admin/platform for cross-org platform analytics
  • Use /supplier/select-org to enter any supplier's context and review their supply chain data
  • Create new organisations and first admin accounts for new supplier companies
  • Review all users at /user-management/users — filter by role_type to find unlinked accounts
  • Review paid /admin/platform/subscriptions applications awaiting approval
  • Extend or reactivate a lapsed organisation's subscription from its detail page

Extending or Reactivating a Subscription

1

Open /admin/platform/organizations/{id} — the Subscription panel in Organisation Details shows the current expiry date and status (active/suspended).

2

Enter a number of days in the Extend by (days) field and click Extend & Reactivate.

3

This always both extends the expiry and reactivates the org (sets status = active) in one action — there's no separate "reactivate only" button, since a suspended org needs a valid future expiry to mean anything.

💡 Extending is additive: it adds days to the later of "now" or the org's current expiry, so extending an org that hasn't lapsed yet never loses time already paid for. It also resets all reminder-email flags, so the 7/3/1-day reminders fire fresh for the new cycle.

💳 Subscription Plans New

Plans are no longer hardcoded — /admin/platform/plans lets you create, edit, and retire plans without a deploy.

1

Each plan has a monthly and annual price, an included user seat count (staff/team users, not retailers) with a per-additional-user overage price, plus the existing retailer/product caps and analytics/geo/API feature flags.

2

Click Deactivate to stop a plan appearing on /subscribe for new signups — existing organisations already on it are completely unaffected and keep resolving their limits normally.

⚠️ A plan's slug is fixed at creation and never editable — every organisation on that plan references it by slug (organizations.subscription_plan), so renaming the underlying slug would silently break their pricing/limits lookup. Renaming the display name is fine any time.

🎟️ Coupons

/admin/platform/coupons — percentage or fixed-amount discounts, optionally capped by number of uses, a date window, or restricted to one plan. Applied by the customer at checkout on both /subscribe and /renew. A coupon's use count only increments on a payment that actually succeeds — an abandoned checkout never burns a redemption.

🆓 Trials

1

From an organisation's detail page, enter a number of days under Start Trial.

2

This sets the trial end date and reuses the exact same expiry/reminder/grace-period machinery as a normal subscription — the org just shows a Trial badge instead of a plan badge until it ends.

3

The first time a trialling org actually pays (via /renew), it's stamped as a trial conversion automatically — no manual step.

🔄 Upgrade / Downgrade / Cancel

The Change Plan dropdown on an organisation's detail page switches their plan slug immediately — the new price applies from their next billing cycle (no proration). Cancel Subscription sets a distinct cancelled status (voluntary) separate from suspended (involuntary, non-payment) — cancelling never deletes any data, and the org can be brought back any time via Extend.

🧾 Invoices & Failed Payments

An invoice (INV-YYYY-NNNNN, downloadable as a PDF) is generated automatically the moment a payment is confirmed — visible to the supplier admin at /invoices and to you on the organisation's detail page. Paystack/Monnify failure webhooks, plus a daily sweep for checkouts abandoned for over 24 hours, both mark a subscription_applications row failed — filterable on /admin/platform/subscriptions — so a payment attempt is never left silently stuck in limbo.

🤝 Growth Partners & Referral Attribution New

MAJLINK Business Development Reps ("Growth Partners") each get a unique referral link. A business that signs up through it is automatically attributed to that partner — and stays attributed even across plan changes, renewals, or cancellations, until you explicitly reassign it.

1

Create a partner at /admin/platform/growth-partners — set their tier (Rep, State Manager, Regional Manager, or Country Manager) and the territory they operate in (seeded with Nigeria's real Country → 6 geopolitical Regions → 36 States + FCT hierarchy). A secure login is generated and shown once — share it with the partner directly.

2

Set Reports To to build the management chain — a rep reports to their state manager, who reports to a regional manager, who reports to the country manager. This is what "clearly identifies" who's heading each territory.

3

The partner's unique link (/subscribe?ref={code}) is shown on their own dashboard and on their detail page in your admin view. Anyone who signs up through it sees a confirmation banner naming the referring partner, and — once their application is approved — the new organisation is attributed automatically.

4

If a partner leaves, use Reassign Growth Partner on any of their referred organisations' detail pages. Every reassignment is permanently logged (old partner, new partner, who made the change, when) — attribution history is never silently overwritten.

⚠️ A bad or expired referral link never blocks a signup — it just fails to attribute silently, so a marketing link going stale can never cost you a paying customer.
💡 Growth Partners are recognition/leaderboard-only in this phase — there is no commission ledger or payout tracking. They see their own referred businesses and referral link at /growth-partner/dashboard, logged in with the growth_partner role.

🏆 Leaderboard & Performance Dashboard New

A monthly leaderboard ranks every Growth Partner by how many businesses they've brought on — visible to the whole team so everyone can see how the network is performing, with revenue kept private to the super admin.

1

Everyone except retailers can view /leaderboard. It ranks partners by subscriber count for the selected month, with the top three marked 🥇🥈🥉.

2

Filter by territory (country, region, or state) to see who's leading a specific patch, or by period to look back at a past month.

3

The revenue column only appears for the super admin — everyone else sees rank and subscriber count only, exactly as the client spec requires.

4

The current month is always computed live. Past months are read from a permanent snapshot instead — taken automatically at 00:30 on the 1st of each month by a scheduled job, so historical rankings never change after the fact even as new organisations sign up.

💡 The Super Admin dashboard (/admin/platform/dashboard) now also shows a "Subscription Business" section for the current month — subscription revenue, new customers, renewals, cancellations, failed payments, trial conversions, and the top 5 referral partners — plus a link through to the full leaderboard.

Switching Between Supplier Orgs

1

Click Supply Chain → Supplier Dashboard in the sidebar.

2

You are redirected to /supplier/select-org showing all 6 supplier organisations.

3

Select one and click Enter Supplier View. Session stores the selection.

4

All supply chain pages now show that organisation's data. The blue banner at the top of each page shows which org you are viewing.

5

Click Switch Org in the banner at any time to return to the selection screen.

🏭 Role Guide: Supplier Admin

supplier_admin

Manages one organisation's supply chain. Cannot see other organisations' data.

Daily Routine

  • Open /supplier/dashboard — check pending orders count and unread alerts first
  • Go to /supplier/orders?status=pending and action all pending orders (approve or reject)
  • Check /supplier/alerts for critical alerts (out-of-stock, payment overdue)
  • Check /supplier/mismatches?status=open and begin investigation on any critical discrepancies
  • Review /supplier/inventory?filter=out_of_stock and schedule deliveries for stocked-out retailers

Monthly Tasks

  • Review /supplier/analytics?period=30 for top/least selling products and retailer rankings
  • Reconcile credit balances at /supplier/credit — follow up on overdue accounts
  • Check inactive retailers in the dashboard and dispatch field agents

💳 Subscription Expiry & Renewal

Each plan runs on a ~30-day cycle. As expiry approaches you'll see a banner (and once-a-day popup) at the top of every page — starting 7 days out, it just warns; after expiry there's a 3-day grace period where the app still works but the warning turns urgent; after that the organisation is suspended and every supply-chain page redirects to the renewal page until it's paid.

1

Click Renew Now on the banner, or go directly to /renew.

2

Confirm your plan (price shown includes any extra-user overage beyond your plan's included seats), pick monthly or annual billing, optionally apply a coupon code, choose Paystack or Monnify, and pay on the gateway's checkout page.

3

Access is restored immediately on successful payment — unlike first-time signup, renewal does not wait on super admin approval, since you're already a verified organisation.

💡 Renewing before expiry adds the new cycle on top of your remaining days rather than resetting from today — you never lose time you already paid for. You'll also get an email confirmation, and an invoice appears at /invoices for every successful payment.

🏪 Role Guide: Retailer

retailer

Store owners linked to one or more supplier organisations. Retailers have a full standalone business management suite — see the Retailer Business section for the complete feature set.

Log a Sale

1

Go to /retailer/sales/create.

2

Select the supplier organisation whose stock you are selling from.

3

Add products with quantity and selling price. GPS coordinates are captured automatically if browser location is permitted.

4

Click Record Sale. The system immediately: deducts from current_stock, updates the dashboard KPIs, and checks alert thresholds.

Place a Restock Order

1

Go to /retailer/orders/create.

2

Select products and quantities needed. Add any special instructions in the notes field.

3

Submit. The order goes to the supplier as Pending. You will receive an alert when it is approved or rejected.

Daily Routine

  • /retailer/dashboard — check Revenue, Gross Profit, and Net Profit for today
  • Record all sales through /retailer/sales/create or via POS
  • Log any operating costs at /retailer/expenses/create (wages, rent, fuel)
  • Print a receipt for each customer from the Recent Sales table on the dashboard

Inventory & Reports

  • /retailer/inventory — live stock levels + inline price editor
  • /retailer/inventory/out-of-stock — quick list of stocked-out lines
  • /retailer/reports/overview — sales overview with daily/weekly/monthly breakdown
  • /retailer/team — manage cashier and manager sub-accounts (owner only)

🧳 Role Guide: Field Agent

field_agent

Field agents visit pharmacies and drug stores on behalf of the supplier organisation to verify stock levels, collect orders, and resolve issues.

Pages

URLWhat it shows
/agent/dashboardToday's visit count, 7-day bar chart, overdue retailers (not visited this week), recent visits, and unread stock alerts.
/agent/retailersCard grid of all retailers in your organisation — with total visit count, last-visit date (red if > 7 days ago), and stock health badge. Search by name or email.
/agent/retailers/{id}Retailer deep-dive: inventory table colour-coded by stock level, pending supply orders, recent deliveries, and full paginated visit history.
/agent/visitsFull visit log with filter by status (Visited / Missed / Postponed) and date range. Geolocated visits show a Google Maps link.
/agent/visits/createLog a new visit — select retailer, choose status, write notes, and optionally capture GPS coordinates via the browser's Geolocation API.

Daily Flow

1

Log in and open /agent/dashboard. Check the Retailers to Visit panel for pharmacies not visited in the last 7 days.

2

Go to /agent/retailers and click a retailer card to open their detail page. Review stock levels — rows highlighted in red mean out-of-stock; amber means low stock.

3

After the visit, click Log Visit (from the dashboard, retailers list, or retailer detail page). Choose a status:

  • Visited — you met with the retailer and completed the check.
  • Missed — retailer was not available (closed, refused, etc.).
  • Postponed — visit rescheduled at the retailer's request.

Add notes on stock levels, orders discussed, or issues found. Click Capture Location to stamp the visit with your GPS coordinates.

4

If a stock mismatch needs investigation, record the physical count in the visit notes. The supplier admin can reference this from the retailer's visit history.

💡 The Log Visit button on the retailer card pre-fills the retailer field when opening the form, so you never have to search for it manually.

🔑 Test Credentials

Three verticals are pre-seeded. All retailer accounts demonstrate the full Retailer Business Platform (dashboard, expenses, reports, receipts, team).

Platform Admin

RoleOrganisationEmailPassword
Super Admin— Platformsuperadmin@maazgsi.comSuperAdmin@123

Pharmaceuticals (6 orgs)

RoleOrganisationEmailPassword
Supplier AdminEmzor Pharmaceuticalsadmin@emzorpharma.comSupplier@123
Supplier AdminFidson Healthcareadmin@fidson.comSupplier@123
Supplier AdminMay & Baker Nigeriaadmin@mayandbaker.ngSupplier@123
Supplier AdminGlaxoSmithKline Nigeriaadmin@gsk.ngSupplier@123
Supplier AdminNeimeth Internationaladmin@neimeth.ngSupplier@123
Supplier AdminSanofi Nigeriaadmin@sanofi.ngSupplier@123
RetailerHealthPlus Pharmacy (Ikeja)healthplus@pharmacy.ngRetailer@123
RetailerMedStore Nigeria (Surulere)medstore@pharmacy.ngRetailer@123
Field AgentEmzor Pharmaceuticalsagent@emzorpharma.comAgent@123

FMCG & Consumer Goods — Dangote Industries

RoleStore / OrgEmailPassword
Supplier AdminDangote Industries Ltdadmin@dangote.ngSupplier@123
Field AgentDangote Industries Ltdagent@dangote.ngAgent@123
RetailerShoprite (Ikeja City Mall)shoprite@retailer.ngRetailer@123
RetailerSpar Nigeria (Victoria Island)spar@retailer.ngRetailer@123
RetailerJustrite Superstore (Surulere)justrite@retailer.ngRetailer@123
RetailerPriceLess Foods (Abuja)priceless@retailer.ngRetailer@123
RetailerKano Traders Wholesalekanotraders@retailer.ngRetailer@123

Food & Beverages / Dairy — Chi Limited

RoleStore / OrgEmailPassword
Supplier AdminChi Limitedadmin@chifoods.ngSupplier@123
Field AgentChi Limitedagent@chifoods.ngAgent@123
RetailerFoodCo Supermarket (Ibadan)foodco@retailer.ngRetailer@123
RetailerMega Plaza (Lagos)megaplaza@retailer.ngRetailer@123
RetailerBim's Supermarket (Abuja)bims@retailer.ngRetailer@123
RetailerEbeano Supermarket (Lekki)ebeano@retailer.ngRetailer@123
RetailerGoodies Supermarket (PH)goodies@retailer.ngRetailer@123

📐 Inventory Tracking Logic

Inventory is tracked per organisation × retailer × product in the inventory_snapshots table. There is no manual stock count — everything is computed from transactions.

current_stock = quantity_supplied − quantity_sold
quantity_supplied += units on each confirmed Delivery or Delivered Order
quantity_sold += units on each Sale logged by the Retailer
reorder_level = stock_alert value on the product record
  • If current_stock ≤ reorder_level → low_stock alert fires
  • If current_stock ≤ 0 → out_of_stock alert fires
  • If current_stock < 0 → Mismatch Log created + mismatch alert fires

🔔 Alert System Reference

Alerts are stored in the supply_alerts table. They are created automatically by the system or manually by admins. The bell icon count only shows unread alerts for the logged-in user's organisation.

  • is_read = 0 → unread (counts toward the bell badge)
  • is_read = 1 + read_at timestamp → marked as read
  • Severity levels: info (blue), warning (yellow), critical (red)
  • Alert data field: JSON payload with context (e.g. order_id, product_id, discrepancy units)

📋 Full Order Workflow

1. Retailer creates order /retailer/orders/create
2. Status: pending — supplier receives alert
3. Supplier approves → Status: approved — retailer receives info alert
   OR Supplier rejects → Status: rejected — rejection reason shown to retailer
4. Supplier marks delivered → Status: delivered
   → inventory_snapshot.quantity_supplied incremented
   → supplier_retailer.outstanding_balance incremented
   → credit_transactions row: type = credit_issued
5. Retailer pays → Supplier records payment /supplier/credit/{id}
   → outstanding_balance decremented
   → credit_transactions row: type = payment_received

💳 Credit Ledger Reference

The credit_transactions table is an append-only ledger. Each row records one event:

  • credit_issued — stock delivered on credit (balance ↑)
  • payment_received — cash or transfer received (balance ↓)
  • adjustment — manual correction by supplier admin
  • refund — credit note for returned goods (balance ↓)

Each row also stores balance_after — the running total after that transaction — so the full history can be audited without recalculating.

📦 Product Variants & Pack Sizes

Each product can be sold in multiple pack sizes. These are configured as Product Variants with their own SKU, cost, and price — applicable to any vertical (pharmaceuticals, FMCG, food & beverages, etc.).

Pharma example: Carton (×1000 tabs) → Box (×100 tabs) → Blister Pack (×10 tabs) → Tablet
Pharma: Sachet Box (×50 sachets) → Sachet  |  Bottle Carton (×12 bottles) → Bottle
FMCG example: Bag 50kg → Bag 25kg → Bag 5kg
Beverages example: Carton ×24 → Crate ×12 → Unit (single bottle)

Example — Emzor Paracetamol 500mg (Pharma):

VariantSKUCostPrice
Carton (1000 tabs)EMZ-PCT-CTN₦11,000₦17,000
Box (100 tabs)EMZ-PCT-BOX₦1,200₦1,850
Blister Pack (10 tabs)EMZ-PCT-BLS₦130₦200

📱 Mobile API Reference

Base URL: /api/v1/

All endpoints except /auth/login require a Laravel Sanctum bearer token in the Authorization header:

Authorization: Bearer {token}

All responses are JSON. Successful responses include a status: "success" field. Errors include status: "error" and a message field. Validation errors return HTTP 422 with an errors object.

Authentication

MethodEndpointBody / ParamsReturns
POST/api/v1/auth/loginemail, passwordBearer token + user profile + role_type
GET/api/v1/auth/me—Authenticated user object incl. parent_retailer_id, sub_user_role
POST/api/v1/auth/logout—Revokes current Sanctum token
POST/api/v1/auth/change-passwordcurrent_password, new_passwordConfirmation message

Supply Chain — Retailer Endpoints

These endpoints are used by the retailer-as-customer-of-supplier flow — placing orders, logging sales visible to the supplier. They are different from the Retailer Business Platform endpoints below.
MethodEndpointNotes
GET/api/v1/retailer/inventoryLive stock from inventory_snapshots for this retailer
POST/api/v1/retailer/salesLog a sale. Body: items[]{product_id, quantity, price}, opt. latitude, longitude
GET/api/v1/retailer/ordersAll supply orders placed by this retailer
POST/api/v1/retailer/ordersPlace a restock order. Body: items[]{product_id, quantity}, opt. notes
GET/api/v1/retailer/alertsRetailer-specific supply alerts (unread first)

Retailer Business Platform Endpoints NEW

These endpoints power the retailer's standalone business management features — dashboard KPIs, expenses, financial reports, receipt data, custom pricing, and team management. All endpoints are scoped to the authenticated retailer (or their sub-user's parent account).

Dashboard

MethodEndpointQuery ParamsReturns
GET /api/v1/retailer/business/dashboard period = today|week|month|custom
from, to (if custom, YYYY-MM-DD)
revenue, cash_received, gross_profit, total_expenses, net_profit, cash_flow, stock_stats{product_count, total_qty, cost_value, sell_value, out_of_stock, low_stock}, chart{labels[], revenue[], expenses[]} (30-day daily arrays), top_products[], closing_stock[], recent_sales[], expense_by_category[]

Expenses

MethodEndpointBody / ParamsReturns
GET /api/v1/retailer/business/expenses from, to (YYYY-MM-DD), per_page Paginated expense list + period_total
GET /api/v1/retailer/business/expenses/categories — Array of {id, title} expense categories
POST /api/v1/retailer/business/expenses expense_category_id*, amount*, date*, description Created expense object with expense_ref
DELETE /api/v1/retailer/business/expenses/{id} — Soft-deletes the expense (sets deleted_at)

Sales Reports

MethodEndpointQuery ParamsReturns
GET /api/v1/retailer/business/reports/overview from, to, group_by = day|week|month periods[] — each period: label, revenue, gross_profit, expenses, net_profit
products_sold[] — name, qty, revenue, gross_profit
GET /api/v1/retailer/business/sales from, to, status = paid|partial|unpaid, per_page Paginated sales list with id, Ref, date, GrandTotal, paid_amount, payment_statut
GET /api/v1/retailer/business/sales/{id}/receipt — Full receipt data: sale header + items[] (name, qty, price, total), amounts, status. Use to render a receipt in-app.

Inventory & Pricing

MethodEndpointBody / ParamsReturns
GET /api/v1/retailer/business/inventory filter = all|low_stock|out_of_stock, per_page Paginated inventory: product_id, name, code, cost, sell_price, margin_pct, current_stock, reorder_level, stock_value
POST /api/v1/retailer/business/inventory/{product_id}/price One of: selling_price (absolute) or margin_percent (% markup). System computes the other. Updated {product_id, selling_price, margin_percent}

Team Management

⚠️ Team endpoints are only accessible to the account owner (not sub-users). Sub-user tokens return HTTP 403 on these routes.
MethodEndpointBody / ParamsReturns
GET /api/v1/retailer/business/team — Array of sub-users: id, username, email, sub_user_role, status, created_at
POST /api/v1/retailer/business/team username*, email*, password*, sub_user_role* (cashier|manager|viewer) Created sub-user object. The new account automatically inherits the owner's supplier links and permissions.
DELETE /api/v1/retailer/business/team/{id} — Deactivates (soft-deletes) the sub-user. Cannot delete self.

Request / Response Conventions

Supplier Endpoints

MethodEndpointNotes
GET/api/v1/supplier/dashboardKPI summary: total/active retailers, pending orders, supplied revenue, outstanding balance
GET/api/v1/supplier/retailersOrg's retailer list with status badges
GET/api/v1/supplier/retailers/{id}Single retailer detail — inventory, last orders, credit summary
GET/api/v1/supplier/ordersAll supply orders. Filter: ?status=pending|approved|delivered
POST/api/v1/supplier/orders/{id}/approveApprove a pending order
POST/api/v1/supplier/orders/{id}/rejectBody: reason (required)
GET/api/v1/supplier/inventoryOrg-wide snapshot. Filter: ?filter=low_stock|out_of_stock
GET/api/v1/supplier/alertsAll org alerts. Filter: ?unread=1
POST/api/v1/supplier/alerts/{id}/readMark a single alert read
GET/api/v1/supplier/mismatchesOpen mismatch logs. Filter: ?status=open|investigating|resolved
GET/api/v1/supplier/creditCredit summary per retailer (limit, outstanding, available)
GET/api/v1/supplier/analytics/top-productsTop products by period. Param: ?period=7|30|90|365
GET/api/v1/supplier/analytics/top-retailersRetailer performance ranking for the period
GET/api/v1/supplier/analytics/geoGeo-tagged sales points for map rendering

Field Agent Endpoints

MethodEndpointNotes
GET/api/v1/agent/retailersOrg retailer list with last-sale date and stock health badge
GET/api/v1/agent/retailers/{id}Retailer detail with full inventory snapshot and pending orders
POST/api/v1/agent/visitsLog a visit. Body: retailer_id*, status* (visited|missed|postponed), notes, latitude, longitude
GET/api/v1/agent/visitsAgent's own visit history. Filter: ?status=visited|missed|postponed&from=&to=