Commit Graph
100 Commits
Author SHA1 Message Date
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
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 4562d00bd3 fix(automations): log skipped sends with cooldown/max reason
Schedule runs that hit cooldown or max-send limits now write a skipped row to automation_sends so admins can see why no SMS was sent.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-24 22:31:27 +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 9bb0fa3a1d fix(automations): always append app name footer to SMS with fallbacks
Resolve display name from name_fa/name/name_en, skip duplicate lines, and support %نام_اپ placeholder in templates.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-24 21:57:20 +03:30
mohmdsdgandCursor f5e66bf951 fix(automations): replace %نام_کوچک before generic %نام in SMS templates
The name placeholder regex was matching the prefix of %نام_کوچک first, leaving _کوچک in the rendered message.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-24 21:51:57 +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
mohmdsdg d2469dc253 Merge branch 'main' of https://get.feep.ir/khaneghi_abshodeh/khaneghi_server 2026-08-24 18:18:29 +03:30
mohmdsdg 571cd0ebea fix enamad 2026-08-24 18:17:47 +03:30
mohmdsdgandCursor dd9a287f24 fix(settings): expose about_software and enamad_url to user get_settings
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-24 17:00:18 +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 5c542e2733 fix(settings): never plant deploy seed defaults on restore-from-backup
Ignore limangold/payping seed URLs from backup or superadmin when filling;
keep any real local value untouched unless force-overwrite.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-24 12:48:10 +03:30
mohmdsdgandCursor 3eac5bcb3a fix(settings): treat limangold deploy default as refillable from superadmin
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-24 12:45:52 +03:30
mohmdsdgandCursor 1cb8c40607 fix(settings): never overwrite existing values on restore-from-backup
Prefer superadmin over stale backup defaults like limangold.ir when filling empty keys.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-24 12:45:33 +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 89014821c5 fix all error 3 2026-08-22 16:50:49 +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
mohmdsdg 3ea21594a6 fix all error 2026-08-22 14:42:28 +03:30
mohmdsdg 7d1f8958e5 fix hamkar table 2026-08-20 15:52:42 +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 1c7a3ede77 fix(settings): do not overlay empty SuperAdmin values onto tenant DB
Blank template values must not wipe local can_edit=0 settings like
price_provider until SuperAdmin actually saves a value for that tenant.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-19 21:47:43 +03:30
mohmdsdgandCursor 924234bb19 fix(settings): PHP sync for runtime can_edit after deploy
Force can_edit=1 for Montzar/price runtime keys via settings:deploy
and settings:sync-runtime-can-edit, so tenant DB stays correct even
when an older deploy SQL is still on the server.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-19 21:07:12 +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 832a7683fb fix(migration): parse error in show_in_list COMMENT SQL string
Use double-quoted PHP string for Persian COMMENT; '' is SQL escaping, not valid inside PHP single quotes.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-19 14:16: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
mohmdsdgandCursor 351510d500 chore(server): add helper script to run deploy_settings_const.sql
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-18 17:57:22 +03:30
mohmdsdgandCursor 0afa01eea9 fix(server): queue tiny Pargar gold wallet documents instead of skipping them
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-18 17:57:22 +03:30
mohmdsdgandCursor e158831fd3 feat(server): add show_on_tv product flag and public /tv products API
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-18 17:17:01 +03:30
mohmdsdgandCursor da9f98b958 feat(server): overlay admin get_settings from SuperAdmin program-settings
Fetch public program-settings with 3-origin retry and no Laravel cache so
local DB settings stay in sync with the sold version.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-18 16:10:37 +03:30
mohmdsdgandCursor 7d405cb83b feat(server): store and apply negative special price profits
Keep signed buy/sell extras so discounts work on quotes and orders, and ignore the nested user clone in this repo.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-17 13:11:00 +03:30
mohmdsdg bd8284e4f8 added setting for user 2026-08-16 22:00:23 +03:30
mohmdsdg c3c3a60088 added table of co-woeker requests and new features 4 2026-08-16 20:58:56 +03:30
mohmdsdg 0e45a83088 added table of co-woeker requests and new features 3 2026-08-16 20:46:10 +03:30
mohmdsdg 28fd07d176 added table of co-woeker requests and new features 2 2026-08-16 20:26:23 +03:30
mohmdsdg acd1c2ea20 added table of co-woeker requests and new features 2026-08-16 20:03:18 +03:30
mohmdsdg 6fffd84584 Merge branch 'main' of https://get.feep.ir/khaneghi_abshodeh/khaneghi_server 2026-08-15 18:23:28 +03:30
mohmdsdg d651ff9d6c fix dome bugs 2026-08-15 18:22:58 +03:30
mohmdsdg 52be3eddcb Merge branch 'main' of https://get.feep.ir/khaneghi_abshodeh/khaneghi_server 2026-08-11 22:08:42 +03:30
mohmdsdg cef66ec222 Merge branch 'main' of https://get.feep.ir/khaneghi_abshodeh/khaneghi_server 2026-08-11 16:28:38 +03:30
mohmdsdg 40f0d4f880 fix some bugs 2026-08-11 16:28:01 +03:30
mohmdsdgandCursor fabce6176a Price orders at the provider's real trade rate instead of the mid quote.
montzar_live_price is the midpoint between the colleague's buy and sell rates,
so orders priced straight from it charged the customer less than we pay the
provider and the whole spread was lost on every trade, even though the app
already showed the correct side. Order base price now follows the traded side
(base + spread on buy, base - spread on sell), which also makes price_original
the real cost basis so the dashboard stops counting the provider spread as
profit. Conditional order triggers compare against the same displayed price.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-10 19:21:56 +03:30
mohmdsdgandCursor 279e4bc881 Enable gated multi-level referral profit and harden chat/SMS notify paths.
Honor enable_customer_level_profit for order referral payouts, and tighten support-chat webhook/SMS plus SuperAdmin SMS panel sync settings.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-10 16:48:53 +03:30
mohmdsdgandCursor f421fcb83f Add formula-based product pricing (P/W/MG) for Parsian-style unit prices.
Port FormulaPriceService from colleague app so admins can compute a single unit price from reference mid, weight, and wage instead of offset coefficients.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-10 16:47:29 +03:30
mohmdsdg f42ae09d14 fix support issue 2026-08-05 12:56:52 +03:30
mohmdsdg bfb8b91133 added trigger for chat sms 2026-08-04 18:59:38 +03:30
mohmdsdg fab3c2270a added rahimi dashboard 2 2026-08-03 22:21:07 +03:30
mohmdsdg 406ab4387f added rahimi dashboard 2026-08-03 19:42:23 +03:30
mohmdsdg 020219f887 added rahimi 2026-08-03 18:44:27 +03:30
mohmdsdg 9a4a1fec66 fix jibit error 2026-08-03 13:47:01 +03:30
mohmdsdg d360539208 fix title 2026-08-03 11:51:16 +03:30
mohmdsdg ec0fd28efc fix gift 2026-08-02 16:47:19 +03:30
mohmdsdg ef32046e85 بهط شیی 2026-08-02 14:00:00 +03:30
mohmdsdg eaff9dead2 added gholak 2026-08-01 17:30:14 +03:30
mohmdsdg 9642e603e7 fix some show 2026-08-01 16:47:26 +03:30
mohmdsdg c5361a5706 fix some bugs from chart 2026-08-01 15:53:10 +03:30
mohmdsdg 2d713ce592 Merge remote-tracking branch 'origin/montify' into Abshode_Khanegi 2026-08-01 15:52:17 +03:30
mohmdsdg 5efe021f03 fix pargar and login 2026-08-01 14:13:19 +03:30
mohmdsdg 87f0e2beed fix pargar and login 2026-08-01 14:04:01 +03:30
mohmdsdg 6e75b9632b added chat 2 2026-07-30 20:42:56 +03:30
mohmdsdg dcc6ffb3ca added chat 2 2026-07-30 18:06:53 +03:30
mohmdsdg abb778e090 added chat 2026-07-30 15:46:11 +03:30