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>
This commit is contained in:
2026-08-18 22:23:20 +03:30
co-authored by Cursor
parent 341b2da2c9
commit b0296c6e94
10 changed files with 454 additions and 55 deletions
@@ -593,6 +593,7 @@ DROP TABLE IF EXISTS `price_triggers`;
CREATE TABLE `price_triggers` (
`id` bigint unsigned NOT NULL AUTO_INCREMENT,
`customer_id` bigint unsigned NOT NULL,
`product_id` bigint unsigned DEFAULT NULL,
`target_price` bigint NOT NULL,
`price_condition` varchar(50) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL,
`action` varchar(50) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL,