This commit is contained in:
2026-04-27 17:54:31 +02:00
parent 18ba64eaf8
commit 650cca7337
10 changed files with 148 additions and 4 deletions

17
api/app/enrichment.py Normal file
View File

@@ -0,0 +1,17 @@
def classify_price(robux: int) -> str:
if robux <= 99:
return "low"
elif robux <= 499:
return "medium"
else:
return "high"
def enrich_event(event, game: str):
"""Adds game tag and derived fields."""
event.data = event.data or {}
# Inject game name into event data as a tag
event.data["game"] = game
# Derive price group for robux purchases
if event.type == "robux_purchase" and "robux" in event.data:
event.data["priceGroup"] = classify_price(event.data["robux"])
return event