Mahdi and Cursor
51e350405a
feat: per-tenant server access kill switch
...
Add Tenant.serverAccessBlocked, toggle API with appVersion bump and settings push, and expose stealth server_reachable in get_user.
Co-authored-by: Cursor <cursoragent@cursor.com >
2026-08-11 16:05:04 +03:30
Mahdi and Cursor
af1e217a68
feat(auth): add module read/write admin RBAC
...
Introduce permission catalog, PermissionsGuard, JWT/me payload with
role+permissions, and gate all module controllers. Admins CRUD accepts
role/permissions with safety rules; migrate existing users to super_admin.
Co-authored-by: Cursor <cursoragent@cursor.com >
2026-08-10 15:29:04 +03:30
Mahdi and Cursor
4b3a8a1d6c
docs: record SuperAdmin-only git push policy in AGENTS.md
...
Khanegi/Hamkar product repos require explicit approval before commit/push.
Co-authored-by: Cursor <cursoragent@cursor.com >
2026-08-10 14:28:59 +03:30
Mahdi and Cursor
e9067eb70e
fix: allow localhost/LAN CORS for SuperAdmin public APIs
...
Local Vite frontends can call production adm.montzar.ir get_user/get_version without running a local API.
Co-authored-by: Cursor <cursoragent@cursor.com >
2026-08-10 13:30:22 +03:30
Mahdi and Cursor
a589c7f0c2
fix: normalize Khanegi newTheme ui config for userTheme schema
...
Map sidebar+bottom→both, products→buyProduct, ensure header.variant. Repair script + get_user normalize so colors apply instead of Zod fallback.
Co-authored-by: Cursor <cursoragent@cursor.com >
2026-08-10 12:34:07 +03:30
Mahdi and Cursor
425eb3c714
feat: bulk apply Niazi modular brand colors to Khanegi tenants
...
Add prisma:bulk-khanegi-modular-brand (skip Aygin/newTheme). Palette: header #0a1b37, accent #e0be7f, bg #ffffff; bumps appVersion.
Co-authored-by: Cursor <cursoragent@cursor.com >
2026-08-10 11:42:31 +03:30
Mahdi and Cursor
e025496595
feat: bump appVersion when branding changes to invalidate get_user cache
...
Appearance/avatar/name/uiVariant updates auto-increment Tenant.appVersion so clients refetch get_user only after get_version changes.
Co-authored-by: Cursor <cursoragent@cursor.com >
2026-08-09 17:42:50 +03:30
Mahdi and Cursor
501bcd0894
fix: prefer primary Tenant.domain in get_user/get_version matching
...
When multiple tenants claim the same host via domains aliases, resolve the tenant whose primary domain matches first so branding edits apply to the expected version.
Co-authored-by: Cursor <cursoragent@cursor.com >
2026-08-09 16:36:10 +03:30
Mahdi and Cursor
be50c99f65
feat: public GET /manifest.json from tenant branding
...
Serve PWA/APK web manifest per domain (name, theme colors, multi-size icons from avatar), exclude from api prefix, and proxy via nginx.
Co-authored-by: Cursor <cursoragent@cursor.com >
2026-08-09 15:41:50 +03:30
Mahdi and Cursor
1adaef5d18
Add Khanegi uiVariant modular/newTheme with get_user payload split.
...
Co-authored-by: Cursor <cursoragent@cursor.com >
2026-08-09 12:58:45 +03:30
Mahdi and Cursor
2f0e39edbb
Add bulk copy of Khanegi SMS price and charge info from pilot.
...
Co-authored-by: Cursor <cursoragent@cursor.com >
2026-08-08 16:00:54 +03:30
Mahdi and Cursor
039a2a606b
Fix SMS batch apply dry-run env and add rollout tracker.
...
Co-authored-by: Cursor <cursoragent@cursor.com >
2026-08-08 15:34:45 +03:30
Mahdi and Cursor
448dc444c9
Add Khanegi SMS sync inventory, batch import, and rollout helpers.
...
Co-authored-by: Cursor <cursoragent@cursor.com >
2026-08-08 15:30:43 +03:30
Mahdi and Cursor
b9a33505e4
Allow negative SMS auto-block threshold in API.
...
Co-authored-by: Cursor <cursoragent@cursor.com >
2026-08-08 14:55:15 +03:30
Mahdi and Cursor
26f7b7e69e
Fix auto-block migration SQL for PostgreSQL.
...
Co-authored-by: Cursor <cursoragent@cursor.com >
2026-08-08 14:42:39 +03:30
Mahdi and Cursor
8eba9a9b8f
Add optional SMS auto-block threshold below balance.
...
Co-authored-by: Cursor <cursoragent@cursor.com >
2026-08-08 14:12:29 +03:30
Mahdi and Cursor
f9b77ceaac
Show SMS money labels in tomans; keep remote APIs in rials.
...
Co-authored-by: Cursor <cursoragent@cursor.com >
2026-08-08 13:27:31 +03:30
Mahdi and Cursor
db66a44527
Add support subscription panel API with optional free periods.
...
Co-authored-by: Cursor <cursoragent@cursor.com >
2026-08-08 11:20:25 +03:30
Mahdi and Cursor
f61d10e07b
Allow multiple hosting servers per sold version.
...
Drop unique tenant_id on server_accounts and add create/update/delete/renew APIs per server account, with list/expiring using the worst status.
Co-authored-by: Cursor <cursoragent@cursor.com >
2026-08-06 19:23:37 +03:30
Mahdi and Cursor
c6d90ea262
Fix SMS tenant copy target matching; add list-tenants helper.
...
Co-authored-by: Cursor <cursoragent@cursor.com >
2026-08-06 17:17:56 +03:30
Mahdi and Cursor
7ebee7fa4e
Add script to copy SMS wallet between SuperAdmin tenants.
...
Co-authored-by: Cursor <cursoragent@cursor.com >
2026-08-06 16:58:19 +03:30
Mahdi and Cursor
2d21813c7b
Fix SMS import tableExists to use selected database name.
...
Co-authored-by: Cursor <cursoragent@cursor.com >
2026-08-06 15:39:59 +03:30
Mahdi and Cursor
12513e4967
Allow SMS send with negative balance; only block switch stops sending.
...
Co-authored-by: Cursor <cursoragent@cursor.com >
2026-08-05 22:24:20 +03:30
Mahdi and Cursor
17a54774ae
Add remote SMS panel sync API and product MySQL import script.
...
Co-authored-by: Cursor <cursoragent@cursor.com >
2026-08-05 20:53:59 +03:30
Mahdi and Cursor
57654e295c
Add shared HMAC+domain auth for remote SMS wallet API.
...
Products can authenticate with one shared secret and tenant domain instead of per-version tokens; Bearer token remains as fallback.
Co-authored-by: Cursor <cursoragent@cursor.com >
2026-08-05 17:11:55 +03:30
Mahdi
14d9c5d143
Implementing SMS panel in Super Admin
2026-08-05 14:13:44 +03:30
Mahdi and Cursor
b66e47c3b3
Add Khanegi default appearance snapshot seed and strip SA meta from get_user.
...
Mirrors Hamkar so each khanegi tenant can restore its factory ui-config without exposing defaultSnapshot publicly.
Co-authored-by: Cursor <cursoragent@cursor.com >
2026-08-03 21:13:46 +03:30
Mahdi and Cursor
3fa24ac965
Add Hamkar default appearance snapshot seed script and builder support.
...
Co-authored-by: Cursor <cursoragent@cursor.com >
2026-08-03 20:51:33 +03:30
Mahdi and Cursor
1586725a5b
Allow HTTPS tenant origins for cross-origin get_user CORS.
...
Co-authored-by: Cursor <cursoragent@cursor.com >
2026-08-03 19:47:54 +03:30
Mahdi
0a08cdb7ca
Edit dist/src/main.js
2026-07-30 20:53:53 +03:30
Mahdi and Cursor
54036a531c
Emit Nest build to dist/main.js by compiling only src.
...
Co-authored-by: Cursor <cursoragent@cursor.com >
2026-07-30 20:47:37 +03:30
Mahdi and Cursor
3156093305
Track uploads util; ignore only runtime /uploads directory.
...
Co-authored-by: Cursor <cursoragent@cursor.com >
2026-07-30 20:39:58 +03:30
Mahdi and Cursor
5cd8683fe6
Add AGENTS.md and deploy configs to the API repo.
...
Co-authored-by: Cursor <cursoragent@cursor.com >
2026-07-30 19:21:30 +03:30
Mahdi and Cursor
01f0b82ac6
Switch Prisma from SQLite to PostgreSQL for production deploy.
...
Co-authored-by: Cursor <cursoragent@cursor.com >
2026-07-30 19:14:06 +03:30
Mahdi and Cursor
a6b3457779
Add production-ready SuperAdmin API features for tenants, SMS, servers, and plugins.
...
Includes mobile auth, get_user/get_version, SMS wallet parity endpoints, appearance backfill, and related Prisma migrations.
Co-authored-by: Cursor <cursoragent@cursor.com >
2026-07-30 18:19:53 +03:30
Mahdi
ddf36f8470
Creating a control panel infrastructure
2026-07-23 19:41:21 +03:30
SuperAdmin
7fbc47766c
Initial SuperAdmin API (NestJS + Prisma)
2026-07-23 10:25:32 +03:30