Commit Graph
633 Commits
Author SHA1 Message Date
mohmdsdgandCursor c802c67e0d feat(tahesab): register remaining panel customers after document sync
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>
2026-09-03 10:09:54 +03:30
mohmdsdgandCursor ff5430eceb fix(tahesab): register unlinked customers before sending documents
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>
2026-09-03 09:25:18 +03:30
mohmdsdgandCursor bb52e4c35a fix(tahesab): show missing docs and create local table if absent
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>
2026-09-02 21:51:21 +03:30
mohmdsdgandCursor ad12de87c7 fix(tahesab): do not 500 pending-summary when tahesab table is missing
Gholaktala has no local tahesab table; count queries now return empty pending stats instead of QueryException.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-02 21:00:22 +03:30
mohmdsdgandCursor c5fd3b45fe feat(tahesab): pump pending documents slowly from admin, not schedule
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>
2026-09-02 20:48:14 +03:30
mohmdsdg 92d8f2e9b3 fix scadule for getting price 2026-09-02 18:14:32 +03:30
mohmdsdgandCursor 0b1e5c687b feat(order): wait for colleague callback before settling wallet
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>
2026-09-02 15:55:03 +03:30
mohmdsdg e9674d6571 fix some bugs 2026-09-02 11:38:57 +03:30
mohmdsdgandCursor b54f9f0527 fix(customer): save only profile fields on admin PUT
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>
2026-09-02 11:18:59 +03:30
mohmdsdgandCursor 91a2dab440 fix(sms): keep charge deposit defaults and unlock referral bonus
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>
2026-09-01 21:38:19 +03:30
mohmdsdgandCursor cae41e72b8 fix(search): match Arabic ye/kaf with Persian letters in admin search
Customer names stored with ي/ك were missed when typing ی/ک; fold both sides of LIKE.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-01 21:38:09 +03:30
mohmdsdgandCursor e27a8ac397 fix(zarin): post rial wallet docs as cash via payment, not pooli buy-fi
Zarin kind=payment creates type 55 cash-only rows; it needs zarin_idbank as the counterpart account.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-01 16:51:16 +03:30
mohmdsdg c09dcfc704 Merge branch 'main' of https://get.feep.ir/khaneghi_abshodeh/khaneghi_server 2026-09-01 15:45:55 +03:30
mohmdsdgandCursor 102a8e1473 fix(zarin): send mazaneh on rial wallet docs so deposits are not rejected
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>
2026-09-01 15:45:11 +03:30
Mahdi 00610246ce fix(sms): parallel SA failover and clear sticky cache 2026-09-01 12:04:04 +03:30
mohmdsdgandCursor d12b38a1e8 fix(montzar): persist local order before provider cover and record success or failure
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>
2026-08-31 22:14:36 +03:30
mohmdsdgandCursor f6118689e1 fix(zarin): post rial deposits without gold conversion and restore shop-side trade korf
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>
2026-08-31 18:34:40 +03:30
mohmdsdgandCursor 0adcb5f9d5 Surface specific Jibit identity errors on profile update.
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>
2026-08-31 16:52:59 +03:30
mohmdsdgandCursor 4c2200a0e0 Widen order price columns so current gold rial quotes persist.
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>
2026-08-31 16:14:02 +03:30
mohmdsdgandCursor 5537cd7086 Retry Montzar orders after refreshing a stale quote.
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>
2026-08-31 16:14:02 +03:30
mohmdsdgandCursor c5fd6608bf fix(tahesab): sync gateway and admin cash deposits as VKHBank charge
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>
2026-08-31 14:58:20 +03:30
mohmdsdgandCursor 142cfd7661 fix(price): read last quote and daily extremes from the active provider
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>
2026-08-31 09:45:37 +03:30
mohmdsdgandCursor 1b73305d6f Return admin-approval messages when Jibit profile or card verify is off.
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>
2026-08-30 21:35:10 +03:30
mohmdsdgandCursor f1fb3c1e74 Show Tahesab balance docs on conflict and label adjust txs for customers.
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>
2026-08-30 21:18:24 +03:30
mohmdsdg c27cfabd22 added some feature for accounting 2026-08-30 20:47:26 +03:30
mohmdsdg 283f17561c added some feature for accounting and enhance performance for dashboard 2026-08-30 20:18:48 +03:30
mohmdsdgandCursor e059a4709e Apply Tahesab account balances to wallets with admin overwrite control.
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>
2026-08-30 14:16:36 +03:30
mohmdsdgandCursor 050bd26318 Add gold credit feature gated by SuperAdmin enable_gold_credit.
Port tables, APIs, and overdue cron from goldali, default the flag off, and keep customer routes behind auth.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-30 00:17:01 +03:30
mohmdsdg a8be3d499b fix superadmin settings cache 2026-08-29 23:47:58 +03:30
mohmdsdgandCursor 9f6203075a Fix SuperAdmin access sync for tenant domains and persist flags locally.
Expand www/admin domain aliases when resolving program-settings, and save owned keys to local settings after a successful refresh so menu flags like customer_special_pricing stay applied.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-29 23:35:37 +03:30
mohmdsdgandCursor 63195718a2 fix(settings): drop program-settings last-good cache and prefer montzar
Stale Redis overlay and SMS-origin-first fetch kept feature flags like customer_special_pricing false after SuperAdmin turned them on. Always fetch live and try adm.montzar.ir first.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-29 22:39:08 +03:30
mohmdsdgandCursor cecb84bad9 Allow erase-bad-buy when the orders row was already deleted.
Find orphan buy transactions or accept --gold/--transaction so wallet gold can still be stripped and cash recharged.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-29 14:08:51 +03:30
mohmdsdg 7f74a951d3 script added 2026-08-29 14:04:13 +03:30
mohmdsdgandCursor c1e2bb5e9b fix zarin duplicate hesab and convert mesghal unit price to gram before cash/weight.
Reuse an existing Zarin hesab instead of a second addhesab, and stop rial-locked orders from treating mesghal as per-gram.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-29 13:50:12 +03:30
mohmdsdg 6b5b490e2b added accounting failing handles 2026-08-27 16:16:20 +03:30
mohmdsdg 93834c9f40 fix transaction bug 2 2026-08-27 14:29:50 +03:30
mohmdsdg 8ceb737856 fix transaction bug 2 2026-08-27 14:26:01 +03:30
mohmdsdg 2c31595b5f fix transaction bug 2026-08-27 14:20:19 +03:30
mohmdsdg acf229006e fix transaction bug 2026-08-27 14:01:34 +03:30
mohmdsdg 17d79c0ce6 fix some issue from sse 2026-08-27 11:53:29 +03:30
mohmdsdg 40b185187c fix some issu 2026-08-26 21:47:09 +03:30
mohmdsdgandCursor 74cc50149f fix(const): return latest app_banners row and keep value_json in sync
Admin banner uploads were lost on refresh when an older const row or empty value column was served instead of the saved JSON.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-26 18:01:22 +03:30
mohmdsdgandCursor 885ed33e6e feat(accounting): document colleague trades on configured accounts
Post Montzar-covered buy/sell to Zarin/Tahesab/Pargar using montzar_account_* settings, and harden public storage URL/MIME handling for uploads.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-26 16:59:27 +03:30
mohmdsdg ad78545ebd update setting 2026-08-26 12:56:57 +03:30
mohmdsdgandCursor c635ab5f5f fix(api): raise admin rate limit and skip throttle on /admin/p
Admin price polling was hitting the shared 60/min IP limit and returning 429 on restore-all.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-25 21:43:29 +03:30
mohmdsdg ce8f5ca482 permission check 2026-08-25 21:24:35 +03:30
mohmdsdgandCursor ffaded6fef fix(price): normalize store product list for SSE identity and images
Store SSE payloads were Eloquent models, so listIdentity skipped them and file_id changes never republished; encode to plain arrays before hash/publish.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-25 20:49:53 +03:30
mohmdsdgandCursor 9a6d22daf6 fix(price): include product file_id in SSE list identity
Image uploads were ignored by the live list hash, so the stream kept republishing a stale product payload and the theme reverted to the old photo.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-25 16:14:46 +03:30
mohmdsdgandCursor 793c8cd9ed fix(settings): expose SuperAdmin feature flags to customer get_settings
Menu gates like enable_product_funds were missing from the public API, so the user app could not hide disabled features.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-25 14:19:22 +03:30
mohmdsdgandCursor dfa6d792ee fix(price): drop quote deviation cap so Montzar live price can apply
Stale prices rows were rejecting a valid ~220M partner quote against an old ~168M reference and locking the app on database_last.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-25 13:31:47 +03:30