Wire outbound Invoice/Document sync after confirmed ops, store sync status with timeout lock, and keep SQL credentials out of frontend responses.
Co-authored-by: Cursor <cursoragent@cursor.com>
Admin charge can now wipe the exact remaining balance when a count product has a leftover decimal amount.
Co-authored-by: Cursor <cursoragent@cursor.com>
Add admin decision to write app wallet onto Tahesab even when zero, always await colleague callback regardless of the wait switch, and SMS admins on colleague reject.
Co-authored-by: Cursor <cursoragent@cursor.com>
The list stream must tell clients whether each product is open so the device clock cannot reopen a closed shop.
Co-authored-by: Cursor <cursoragent@cursor.com>
Run one-time overflow cleanup on migrate and keep mande/document success
rows capped at 2000 with an AFTER INSERT trigger, without cron or manual SQL.
Co-authored-by: Cursor <cursoragent@cursor.com>
Clear tahesab_id on locally successful rows so they re-enter the send queue without touching panel customer codes.
Co-authored-by: Cursor <cursoragent@cursor.com>
Split frontends like my.goldarvin.ir were waiting on 404 retries for the API hostname, which made get_settings take ~16s.
Co-authored-by: Cursor <cursoragent@cursor.com>
Keep the newest 2000 success rows per inbound type so dumps stop growing from Pargar webhooks, and store compact document payloads instead of full JSON.
Co-authored-by: Cursor <cursoragent@cursor.com>
After pending docs finish, the same pump writes customers without a code into Tahesab. Inbound import is server-side; the admin only polls status.
Co-authored-by: Cursor <cursoragent@cursor.com>
File cache cannot use Cache::lock, so docs for customers without a code always failed. Register first, put the customer name on the sanad, and surface the real error.
Co-authored-by: Cursor <cursoragent@cursor.com>
Pending list was empty because a missing tahesab table hid unsynced orders and charges. Create the table when needed and keep customer on each row.
Co-authored-by: Cursor <cursoragent@cursor.com>
Gholaktala has no local tahesab table; count queries now return empty pending stats instead of QueryException.
Co-authored-by: Cursor <cursoragent@cursor.com>
Send leftover orders and charges one-by-one with a gap so Tahesab is not rate-limited, skip already-synced rows, and expose start/stop plus progress on existing status APIs.
Co-authored-by: Cursor <cursoragent@cursor.com>
Keep cover orders pending until colleague sts 2/4/6 via callback or 35s poll. Nightly prices:prune also drops old log tables.
Co-authored-by: Cursor <cursoragent@cursor.com>
The list edit dumped the whole table row into update(); whitelist form and accounting fields, and skip hashing an empty password.
Co-authored-by: Cursor <cursoragent@cursor.com>
Empty SuperAdmin chargeInfo was wiping sms_charge_* on header refresh.
Seed those keys only when empty, and move referral_bonus_amount to can_edit=1.
Co-authored-by: Cursor <cursoragent@cursor.com>
Zarin pooli returns HTTP 400 when fi is empty; a quote within 25% of market is required, which still posts as خرید فی.
Co-authored-by: Cursor <cursoragent@cursor.com>
Create the Elif order first (pending colleague), then submit to Liman so failed quote or wallet attempts stay visible instead of leaving orphan provider trades.
Co-authored-by: Cursor <cursoragent@cursor.com>
Wallet docs were sending mazaneh as fi so Zarin turned cash deposits into خرید فی rows; customer buy/sell used the inverted korf mapping.
Co-authored-by: Cursor <cursoragent@cursor.com>
Map Shahkar mismatch, token, unreachable, and duplicate cases to clear Persian messages instead of a generic wait-for-admin toast.
Co-authored-by: Cursor <cursoragent@cursor.com>
Gold gram prices now exceed the old DECIMAL/INT range and MySQL 1264 aborted buys; store money fields as DECIMAL(20,4) and hide the raw SQL error from the app.
Co-authored-by: Cursor <cursoragent@cursor.com>
When the partner rejects with a mazaneh-changed error, pull the live quote and submit once more so the customer buy can succeed without a page refresh.
Co-authored-by: Cursor <cursoragent@cursor.com>
Route online wallet deposits to Tahesab/Zarin wallet() instead of leaving
staff to post gold buy docs; keep «شارژ حساب» in accounting notes.
Co-authored-by: Cursor <cursoragent@cursor.com>
A stray montzar tick landed in the prices table, which stores no source, so
the database_last fallback served a ~168M quote on a shop whose Zaarbox board
was at ~217M. Last price and today's high/low now come from price_sync_logs
filtered by price_provider, the database fallback no longer counts as today's
price, and daily extremes reset when the provider changes.
Co-authored-by: Cursor <cursoragent@cursor.com>
Profile and bank-card save paths now succeed with clear pending-admin copy instead of a validation error when automatic Jibit checks are disabled.
Co-authored-by: Cursor <cursoragent@cursor.com>
Preview and conflict paths now include recent wallet and Tahesab documents, and applied adjustments use a visible type/title/note so customers can see the sync document.
Co-authored-by: Cursor <cursoragent@cursor.com>
Add inbound mande sync on customer import plus per-customer and bulk wallet-sync endpoints so previously linked accounts can catch up.
Co-authored-by: Cursor <cursoragent@cursor.com>