Jerkinator / secondRoll

0 stars 0 forks source link

91 gamead order modelsdtos constraints annotations #106

Closed Vurpas closed 5 months ago

Vurpas commented 5 months ago

Added validation to the createGameAdController so that all the fields needs to be "notBlank", and also has a size limit. example: ShippingCost now has a range of 1-500, so you cant create a gameAd with a shippingCost of 0:- or less, or more than 500:-. Similar restrictions apply to all the fields required for a gameAd.

Tested in postman

Checkout to the branch: -git fetch -git checkout 91-gamead--order-modelsdtos-constraints-annotations

Postman: endpoint: http://localhost:8080/api/gameAds body: { "userId": "_id", "title": "title", "description": "description", "price": 1, "gameCreator": "gameCreator", "gamePlayTime": "playtime", "gameRecommendedAge": "age", "gamePlayers": "players", "gameGenres": [ "genres", "more genres" ], "shippingCost": 1 }