merimmurtic / bh-fantasy

0 stars 0 forks source link

Update /{teamId}/add-player method to prevent having e.g. 15 goalkeepers inside fantasy team. #35

Open nirm3l opened 5 years ago

nirm3l commented 5 years ago

Update /{teamId}/add-player method to prevent having e.g. 15 goalkeepers inside fantasy team.

You should check if the team belongs to one of Fantasy League and if it is, prevent having more than 2 goalkeepers, more than 5 defenders, more than 5 middles and more than 3 forwards.

NOTE, TODO: In the future, we will add additional validation to prevent exceeding team budget and additional rule to prevent adding more than 5 players from one regular league (for Fantasy league consisting from 5 regular leagues).