-
Run docker compose command:
docker-compose up -d
-
It will generate one containers with two instances inside:
- graphql: NodeJS app using TypeScript/TypeORM for GraphQL and API Rest Endpoints with Express
- postgres: Database instance, generated with "pizza_db" schema containing pre-seeded data from migrations
-
Links: For any of the available endpoints, we should send parameter on the body for filtering (being PizzaType optional):
- date_from
- date_to
- pizza_type
-
Inside apollo, we can find 4 pre-built queries aligned to the requisites:
You need to create a graphQL API that will return data with these filters: time: (period start date, end date) or per selected calendar month selected pizza(s) or all pizza You should be able to query the following information through the above filters. Number of unit sold Number of ingredients used Cost of ingredients Sales
-
In order to have a better data management and storage, I normalized the model from the assumptions:
- https://docs.google.com/spreadsheets/d/1byShULmKZCmGqfLSUwh1RWWcEUPgZq3FRwYHJpV1ZXo/edit?usp=sharing
Into the following tables:
- Ingredient: List of ingredients with their unit and cost.
- Order: List of orders per day and pizza type
- Pizza_Type: List of available pizza types with their respective "price"
- Recipe: List of ingredients per pizza type with their necessary quantity.
- Unit: List of available units