Skip to content

arosiek/fruits-and-vegetables-challenge

 
 

Repository files navigation

🍎🥕 Fruits and Vegetables

🎯 Goal

We want to build a service which will take a request.json and:

  • Process the file and create two separate collections for Fruits and Vegetables
  • Each collection has methods like add(), remove(), list();
  • Units have to be stored as grams;
  • Store the collections in a storage engine of your choice. (e.g. Database, In-memory)
  • Provide an API endpoint to query the collections. As a bonus, this endpoint can accept filters to be applied to the returning collection.
  • Provide another API endpoint to add new items to the collections (i.e., your storage engine).
  • As a bonus you might:
    • consider giving an option to decide which units are returned (kilograms/grams);

    • how to implement search() method collections;

    • use latest version of Symfony's to embed your logic

    • Provide API documentation

✔️ How can I check if my code is working?

You have two ways of moving on:

  • You call the Service from PHPUnit test like it's done in dummy test (just run bin/phpunit from the console)

or

  • You create a Controller which will be calling the service with a json payload

💡 Hints before you start working on it

  • Keep KISS, DRY, YAGNI, SOLID principles in mind
  • Timebox your work - we expect that you would spend between 3 and 4 hours.
  • Your code should be tested
    • static tests: phpcs + phpstan
    • unit/integration/functional tests
    • all tests are added as github action jobs

When you are finished

  • Please upload your code to a public git repository (i.e. GitHub, Gitlab)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 99.5%
  • Dockerfile 0.5%