hpi-schul-cloud / gamification

A reusable microservice for gamification.
GNU Affero General Public License v3.0
44 stars 17 forks source link

First achievement (CommunicatorBronze) is not obtained from the database #69

Closed catamaican closed 5 years ago

catamaican commented 5 years ago

Steps for initial database:

2 x POST events, data: { "user_id": "user123", "name": "ForumPost", "payload": {} }

1 x GET user/user123 >> response= { "user_id": "user123", "achievements": [], "xp": [ { "name": "XP", "amount": 43 }, { "name": "postXP", "amount": 2 } ], "level": 1 }

but in database >> {"_id":"5be13f399acbc00fb8e473fb","scope":null,"user_id":"user123","name":"CommunicatorBronze","current_amount":1,"total_amount":1,"__v":0}

Expected: the document from the database

Subsequent requests for event=ForumPost are executed correctly --MongoDB data: {"_id":"5be13f399acbc00fb8e473fb","scope":null,"user_id":"user123","name":"CommunicatorBronze","current_amount":0,"total_amount":1,"__v":0} {"_id":"5be140329acbc00fb8e473ff","scope":null,"user_id":"user123","name":"CommunicatorSilver","current_amount":1,"total_amount":1,"__v":0}

and GET user/user123 >>> { "user_id": "user123", "achievements": [ { "name": "CommunicatorSilver", "amount": 1, "scope": null } ], "xp": [ { "name": "XP", "amount": 73 }, { "name": "postXP", "amount": 5 } ], "level": 1 }

catamaican commented 5 years ago

ok....it's mai fault

CommunicatorBronze: [....] actions: