Order Management — Release Notes v1.3
Order Management — CS WhatsApp & Command Center (v1.3)
| Release version | OMS 1.3 — “Store WhatsApp” |
| Release date | 12 June 2026 |
| Applies to | Orders → CS Command Center · Admin → Tenant stores · Admin → Settings → Stores · Admin → System → Tenant Warehouse |
| Availability | GA — requires migration 20260612120000_store_evolution_whatsapp and Evolution API credentials on the API host |
What this release is
Pharmacy CS staff can WhatsApp customers from the store’s own inbox while working CS Command Center. Human chat now uses the linked store Evolution WhatsApp line — not the platform Ailaaj One AI Bot number used for automated marketing. Platform admins link each storefront store to an Evolution instance; tenant owners see the linked number and can turn notifications on or off at Admin → Settings → Stores. Background queue sync is calmer — fewer redundant network calls while the console stays open.
New Features
- Per-store WhatsApp inbox — L1 platform admins link an Evolution instance to a tenant store at Admin → Tenant stores (warehouse tree shows linked number).
- CS human chat on the store line (not the AI bot) — In Orders → CS Command Center, staff open WhatsApp chat on an intake or order; messages send and receive through the linked store Evolution instance, with thread history on the patient’s number. The Ailaaj One AI Bot WhatsApp automation is not used for this human CS session.
- Tenant notification toggle — Store owners see linked vs Not linked per store and enable or disable outbound WhatsApp at Admin → Settings → Stores (
/settings/stores) without seeing Evolution credentials.

Improvements
- Lighter CS queue sync — Attention pool refreshes about once per minute while idle; switching browser tabs no longer re-fetches the full queue.
- Cached storefront routing — Default API warehouse and storefront domain are stored locally after first load so routine polls skip
tenant_api_secretsandtenant_domains. - Fewer duplicate calls — Merged order-line fetches, in-memory product-priority cache, and no double reload after queue actions.
Bug Fixes
- CS chat auth for L1 admins — Hub WhatsApp API resolves tenant from the active store when the signed-in user has no
tenant_id. - Dev / Coolify Postgres — API pool no longer forces SSL against dev databases without TLS.
- Empty chat history on some Evolution instances — Message load uses inbox scan + phone filter when per-JID
findMessagesreturns no rows.
Known Issues
- First chat open can take 1–2 seconds while the inbox thread is resolved from Evolution
findChats. - Store must be linked before CS chat works for that storefront — unlinked stores fall back to platform bot configuration (if any).
- Inbound webhooks per store are not yet routed automatically; outbound CS chat and storefront notifications use the linked instance.
Notes for operators
- Apply migration on the target database before deploy:
20260612120000_store_evolution_whatsapp- Dev:
npm run db:migrate:devornode scripts/db/apply-single-migration.mjs 20260612120000_store_evolution_whatsapp - Prod:
CONFIRM_PROD_MIGRATE=yes npm run db:migrate:prod
- Vercel / API env —
EVOLUTION_API_URL,EVOLUTION_API_KEY, and service-role Supabase keys must match the environment (dev vs prod). - Link the store — Admin → Tenant stores → select store → link Evolution instance (e.g. storefront e-com warehouse).
- Post-migrate — Notify PostgREST schema reload (migration script does this on direct apply).
- Permissions — CS staff need
order.view_cs_command_center/order.manage_cs_queue; HOD queue needsorder.view_cs_hod_queue.
Related docs
- How-to — CS store WhatsApp settings — tenant view at Admin → Settings → Stores
- Storefront support KB — WhatsApp human chat (agent corpus)
- Migration:
supabase/migrations/20260612120000_store_evolution_whatsapp.sql— applied to dev and prod