Fix duplicate session billing and align pricing with DeepSeek ×3.

Serialize billSessionUsage with row locks, expose rates on recharge, add compensation script and admin usage views.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
John
2026-06-16 03:10:05 -07:00
parent befeedfd37
commit 03690ee354
14 changed files with 472 additions and 52 deletions
+1
View File
@@ -354,6 +354,7 @@ CREATE TABLE IF NOT EXISTS h5_usage_records (
balance_after_cents BIGINT NOT NULL,
created_at BIGINT NOT NULL,
KEY idx_h5_usage_user_time (user_id, created_at),
KEY idx_h5_usage_created (created_at),
CONSTRAINT fk_h5_usage_user FOREIGN KEY (user_id) REFERENCES h5_users(id) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;