jluudev / arthurslastcrusade

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

Schema/API Design comments (Peter Kallos) #29

Open KallosP opened 4 months ago

KallosP commented 4 months ago
  1. Keep a consistent type for integer values (e.g. don't mix int8 and int4).
  2. Define cascade actions on foreign key constraints (e.g. hero and guild tables).
  3. For number values in spec, specify the type (i.e. int, double, float, long).
  4. Keep descriptions consistent for endpoints/add descriptions to endpoints that don't already have one.
  5. Add comments to requests and responses in spec for clarity.
  6. Add created_at and updated_at timestamps to schema.sql to track record creations.
  7. Use enum type rather than text for status in the dungeon table.
  8. Keep a consistent naming convention across all tables (e.g. foreign key to world in dungeon table named world_id but in the world table it's id).
  9. Replace null with default values (e.g. if a guild_id foreign does not exist for a record in hero, set it to -1 instead).
  10. Consider adding a ledger table for keeping track of a guild's gold history.
  11. Add filtering/searching for endpoints that return a list of items (e.g. guild/available_heroes/{guild_id}, /dungeon/assess_damage/{dungeon_id}).
  12. Add more detail in success responses for user confirmation (e.g. return guild_name after calling /guild/create_guild/{world_id}).