update
This commit is contained in:
17
api/app/enrichment.py
Normal file
17
api/app/enrichment.py
Normal 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
|
||||
Reference in New Issue
Block a user