[{"data":1,"prerenderedAt":346},["ShallowReactive",2],{"project-pkwa":3},{"id":4,"title":5,"body":6,"description":186,"extension":327,"meta":328,"navigation":341,"path":342,"seo":343,"stem":344,"__hash__":345},"content\u002Fprojects\u002Fpkwa.md","PKWA",{"type":7,"value":8,"toc":309},"minimark",[9,14,43,47,63,82,86,93,99,105,121,125,128,154,157,172,176,179,189,194,219,223,227,230,242,246,249,263,267,270,280,284,287,294,298],[10,11,13],"h2",{"id":12},"project-at-a-glance","Project at a Glance",[15,16,17,25,31,37],"ul",{},[18,19,20,24],"li",{},[21,22,23],"strong",{},"Problem:"," Multi-branch retail and wholesale operations across multiple physical stores and warehouses suffered from disconnected inventory records, manual stock reconciliation, and stock discrepancies caused by concurrent cashier sales and uncoordinated inter-branch transfers.",[18,26,27,30],{},[21,28,29],{},"Deliverables:"," A centralized Laravel REST API and MySQL backend powering a Next.js + Tailwind CSS multi-outlet POS and inventory platform covering tiered pricing (Agent, Wholesale, Retail), multi-warehouse stock management, stock opname, inter-branch shipments, branch-scoped RBAC, and centralized sales reporting.",[18,32,33,36],{},[21,34,35],{},"Core Stack:"," Laravel (REST API Backend), MySQL (Relational Database), Next.js + Tailwind CSS (Frontend by team).",[18,38,39,42],{},[21,40,41],{},"Practical Value:"," Unified multi-outlet retail and warehouse operations for Wahyu Abadi Group into a single synchronized transactional backend supporting concurrent cashier sales, auditable stock transfers, and real-time management visibility across branches and warehouses.",[10,44,46],{"id":45},"project-overview","Project Overview",[48,49,50,51,54,55,58,59,62],"p",{},"PKWA is a multi-outlet Point of Sale (POS) and distributed stock inventory system developed in collaboration with the ",[21,52,53],{},"SEJE Digital"," engineering team for ",[21,56,57],{},"Wahyu Abadi Group",". Working specifically on the ",[21,60,61],{},"Backend (Laravel REST API & MySQL)"," while collaborating with the Next.js + Tailwind CSS frontend team, I designed and built the core transactional APIs, inventory ledger logic, multi-branch authorization rules, and reporting queries.",[48,64,65,66,70,71,70,74,77,78,81],{},"The platform orchestrates daily operations across multiple retail outlets and central warehouses, handling tens of thousands of product SKUs, tiered pricing (",[67,68,69],"code",{},"Harga Agen",", ",[67,72,73],{},"Harga Grosir",[67,75,76],{},"Harga Ecer","), stock adjustments, locked stock (",[67,79,80],{},"Stok Terkunci","), stock opname, supplier purchasing, inter-branch and customer shipments, employee\u002Fmember management, and centralized revenue reporting.",[10,83,85],{"id":84},"interface-specimens","Interface Specimens",[48,87,88],{},[89,90],"img",{"alt":91,"src":92},"PKWA owner dashboard showing multi-store and warehouse statistics, shipment queues, pending stock adjustments, and out-of-stock charts","\u002Fimg\u002Fportfolio\u002Fpkwa-dashboard.jpg",[48,94,95],{},[96,97,98],"em",{},"Central Management Dashboard (Owner View): Real-time operational overview across multiple stores and warehouses, tracking active shipments (to customers, stores, and warehouses), pending stock adjustments, product repairs, and out-of-stock distribution charts.",[48,100,101],{},[89,102],{"alt":103,"src":104},"PKWA POS cashier interface showing tiered Agent, Wholesale, and Retail pricing, searchable product catalog, and multi-item checkout cart","\u002Fimg\u002Fportfolio\u002Fpkwa-cashier.jpg",[48,106,107],{},[96,108,109,110,113,114,70,116,70,118,120],{},"Branch POS Cashier View (",[67,111,112],{},"Kasir","): Branch-scoped cashier workflow supporting tiered pricing (",[67,115,69],{},[67,117,73],{},[67,119,76],{},"), high-volume SKU search, pack\u002Funit stock visibility, custom additional fees, and live checkout calculation.",[10,122,124],{"id":123},"context-the-problem","Context & The Problem",[48,126,127],{},"Operating a multi-branch retail and distribution group with separate physical stores and warehouses introduces complex backend data-integrity challenges:",[15,129,130,136,142,148],{},[18,131,132,135],{},[21,133,134],{},"Concurrent Cashier Sales:"," When multiple cashiers at an outlet sell fast-moving items simultaneously, unguarded stock updates can cause race conditions, negative stock anomalies, or overselling.",[18,137,138,141],{},[21,139,140],{},"Inter-Branch & Warehouse Stock Movement:"," Moving inventory between warehouses and retail branches requires explicit shipment tracking so goods in transit are never double-counted or lost from stock reports.",[18,143,144,147],{},[21,145,146],{},"Multi-Outlet Access Control:"," Branch cashiers and store heads must only access and mutate transactions belonging to their assigned outlet, whereas owners and central administrators require consolidated cross-branch visibility.",[18,149,150,153],{},[21,151,152],{},"Growing Transaction & SKU Volume:"," Reporting revenue summaries, stock movement histories, and out-of-stock alerts across tens of thousands of SKUs and continuous daily sales can degrade quickly without deliberate database indexing and query optimization.",[48,155,156],{},"The core backend engineering objectives were:",[15,158,159,162,165],{},[18,160,161],{},"Build a clean, reliable Laravel REST API consumed by the Next.js frontend covering POS transactions, inventory, transfers, master data, purchasing, and reporting.",[18,163,164],{},"Enforce strict MySQL transactional integrity and row-level locking on stock mutations.",[18,166,167,168,171],{},"Implement granular role and branch-scoped access control (",[67,169,170],{},"Role & Akses",") across store, warehouse, and owner personas.",[10,173,175],{"id":174},"system-architecture","System Architecture",[48,177,178],{},"PKWA uses a decoupled API-first architecture separating the Next.js + Tailwind CSS web client from the Laravel transactional backend and MySQL database:",[180,181,187],"pre",{"className":182,"code":184,"language":185,"meta":186},[183],"language-text","+-------------------------------------------------------------------+\n|             Web Client (Next.js + Tailwind CSS - Team)              |\n|   Branch POS Cashier UI  |  Warehouse Console  |  Owner Dashboard |\n+---------------------------------+---------------------------------+\n                                  | Authenticated REST API (JSON)\n+---------------------------------v---------------------------------+\n|                Central Backend Core (Laravel REST API)            |\n|  +--------------------+  +------------------+  +---------------+  |\n|  | POS & Pricing      |  | Multi-Branch     |  | RBAC, Master  |  |\n|  | Transaction Engine |  | Stock & Transfer |  | & Reporting   |  |\n|  +---------+----------+  +--------+---------+  +-------+-------+  |\n+------------|----------------------|--------------------|----------+\n             +----------------------+--------------------+\n                                    | SQL Transactions & Row Locking\n+-----------------------------------v-------------------------------+\n|                      Primary Database (MySQL)                     |\n|   Normalized Multi-Outlet Schema, Indexed Sales & Stock Ledgers   |\n+-------------------------------------------------------------------+\n","text","",[67,188,184],{"__ignoreMap":186},[190,191,193],"h3",{"id":192},"architectural-decisions","Architectural Decisions",[195,196,197,203,209],"ol",{},[18,198,199,202],{},[21,200,201],{},"Decoupled Laravel REST API:","\nLaravel provided structured request validation, clean API resource transformations, authentication middleware, and expressive database migration tooling, allowing the backend team to deliver well-defined endpoints in parallel with the Next.js frontend team.",[18,204,205,208],{},[21,206,207],{},"Normalized Multi-Outlet MySQL Schema:","\nMaster data (products, categories, suppliers, per-branch\u002Ftier pricing) was cleanly separated from per-location stock tables, stock adjustment approvals, locked stock records, and shipment logs so every stock change remained auditable.",[18,210,211,214,215,218],{},[21,212,213],{},"Role & Branch-Scoped Authorization (RBAC):","\nPermissions and outlet scoping were enforced directly at the Laravel API middleware and query layer so store cashiers, branch heads (",[67,216,217],{},"Kepala Toko","), warehouse staff, and owners always operate within their authorized data boundaries.",[10,220,222],{"id":221},"engineering-challenges-solutions","Engineering Challenges & Solutions",[190,224,226],{"id":225},"_1-preventing-stock-discrepancies-overselling-during-concurrent-sales","1. Preventing Stock Discrepancies & Overselling During Concurrent Sales",[48,228,229],{},"During busy retail hours, simultaneous checkout requests targeting the same SKU at the same outlet can trigger race conditions if stock reads and decrements are not serialized.",[15,231,232],{},[18,233,234,237,238,241],{},[21,235,236],{},"Solution:"," Wrapped POS checkout and stock-mutating workflows inside explicit MySQL database transactions with pessimistic row-level locking (",[67,239,240],{},"SELECT ... FOR UPDATE","). Stock quantities are validated and decremented atomically before committing the invoice, preventing overselling under concurrent cashier load.",[190,243,245],{"id":244},"_2-multi-branch-warehouse-stock-transfer-auditing","2. Multi-Branch & Warehouse Stock Transfer Auditing",[48,247,248],{},"Transferring stock between warehouses and retail stores creates a window where goods have left the origin location but have not yet been confirmed at the destination.",[15,250,251],{},[18,252,253,255,256,258,259,262],{},[21,254,236],{}," Built a structured shipment and transfer workflow tracking dispatch and receipt states across warehouse-to-store, store-to-warehouse, and customer deliveries, paired with locked stock (",[67,257,80],{},") and approval-gated stock adjustments (",[67,260,261],{},"Penyesuaian Stok",") so inventory balances remain reconciled at every stage.",[190,264,266],{"id":265},"_3-multi-branch-data-isolation-role-based-access-control-rbac","3. Multi-Branch Data Isolation & Role-Based Access Control (RBAC)",[48,268,269],{},"With over a hundred users spanning cashiers, store heads, warehouse operators, and owners across multiple outlets, leaking cross-branch data or allowing unauthorized price\u002Fstock overrides poses an operational risk.",[15,271,272],{},[18,273,274,276,277,279],{},[21,275,236],{}," Implemented structured RBAC (",[67,278,170],{},") and branch-context scoping in Laravel middleware and repository\u002Fservice queries, automatically constraining branch-level endpoints to the user's assigned outlet while granting owners consolidated multi-branch access.",[190,281,283],{"id":282},"_4-optimizing-sales-revenue-inventory-reporting-queries-in-mysql","4. Optimizing Sales, Revenue & Inventory Reporting Queries in MySQL",[48,285,286],{},"Generating real-time dashboard metrics (out-of-stock breakdowns per store and warehouse, pending adjustments, shipment counts, and historical sales recaps) across tens of thousands of products and growing transaction tables can cause slow queries and table locks.",[15,288,289],{},[18,290,291,293],{},[21,292,236],{}," Designed composite MySQL indexes aligned with branch, date-range, and product filters, separated heavy reporting aggregations from hot POS checkout paths, and enforced server-side pagination across high-volume catalog and history endpoints.",[10,295,297],{"id":296},"outcomes-key-learnings","Outcomes & Key Learnings",[15,299,300,303,306],{},[18,301,302],{},"Delivered the central Laravel REST API and MySQL transactional backend powering Wahyu Abadi Group's multi-outlet POS and warehouse operations in collaboration with the SEJE Digital team.",[18,304,305],{},"Unified POS sales (Agent, Wholesale, and Retail pricing), multi-warehouse stock management, stock opname, inter-branch shipments, purchasing, and management reporting under one consistent API.",[18,307,308],{},"Reinforced practical backend discipline in relational data modeling, MySQL row-level locking, branch-scoped RBAC, and query indexing for high-SKU retail systems.",{"title":186,"searchDepth":310,"depth":310,"links":311},2,[312,313,314,315,316,320,326],{"id":12,"depth":310,"text":13},{"id":45,"depth":310,"text":46},{"id":84,"depth":310,"text":85},{"id":123,"depth":310,"text":124},{"id":174,"depth":310,"text":175,"children":317},[318],{"id":192,"depth":319,"text":193},3,{"id":221,"depth":310,"text":222,"children":321},[322,323,324,325],{"id":225,"depth":319,"text":226},{"id":244,"depth":319,"text":245},{"id":265,"depth":319,"text":266},{"id":282,"depth":319,"text":283},{"id":296,"depth":310,"text":297},"md",{"subtitle":329,"slug":330,"client":331,"year":332,"role":333,"category":334,"technologies":335},"Multi-Outlet POS & Distributed Stock Inventory Engine","pkwa","Wahyu Abadi Group \u002F SE-JE Digital",2022,"Backend Developer (Team Collaboration)","Business & Enterprise Systems",[336,337,338,339,340],"Laravel","MySQL","REST API","Next.js","Tailwind CSS",true,"\u002Fprojects\u002Fpkwa",{"title":5,"description":186},"projects\u002Fpkwa","2ScaHYVtEiO8fnK9gs_NxmsmWbufEdummVPIMvrqQ5Y",1796006983657]