Amirhf1 / Recruitment-task

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Backend Recruitment Test

Taxi Logo

This project is a incomplete online taxi backend which developed based on TDD So basically you should just fill the blank with simplest code that pass the tests.

Functionality

Idea is simple. There are drivers and passengers:

  1. Users register in the system. (POST /register)

  2. Some of users sign up for being a driver (POST /driver)

  3. Drivers send updates about their car's coordination and retreive availble travels. (PUT /driver)

  4. Passenger creates a travel with multiple stop spots with coordinates. (POST /travels)

  5. Driver accept the travel. (POST /travels/{travelId}/take)

  6. Driver go to coordinates of first spot and notify his arrival to passenger (POST /travels/{travelId}/spots/{spotId}/arrived).

  7. Driver save an event in the system when passenger got in the car (POST /travel/{travelId}/passenger-on-board).

  8. Driver take passenger to next destinations based on a predefined order by passenger and save an event for each arrival. (POST /travels/{travelId}/spots/{spotId}/arrived)

  9. Travel mark as done when all of spots are passed. (POST /travels/{travelId}/done)

Both parties can cancel travel (POST /travels/{travelId}/cancel) in some situations:

  • Passenger: no driver accept the travel.
  • Passenger: driver does not arrived at origin of travel.
  • Driver: passenger doesn't got in the car yet.

Also, passenger can add (POST /travels/{travelId}/spots) or remove (DELETE /travels/{travelId}/spots/{spotId}) destinations on the way.

What's included

We did it all before you then delete controllers method body codes, so these are included in the code and you don't need to write.

  • Eloquent Models (app/Models) and Enums (app/Enums)
  • Exceptions (app/Exceptions)
  • Authtorization policies (app/Policies) and service providers
  • Http form requests (app/Http/Requests) and Resources (app/Http/Resources)
  • Database migrations (database/migrations)
  • Model Factories (database/factories)
  • Routes (routes/api.php)
  • Feature tests (tests)

Code Coverage Report

You can put your mind on http controllers. Based on our implementation you need to write roughly < 200 lines of SMART code.

Steps

  1. Start coding wherever it's needed.
  2. Run vendor/bin/phpunit.
  3. Send us a pull request when all tests are passed.
  4. Make sure CI run successfully.
  5. Wait for us!

Technology & Framework

  • PHP >= 8.1
  • Laravel > 9.19

Wish you best of luck.

About


Languages

Language:PHP 100.0%