- portal.ejs: add TZ flag+prefix pill (+255), section divider between
plans and payment, hint text showing format (0765 123 456)
- engine.js: auto-format phone as user types into groups 4-3-3
(0765 123 456); strips non-digits and caps at 10 digits
- migrate.js: add cleanup UPDATEs before MODIFY COLUMN to reset any
invalid ENUM values before altering the column definition
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
fix status ENUM truncation and add pre-query debug loggingβ
- migrate.js: add migrations 004/005 to MODIFY access_tokens.status
and payments.status ENUMs so older live DBs get the missing values
('unused', 'completed', 'refunded') without a wipe
- webhooks.routes.js: log all status writes before each query so the
last visible log before a Processing error pinpoints the exact statement
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
remove auto-trial on registration; admin grants trial manuallyβ
Devices now register with billing_status='suspended' so they are
inactive until an admin explicitly grants access. New endpoint
POST /api/admin/devices/:id/grant-trial sets billing_status='trial'
with a configurable number of days (default DEVICE_TRIAL_DAYS env).
Tenant receives an SMS when the trial is granted.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
fix(portal): add device_portal_settings migration and fix NOT NULL columnsβ
- Create table if it doesn't exist with all columns nullable
- MODIFY bg_color and primary_color to DEFAULT NULL on pre-existing tables
- Fix ON DUPLICATE KEY UPDATE to use row alias instead of deprecated VALUES()
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add migration runner that executes before server startβ
Migrations are idempotent β errno 1060 (duplicate column) is silently
skipped so they are safe to run on every boot.
First migration adds ssid_name, ssid_password, omada_wlan_id, omada_ssid_id
to the devices table for existing installations.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Node.js/Express backend with Omada SDN integration, M-Pesa payments via
Snippe, SMS notifications, captive portal, and tenant dashboard API.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>