> For the complete documentation index, see [llms.txt](https://docs.xenoraa.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.xenoraa.com/xenoraa-changelog-and-architecture/full-version-changelog-2.md).

# Full Version Changelog

## Full Version Changelog

> Auto-synced from `AGENTS.md`. All versions, newest first.

#### v8.4.0 — Phase 3 — OPcache + Cloudflare WAF + Slack Error Monitoring `2026-07-08` [`9134154`](https://github.com/goesscay/xenoraa/commit/9134154)

* PHP OPcache: 256MB memory, 20000 max files, validate\_timestamps=0, JIT off (production-tuned)
  * Cloudflare security: SSL=full, always\_use\_https=on, min\_tls=1.2, security\_level=medium
  * Cloudflare performance: brotli=on, minify(css+html+js)=on, browser\_cache\_ttl=14400
  * Cloudflare WAF (5 custom rules, ruleset: f3fd2dba282e4c22901c317f879cbc1f):
    1. BLOCK: malicious scanners (sqlmap, nikto, masscan, zgrab, nmap, nuclei)
    2. BLOCK: common exploit paths (.env, .git, wp-admin, phpmyadmin, adminer)
    3. BLOCK: direct IP access (host=69.62.75.225)
    4. MANAGED\_CHALLENGE: suspicious login POST attempts (threat\_score > 10)
    5. BLOCK: PHP exploit endpoints (xmlrpc.php, config.php, setup.php, install.php)
  * Slack error monitoring: LOG\_SLACK\_WEBHOOK\_URL configured, stack=\[single+slack], level=error
  * Test message sent to Slack successfully
  * GitHub commit: 9134154

***

#### v8.3.0 — Phase 2 — CI/CD + Staging Environment `2026-07-08`

* Staging environment: /var/www/xenoraa-staging, DB: xenoraa\_staging
  * staging.xenoraa.com: Nginx vhost + Let's Encrypt SSL
  * Cloudflare DNS: staging A record → 69.62.75.225 (DNS only)
  * GitHub Actions: deploy-production.yml (push to main → xenoraa.com)
  * GitHub Actions: deploy-staging.yml (push to develop → staging.xenoraa.com)
  * Deploy SSH key: Ed25519 key pair, public key in authorized\_keys
  * develop branch created on GitHub
  * Staging login: <support@xenoraa.com> / @biSou20717 (super admin)
  * Staging tenant: <gopi@staging.xenoraa.com> / @biSou20717 (via /gopi/login)

***

#### v8.2.0 — Phase 1 — Redis + Queue Workers + DB Backups `2026-07-08`

* APP\_URL fixed to <https://xenoraa.com>
  * Redis installed, CACHE/SESSION/QUEUE all use redis driver
  * Supervisor: 2 xenoraa-worker processes (auto-restart, survives reboots)
  * Daily PostgreSQL backups: /root/xenoraa-backup.sh, 2:00 AM UTC, 7-day rotation

***

#### v8.1.0 — ChatGPT Integration — Tenant API Token Management `2026-07-08`

* xena\_api\_tokens table: id, user\_id, token, name, last\_used\_at, created\_at
  * Route: GET /admin/xena/chatgpt-token (token management page)
  * Route: POST /admin/xena/chatgpt-token/generate (generate/regenerate token)
  * Route: POST /admin/xena/chatgpt-token/revoke (revoke token)
  * View: resources/views/admin/xena/chatgpt\_token.blade.php
  * Sidebar nav link: ChatGPT Integration (after Xena Knowledge Base)
  * Admin.blade.php updated with nav link

***

#### v8.0.0 — ChatGPT Actions API `2026-07-08`

* routes/api.php: GET /api/v1/xena/openapi, POST /api/v1/xena/action
  * XenaApiController: Bearer token auth via xena\_api\_tokens table
  * OpenAPI 3.1.0 spec auto-generated at /api/v1/xena/openapi
  * Custom GPT created: Xenoraa Business Assistant (private, gopi.blog tenant)
  * GPT ID: g-6a4cfc6ff2508191a764cd96b3d71edd
  * API token for gopi.blog: xr\_live\_gopi\_chatgpt\_action\_token\_98234710

***

#### v7.9.0 — Xena AI System Prompt — Maximum Knowledge Upgrade `2026-07-08`

* buildSystemPrompt() completely rewritten with 8 modules, UI/UX rules, brand guidelines
  * 166 tools documented, Indian number formatting, business analyst personality

***

#### v7.8.0 — Batch 4 — 16 New Tools (Appointments/Blog/Advanced CRM) `2026-07-08`

* crm\_list\_appointments, crm\_create\_appointment, crm\_list\_appointment\_slots
  * crm\_list\_document\_templates, crm\_list\_documents, crm\_list\_ai\_forecasts
  * crm\_list\_lead\_integrations, crm\_get\_price\_book, crm\_list\_inventory\_items
  * pos\_list\_sessions, site\_list\_enquiries, blog\_list\_posts, blog\_create\_post
  * forum\_list\_topics, newsletter\_list\_subscribers, pos\_list\_order\_items
  * Total Xena tools: 166 (was 150)

***

#### v7.7.0 — Batch 3 — 16 New Accounts/HR Tools `2026-07-08`

* accounts\_list\_budgets, accounts\_create\_budget
  * accounts\_list\_credit\_notes, accounts\_create\_credit\_note
  * accounts\_list\_debit\_notes, accounts\_create\_debit\_note
  * accounts\_list\_journal\_entries, accounts\_create\_journal\_entry
  * accounts\_list\_chart\_of\_accounts, accounts\_list\_tax\_rates
  * accounts\_list\_bank\_transfers, accounts\_create\_bank\_transfer
  * accounts\_list\_employees, accounts\_create\_employee
  * accounts\_list\_payslips, accounts\_create\_payslip
  * Total Xena tools: 150 (was 134)

***

#### v7.6.0 — Batch 2 — 17 New Tools (Notes/Services/Bookings/Calendar/Todos/Settings) `2026-07-08`

* crm\_update\_note, crm\_delete\_note
  * crm\_list\_services, crm\_create\_service, crm\_list\_service\_bookings, crm\_create\_service\_booking
  * crm\_list\_solutions, crm\_create\_solution
  * crm\_list\_calendar\_events, crm\_create\_calendar\_event
  * crm\_create\_todo, crm\_create\_reminder
  * crm\_list\_pipeline\_stages, crm\_get\_settings, crm\_list\_price\_books
  * ecommerce\_create\_coupon, accounts\_list\_expenses (upgraded with correct columns)
  * Total Xena tools: 134 (was 117)

***

#### v7.5.0 — Batch 1 — 16 New Tools (Requirements/Milestones/Issues/TimeLogs/MailTemplates) `2026-07-08`

* crm\_get\_requirements, crm\_add\_requirement, crm\_list\_requirements
  * crm\_list\_milestones, crm\_create\_milestone, crm\_update\_milestone
  * crm\_list\_issues, crm\_create\_issue, crm\_update\_issue, crm\_close\_issue
  * crm\_list\_time\_logs, crm\_add\_time\_log, crm\_project\_time\_summary
  * crm\_list\_mail\_templates, crm\_get\_mail\_template, crm\_create\_mail\_template
  * Total Xena tools: 117 (was 101)

***

#### v7.0.0 — Xena AI — Phase 4: 15 New CRM Tools (POs / Cases / Products / Vendors / Project Tasks / Create Docs) `2026-07-07` [`f055afe`](https://github.com/goesscay/xenoraa/commit/f055afe)

* crm\_get\_purchase\_order: View PO by number/subject/ID — View + Edit buttons
  * crm\_update\_purchase\_order: Update PO status, delivery date, notes, tracking, carrier
  * crm\_get\_case: View support case by case number/subject/ID — View + Edit buttons
  * crm\_create\_case: Create new support case (subject, priority, status, type, origin)
  * crm\_update\_case: Update case status, priority, description, resolution
  * crm\_close\_case: Close case with optional resolution — records closed\_at timestamp
  * crm\_get\_product: View CRM product by name/ID — price, stock, GST, SKU
  * crm\_update\_product: Update product price, stock, GST, description, active status
  * crm\_get\_vendor: View vendor by name/ID — View + Edit buttons
  * crm\_create\_vendor: Create new vendor/supplier with contact details
  * crm\_get\_project\_task: View project task by name/ID — View + Edit buttons
  * crm\_update\_project\_task: Update task status, priority, due date, description
  * crm\_complete\_project\_task: Mark project task as completed — records completed\_at
  * crm\_create\_invoice: Create header-only invoice (subject, amount, due date, status)
  * crm\_create\_sales\_order: Create new sales order (subject, amount, delivery date, status)
  * Total Xena tools: 101 (was 86)
  * GitHub commit: f055afe

***

#### v6.9.0 — Xena AI — Phase 3 CRM Activities/Quotes/SalesOrders/Invoices (9 new tools, total: 86) `2026-07-07` [`93c2651`](https://github.com/goesscay/xenoraa/commit/93c2651)

* crm\_get\_activity: view activity by subject/ID — returns type, status, priority, due\_at, related\_type/id + View/Edit buttons
  * crm\_update\_activity: update type/subject/description/status/priority/due\_at on any activity by subject/ID
  * crm\_complete\_activity: mark activity as completed — sets status=completed, records completed\_at
  * crm\_get\_quote: view quote by quote\_number/subject/ID — returns stage, grand\_total, valid\_until + View/Edit buttons
  * crm\_update\_quote: update subject/stage/valid\_until/notes/terms on any quote by quote\_number/subject/ID
  * crm\_get\_sales\_order: view SO by so\_number/subject/ID — returns status, grand\_total, delivery\_date + View/Edit buttons
  * crm\_update\_sales\_order: update subject/status/delivery\_date/notes/terms/purchase\_order/carrier on any SO
  * crm\_update\_invoice: update subject/status/due\_date/notes/terms/amount\_paid (auto-recalculates balance\_due)
  * crm\_mark\_invoice\_paid: mark invoice as paid — sets status=paid, balance\_due=0, records amount\_paid (default: full grand\_total)
  * All 9 tools have thinking steps + suggestion chips in XenaController
  * GitHub commit: 93c2651

***

#### v6.8.0 — Xena AI — Phase 2 CRM Edit Tools (4 new tools, total: 77) `2026-07-07` [`3a21dcd`](https://github.com/goesscay/xenoraa/commit/3a21dcd)

* crm\_update\_lead: update any field on a lead by name or ID Updatable: status, lead\_status, deal\_value, source, company, title, notes, email, mobile, phone, assigned\_to, priority Resolves by name (ILIKE on name+company) or lead\_id; returns updated\_fields + View+Edit buttons
  * crm\_update\_contact: update any field on a contact by name or ID Updatable: first\_name, last\_name, email, phone, mobile, company, title, department, status, lead\_source, description Resolves by name (ILIKE on first\_name+last\_name+concat) or contact\_id
  * crm\_update\_account: update any field on an account by name or ID Updatable: name, industry, annual\_revenue, employees, phone, email, website, status, city, country, description Resolves by name (ILIKE) or account\_id
  * crm\_update\_forecast: update or auto-create forecast for any quarter+year Updatable: target\_amount, achieved\_amount, notes Auto-creates record if quarter+year not found; normalises 'Q3' -> 3 Returns attainment\_pct + Edit button
  * All 4 tools have thinking steps + suggestion chips in XenaController
  * GitHub commit: 3a21dcd

***

#### v6.7.0 — Xena AI — Phase 1 CRM Sales Module Tools (10 new tools, total: 73) `2026-07-07` [`f695f18`](https://github.com/goesscay/xenoraa/commit/f695f18)

* crm\_count\_leads: total + status breakdown + link to /admin/crm2/sales/leads
  * crm\_count\_contacts: total + lead\_source breakdown + link to /admin/crm2/sales/contacts
  * crm\_count\_accounts: total + account\_type breakdown + total annual\_revenue + link
  * crm\_count\_deals: total + stage breakdown + pipeline value + won\_this\_month + link
  * crm\_forecast\_summary: all quarters for a year (target/achieved/attainment%) from crm\_forecasts
  * crm\_get\_contact: find by name (ILIKE first\_name+last\_name) or contact\_id; View+Edit buttons
  * crm\_get\_account: find by name (ILIKE) or account\_id; View+Edit buttons
  * crm\_get\_forecast: find by quarter+year; target/achieved/gap/attainment%; Edit button
  * crm\_create\_contact: creates crm\_contacts; splits name into first\_name/last\_name; View+Edit buttons
  * crm\_create\_deal: creates crm\_deals; resolves account/contact by name; stage enum matches CrmDeal::STAGES
  * All 10 tools have thinking steps + suggestion chips in XenaController
  * GitHub commit: f695f18

***

#### v6.6.1 — Xena AI — Auto-Resume Last Session on Drawer Open `2026-07-07` [`78eb245`](https://github.com/goesscay/xenoraa/commit/78eb245)

* xena.js: autoResumeLastSession() — on first drawer open (xenaSession===null), fetches /admin/xena/history, takes sessions\[0], loads full message list via /admin/xena/session/{id}, renders all messages + action cards
  * Shows subtle 'Resumed last conversation · + New Chat' bar at top of chat
  * xenaStartNewChat() (window-exposed): resets xenaSession=null, clears chat, restores welcome screen + quick prompts, switches to chat tab
  * New Chat button in History pane (#xenaNewChatBtn) wired to xenaStartNewChat()
  * Auto-resume guard: only runs when xenaSession===null (first open per page load)
  * Subsequent drawer opens preserve the active session
  * First-time users (no history) see welcome screen as before
  * GitHub commit: 78eb245

***

#### v6.6.0 — Xena AI — Batch C: 11 New Tools `2026-07-07` [`ab70b5b`](https://github.com/goesscay/xenoraa/commit/ab70b5b)

* general\_sales\_forecast: Pipeline forecast by stage with weighted revenue
  * Queries crm\_deals (excludes won/lost); returns stage/deals/total\_value/avg\_probability
  * Also returns won\_this\_month (closed\_at current month)
  * general\_search\_all: Cross-module search across leads+contacts+accounts+deals+products
    * ILIKE search; returns up to 5 results per module with view\_url per item
    * Accepts: query (required)
  * general\_reminders: Upcoming reminders + pending todos
    * reminders table (is\_sent=false, remind\_at>=now); todos table (is\_completed=false)
    * Returns overdue\_count for todos past due\_date
  * pos\_sales\_summary: POS sales summary by period (today/week/month)
    * Joins pos\_order\_items+products+product\_categories for top category breakdown
    * Returns orders, revenue, avg\_order, by\_day, top\_categories
  * ecommerce\_revenue\_trend: Month-by-month ecom revenue (ecom\_orders)
    * Excludes cancelled orders; groups by YYYY-MM; default 6 months, max 12
  * ecommerce\_list\_coupons: List ecom coupons (ecom\_coupons)
    * Returns code, type, value, used\_count, max\_uses, is\_active, expires\_at
    * Accepts: active\_only, limit
  * accounts\_list\_payments: List payment records (acc\_payments)
    * Filter by payment\_type (receipt/payment) and status
    * Returns total\_receipts and total\_payments in summary
  * accounts\_create\_payment: Record new payment (acc\_payments)
    * Auto-generates payment\_number (PAY-YYYY-NNN)
    * Sets status=received for receipts, paid for payments
    * Accepts: amount(required), type, party\_name(required), date, method, notes
  * crm\_list\_notes: List notes for a CRM record or all recent notes (crm\_notes)
    * Resolves record by ILIKE name search across leads/contacts/deals/accounts
    * Accepts: record\_name, record\_type, limit
  * projects\_get: Full project detail with task breakdown (crm\_projects + crm\_project\_tasks)
    * Returns task\_stats (total/pending/in\_progress/completed)
    * Accepts: project\_name (ILIKE) or project\_id
  * projects\_task\_summary: Task completion summary across all active projects
    * Joins crm\_project\_tasks + crm\_projects; returns completion\_rate, overdue, high\_priority
    * Also returns per-project breakdown (top 5 by task count)
  * Total Xena tools: 63 (was 52)
  * GitHub commit: ab70b5b

***

#### v6.5.0 — Xena AI — Batch B: 8 New Tools `2026-07-07` [`2d79696`](https://github.com/goesscay/xenoraa/commit/2d79696)

* crm\_list\_accounts: List CRM accounts with search/industry/status filter
  * Returns name, type, industry, annual\_revenue, phone per account
  * crm\_create\_account: Create CRM account (company)
    * Accepts: name(required), type, industry, phone, email, website, annual\_revenue, city, country
  * crm\_list\_vendors: List vendors/suppliers with category filter
    * Returns name, category, status, phone per vendor
  * crm\_list\_cases: List support cases with status/priority filter
    * Sorted High→Medium→Low priority; shows case\_number, subject, status, priority
    * Returns open case count in summary
  * pos\_top\_products: Top selling POS products by quantity or revenue
    * Joins pos\_order\_items + pos\_orders (tenant\_id scoped)
    * Accepts: by (quantity|revenue), limit
  * pos\_update\_stock: Update product stock quantity by name or ID
    * ILIKE name search; updates products.qty\_in\_stock
    * Returns old stock → new stock in card
  * ecommerce\_update\_order\_status: Update ecom order status
    * ILIKE order\_number search; auto-sets delivered\_at/shipped\_at/cancelled\_at timestamps
    * Accepts: order\_number or order\_id, status (pending/confirmed/processing/shipped/delivered/cancelled)
  * ecommerce\_get\_order: Get full ecom order detail with line items
    * Joins ecom\_order\_items; returns all order fields + items list
  * Total Xena tools: 52 (was 44)
  * GitHub commit: 2d79696

***

#### v6.4.0 — Xena AI — Batch A: 7 New Tools `2026-07-07` [`409bbaf`](https://github.com/goesscay/xenoraa/commit/409bbaf)

* crm\_add\_note: Add note to lead/contact/deal/account by name or ID
  * Auto-resolves record by ILIKE name search if ID not given
  * Saves to crm\_notes (notable\_type/notable\_id polymorphic)
  * crm\_list\_invoices: List CRM invoices with status filter (draft/sent/paid/overdue/cancelled)
    * Returns invoice\_number, subject, status, grand\_total, balance\_due, total unpaid amount
  * crm\_list\_sales\_orders: List CRM sales orders with status filter (draft/confirmed/delivered/cancelled)
    * Returns so\_number, subject, status, grand\_total, delivery\_date
  * projects\_list\_tasks: List project tasks with multi-filter (status/priority/project\_name/project\_id)
    * Sorted by priority (high→medium→low) then due\_date; shows project name per task
  * projects\_create\_task: Create task in a project
    * Auto-resolves project by name (ILIKE) or defaults to most recent active project
    * Accepts: name, project\_name, description, due\_date, priority, assigned\_to
  * accounts\_bank\_balance: Show all active bank account balances (acc\_bank\_accounts)
    * Returns total balance + per-account breakdown with bank name and type
  * accounts\_revenue\_trend: Month-by-month income vs expense trend (acc\_income + acc\_expenses)
    * Default 6 months, max 12; returns income/expense/profit per month
    * Links to P\&L report
  * Total Xena tools: 44 (was 37)
  * GitHub commit: 409bbaf

***

#### v6.3.3 — Xena AI — Step 3: Smart Cross-Search (crm\_smart\_search) `2026-07-07` [`86d7b18`](https://github.com/goesscay/xenoraa/commit/86d7b18)

* New tool: crm\_smart\_search — searches BOTH crm\_leads AND crm\_contacts simultaneously
  * Single lead match: full lead detail card (purple) with Open Lead button
  * Single contact match: full contact detail card (blue) with Open Contact button
  * Multiple matches: unified list card with \[Lead]/\[Contact] prefix per row
  * Zero matches: friendly card with 'Create new lead?' suggestion
  * XenaController: tool definition with 'USE THIS FIRST' instruction
  * XenaController: SMART SEARCH RULE added to system prompt — use crm\_smart\_search when user says a name without 'lead'/'contact' qualifier
  * XenaController: thinking steps + suggestion chips for crm\_smart\_search
  * Fixes: 'open Priya', 'find Vikram', 'show me Arjun' now correctly finds person regardless of whether they are a lead or contact
  * GitHub commit: 86d7b18

***

#### v6.3.2 — Xena AI — Step 2: New Tools (crm\_create\_product + crm\_send\_quote\_email) `2026-07-07` [`e0c4157`](https://github.com/goesscay/xenoraa/commit/e0c4157)

* crm\_create\_product: Creates a product in crm\_products table
  * Accepts: name(required), price, category, qty, product\_code/sku, gst\_rate, hsn\_code, description, reorder\_level
  * Returns detail card with View Product link
  * Fixes: AI was asking for product details but not saving anything
  * crm\_list\_products: Lists crm\_products with optional search/category filter
    * Returns list card with price, stock, View All link
  * crm\_list\_quotes: Lists crm\_quotes with optional stage filter
    * Returns list card with quote number, subject, stage, amount
  * crm\_send\_quote\_email: Sends quote email using tenant SMTP (crm\_mail\_configs)
    * Builds professional HTML email with quote table (number, subject, total, valid\_until)
    * Logs send to crm\_account\_emails table
    * Returns success card with To, Subject, Amount, Sent At
    * Fixes: AI was giving manual instructions instead of sending the email
  * Also fixed crmGetInvoice: total\_amount → grand\_total (correct column name)
  * GitHub commit: e0c4157

***

#### v6.3.1 — Xena AI — 3 Bug Fixes (crm\_search\_leads + POS tables + status enum) `2026-07-07` [`e8d18d9`](https://github.com/goesscay/xenoraa/commit/e8d18d9)

* Bug 1: Added crm\_search\_leads tool — new crmSearchLeads() in XenaActionService, new tool in XenaController
  * Searches crm\_leads by name/email/mobile/company (ILIKE)
  * Single match: full detail card (name, company, email, mobile, status, lead\_status, source, deal\_value)
  * Multiple matches: list card with view links per lead
  * Tool description: PREFER over crm\_search\_contacts when user asks about a person by name in CRM context
  * Fixes: 'open Priya', 'view lead Vikram' now correctly searches leads not contacts
  * Bug 2: Fixed POS table names in XenaActionService
    * posTodaySales: pos\_orders WHERE user\_id → tenant\_id
    * posLowStock: pos\_products → products (user\_id correct), threshold default 5→10
    * posListProducts: pos\_products → products, added is\_active=true filter
    * generalDashboardStats: pos\_orders WHERE user\_id → tenant\_id
    * Fixes: 'relation pos\_products does not exist' crash on all POS queries
  * Bug 3: Fixed crm\_list\_leads status enum in XenaController getTools()
    * Added 'proposal\_sent' and 'not\_contacted' to enum (actual DB values)
    * Fixes: filtering by 'proposal leads' or 'not contacted leads' returned zero results
  * GitHub commit: e8d18d9

***

#### v5.1.0 — Xena AI Phase 5 — Proactive Alert Chips on Dashboard `2026-07-06` [`6a1b2c0`](https://github.com/goesscay/xenoraa/commit/6a1b2c0)

* New DB table: xena\_alert\_dismissals (user\_id, alert\_key, dismissed\_date — tracks per-day dismissals)
  * New Model: XenaAlertDismissal with dismiss()/dismissedToday() static helpers
  * XenaController: GET /admin/xena/alerts — reads today's snapshot alerts JSON, filters dismissed, transforms to {key, text, type, icon, action{label,url}} structured objects
  * XenaController: POST /admin/xena/alerts/dismiss — saves dismissal for today
  * Alert classification: crm (purple), activity (red), financial (amber), inventory (orange), general (blue)
  * Routes: admin.xena.alerts (GET) + admin.xena.alerts.dismiss (POST)
  * dashboard.blade.php: Xena Alerts bar between action buttons and CRM KPIs section (type-colored chips, icon, text, action button, dismiss x button)
  * dashboard.blade.php: Phase 5 JS IIFE — fetches alerts on load, renders chips dynamically, dismiss with POST + fade-out animation, hides bar when all chips dismissed
  * Verified: 3 alert chips visible (22 uncontacted leads, 2 overdue activities, 30% revenue drop)
  * GitHub commit: 6a1b2c0

***

#### v5.0.0 — Xena AI Phase 4 — xena\_tenant\_memory Persistent Memory Store `2026-07-06` [`51b4cc8`](https://github.com/goesscay/xenoraa/commit/51b4cc8)

* New DB table: xena\_tenant\_memory (user\_id, category, memory\_key, memory\_value, source, context, confidence, times\_referenced, last\_referenced\_at)
  * Categories: business\_info, preference, pattern, goal, product, team, financial, custom
  * New Model: XenaTenantMemory with remember()/forget()/getForUser()/incrementRef() static helpers
  * New Service: XenaMemoryService
    * buildMemoryBlock(): formats all active memories as 'WHAT I KNOW ABOUT YOUR BUSINESS' section
    * storeExplicit(): detects 'remember that X is Y' / 'remember my X is Y' patterns and saves
    * checkForgetCommand(): detects 'forget that' / 'forget my X' and returns memory\_key to delete
    * extractAndStore(): uses GPT to auto-extract new facts from each conversation turn
  * XenaController: memory block injected into every system prompt as Layer 4 (after tenant profile, daily snapshot, platform knowledge)
  * XenaController: after each assistant reply, runs memory extraction pipeline (non-blocking)
  * Seeded 8 initial memories for gopi.blog: business\_name, business\_plan, primary\_module, lead\_sources\_active, lead\_creation\_method, pipeline\_stage\_focus, pipeline\_target, product\_count
  * Verified: 'What do you know about my business and goals?' returns all seeded memories correctly
  * GitHub commit: 51b4cc8

***

#### v4.99.0 — Xena AI Phase 3 — Daily Business Snapshot `2026-07-06`

* New DB table: xena\_daily\_snapshots (user\_id, snapshot\_date, leads\_total, leads\_7d, leads\_uncontacted, pipeline\_value, deals\_open, deals\_won, activities\_pending, activities\_overdue, invoices\_unpaid, invoices\_unpaid\_amt, income\_30d, expense\_30d, net\_profit\_30d, pos\_revenue\_today, pos\_orders\_7d, pos\_low\_stock\_count, ecom\_orders\_7d, ecom\_revenue\_7d, insights JSON, alerts JSON)
  * New Artisan command: xena:daily-snapshot \[--user=ID] — computes all metrics + auto-generates alerts (uncontacted leads, overdue activities, revenue drop >20%, low stock) and insights (profit margin, pipeline health, lead velocity)
  * Laravel scheduler: runs xena:daily-snapshot daily at 06:00 for all active tenants
  * Crontab installed on server: \* \* \* \* \* php artisan schedule:run
  * XenaController buildSystemPrompt() now injects today's snapshot as 'DAILY BUSINESS SNAPSHOT' section — GPT answers trend/alert questions without any tool call
  * Fixed column names: crm\_invoices.grand\_total (not total\_amount), crm\_products.qty\_in\_stock/reorder\_level
  * Verified: 'What are my key business alerts for today?' returns alerts + insights from snapshot (22 uncontacted leads, 2 overdue activities, 30% revenue drop, 57% profit margin)
  * GitHub commits: e4dc865 (v4.99.2 column fixes)

***

#### v4.98.0 — Xena AI Phase 2 — Enriched System Prompt with Platform Knowledge + Live Tenant Profile `2026-07-06` [`1411f6b`](https://github.com/goesscay/xenoraa/commit/1411f6b)

* Added buildTenantProfile() method: single DB query fetching live tenant stats at chat time (leads total/new/today, contacts, deals open/pipeline value, activities pending/overdue, invoices, products, POS orders, ecom orders, lead sources via STRING\_AGG)
  * Injected tenant profile snapshot into every system prompt as 'TENANT PROFILE (live data as of now)'
  * Replaced sparse 9-line platform knowledge with comprehensive 6-module knowledge block: CRM (leads/contacts/accounts/deals/activities — all fields, statuses, navigation URLs) Inventory & Billing (products/quotes/sales orders/invoices/vendors — navigation) Accounts (income/expense ledger, reports — navigation) POS (terminal, sessions, products — navigation) Ecommerce (online store, orders — navigation) Projects (tasks, milestones — navigation)
  * Added full CRM workflow: Lead -> Contact -> Account -> Deal -> Quote -> Sales Order -> Invoice
  * Added Indian number formatting rule (Rs., lakhs/crores)
  * Added how-to question handling: answer with navigation path and steps (no tool needed)
  * Verified: 'How do I convert a lead to a deal? Also what is my pipeline value?' correctly answered both parts — workflow from knowledge + Rs.5,180,000 pipeline from live DB
  * GitHub commit: 1411f6b

***

#### v4.97.0 — Xena AI Phase 1 — OpenAI Function Calling (Tools API) `2026-07-06` [`43eb402`](https://github.com/goesscay/xenoraa/commit/43eb402)

* Replaced XenaIntentParser regex with OpenAI Tools API — 20 tool definitions covering all Xenoraa modules
  * GPT now natively understands any phrasing and extracts all params accurately without regex
  * Fixed PHP empty properties: (object)\[] serializes to JSON {} not \[] (OpenAI requires object not array)
  * Tools: crm\_list\_leads, crm\_create\_lead, crm\_list\_contacts, crm\_search\_contacts, crm\_list\_deals, crm\_pipeline\_value, crm\_list\_activities, crm\_create\_activity, accounts\_summary, accounts\_unpaid\_invoices, accounts\_create\_income, accounts\_create\_expense, pos\_today\_sales, pos\_low\_stock, pos\_list\_products, ecommerce\_recent\_orders, ecommerce\_order\_stats, projects\_list, projects\_overdue\_tasks, general\_dashboard\_stats
  * toolToActionKey() auto-maps crm\_create\_lead -> crm.create\_lead (underscore to dot notation)
  * XenaIntentParser no longer used for intent detection (kept for backward compat)
  * Verified: 'I need to add a new prospect named Priya Sharma, she works at TechSoft India, her mobile is 9988776655' correctly calls crm\_create\_lead with name/company/phone extracted by GPT natively
  * GitHub commit: 43eb402

***

#### v4.96.0 — Xena AI — Lead Creation, Tenant Scoping, Contact Search, Response Quality `2026-07-06` [`534782f`](https://github.com/goesscay/xenoraa/commit/534782f)

* Bug 1 (extractParams): Added 4 regex patterns to cover all name formats including 'Create lead Kavin from SGT Technologies' — previously only matched 'for/named/called CapitalName'
  * Bug 2 (crmCreateLead): Now sets first\_name, last\_name, lead\_status='Not Contacted', source='xena\_ai' — lead now appears correctly in the Leads landing page
  * Bug 3 (crmListContacts): New action added to actionMap and dispatch — 'show contacts' / 'how many contacts' now works
  * Bug 4 (crmSearchContacts): Fixed SQL from 'name' column (doesn't exist) to first\_name/last\_name/mobile — contact search no longer crashes
  * Bug 5 (logAction): Fixed column names: app/action/params/success instead of action\_type/action\_params/status — action logging now works
  * Bug 6 (dispatch): Now returns 'summary' field from action result so XenaController can pass exact data to GPT
  * Bug 7 (buildSystemPrompt): Added actionError param — when action fails, GPT explains the failure in plain language instead of saying 'I cannot access data'
  * Bug 8 (buildSuggestions): Added crm.list\_contacts suggestion chips
  * Tenant scoping: All actions use $this->userId (Auth::id()) — confirmed all DB queries scoped by user\_id
  * Verified: Lead 'Kavin from SGT Technologies' created via Xena and visible at top of Leads page
  * GitHub commit: 534782f

***

#### v4.95.0 — Xena AI Response Quality Improvements `2026-07-06` [`b009338`](https://github.com/goesscay/xenoraa/commit/b009338)

* Root cause: XenaController never passed action result data to GPT — it only said "action was executed" without sharing the actual numbers/names/amounts retrieved from DB
  * Fix 1 (XenaController): Extract `summary` field from action result and inject into system prompt as "ACTION RESULT — use these exact numbers/data in your response"
  * Fix 2 (XenaController): Added instruction "NEVER say you cannot access data" to prevent hallucinated refusals when data is already retrieved
  * Fix 3 (XenaIntentParser): Added missing patterns: 'how many lead', 'total lead', 'lead count', 'today.\*lead', 'number of lead'
  * Fix 4 (XenaIntentParser): Added new `crm.list_contacts` action with patterns: show/list/all/my/view/how many/total/get contacts
  * Fix 5 (XenaIntentParser): Added 'search a contact', 'find a contact', 'look for contact', 'search for contact' to crm.search\_contacts
  * Fix 6 (XenaActionService): Fixed crm\_contacts SQL — column is `full_name` not `name`; added `summary` field to all action results
  * Verified: Xena responds with exact DB data ("You have 150 leads"), shows action card with lead names/companies/statuses, suggestion chips work
  * GitHub commit: b009338

***

#### v4.94.4 — Fix Xena AI Streaming — CURLOPT\_RETURNTRANSFER Conflict `2026-07-06` [`d2d553c`](https://github.com/goesscay/xenoraa/commit/d2d553c)

* Root cause: CURLOPT\_RETURNTRANSFER => false was conflicting with CURLOPT\_WRITEFUNCTION in PHP curl
  * When both are set, PHP ignores the write function and dumps raw SSE data to stdout (0 chunks received, empty assistant bubble)
  * Fix: Removed CURLOPT\_RETURNTRANSFER => false from XenaController.php curl\_setopt\_array
  * Also fixed: config/openai.php added api\_base key; XenaController changed env('OPENAI\_API\_KEY') to config('openai.api\_key') (env() returns null when config cache is active)
  * Also fixed: Nginx gopi.blog SSE location block with fastcgi\_buffering off and correct SCRIPT\_FILENAME → index.php
  * Verified: Xena responds with live data (20 leads), suggestion chips appear, streaming works end-to-end
  * GitHub commit: d2d553c

***

#### v4.94.3 — Fix Xena Drawer Double-Listener Bug `2026-07-06` [`2ba2ea1`](https://github.com/goesscay/xenoraa/commit/2ba2ea1)

* Root cause: xenaOpenBtn had BOTH onclick attribute (window\.xenaToggle) AND addEventListener('click', xenaToggle) from DOMContentLoaded in xena.js
  * Each click fired xenaToggle TWICE → open then immediately close → drawer appeared to do nothing
  * Fix: Removed onclick attribute from xenaOpenBtn in admin.blade.php (line 439)
  * The single addEventListener in xena.js DOMContentLoaded now handles the click correctly
  * Verified: Drawer opens and stays open on single click; drawerClass=open, drawerRight=0px, btnOnclick=null
  * GitHub commit: 2ba2ea1

***

#### v4.94.0 — Xena AI Agent 2.0 — Full Rebuild `2026-07-06` [`a70b947`](https://github.com/goesscay/xenoraa/commit/a70b947)

* New service: XenaIntentParser — keyword/regex NLP maps natural language to structured intent JSON for all apps
  * Rebuilt XenaActionService — all actions return structured result cards (type, title, colour, fields, list rows, stats, view\_url for View buttons)
  * Rebuilt XenaController — streaming SSE with 5 thinking steps (Analyzing, Identifying, Finding, Reviewing, Generating), conversation memory (last 8 messages), next-step suggestions, correct OpenAI streaming tool-call argument accumulation
  * Rebuilt xena.js v2.0 — streaming SSE renderer, action card HTML builder, thinking bar animation, suggestion chips, auto app context from URL, history session loading, welcome screen with quick prompts, all event listeners use IDs not inline onclick
  * Updated admin.blade.php drawer HTML — new IDs (xenaChatArea, xenaChatPane, xenaHistoryPane, xenaTabChat, xenaTabHistory, xenaThinkingBar, xenaSuggestionsRow, xenaWelcome, xenaAttachBtn, xenaMicBtn, xenaCloseBtn, xenaNewChatBtn), welcome screen with personalised greeting and 6 quick prompt buttons
  * Updated admin.blade.php CSS — v2.0 styles with action card (xena-card-*, xena-stat-*, xena-list-\*), thinking dot animation, suggestion chips, drawer uses right:-400px/right:0 transition
  * GitHub commit: a70b947

***

#### v4.93.1 — Xena Phase 5 & 6 Fixes `2026-07-06` [`2b21b69`](https://github.com/goesscay/xenoraa/commit/2b21b69)

* Fixed credits page 500 error: route called creditsPage() but method was named credits() — renamed to match
  * Added 'Xena AI Credits' nav link in tenant sidebar under Administration section
  * Added 'Xena Agent Mgmt' nav link in superadmin sidebar under Training Hub section
  * Fixed superadmin.superadmin.xena doubled route name prefix → superadmin.xena.\*
  * Verified: /admin/xena/credits loads (297 credits, 3 used), /superadmin/xena loads (18 tenants, global settings)
  * GitHub commit: 2b21b69

***

#### v4.93.0 — Xena AI Agent — Full 6-Phase Implementation `2026-07-06` [`05c9f41`](https://github.com/goesscay/xenoraa/commit/05c9f41)

* DB: xena\_credits (user\_id, credits\_used, credits\_total, credits\_reset\_at, is\_active, monthly\_free), xena\_conversations (user\_id, session\_id, role, message, app\_context, action\_taken, action\_result, tokens\_used), xena\_action\_logs (user\_id, session\_id, action\_type, action\_params JSON, result JSON, status, error\_message)
  * Models: XenaCredit (deduct/topup/resetMonthly/ensureExists), XenaConversation, XenaActionLog
  * Service: XenaActionService — intent parsing + actions for CRM (list/create/search leads, contacts, deals), Accounts (summary, income, expenses), POS (today sales, recent orders), Ecommerce (products, orders), Projects (list, summary), cross-app dashboard summary
  * Controller: XenaController (chat POST with OpenAI GPT-4o-mini, history GET, session GET, creditsStatus GET, creditsPage GET, upload POST with file attachment support)
  * Controller: SuperAdminXenaController (index, saveSettings, topupCredits, toggleTenant, tenantLogs)
  * Views: resources/views/admin/xena/credits.blade.php (tenant credit management page), resources/views/admin/superadmin/xena.blade.php (global Xena management panel), resources/views/admin/superadmin/xena-tenant-logs.blade.php (per-tenant conversation logs)
  * Frontend: public/js/xena.js — drawer open/close (slide from right), SSE streaming responses, Web Speech API voice input, file attachment (image/PDF/CSV), app context chips (For You/CRM/Accounts/POS/Ecommerce/Projects), quick prompt buttons, Chat/History tabs, credit counter
  * UI: 'Xena' button in topbar (before user avatar), right-side drawer 380px wide with dark overlay
  * Routes: 6 tenant routes (admin.xena.*) + 5 superadmin routes (superadmin.xena.*)
  * Credits: 300 free monthly credits per tenant, 1 credit per message, auto-reset monthly
  * Security: CSRF on all POST, auth+subscribed middleware, user\_id scoping on all DB queries
  * Keyboard shortcut: Ctrl+Shift+X opens/closes Xena drawer
  * GitHub commit: 05c9f41

***

#### v4.92.2 — User Management Page Redesign `2026-07-06` [`fc625c8`](https://github.com/goesscay/xenoraa/commit/fc625c8)

* Replaced legacy generic CSS (btn, form-control, card, table, badge-*) with crm2-* design system
  * All colours use CSS variables — full dark/light theme support
  * License bar, filter bar, table, user cell avatars, role/status badges, action buttons all redesigned
  * GitHub commit: fc625c8

***

#### v4.92.1 — Lead Ad Forms Polish `2026-07-06` [`141a37c`](https://github.com/goesscay/xenoraa/commit/141a37c)

* Sidebar: single 'Lead Ad Forms' menu item (removed separate Meta/Google links)
  * Dark theme: all hardcoded colours replaced with CSS vars in lead-sources blade
  * Step 3 alignment fixed in setup guide
  * GitHub commit: 141a37c

***

#### v4.92.0 — Meta Lead Ads + Google Lead Forms Integration `2026-07-06` [`47e0040`](https://github.com/goesscay/xenoraa/commit/47e0040)

* New: CRM > Integrations > Lead Source Integrations page
  * DB: crm\_lead\_integrations table (user\_id, platform, is\_active, webhook\_token, meta\_app\_id, meta\_app\_secret, meta\_page\_id, meta\_access\_token, meta\_verify\_token, google\_webhook\_key, field\_mapping JSON, leads\_received, last\_synced\_at)
  * Model: App\Models\CrmLeadIntegration with encrypt/decrypt helpers, generateToken(), defaultMapping()
  * Controller (CrmModuleController): leadIntegrations(), leadIntegrationsMetaSave(), leadIntegrationsGoogleSave(), leadIntegrationsMetaRegenerateToken(), leadIntegrationsGoogleRegenerateToken(), \_metaSubscribePage() (Graph API subscription)
  * WebhookController (new public controller):
    * metaVerify() — GET hub.challenge handshake for Meta webhook verification
    * metaReceive() — POST receives Meta lead payload, validates HMAC-SHA256 signature
    * googleReceive() — POST receives Google lead payload, validates google\_key
    * \_insertLead() — applies field\_mapping JSON, inserts into crm\_leads with source tag
  * Routes: 5 admin routes (admin.crm2.integrations.lead-sources.\*) + 3 public webhook routes (webhook.meta.verify, webhook.meta.receive, webhook.google.receive — no auth middleware)
  * UI: two-column card layout, each card has enable toggle, step-by-step setup guide, webhook URL + verify token with copy buttons, credential inputs (secrets masked), field mapping table (add/remove rows), stats bar, save + regenerate token buttons
  * Sidebar: Integrations flyout + sub-panel updated with Meta Lead Ads and Google Lead Forms links
  * GitHub commit: 47e0040

***

#### v4.91.4 — Professional Mobile Header Redesign `2026-07-06` [`c37c66a`](https://github.com/goesscay/xenoraa/commit/c37c66a)

* Mobile topbar: clean 3-item layout — 9-dots launcher | App›Page breadcrumb | hamburger + avatar
  * Hidden on mobile via CSS @media (max-width:1024px): desktop 3-line toggle, App Name, divider, AI On, Dark mode, POS link, View Site link
  * Shown on mobile via CSS @media: #xnMobileMenuBtn hamburger, .xn-topbar-mobile-title breadcrumb
  * Mobile breadcrumb: two-line (app name in --accent colour + page title in bold)
  * Profile button: icon-only on mobile (username + chevron hidden via .xn-profile-username/.xn-profile-chevron CSS classes)
  * Launcher panel: full-width on mobile (left:8px right:8px auto width)
  * Edge tab: hidden on mobile (display:none !important — no hover on touch)
  * Sidebar: full-width drawer on mobile, slides in from left with dark overlay
  * xnToggleSidebar(): mobile-aware — calls xnMobileToggle() when window\.innerWidth<=1024px
  * Removed fragile JS window\.innerWidth hack; CSS @media handles all visibility
  * DOMContentLoaded: auto-close sidebar drawer when any .xn-nav-link or .xn-nav-sub-link is tapped on mobile
  * \#xnMobileMenuBtn: default display:none on desktop, shown only via @media
  * GitHub commit: c37c66a

***

#### v4.91.3 — Fix Broken Route Names in Admin Sidebar + Edge-Tab Hover `2026-07-06` [`40b5005`](https://github.com/goesscay/xenoraa/commit/40b5005)

* Root cause: admin.blade.php had wrong route names in flyout JS onmouseenter handlers and nav link hrefs
  * Fixed 9 broken route references:
    * admin.accounts.trial-balance → admin.accounts.reports.trial-balance
    * admin.accounts.general-ledger → admin.accounts.reports.general-ledger
    * admin.accounts.gst-report → admin.accounts.reports.gst
    * admin.accounts.comparative-pl → admin.accounts.reports.comparative-pl
    * admin.accounts.segment-report → admin.accounts.reports.segment
    * admin.ecommerce.integrations → admin.ecommerce.integrations.mail-config
    * admin.ecommerce.settings → admin.ecommerce.settings.mail-templates
    * admin.crm2.settings.document → admin.crm2.settings.document-templates
    * admin.crm2.projects.index → admin.crm2.projects.list
  * Added flyout onmouseenter/onmouseleave to ALL CRM and Accounts nav group buttons (previously many buttons were missing flyout handlers)
  * Edge-tab hover fix: CSS .xn-sidebar:hover \~ .xn-sidebar-edge-tab (broken CSS sibling selector since edge tab was before sidebar in DOM) replaced with JS mouseenter/mouseleave on #xnSidebar toggling .show class on edge tab; CSS updated to .xn-sidebar-edge-tab.show{opacity:1}
  * All routes verified with artisan route:list — zero broken routes remaining
  * GitHub commit: 40b5005

***

#### v4.9.2 — Professional Compact Tenant Dashboard (Final) `2026-06-12` [`fbbbc6f`](https://github.com/goesscay/xenoraa/commit/fbbbc6f)

* Fully self-contained CSS with hardcoded colour values (no CSS variable chain dependency)
  * Fixed all wrong route names: admin.ecommerce.products, admin.users.index, admin.crm2.activities.tasks, admin.chat.index
  * KPI cards: CRM (7 cards) + Inventory (6 cards) in proper multi-column grid with icons and sub-badges
  * Charts: Invoice Revenue line chart + Deal Pipeline bar chart (Chart.js 4.4.0)
  * Other Modules: Products, POS Orders, Today's Sales, Active Sessions, Blog Posts, Team Members
  * Recent Activity: 3-column tables (Leads, Invoices, Deals) + Recent Posts with colour-coded badges
  * Quick Actions: 12 shortcut buttons across all modules
  * GitHub commit: fbbbc6f

***

#### v4.9.1 — Dashboard Grid Layout Fix `2026-06-12` [`a59b799`](https://github.com/goesscay/xenoraa/commit/a59b799)

* Root cause: crm2-kpi-grid and crm2-charts-grid CSS classes were not applying display:grid correctly on the dashboard page
  * Fix: replaced with explicit xn-dashboard-grid / xn-charts-grid classes defined in @push('styles') with display:grid !important
  * GitHub commit: a59b799

***

#### v4.9.0 — Professional Tenant Dashboard Redesign (CRM Design Language) `2026-06-12` [`615e450`](https://github.com/goesscay/xenoraa/commit/615e450)

* Replaced generic widget layout with full crm2-page / crm2-kpi-card / crm2-card / crm2-table / crm2-badge design system
  * CRM section: 7 KPI cards (Accounts, Contacts, Leads, Deals+won, Activities, Won Revenue, Pipeline Value) — all clickable
  * Inventory section: 6 KPI cards (Quotes, SOs, POs, Invoices+pending badge, Vendors, Revenue)
  * Charts: Invoice Revenue line chart (last 6 months) + Deal Pipeline bar chart by stage — Chart.js 4.4.0
  * Other Modules: Products (active count), POS Orders, Today's POS Sales, Active Sessions, Blog Posts, Team Members
  * Recent Activity: 4 tables (Leads, Invoices, Deals, Blog Posts) with crm2-badge status/stage badges
  * Quick Actions: 12 one-click shortcuts across all modules
  * Controller: added monthlyRevenue (EXTRACT month/PostgreSQL) and dealsByStage queries
  * GitHub commit: 615e450

***

#### v4.8.0 — Tenant Dashboard Redesign — Module-Aligned Widgets `2026-06-12` [`e96e5ff`](https://github.com/goesscay/xenoraa/commit/e96e5ff)

DashboardController: replaced old stats (users/posts/jobs/expenses) with full module counts CRM section: Accounts, Contacts, Leads, Deals (open/won breakdown), Open Activities Inventory section: Quotes, Sales Orders, POs, Invoices (pending count), Vendors, Revenue (Paid invoices) E-Commerce section: Products (active count), Categories, Reviews POS section: Total Orders, Today's Sales, Active Sessions, Open Terminal shortcut Site Builder section: Published Posts (drafts count), Team Members, Site Settings Quick Actions: 12 shortcuts across all modules Recent Activity panels: Leads, Deals, Invoices, Blog Posts GitHub commit: e96e5ff

***

#### v4.7.0 — Checkboxes + 3-dot Bulk/View Menus — All 5 Inventory Sub-modules `2026-06-12` [`1997864`](https://github.com/goesscay/xenoraa/commit/1997864)

Listing pages (Price Books, Sales Orders, Purchase Orders, Invoices, Vendors):

* Removed Actions column; added checkbox column (select-all in header)
* Selection badge shows count when rows checked
* 3-dot bulk menu next to New button: Export Selected (CSV), Print Default View, Delete Selected View pages (Price Books, Sales Orders, Purchase Orders, Invoices, Vendors):
* Added 3-dot action menu (⋮) in header: Clone, Export to PDF, Print Preview, Send Mail, Delete
* Each module has its own clone/destroy/export-pdf controller method
* 20 new routes registered (bulk-delete, clone, destroy, export-pdf × 5 modules)
* JS toggle with outside-click close on all menus GitHub commit: 1997864

***

#### v4.6.0 — Quote Listing Checkboxes + Bulk Menu + View 3-dot Actions `2026-06-12` [`5f38a93`](https://github.com/goesscay/xenoraa/commit/5f38a93)

Listing Page:

* Removed Actions column; added checkbox as first column (select-all in header)
* Selection count badge ("N selected") appears when rows are checked
* 3-dot bulk menu next to New Quote: Export Selected (CSV), Print Default View, Delete Selected
* quotesBulkDelete() controller method handles bulk DELETE View Page:
* 3-dot action menu (⋮) added in header next to Convert button
* Options: Clone, Print Preview, Export to PDF, Send Mail, Delete
* quoteClone(): copies all fields, new QT-XXXXXXXX number, stage=draft
* quoteExportPdf(): builds HTML invoice PDF (wkhtmltopdf → Dompdf → HTML fallback)
* quoteDestroy(): single delete, redirects to listing
* Both Convert and Actions dropdowns close on outside click New Routes: bulk-delete, clone, destroy, export-pdf GitHub commit: 5f38a93

***

#### v4.5.0 — Sales Order Convert to Invoice `2026-06-12` [`388d9c4`](https://github.com/goesscay/xenoraa/commit/388d9c4)

* soConvertToInvoice(): copies all SO fields to new Invoice (sales\_order\_id, account, contact, deal, owner, address, line items, totals, terms, notes); status=Draft; invoice\_date=today; amount\_paid=0; INV-XXXXXXXX number; redirects to new Invoice view
  * 1 new POST route: admin.crm2.inventory.sales-orders.convert.invoice
  * Green "Convert" dropdown button added to view-sales-order header (next to Edit)
  * Single option: Convert to Invoice (amber invoice icon)
  * Closes on outside click
  * GitHub commit: 388d9c4

***

#### v4.4.1 — PostgreSQL Sequence Fix (all 89 tables) `2026-06-12` [`632c7b9`](https://github.com/goesscay/xenoraa/commit/632c7b9)

* Root cause: MySQL auto\_increment values not carried over during migration
  * All 89 table sequences reset to MAX(id)+1 using setval(pg\_get\_serial\_sequence(...))
  * Fixes 500 errors on any INSERT (create/convert) across all modules
  * Script saved at scripts/fix\_pg\_sequences.py (re-run after any future data import)
  * GitHub commit: 632c7b9

***

#### v4.4.0 — Quote Conversion — Convert to Sales Order / Invoice `2026-06-12` [`65c5364`](https://github.com/goesscay/xenoraa/commit/65c5364)

* quoteConvertToSalesOrder(): copies all Quote fields to new Sales Order (quote\_id, account, contact, deal, owner, carrier, address, line items, totals, terms, notes); status=Created; SO-XXXXXXXX number; redirects to new SO view
  * quoteConvertToInvoice(): copies all Quote fields to new Invoice (account, contact, deal, owner, address, line items, totals, terms, notes); status=Draft; invoice\_date=today; amount\_paid=0; INV-XXXXXXXX number; redirects to new Invoice view
  * 2 new POST routes: admin.crm2.inventory.quotes.convert.sales-order / .invoice
  * Green "Convert" dropdown button added to view-quote header (next to Edit)
  * Dropdown: Convert to Sales Order (indigo icon) + Convert to Invoice (amber icon)
  * Closes on outside click
  * GitHub commit: 65c5364

***

#### v4.3.0 — Dual-Rail Sidebar Navigation `2026-06-12` [`4c6ef96`](https://github.com/goesscay/xenoraa/commit/4c6ef96)

* Replaced 260px single sidebar with 60px icon rail + 220px slide-out module panel
  * Icon rail: Administration, CRM, E-Commerce, AI Hub, POS, Site Builder (icon + label)
  * Each module has its own dedicated panel with all sub-menus and sub-group accordions
  * Panel auto-opens for the active module on page load (PHP-side active module detection)
  * Panel toggle: click rail icon to open/close; X button to close
  * Sub-groups inside panels use smooth max-height CSS accordion
  * Mobile: rail slides in from left, overlay closes both rail and panel
  * Legacy toggleSidebarGroup() kept for backward compatibility with existing blades
  * Dark/light theme, profile dropdown, AI toggle, impersonation banner all preserved
  * GitHub commit: 4c6ef96

***

#### v4.2.0 — Inventory View Pages — Notes/Activities/Attachments/Email Bug Fixes `2026-06-12` [`1c1914f`](https://github.com/goesscay/xenoraa/commit/1c1914f)

* Fixed mail config field name mismatches (smtp\_host/smtp\_user/smtp\_pass/from\_email → mail\_host/mail\_username/mail\_password/from\_address) in all 5 sendMail methods
  * Added note DELETE routes for all 6 inventory modules (price-books, quotes, sales-orders, purchase-orders, invoices, vendors)
  * Added note destroy controller methods: priceBookNoteDestroy, quoteNoteDestroy, soNoteDestroy, poNoteDestroy, invoiceNoteDestroy, vendorNoteDestroy
  * Added note delete buttons (red ✕) with AJAX handlers in all 6 view blades
  * Fixed vendor contacts edit route: admin.crm2.contacts.edit → admin.newcrm.contacts.edit
  * GitHub commit: 1c1914f

***

#### v4.19.0 — About Us + Careers Pages — Xenoraa Public Site `2026-06-13` [`90144d7`](https://github.com/goesscay/xenoraa/commit/90144d7)

* New page: /xenoraa/about — About Us
  * Company story: Go Esscay Solutions Private Limited origin and Xenoraa genesis
  * Founder quote card, stats (4+ apps, 10k+ leads, 99.9% uptime), core values grid
  * CTA section linking to Get Started and Pricing
  * New page: /xenoraa/careers — Careers
    * Remote-first culture with 3 benefit cards (Remote-First, High Ownership, Growth & Learning)
    * 3 open job listings: Senior Full-Stack Engineer, UI/UX Designer, Technical Support Engineer
    * Apply Now mailto links to <careers@esscay.in>
  * XenoraaController: added about() and careers() methods
  * web.php: registered xenoraa.about and xenoraa.careers routes
  * Footer (layouts/xenoraa.blade.php): linked About Us and Careers to their routes
  * Both pages use Xenoraa design system (xn-page-hero, xn-feature-tag, xn-heading-xl, xn-btn-primary-lg)
  * GitHub commit: 90144d7

***

#### v4.15.0 — Sticky Top Action Bar — All 19 CRM Creation Pages `2026-06-13` [`cb20fa2`](https://github.com/goesscay/xenoraa/commit/cb20fa2)

* Implemented frozen Save/Cancel action bar on all CRM module creation pages
  * Bar uses position:fixed (top:60px, left:var(--rail-width), right:0) with GPU compositing
  * Shifts right when sidebar panel is open (body.xn-panel-open .xn-sticky-bar)
  * CSS class: .xn-sticky-bar (injected via @push('styles') in each blade)
  * Each page gets: sticky bar HTML, form id attribute, 64px spacer div, bottom buttons retained
  * Pages: create-contact, create-account, create-deal, create-forecast, create-activity, create-invoice, create-price-book, create-product, create-purchase-order, create-quote, create-sales-order, create-vendor, create-project, create-task, create-booking, create-service, create-mail-template, create-case, create-solution
  * GitHub commit: cb20fa2

***

#### v4.14.3 — Freeze Global Topbar — position:fixed + GPU Compositing `2026-06-13` [`79235d5`](https://github.com/goesscay/xenoraa/commit/79235d5)

* Changed .topbar from position:sticky to position:fixed in layouts/admin.blade.php
  * Fixed positioning: top:0, left:var(--rail-width), right:0, z-index:150
  * Added body.xn-panel-open .topbar rule to shift right when sidebar panel opens
  * Added will-change:transform + translateZ(0) + backface-visibility:hidden (GPU layer)
  * Added transition:left for smooth sidebar animation
  * Added padding-top:60px to .main-content to offset fixed topbar height
  * Applies globally to ALL admin pages
  * GitHub commit: 79235d5

***

#### v4.14.2 — Fix sticky bar shaking on scroll `2026-06-13` [`67bce1d`](https://github.com/goesscay/xenoraa/commit/67bce1d)

* Added html { scrollbar-gutter: stable } to admin layout (prevents page width reflow)
  * Added will-change:transform + translateZ(0) + backface-visibility:hidden to .lead-sticky-bar
  * GitHub commit: 67bce1d

***

#### v4.14.1 — Lead Create Sticky Bar — position:fixed fix `2026-06-13` [`b504cf3`](https://github.com/goesscay/xenoraa/commit/b504cf3)

* Changed from position:sticky to position:fixed with top:60px, left:var(--rail-width)
  * Added body.xn-panel-open rule, spacer div, margin-top on first section
  * GitHub commit: b504cf3

***

#### v4.14.0 — Lead Create Page — Sticky Top Action Bar + 500 Error Fix `2026-06-13` [`9d5df0c`](https://github.com/goesscay/xenoraa/commit/9d5df0c)

* 500 Error Root Cause: crm\_leads table was missing 'company' and 'internal\_notes' columns
  * Fix: Added migration 2026\_06\_13\_000001\_add\_missing\_columns\_to\_crm\_leads.php
  * Both columns now confirmed in PostgreSQL DB
  * Sticky Top Action Bar: replaced .lead-form-header with .lead-sticky-bar (position:sticky, top:0, z-index:100)
  * Sticky bar shows: 'Create New Lead' title + Cancel + Save & New + Save Lead buttons
  * Buttons use form='leadCreateForm' attribute to submit form from outside it
  * Removed bottom .lead-form-actions block (buttons now only at top)
  * Users can Save/Cancel from any scroll position without scrolling to bottom
  * GitHub commit: 9d5df0c

***

#### v4.13.0 — Hover-Slide + Click-Lock Sidebar — REVERTED `2026-06-13`

* Implemented but reverted by user request; click-only behaviour preferred
  * Revert commit: 3f8dbc3 (restores be8ee5b admin.blade.php)

***

#### v4.12.4 — Accounts Module Theme — Root Cause Fix `2026-06-12` [`be8ee5b`](https://github.com/goesscay/xenoraa/commit/be8ee5b)

* ROOT CAUSE IDENTIFIED: crm2.css was only loaded for admin.crm2\* and admin.ecommerce\* routes, NOT for admin.accounts\* routes
  * Fixed layouts/admin.blade.php: Added || request()->routeIs('admin.accounts\*') to the crm2.css conditional load
  * This single fix resolved ALL Accounts module theme issues (filter bar, table styling, badges, buttons, cards)
  * Added filter bar CSS overrides to income, expenses, transactions, journal-entries blades (flex-wrap:nowrap, min-width:0)
  * All 8 Accounts pages now fully themed with global CRM2 styles matching Leads/Contacts/Deals pages
  * GitHub commit: be8ee5b

***

#### v4.12.3 — Accounts Module Final Theme Fix `2026-06-12` [`f6cd1dd`](https://github.com/goesscay/xenoraa/commit/f6cd1dd)

* Removed crm2-subtitle paragraphs from all 8 Accounts blade headers (makes header compact, matching Leads/Contacts)
  * Replaced custom acc-kpi-card/acc-kpi-grid CSS on dashboard with compact inline styles using global CSS variables
  * Fixed CSS variable mismatches across all blades: var(--card-bg) -> var(--bg-card,#fff), var(--border-color) -> var(--border,#e2e8f0), var(--text-primary) -> var(--text-primary,#1a1a2e), var(--text-muted) -> var(--text-muted,#64748b)
  * GitHub commit: f6cd1dd

***

#### v4.12.2 — Accounts Module Theme Fix (Sidebar + Filter Bar) `2026-06-12` [`39dad2b`](https://github.com/goesscay/xenoraa/commit/39dad2b)

* Converted flat Accounts sidebar panel to accordion structure matching CRM panel (Banking / Money In-Out / Accounting groups)
  * Removed filter-group div wrappers from all listing pages so filter bar renders as horizontal flex row
  * Removed Tax column from Income and Expenses tables to reduce column count and prevent row wrapping
  * Added white-space:nowrap to all table th/td cells with text-overflow:ellipsis
  * GitHub commit: 39dad2b

***

#### v4.12.1 — Accounts Module Theme Fix `2026-06-12` [`a864777`](https://github.com/goesscay/xenoraa/commit/a864777)

* Rewrote all 8 Accounts blade views to use global crm2-\* CSS classes (crm2-page, crm2-header, crm2-title, crm2-card, crm2-table, crm2-badge, crm2-btn, crm2-input, crm2-filter-form)
  * Fixed sidebar panel structure to match global module panel pattern (Banking / Money In-Out / Accounting sections)
  * Fixed controller method name mismatches: chartOfAccounts() renamed to coa(), journalEntries() renamed to journal()
  * Fixed route references in web.php: chartOfAccounts -> coa, journalEntries -> journal
  * Fixed variable name mismatches: $entries -> $journalEntries in journal-entries blade
  * Added missing $accountsByType (grouped by type) and $categories variables to controller methods
  * GitHub commit: a864777

***

#### v4.12.0 — Accounts (Finance) Module `2026-06-12` [`827539c`](https://github.com/goesscay/xenoraa/commit/827539c)

* New top-level module accessible via ACCTS button in sidebar rail
  * Dashboard: 6 KPI cards (Total Cash Balance, Income This Month, Expenses This Month, Net Profit, Receivables, Payables) + Cash Flow bar chart (last 6 months) + Expenses by Category pie chart + Bank Accounts widget + Recent Transactions/Income/Expenses tables
  * Bank Accounts: listing with balance, type, account number; add/edit/delete
  * Transactions: chronological ledger with type badges (income/expense/transfer), bank account filter, date range filter
  * Income: listing with INC-XXXX reference numbers, category, customer, amount, tax, status, recurring badge; add/edit/delete
  * Expenses: listing with EXP-XXXX reference numbers, category, vendor, amount, tax, status, billable badge; add/edit/delete
  * Chart of Accounts: structured account tree (Assets, Liabilities, Equity, Income, Expenses) with type badges
  * Journal Entries: double-entry journal with debit/credit lines per entry
  * Reports: 6 report types (P\&L, Balance Sheet, Cash Flow, Aged Receivables, Aged Payables, Expense Summary) with date range filter, CSV export, Print
  * New DB tables: acc\_chart\_of\_accounts, acc\_bank\_accounts, acc\_transactions, acc\_income, acc\_expenses, acc\_journal\_entries, acc\_journal\_lines, acc\_tax\_rates
  * New models: AccChartOfAccount, AccBankAccount, AccTransaction, AccIncome, AccExpense, AccJournalEntry, AccJournalLine, AccTaxRate
  * New controller: AccountsController (App\Http\Controllers\Admin\AccountsController)
  * Routes: 28 new routes under admin.accounts.\* prefix
  * Sidebar: ACCTS rail button + panel with Banking / Money In-Out / Accounting sections
  * plan\_modules: accounts added to professional and business tiers
  * Demo data seeded: 4 bank accounts, 10 income entries, 10 expense entries, 10 transactions
  * GitHub commit: 827539c

***

#### v4.11.0 — Enhanced Projects Module — View page, Kanban tasks, Milestones, Issues, Time Log, Notes `2026-06-12` [`2afb214`](https://github.com/goesscay/xenoraa/commit/2afb214)

* Projects listing: checkboxes, row-click navigation, progress bar, priority badge, linked account/deal, overdue indicator, 3-dot bulk menu
  * Project view page: 6-tab layout (Overview, Tasks, Milestones, Issues, Time Log, Notes)
  * Tasks tab: inline Add Task form + Kanban board (To Do / In Progress / Testing / Completed)
  * Milestones tab: inline Add Milestone form + milestone cards with task progress bars
  * Issues tab: inline Report Issue form + table with severity/status inline update
  * Time Log tab: total hours stat cards + inline Log Time form + log table
  * Notes tab: inline Add Note form + note cards with author and timestamp
  * 3-dot action menu on view page: Clone Project, Print Preview, Delete Project
  * New DB tables: crm\_project\_milestones, crm\_project\_issues, crm\_project\_time\_logs, crm\_project\_notes
  * New columns: crm\_projects.priority/owner\_id; crm\_project\_tasks.milestone\_id/estimated\_hours/sort\_order
  * New models: CrmProjectMilestone, CrmProjectIssue, CrmProjectTimeLog, CrmProjectNote
  * 22 new controller methods + 28 new routes
  * GitHub commit: 2afb214

***

#### v4.10.0 — Leads Listing & View Page Enhancements `2026-06-12` [`232029d`](https://github.com/goesscay/xenoraa/commit/232029d)

* Leads listing: removed Actions column, added checkbox column (select-all in header)
  * Row-click navigation: clicking any row redirects to the Lead View page
  * 3-dot bulk menu next to New Lead button: Create Task (bulk), Delete Selected, Export Selected (CSV)
  * New routes: admin.crm2.sales.leads.clone, admin.crm2.sales.leads.bulk-delete, admin.crm2.sales.leads.bulk-task
  * New controller methods in CrmModuleController: salesLeadsClone, salesLeadsBulkDelete, salesLeadsBulkTask
  * Lead View 3-dot action menu: Clone Lead, Print Preview, Delete Lead
  * GitHub commit: 232029d

***

#### v4.1.0 — MySQL to PostgreSQL Migration + Inventory View Pages `2026-06-12` [`54373fc`](https://github.com/goesscay/xenoraa/commit/54373fc)

* Database: Migrated all 1,186 rows from MySQL to PostgreSQL 16.14
  * Fixed all ->after() MySQL-only migration calls (183 removed)
  * Fixed MONTH()/YEAR() raw SQL to EXTRACT() in SuperAdminController
  * AppServiceProvider: wrapped tenant lookup in try/catch for migrate:fresh compatibility
  * Migration ordering fix: 2025-dated migration now checks hasTable() before altering
  * Added missing tenant isolation columns (user\_id, tenant\_owner\_id) to portfolio tables
  * Inventory View Pages: view-price-book, view-quote, view-sales-order, view-purchase-order, view-invoice, view-vendor
  * All listing pages: row-click navigation + eye icon View button in Actions column
  * Address layout fix: 3-column grid (Billing | Copy Button | Shipping) on all 8 inventory forms
  * Attachment tables: crm\_price\_book\_attachments, crm\_quote\_attachments, crm\_so\_attachments, crm\_po\_attachments, crm\_invoice\_attachments, crm\_vendor\_attachments
  * Email model: CrmMailTemplate (NOT CrmEmailTemplate)
  * Contacts route prefix: admin.newcrm.contacts.\* (NOT admin.crm2.contacts.\*)
  * GitHub commit: 54373fc

***

#### v4.0.0 — Subscription Module Access, AI Tenant Creation, Pricing Flow `2026-06-09`

* config/xenoraa.php: plan\_modules mapping (starter/professional/business\_pro)
  * User model: planHasModule(), plan\_billing, payment\_id, business\_info, business\_info\_ai
  * admin.blade.php: canSee() gates by plan for tenant owners
  * SuperAdminController: planModules() and savePlanModules() methods
  * superadmin/plan-modules.blade.php: UI to configure plan modules
  * Pricing page: removed free tier, CTAs go to /xenoraa/get-started?plan=X
  * Home/features pages: removed free trial language
  * RegisteredUserController: redirects to payment.checkout after registration
  * PaymentController: checkout() method added; verifyPayment() bootstraps tenant
  * xenoraa/payment/checkout.blade.php: dedicated Razorpay checkout page
  * OnboardingController: businessInfo() and saveBusinessInfo() steps added
  * onboarding/business-info.blade.php: text + file upload + AI animation
  * AiTenantContentService: OpenAI GPT-4o-mini content generation from business info
  * Migration: plan\_billing, payment\_id, business\_info, business\_info\_ai columns
  * pdftotext: installed for PDF text extraction in onboarding

***

#### v3.9.0 — Theme System Expansion `2026-06-08`

* New Templates: ecommerce (ShopFront), business (Corpora) in resources/views/tenant/templates/
  * New Professions: 'E-Commerce / Online Store' and 'Business / Company' added to all profession dropdowns
  * Theme Preview: superadmin.themes.preview route + view (superadmin/themes/preview\.blade.php)
  * DB: ShopFront (id=7) and Corpora (id=8) inserted via NewThemesSeeder
  * SiteController: ecommerce & business added to getThemeDefinitions() and activateTheme() valid slugs
  * TenantBootstrapService: ecommerceConfig() and businessConfig() methods added
  * PortfolioController: ecommerce and business added to templateViews map
  * Seeder: database/seeders/NewThemesSeeder.php (safe to re-run)

***

#### v3.8.1 — POS product card layout fix + hero section image stability `2026-06-09`

* POS terminal: fixed broken onerror HTML attribute (double-quotes inside double-quotes were breaking img tag parsing causing cards to appear as thin strips)
  * POS terminal: changed img-wrap from aspect-ratio:1 to explicit height:140px for reliable card sizing
  * POS terminal: added grid-auto-rows: minmax(240px, auto) to prevent row height compression with 113 products
  * Hero section (ecommerce.blade.php): fixed onerror attribute quote nesting issue
  * Hero section: product images now served from local storage (no more IndiaMART hotlink expiry)
  * All 113 product images cached locally at storage/app/public/products/15/ (500x500 from IndiaMART)

***

#### v3.8.0 — POS (Point of Sale) module `2026-06-07`

* Tables: pos\_sessions, pos\_orders, pos\_order\_items
  * Route: /admin/pos (all 13 POS routes under admin.pos.\*)
  * Controller: App\Http\Controllers\Admin\PosController
  * Views: resources/views/admin/pos/ (terminal, orders, sessions, session-detail, dashboard, settings)
  * Models: PosSession, PosOrder, PosOrderItem
  * Admin topbar: "View POS" button added before "View Site"
  * Sidebar: "Point of Sale" group added under E-Commerce

***


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.xenoraa.com/xenoraa-changelog-and-architecture/full-version-changelog-2.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
