• wucm667's avatar
    fix: quota display shows stale cumulative usage after daily/weekly reset · 0d45d866
    wucm667 authored
    The quota reset mechanism is lazy — quota_daily_used/quota_weekly_used
    in the database are only reset on the next IncrementQuotaUsed call.
    The scheduling layer (IsQuotaExceeded) correctly checks period expiry
    before enforcing limits, so the account remains usable. However, the
    API response mapper reads the raw DB value without checking expiry,
    causing the frontend to display cumulative usage (e.g. 110%) even
    after the reset period has passed.
    
    Add IsDailyQuotaPeriodExpired/IsWeeklyQuotaPeriodExpired methods and
    use them in the mapper to return used=0 when the period has expired.
    0d45d866
account.go 47.3 KB