A customer cart line is a single piece, the home reel opens on tap, and a variant can be saved without a rial wage.
Co-authored-by: Cursor <cursoragent@cursor.com>
Vendor the locked sharp Linux runtime and verify it during Docker builds. Add complete image response lengths and persistent frontend fallbacks, with real-codec HTTP and isolated release regression tests. Refresh tested API, admin and customer release artifacts.
Co-Authored-By: Claude Code <noreply@anthropic.com>
OrdersService gained a CartService dependency (createOrder empties the cart
once the order is placed), so both specs failed to compile with TS2554 and
their suites never ran. Adds a clearForCustomer stub.
Full suite: 52/52 suites, 547/547 tests.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The custom runner only tracks its own table, so a database brought up with
`prisma migrate deploy` looked empty to it and the baseline was replayed —
failing on "type AdminRole already exists". Read applied names from
`_prisma_migrations` too (a no-op when that table does not exist).
Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
nginx picks a regex location over a plain prefix location, so with
`location /api/` the static-asset rule (\.png$ …) won any API request whose
path ended in an image extension: /api/img/<hash>.png?w=400 was looked up
under /usr/share/nginx/html and 404ed instead of reaching the API. The same
file at /uploads/<hash>.png still loaded, which is exactly why an uploaded
card thumbnail showed broken on the server but opened fine at full size —
and why only .png/.jpg/.gif/.svg uploads were affected while .webp ones
looked fine.
^~ stops the regex pass. Verified in an nginx:alpine container with this
config: /api/img/abc.png?w=400 now reaches the proxy (502 without an
upstream) instead of 404, while bundled assets still come from disk.
Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
A flat 8000x8000 PNG can weigh 13 KB, so the byte-size shortcut skipped
compression and every thumbnail render had to decode 64 MP first — on a small
server that outlived nginx's timeout, leaving the card broken until the
variant finished while the original (/uploads) opened fine. Files over 2000 px
on their long side are now converted even when they are small on disk.
ant-design-vue paints the upload tile as <img src=thumbUrl alt=name> with no
error handling, so any failed resize showed the grey box with just the file
name. The tile now falls back to the stored original.
Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
The survey screen, its nav item, route guard and API were gated on the
product.survey rid, which only the super admin held in practice.
Grant 'product' and 'product.survey' to every user type (migration for
existing databases, seed for fresh ones). 'product' only opens the products
menu group — its other children keep their own rids — so nothing else new
becomes visible.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
- API ceiling 8 MB -> 15 MB, sharp limitInputPixels 64 MP (8000x8000)
- accept AVIF, BMP, TIFF, HEIC/HEIF, JXL alongside JPEG/PNG/WebP/GIF/SVG/PDF;
fall back to the file extension when the browser sends an empty or
octet-stream type
- convert formats browsers cannot paint (TIFF, HEIC, JXL) to WebP on upload
- pre-warm 200/400/600/1600 variants so card thumbnails never wait on a render
- nginx: client_max_body_size 20m, proxy_read_timeout 180s (the 1m default
rejected every real photo with a bare 413, and a slow 8000px render became
a 504 that left the card thumbnail broken while /uploads worked)
- gallery tile falls back to the original file if a variant fails
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
- Replace the crown logo with logo.svg / logo_bk.svg across both frontends;
regenerate favicons and PWA icons via scripts/generate-brand-icons.cjs
- Custom button: admin chooses whether it shows before login or only after
- Dashboard: drop the survey-majority banner, hide the custom-order row
Co-authored-by: Cursor <cursoragent@cursor.com>
- Rial wage and gram-debt arithmetic matched to the reference; order corrections keep debt in sync
- Document confirm/un-confirm is a compare-and-swap (no double-applied cache under concurrency)
- Settlement document and expert inputs validated (400 instead of 500)
- Expert: edit / activate-deactivate own customers, adjust raw weights only
- Made-to-order flow in the app, PreOrder.quantity migration
- Order grids: customer column, sort keys; panel select search; pre-order quantity save
- Rebuilt release artifacts
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Drop the duplicate customer app from the monorepo and keep user-app-v2 as the only app; include order pricing, admin cart, OTP/SMS, and dashboard cache updates.
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>