Commit Graph
465 Commits
Author SHA1 Message Date
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
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
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 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
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 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 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 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
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 b21b136711 fix(settings): honor last-price switch and overlay only SuperAdmin access flags
Stored DB prices were treated as live quotes, and SuperAdmin overlay overwrote tenant keys like trading hours. Keep overlay to the 14 access flags and hide fallback prices when the panel says so.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-25 03:01:07 +03:30
mohmdsdgandCursor 8984899042 fix(settings): push trading-hours changes to live user prices immediately
Recompute home price display on save, broadcast settings over SSE, and keep last-price status in sync without a user refresh.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-25 02:29:00 +03:30
mohmdsdgandCursor 1c8ab4b725 feat(schedule): add schedule:bootstrap and minute-precise automation runs
Install per-module schedule:run cron from artisan, store sms/in_app send minutes, and match scheduled triggers at exact HH:mm Tehran time.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-24 22:13:06 +03:30
mohmdsdgandCursor 995f6984ed feat(automations): add run-now test endpoint and sends log table
Enable immediate automation test runs without waiting for the scheduled hour, expose send history for debugging, and return all SuperAdmin overlay keys on refresh instead of only enable_automation.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-24 21:46:13 +03:30
mohmdsdgandCursor 7e8979d78d fix(settings): honor per-day trading hours and refresh SuperAdmin overlay
Use trading_hours_by_day for close_price gates, prefer public SuperAdmin fetch, and add refresh endpoint/command so stale last-good cache no longer keeps switches like enable_automation off.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-24 21:22:44 +03:30
mohmdsdgandCursor 352bb9976d feat(settings): enable_automation gate; reject stale montzar quote jumps
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-24 16:15:52 +03:30
mohmdsdgandCursor b28a98938e feat(settings): add menu/show_to_user and public get_settings for client apps
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-24 15:32:35 +03:30
mohmdsdgandCursor d2fd315e8a setting pushed
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-23 22:34:18 +03:30
mohmdsdg d3997cfc8f added time working 2026-08-23 17:13:30 +03:30
mohmdsdg 657c10d1cc added automation 2026-08-23 14:16:00 +03:30
mohmdsdg 0c0b424a69 fix price 2026-08-22 18:06:35 +03:30
mohmdsdg 7bdb2c91a0 fix(settings): read SuperAdmin overlay via ConfigService everywhere 2026-08-22 15:10:54 +03:30
mohmdsdg 197b49b719 fix(pargar): read login credentials from ConfigService overlay 2026-08-22 15:04:36 +03:30
mohmdsdgandCursor 2e960c07a1 fix(settings): keep local can_edit=0 keys in get_settings when SA omits them
Customer /api/get_settings dropped price_provider because SuperAdmin
catalog did not return it. Merge SA values when present; otherwise keep
the tenant copy so the app still receives the key.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-19 22:02:10 +03:30
mohmdsdgandCursor b7eed369c6 fix(settings): force can_edit=1 for runtime keys in API and DB writes
editable_only now includes RUNTIME_KEYS; normalize can_edit in responses.
UpdateConfig and montzar login persist can_edit=1. SQL override moved before COMMIT.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-19 20:15:28 +03:30
mohmdsdgandCursor 027170a33f fix(settings): fee only from fee_service_charge_percentage; deploy:tenant
Remove service_charge_percentage alias and config/fee.php fallback (empty → 0).
Move code-managed Montzar/price runtime keys to can_edit=1 in deploy SQL.
Add settings:deploy and deploy:tenant artisan commands for server deploy.
Advanced admin settings merge runtime keys from local DB; block manual edits.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-19 19:55:29 +03:30
mohmdsdgandCursor 5b2ed2e5fc fix(price-trigger): restrict notifications to SMS only
Remove email/in-app paths and enforce sms action on create/update so
price alerts match the product requirement for SMS-only delivery.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-19 19:02:46 +03:30
mohmdsdgandCursor 08d51ab1d1 feat(admin): add Montzar partner product list API for settings select
Expose GET /admin/montzar/products using MontzarService::listProductOptions().

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-19 14:02:48 +03:30
mohmdsdgandCursor a321ebdaad feat(product): add show_in_list toggle and TV price formula
- New `show_in_list` column to control product visibility in customer list
- New `tv_price_formula_enabled` + `tv_price_formula` columns for separate TV pricing
- FormulaPriceService: isTvEnabled() and calculateTvForProduct()
- listTvProducts applies TV formula overrides before returning
- filterProductData handles both new field sets

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-19 11:51:54 +03:30
mohmdsdgandCursor b0296c6e94 feat(server): evaluate price alerts per product and fix gold discharge rounding
Alerts now bind to a product_id and share one evaluator; displayed gold within a rounding step discharges the full wallet.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-18 22:23:20 +03:30
mohmdsdgandCursor 341b2da2c9 feat(server): expose settings table API and compose get_settings from SA locks plus local edits
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-18 18:52:29 +03:30
mohmdsdg 5337818396 fix setting bug 2026-08-18 18:32:41 +03:30