24 Commits
Author SHA1 Message Date
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 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 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 69538226d2 fix bugs 2026-07-16 14:33:57 +03:30
mohmdsdg 277cf31d93 fix bug 22/4 2 2026-07-13 19:03:30 +03:30
mohmdsdg 17e50de53e fix sql 2026-07-02 01:26:26 +03:30
mohmdsdg 14055c5770 fixed price 2026-06-28 10:51:56 +03:30
mohmdsdg dec13e8537 fixed price 2026-06-28 10:46:09 +03:30
mohmdsdg 37a54e0764 fixed provider price 2 2026-06-27 11:29:09 +03:30
mohmdsdg 6e9a5b5baa fixed provider price 2026-06-27 11:06:32 +03:30
mohmdsdg c7638918ff fixed upload file 2 2026-06-23 15:55:12 +03:30
mohmdsdg 2a91837c2b fixed show true when price is 0 3 2026-06-22 19:50:45 +03:30
mohmdsdg 8858cf968b fixed show true when price is 0 2 2026-06-22 19:35:20 +03:30
mohmdsdg 27d58e8a11 fixed show true when price is 0 2026-06-22 19:14:24 +03:30
mohmdsdg b021acde56 fix bug 2026-06-14 22:00:21 +03:30
mohmdsdg 91a82c06e4 khanegi setting and prices records 2026-06-13 17:35:40 +03:30
mohmdsdg 98e1fe969c store 2026-06-12 19:49:53 +03:30
mohmdsdg 11fb7272cb added kashkool 5 2026-06-12 19:23:09 +03:30
mohmdsdg e3bc50e2c6 new check for kashkol 2026-06-12 16:06:37 +03:30
mohmdsdg 779a67a23e fix bug 3 2026-06-11 21:48:18 +03:30
mohmdsdg e8ebdcb44f fix bug 2 2026-06-11 21:37:17 +03:30
mohmdsdg a21dbcf3e1 fix bug 2 2026-06-11 21:17:40 +03:30
mohmdsdg b5d2b878de fix bug 2026-06-11 19:23:16 +03:30
mohmdsdg f329419c3a fix bug 2026-06-11 16:41:28 +03:30