Hira Ahmed
Case Study · professionalClient: PharmaConnect·Role: Lead QA·Practice Area: B2B SaaS QA, Multi-Tenant Testing, API Testing, Business Logic Testing

PharmaConnect: Multi-Tenant B2B SaaS QA

Lead QA on a multi-tenant B2B pharma platform: 20 end-to-end journeys across 6 user roles and 110+ documented defects. Read the case study.

20
End-to-end journeys (17 passed, 3 failed)
6
User roles tested
110+
Defects documented (108 in sheet)
15
Critical P1 findings
15
Modules tested
75
Verified & closed fixes
System Architecture & Execution Flow
QA coverage: journeys by persona, defects by severity and layerTwenty journeys across four groups: order to delivery 6, payments 4, returns 4, security 6, each run as the persona that performs it. Defects by severity: 15 P1, 26 P2, 58 P3, 9 P4. By layer: 72 frontend only, 13 backend only, 23 in both. 75 defects verified and closed after retesting.Journeys by personaOrder to delivery6 journeysPayments4 journeysReturns4 journeysSecurity6 journeysPharmacy manager111–Distributor manager4322Driver1–11All roles (sweeps)–––320 journeys · 6 roles · 15 modulesDefects by severityP115P226P358P49Defects by layerFrontend only72Backend only13Both layers23
Journeys were run as the real persona. Boundary sweeps covered all roles at once. Recording the affected layer separated UI fixes from API-level fixes. 75 defects verified and closed after retesting.

Problem

PharmaConnect is a multi-tenant B2B pharmaceutical distribution and logistics platform. Distributors, pharmacies, drivers, and administrators operate across a unified system where catalog pricing, discounts, checkout, delivery batches, invoicing, payment reconciliation, returns, and credit notes govern commercial transactions. Defects in such an architecture risk privilege escalation, cross-tenant data tampering, and financial corruption.

The platform required rigorous end-to-end verification of its full order-to-cash lifecycle and authorization boundaries prior to release.

Context

Production engagement leading QA across 15 functional modules, testing directly against staging and API gateways with reproduction evidence and retest verification.

My Role

Lead QA: authored journey-based test plans, led multi-persona execution, investigated defects at the browser network and API level with curl, validated database persistence, and retested fixes through to resolution.

Architecture & Coverage Scope

Testing covered 6 user roles (Pharmacy Manager, Distributor Manager, Driver, System Admin, and public visitor personas) across 15 core modules:

  • •Order-to-delivery: catalog search, shopping cart, checkout, order management, logistics dispatch, route execution, and proof of delivery
  • •Finance & billing: invoicing, partial payments, ledger settlement, overdue derivation, and returns/credit notes
  • •Catalog & pricing: master catalog, distributor tiered pricing, volume discounts, and promotional validity windows
  • •Access & tenant isolation: authentication, onboarding workflows, RBAC role assignments, partnerships, and multi-tenant isolation boundaries
  • •Reporting: dashboards, audit logging, and financial ledgers

Implementation & Journey Matrix

Testing was structured into 20 end-to-end journeys across four functional groups:

  • •Order to delivery (6 journeys): Pharmacy checkout, distributor back-office booking, batch dispatching, driver route execution (proof of delivery, GPS, partial delivery), and automated invoice generation.
  • •Payments and finance (4 journeys): Negative RBAC authorization checks, three-stage partial settlements, ledger reconciliation against dashboards, and cross-tenant invoice boundary audits.
  • •Returns (4 journeys): Return authorizations with attachment validation, stock dispositioning (restock vs. disposal), driver pickups, and credit note ledger issuance.
  • •Security and boundaries (6 journeys): Distributor vs. driver boundaries, deactivated/unverified account isolation, cross-entity tenant isolation sweeps, RBAC permission matrices, and frontend-versus-backend parity testing.

Reliability & Verification Findings

Systematic testing documented 110+ defects (108 logged in the export sheet) across 15 modules, with 75 defects verified and closed after rigorous retesting. Network traffic and database inspections separated UI presentation bugs from severe backend authorization faults.

Critical findings uncovered during testing included:

  • •Authentication & session bypass: Deactivated users remained able to authenticate and access active sessions; unverified accounts bypassed verification requirements without completing OTP or admin approval gates.
  • •Privilege escalation: Distributor Managers were able to assign themselves and others System Admin permissions via direct API manipulation, bypassing UI restrictions.
  • •Cross-tenant account tampering: Account isolation gaps allowed users to modify settings and view resources belonging to separate tenant organizations.
  • •Credential & token exposure in audit logs: Audit trails inadvertently recorded live refresh tokens, active session tokens, one-time verification codes (OTPs), and password hashes in plaintext logs.
  • •Financial & ledger corruption: Payments exceeding the outstanding balance were accepted and corrupted revenue ledgers; invoice line quantities doubled when re-batching orders from cancelled delivery runs; expired-discount pricing was honored during checkout.
  • •Checkout workflow blockers: Phone input formatting defects blocked submission across specific international pharmacy numbers.

Results & Impact

  • •20 end-to-end journeys executed across 6 user roles (17 passed, 3 failed security sweeps leading to critical remediation)
  • •110+ defects documented with step-by-step reproduction scripts and API-level payload evidence
  • •75 defects verified and closed through regression retesting
  • •Prevented unauthorized privilege escalation, ledger balance corruption, and credential leakage before release
Author & System Architect

Hira Ahmed

AI Engineer & Systems QA Lead specializing in autonomous LLM pipelines, formal verification with Z3 SMT solvers, and mission-critical SaaS reliability.

Technologies & Tools Used

Exploratory testingAPI testingBrowser network inspectioncurlRBAC permission matrix

External References