refactor(quota): canonical <entity>_<action> taxonomy for quota events

The quota-attribution action keys were inconsistent (mixed verbs, ad-hoc names,
English-only labels). Introduce a QuotaAction constants holder (one source of
truth), rename every attribution call site to it, and add migration 0020 to
rename historical quota_events.action values. The display label now resolves
from i18n (quotaActions.<key>, EN/HU/DE) instead of a hard-coded English map.
Scheduler job ids and progress phase labels are a separate namespace and are
left untouched.
This commit is contained in:
npeter83 2026-06-19 11:48:11 +02:00
parent e3d3596c7c
commit dc70a978ed
12 changed files with 151 additions and 33 deletions

View file

@ -549,7 +549,7 @@ def get_video_detail(
}
try:
with quota.attribute(user.id, "video_lookup"), YouTubeClient(db, user) as yt:
with quota.attribute(user.id, quota.QuotaAction.VIDEOS_LOOKUP), YouTubeClient(db, user) as yt:
items = yt.get_videos([video_id])
except YouTubeError as exc:
raise HTTPException(status_code=422, detail=f"YouTube lookup failed: {exc}")