Refactor revenue and tax calculations in DirectorWorker: Adjust the pricing logic to account for cumulative tax inflation, ensuring accurate revenue and payout calculations. Update SQL query for sell logs to change conflict resolution order for better data integrity.
This commit is contained in:
@@ -208,7 +208,7 @@ DELETE FROM falukant_data.inventory WHERE id = $1;
|
||||
pub const QUERY_ADD_SELL_LOG: &str = r#"
|
||||
INSERT INTO falukant_log.sell (region_id, product_id, quantity, seller_id, sell_timestamp)
|
||||
VALUES ($1, $2, $3, $4, NOW())
|
||||
ON CONFLICT (region_id, product_id, seller_id)
|
||||
ON CONFLICT (seller_id, product_id, region_id)
|
||||
DO UPDATE SET
|
||||
quantity = falukant_log.sell.quantity + EXCLUDED.quantity,
|
||||
sell_timestamp = COALESCE(EXCLUDED.sell_timestamp, NOW());
|
||||
|
||||
Reference in New Issue
Block a user