root
1aad002a3e
feat(ops): use 'reset' quota status for plan-usage reset and invalidate quota cache
...
When ops staff reset a tenant's current-plan usage, the existing
'refunded' terminal status conflated user-initiated refunds with
ops-driven resets, and tenants still saw the old balance in the top-nav
chip until the quota-summary cache TTL expired.
- Introduce a dedicated 'reset' status for quota_reservations, separate
from 'refunded'. Both the initial and an incremental migration widen
the CHECK constraint to allow it; the down migration folds 'reset'
rows back into 'refunded' before tightening the constraint.
- resetQuotaReservations / resetAIPointReservations now write 'reset'
without touching refunded_amount, and stop cascading into
ai_point_usage_logs (carried no audit value for ops resets).
- AdminUserService gains an optional cache dependency and calls
invalidateQuotaSummaryCache(tenant_id) immediately after a successful
reset so the tenant's top-nav chip refreshes on the next request
without waiting on TTL.
- Wire the existing appCache into AdminUserService at boot.
- Drop the now-unused ai_point_usage_logs field from the reset response
and from the ops-web AdminUsersView type.
- Add a unit test covering the cache-key invalidation contract.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-12 01:55:29 +08:00
..
2026-04-01 00:58:42 +08:00
2026-04-01 00:58:42 +08:00
2026-04-01 00:58:42 +08:00
2026-04-29 00:01:36 +08:00
2026-04-01 00:58:42 +08:00
2026-04-01 00:58:42 +08:00
2026-04-01 00:58:42 +08:00
2026-04-01 00:58:42 +08:00
2026-04-01 00:58:42 +08:00
2026-04-01 00:58:42 +08:00
2026-04-01 00:58:42 +08:00
2026-04-01 00:58:42 +08:00
2026-04-01 00:58:42 +08:00
2026-04-01 00:58:42 +08:00
2026-04-01 00:58:42 +08:00
2026-05-12 01:55:29 +08:00
2026-04-01 00:58:42 +08:00
2026-04-01 00:58:42 +08:00
2026-04-01 00:58:42 +08:00
2026-04-01 00:58:42 +08:00
2026-04-01 00:58:42 +08:00
2026-04-01 00:58:42 +08:00
2026-04-01 00:58:42 +08:00
2026-04-01 00:58:42 +08:00
2026-04-01 00:58:42 +08:00
2026-04-01 00:58:42 +08:00
2026-04-01 00:58:42 +08:00
2026-04-01 00:58:42 +08:00
2026-04-01 00:58:42 +08:00
2026-04-09 14:43:20 +08:00
2026-04-09 14:43:20 +08:00
2026-04-09 14:43:20 +08:00
2026-04-01 00:58:42 +08:00
2026-04-01 00:58:42 +08:00
2026-04-01 00:58:42 +08:00
2026-04-01 00:58:42 +08:00
2026-04-01 00:58:42 +08:00
2026-04-01 00:58:42 +08:00
2026-04-02 00:31:28 +08:00
2026-04-02 00:31:28 +08:00
2026-04-02 00:31:28 +08:00
2026-04-02 00:31:28 +08:00
2026-04-02 00:31:28 +08:00
2026-05-01 12:25:29 +08:00
2026-04-02 00:31:28 +08:00
2026-04-02 00:31:28 +08:00
2026-04-02 00:31:28 +08:00
2026-04-02 00:31:28 +08:00
2026-05-01 12:25:29 +08:00
2026-05-01 12:25:29 +08:00
2026-04-02 00:31:28 +08:00
2026-04-02 00:31:28 +08:00
2026-04-02 00:31:28 +08:00
2026-04-02 00:31:28 +08:00
2026-04-02 00:31:28 +08:00
2026-04-02 00:31:28 +08:00
2026-04-02 00:31:28 +08:00
2026-04-02 00:31:28 +08:00
2026-04-02 00:31:28 +08:00
2026-04-30 01:32:19 +08:00
2026-04-02 00:31:28 +08:00
2026-04-02 00:31:28 +08:00
2026-04-02 10:58:39 +08:00
2026-04-02 10:58:39 +08:00
2026-04-02 11:38:08 +08:00
2026-04-02 11:38:08 +08:00
2026-04-02 11:38:08 +08:00
2026-04-02 11:38:08 +08:00
2026-04-02 21:16:12 +08:00
2026-04-02 21:16:12 +08:00
2026-04-20 13:52:35 +08:00
2026-05-06 18:25:35 +08:00
2026-04-20 13:52:35 +08:00
2026-04-20 13:52:35 +08:00
2026-04-05 17:14:13 +08:00
2026-04-05 17:14:13 +08:00
2026-04-05 20:41:42 +08:00
2026-04-05 20:41:42 +08:00
2026-04-07 22:21:16 +08:00
2026-04-07 22:21:16 +08:00
2026-04-09 14:43:20 +08:00
2026-05-01 12:37:15 +08:00
2026-04-12 09:56:18 +08:00
2026-04-23 09:09:20 +08:00
2026-04-30 01:32:19 +08:00
2026-04-30 01:32:19 +08:00
2026-04-16 20:40:41 +08:00
2026-04-16 20:40:41 +08:00
2026-04-16 20:40:41 +08:00
2026-04-16 20:40:41 +08:00
2026-04-17 07:53:56 +08:00
2026-04-17 07:53:56 +08:00
2026-04-17 08:04:56 +08:00
2026-04-17 08:04:56 +08:00
2026-04-17 08:34:12 +08:00
2026-04-17 08:34:12 +08:00
2026-04-17 08:06:36 +08:00
2026-04-17 08:06:36 +08:00
2026-04-18 00:47:57 +08:00
2026-04-18 00:47:57 +08:00
2026-04-19 14:18:20 +08:00
2026-04-19 14:18:20 +08:00
2026-04-19 14:18:20 +08:00
2026-04-19 14:18:20 +08:00
2026-04-19 14:18:20 +08:00
2026-04-19 14:18:20 +08:00
2026-04-19 14:18:20 +08:00
2026-05-06 18:25:35 +08:00
2026-04-19 14:18:20 +08:00
2026-05-06 12:56:39 +08:00
2026-04-20 13:52:35 +08:00
2026-04-20 13:52:35 +08:00
2026-04-20 15:40:18 +08:00
2026-04-20 15:40:18 +08:00
2026-04-22 00:24:21 +08:00
2026-04-22 00:24:21 +08:00
2026-04-24 22:19:57 +08:00
2026-04-24 22:19:57 +08:00
2026-04-28 11:33:47 +08:00
2026-04-28 11:33:47 +08:00
2026-04-29 00:01:36 +08:00
2026-04-29 00:01:36 +08:00
2026-04-30 01:32:19 +08:00
2026-04-30 01:32:19 +08:00
2026-05-01 11:02:21 +08:00
2026-05-01 11:02:21 +08:00
2026-05-05 20:48:14 +08:00
2026-05-05 20:48:14 +08:00
2026-05-03 02:02:39 +08:00
2026-05-05 20:48:14 +08:00
2026-05-06 12:56:39 +08:00
2026-05-06 12:56:39 +08:00
2026-05-05 19:47:04 +08:00
2026-05-05 19:47:04 +08:00
2026-05-05 23:43:10 +08:00
2026-05-05 23:43:10 +08:00
2026-05-06 18:25:35 +08:00
2026-05-06 18:25:35 +08:00
2026-05-11 11:11:31 +08:00
2026-05-11 11:11:31 +08:00
2026-05-12 01:55:29 +08:00
2026-05-12 01:55:29 +08:00