rcereno / REDX

0 stars 0 forks source link

Schema/API Design Comments (Tarj Mecwan) #11

Open TarjMecwan opened 4 months ago

TarjMecwan commented 4 months ago

Schema/API Design Comments (Tarj Mecwan)


Description:

  1. API 7.3 (Cart View): The cart view seems a bit confusing because the API documentation doesn't quite match up with how it's actually implemented. To make things clearer, try to figure out a better way to fetch cart reviews and then change the APISpec.

  2. API 8 (Add to Wishlist): For adding items to the wishlist, it would be clearer if the request payload specified the item SKU instead of the customer name. This change would make it clearer when testing if the item is being added to the wishlist.

  3. SQL Schema (carts table): Storing the total number of games and the total cost in each cart row might introduce data redundancy. Try to calculate these values from the cart items to minimize the overhead of updates. You can implements ledgers, like from potion shop, to keep the total numbers of games and costs constantly updated. I noticed this changed when two responses were put in at the same time, and it wasn't updating it correctly.

  4. API 7.1 (Account Registration): Improve the registration process by including the newly created account ID in the API response. This enhancement would simplify subsequent interactions with the account, aligning with common practices in account management APIs and providing a smoother user experience.

  5. SQL Schema: Clear up the schema by removing commented-out code segments. This action enhances readability, minimizing clutter and eliminating potential confusion caused by unused code sections.

  6. API 5 (Current Time): Assess the relevance of this endpoint within the project's scope. If deemed redundant, removing it will streamline the API, simplifying its structure and reducing unnecessary complexity.

  7. API 9 (Review Game): Maintain consistency between the API documentation and the actual endpoint location to prevent confusion. Enhance developer usability by including the new review ID in the response, facilitating easier tracking and management of reviews.

  8. SQL Schema (games table): Simplify data handling and align with industry standards by considering switching the price column to represent dollar amounts. This adjustment would enhance usability and streamline data management.

  9. API 1 (Get Catalog): The SKU length restriction specified in the API documentation doesn't accurately reflect the data returned. Some SKUs exceed the stated limit, which could pose challenges for consumers parsing this information.

  10. API 3 (Add Item to Cart): The API specification should offer clearer guidance on the expected request payload. Inadequate instructions may present challenges for developers when integrating with this endpoint.

  11. SQL Schema: To maintain data integrity, it's crucial to enforce "not null" constraints on essential columns like item SKU and name in the games table. This helps mitigate the risk of null values and ensures consistency in the schema.

  12. SQL Schema (carts for accounts): Streamline the schema by incorporating a "current cart" column in the accounts table to link to the current open cart. This optimization reduces redundancy and boosts database efficiency.