In large pharmaceutical manufacturing operations like PT. Royal Medicalink Pharmalab, disconnected legacy tools create severe administrative drag. When procurement approvals, quality control sign-offs, and warehouse dispatch receipts are spread across separate silos, operational turnaround slows down exponentially.
As Lead Engineer and System Analyst, I led the architectural overhaul that consolidated these fragmented workflows into an integrated Enterprise Super App ecosystem. The goal was straightforward: a unified interface with real-time transactional integrity, sub-second latency, and seamless offline functionality for floor staff.
Unified Micro-Service Core & Optimistic Locking
When multiple supervisors review purchase orders and inventory manifests simultaneously, database race conditions and double-approvals are catastrophic. We resolved this by implementing optimistic locking with monotonic sequence versioning across our transactional endpoints.
public function approveTransaction(string $orderId, int $expectedVersion, User $approver): TransactionResult
{
return DB::transaction(function () use ($orderId, $expectedVersion, $approver) {
$order = PurchaseOrder::where('id', $orderId)
->where('version', $expectedVersion)
->lockForUpdate()
->first();
if (!$order) {
throw new ConcurrencyException("Record state modified by another supervisor. Please refresh.");
}
$order->status = OrderStatus::APPROVED;
$order->version += 1;
$order->approved_by = $approver->id;
$order->save();
Event::dispatch(new OrderApprovedEvent($order));
return new TransactionResult(success: true, order: $order);
});
}
Offline-First Warehouse Synchronization
Pharmaceutical warehouses with heavy cold-storage insulation frequently suffer from intermittent Wi-Fi coverage. Floor workers cannot afford dropped forms while logging temperature-sensitive vaccine batches.
We engineered an offline-first indexed client queue with idempotent background sync. When network reconnects, transactions replay in exact chronological batches with UUID reconciliation, guaranteeing zero duplicate inventory adjustments.
Empirical Production Impact
Following deployment across corporate headquarters and pharmaceutical logistics facilities:
- Approval turnaround dropped by 68%: Routine document sign-offs shrank from 2.5 business days to under 4 hours.
- 100% paperless auditing: Complete immutable audit logs satisfying regulatory compliance standards.
- Zero data loss in low-connectivity zones: Handled over 50,000 monthly warehouse scans reliably.
Building S-SPARC: From a Paper Sketch to a Hong Kong Merit Award
How an eco-conscious learning companion achieved 83.94% token savings and won the AIREA 2026 Merit Award in Hong Kong.
Read story →Behind the Peer Review Desk: Evaluating AI Manuscripts for Nature Scientific Data & Springer
Methodological rigor, reproducibility audit checklists, and prompt leakage evaluation in top Q1 journals.
Read story →