jluudev / arthurslastcrusade

https://arthurslastcrusade.onrender.com
0 stars 0 forks source link

Code Review Comments (Martin Wise) #38

Open Martin-Wise opened 4 months ago

Martin-Wise commented 4 months ago

1) I suggest adding prints/logs throughout your code for testing, it helped me a ton when implementing the potion shop 2) Finding your schema folder was a touch hard, naming it just schema.sql would've been super helpful for me 3) After reading through your schema file, I think that you should try and stay more consistent with your integers eg BIGINT or INT as to not leave confusion to you or the user in the future 4) In dungeon.py while creating a dungeon I think it would be beneficial to you to check here if values are invalid, such as what would happen if a user entered a negative value for a dungeon or something so large its never going to actually be used. 5) Similarly in most of your create endpoints, you have correctly restricted the types of values, such as an integer or string, through your schema.sql and thus your database. However in terms of keeping your game balanced, I think additional checks should be in place as well to ensure proper items to be added to your game (ideally in a frontend this would be handled but as there is only a backend here I think it's useful) 6) In hero.py, in attack_monster, validating the success of updating the monster's health could prevent unexpected behavior. This touches a little on what I mentioned in 5 and 6 but deals with the possibility that a hero hurts a monster past 0 health causing it to become negative and thus unkillable. 7) I do think there's a lack of double checking to see if a database request went through sucessfully before continuing, this isn't tooo terribly necessary for something at this scale but something that I think will cover all your ends. 8) Send Party in your API spec is a little confusing as I believe it is formatted incorrect (I could be wrong)