vioott's picture
feat: add fantasy category to user history and AI decision logic
8a4d350
raw
history blame
469 Bytes
def get_user_history(user_id: int) -> dict:
"""
Retorna o histórico de compras do usuário.
"""
user_histories = {
1: {'fiction': 5, 'non_fiction': 2, 'science': 0, 'fantasy': 0},
2: {'fiction': 1, 'non_fiction': 4, 'science': 1, 'fantasy': 2},
3: {'fiction': 0, 'non_fiction': 1, 'science': 5, 'fantasy': 0},
4: {'fiction': 1, 'non_fiction': 0, 'science': 0, 'fantasy': 6},
}
return user_histories.get(user_id)