Nginx 502 Host-not-found meant the API never stayed listening. Stamp all
migrations when tracking is empty but a late table exists, apply DDL
statement-by-statement skipping already-exists, harden remaining CREATE
TYPE/TABLE files, and never let seed crash the process.
Co-authored-by: Cursor <cursoragent@cursor.com>
Dokploy boots crash-looped on CREATE TYPE AdminRole against an existing
Postgres with an empty _goldbank_migrations table. Adopt Prisma CLI history
when present, record the baseline if AdminRole exists, and treat duplicate
object errors as already-applied so the API can start without DB shell access.
Co-authored-by: Cursor <cursoragent@cursor.com>
Keep OrdersView typing against this branch's API, and omit channel from createOrder since the server already forces WHOLESALE for app placements.
Co-authored-by: Cursor <cursoragent@cursor.com>
Rename the brand, ship Hedena logos, persist login OTP text in the SMS list, and port home/nav/auth/theme polish from main while keeping expert customers intact.
Co-authored-by: Cursor <cursoragent@cursor.com>
Rebuilds apps/api/release so the deployed image carries 5f3b004. The vendored
Prisma client changes are only its recorded build paths. No source change.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Experts (AdminUser) and customers (Customer) sign in to the same apps by mobile
but live in different tables, so the database cannot make the number unique
across them. A number could be given to an expert and to a customer, and the
login then silently merged the two (the customer row was adopted as the expert's
trading account), which left the expert on a customer session and the panel's
name edits unreachable.
The reference rejected a duplicate at entry (`unique:customers`, the agent being
a customers row too); this does the same where a number is typed in:
- customer create/update (wholesale, banker, walk-in): refused when an ACTIVE
expert holds the number;
- expert create/update: refused when a customer holds it (the expert's own
trading account excepted);
- the app's self sign-up: refused when an active expert holds it.
Only a number being created or CHANGED is checked, so existing duplicates keep
signing in and stay editable; the login's "expert wins" adoption is untouched.
Plain equality on the two unique columns, normalised with faToEn, so both
lookups are index hits.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
- apps: the fixed «در حال مشاهده بهعنوان» strip (38px) sat over the fixed page
headers, which still sat at top: 0 (the old 30px body padding was shorter than
the strip too). The strip's height is now one variable, --aab-h, that the
fixed headers (PageBar, home, dashboard, toasts) use as their top.
- admin: the customer form offers only «مغازه دار اپلیکیشن» to anyone but the
super admin; bankers and walk-in shopkeepers are listed by super-admin-only
endpoints, so ordinary admins lost the customers they created under them.
- admin: the mobile slider rid (custom.config.statics.slider) was only under the
«سفارشی» branch, which the permission screen hides outside level 104. Same rid,
now listed under «مدیریت ثابت ها». Display only: the slider routes are still
gated by config.statics.
Rebuilds admin-panel, user-app and user-app-v2 dist.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
CustomerChoiceView, ChildOrdersView and ReportView bound their Drawer with
v-model:open, which only exists from ant-design-vue 4. Both apps ship 3.2.20,
so the drawer never opened: tapping a customer in «مشتریان من» did nothing and
the "ورود به حساب این مشتری" button inside it was unreachable.
Rebuilds user-app and user-app-v2 dist.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The "سفارش مشتریان" / "مشتریان من" entries are shown from session.isSalesExpert,
which was fetched from /expert/whoami only once, at sign-in. A slow or failed
request (silently swallowed) left the flag false until the next login, so an
expert saw a customer-only menu. The dashboard now asks again on mount and on
every re-activation, and keeps the current value when the request fails.
Rebuilds user-app and user-app-v2 dist.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Rebuilds apps/api/release and apps/admin-panel/dist so the deployed images
carry 0156a97 (X-Debug counts block on the wholesale lists, console output in
the panel). No source change.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Sending X-Debug: 1 makes the five wholesale list endpoints return a counts-only
`debug` block next to the rows: the WHERE that actually ran, how many customers
the scope matches before the grid's own filters, how many customers exist per
kind/active/archived/step and how many are an expert's trading account. The
panel sends the header and console-logs the block when localStorage.debug === '1'.
Off by default; DIAG_LOG=false disables it server-side. No names or mobiles.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
index.html was already in git pointing at hashed bundles, but the assets folder was missing from the image so nginx 404ed every JS/CSS request.
Co-authored-by: Cursor <cursoragent@cursor.com>