02 · User journey

The roads users travel

Every screen of the current app, the two order lanes from the workflow sheet — airline and non-airline — and where the bots plug in.

Part A existing · Part B new · Part C bots📄 APP_FLOW.mdVersion 1.0 · 4 October 2026 Part A describes the app as it works today. Part B describes the Orders & Dispatch flow from workflow.xlsx. Part C shows where the agentic bots plug in (detail in AGENTIC.md).

Part AExisting App

A1. Entry and navigation

▸ Open stock_control.php
  1. Not signed in → Login (username + password)
  2. wrong details → "Invalid username or password" → stay on Login
  3. correct → Dashboard (new home; marks "seen today")
  4. Signed in → last requested page

Navigation is the hamburger menu (top right):

SectionItemWho
HomeDashboardAll
StockStock, ProductsAll
Production PlannerProduction Planning, Tartlet OrdersAll (edit = admin)
AdminUsersAdmin
SyncSync from XLSMAdmin
ExportStock levels .xlsx, Transactions .xlsxAll
—LogoutAll

A2. Stock (home) — record stock in / out

▸ Stock page
  1. Type in search box (code or name) → dropdown of matches (live, 160 ms debounce)
  2. Pick product → Product card: live units, boxes + partial, pack size, last 25 movements
  3. Stock IN or Stock OUT → choose Units or Boxes → qty + note → Submit
  4. OUT more than live stock → error "Cannot remove N units — only M in stock"
  5. success → green (IN) / red (OUT) flash → card refreshes

Empty state: greeting card and search box only.

A3. Products

▸ Products → table (Code · Name · Category · Subcategory · Pack · Base · Live)
  1. Filter: search text, Category, Subcategory (subcategory list narrows by category) → "Clear all ×"
  2. Admin: Add Product (modal) / Edit (modal) / Delete (confirm)
  3. Admin: click Live stock cell → type target → Enter → adjustment transaction created

A4. Sync from XLSM (admin)

▸ Hamburger → Sync from XLSM (or Products toolbar button)
  1. Modal: drag & drop or browse .xlsm / .xlsx → Upload & Sync
  2. Server parses: "main data" (catalog) + QUICHE / PIES / OTHER / SWEETS / GEMA ORDERS (stock)
  3. nothing found → error flash explaining expected sheets
  4. found → Products page with Preview panel (code, current, new, difference)
  5. Apply → catalog upserted + adjustment transactions → "Applied N, skipped M"
  6. Discard → preview cleared, nothing changed

A5. Production Planning (airline orders)

▸ Production Planning → matrix: product rows grouped by category × (destination, date) columns
  1. Each row shows: CTN qty · Live stock · Boxes · order cells · Total · Stock after · To produce
  2. Admin edits a cell → autosave → totals and "stock after" recalc; red when negative
  3. Cell ▼ → pick colour (yellow = ordered/red text, green = done/black text)
  4. + Add Column (dest + date) / + Add Week (copies last week +7 days) / edit header / delete column
  5. 💾 Save Plan (name + notes) → snapshot; Saved plans → Load / Delete
  6. 🖨 Print → landscape print with colours kept

A6. Tartlet Orders

▸ Tartlet Orders → "as at" date (click → date picker → Apply)
  1. Order rows (client, DATE DUE OUT, type DELIVERY/PICK UP, notes) × 16 tartlet sizes
  2. DATE DUE OUT header click → sort ↑ / ↓
  3. Admin: add order row, edit cells (autosave), ▼ colour per cell, delete row
  4. Footer: TOTAL ORDERED · TOTAL IN STOCK · NEED TO MAKE ( (n) red = shortfall, n green = surplus )
  5. Save / Load snapshots, Print

A7. Users (admin) and password

▸ Users → list → Add (username, password, role) / Edit / Delete (cannot delete last admin)
  1. Change Password → current + new → saved

A8. Export

Hamburger → Export → Stock levels or Transactions → .xlsx download.


Part BOrders & Dispatch (new)

B1. Primary journey (both lanes)

▸ Order received (email / PO / phone)
  1. Orders › NewCreate order (customer, PO, dates, lines)
  2. same screen(Non-airline) Availability check & delivery date
  3. Record Xero invoice no. (SkyCrest or Annie Makes Cakes) [Order › Invoice]
  4. Order › PrintPrint kitchen ticket → bring to kitchen
  5. Order › ConfirmSend confirmation to customer
  6. PackingPacking team checks stock
  7. enough → Allocate (reserve stock)
  8. not enough → Short → Alex (planner / missing items) → make product → Stock IN → Allocate
  9. Dispatch ScheduleDay before dispatch: delivery schedule prepared
  10. Dispatch ScheduleBook pick-up / Roadmaster / driver
  11. DispatchDispatch → stock removed automatically

B2. Airline lane (SkyCrest)

▸ Email orders from airlines (all by PO)
  1. New order: customer = airline, port (SYD/MEL/BNE/ADL), dispatch date, lines
  2. Invoice in SkyCrest Xero → record invoice no.
  3. Lines appear on Production Planning automatically (column = port + date)
  4. Print order → kitchen → confirmation email
  5. Packing checks stock
  6. enough → allocate
  7. not enough → Alex checks Production Planner → make product
  8. Day before dispatch
  9. Interstate (MEL, BNE …): filter by date & port → book pick-up → book Roadmaster
  10. Intrastate (SYD): filter by date → delivery schedule → book driver
  11. Dispatch → remove from stock

B3. Non-airline lane (Annie Makes Cakes)

▸ Orders by email (PDF PO, HTML PO, email text), bespoke enquiry, or phone
  1. New order: customer, source, lines (bespoke = free-text line)
  2. Check stock → availability per line + suggested delivery date → user confirms date
  3. Invoice in Annie Makes Cakes Xero → record invoice no.
  4. Print order → kitchen → confirmation email
  5. Packing checks stock
  6. enough → allocate
  7. not enough → "Inform Alex" → missing-items list → make product
  8. Day before dispatch: filter by date (all customers) → book pick-up / delivery schedule
  9. Dispatch → remove from stock

B4. Screen details

Orders list (?page=orders)

New / Edit order

Order detail

Packing (?page=packing)

Dispatch schedule (?page=dispatch)

Customers (?page=customers)

Dashboard (?page=dashboard) — see DASHBOARD.md

Airline analytics (?page=analytics)

B5. Secondary flows

B6. Important states

Loading · Empty · Validation error · Saved · Network error (autosave failed → value reverts + message) · Short · Fully allocated · Booked · Dispatched · Cancelled · Bot proposal waiting (see Part C).


Part CWhere the bots fit

▸ Inbox ──► Order Intake Bot drafts order ──► [human confirms] ──► NEW
  1. NEW ──► Availability Bot suggests date / feeds planner
  2. INVOICED? no ──► Invoice Prep Bot drafts Xero invoice ──► [human approves in Xero]
  3. CONFIRMED? no ──► Confirmation Bot drafts email ──► [human sends]
  4. Packing ──► Allocation Bot proposes allocation ──► [packer confirms]
  5. SHORT ──► Production Bot adds to Alex's make-list + alert
  6. Day before 14:00 ──► Dispatch Scheduler Bot drafts schedule + Roadmaster/driver messages ──► [human books]
  7. DISPATCHED ──► Stock Reconciler Bot checks ledger
  8. Every morning 07:00 ──► Hermes: each person's to-do list (WhatsApp / Telegram)
  9. Not seen by check-in ──► Hermes: message → SMS → call → manager
  10. 06:30 ──► Order Pattern Bot: expected-order watch + forecast for make-list

Rule: bots prepare, people decide. Anything that moves stock, money or a promise to a customer needs a named person to press the button.