Skip to content

feat: get a product with its availability

Paul Jarleton requested to merge feat/#7_products_get into main

Summary

It introduce a getter through GET /products/{productId}.

This getter asks the database for all composing parts of the product as well as availability for each according on the needed amount.

It then reduce it to present it in a well formed maner.

What's extra in the box

refactoring

  • fixtures has been refactored to hold a coherent product representation that could be returned by the database/api
  • a utils has been introduced to handle errors in a more convenient way

Creating a product api changes

When creating a product it now returns the whole new object instead of the id. It was changed to make it so we can update the front end in one go and informed as soon as possible on availability.

Merge request reports