This task is developed with the latest version of the Laravel framework (Laravel v11). PHP v8.2 and above is required to run this task.
I developed an API endpoints that accepts employee data from two (2) different identity providers. Each provider has a different schema and the data is transformed before posting to the TrackTik Rest API to handle.
Here is how you can run the project locally:
- Clone this repo
git clone https://github.com/dotmarn/trackit-assessment.git
- Go into the project root directory
cd trackit-assessment
- Copy
.env.example
file to.env
file:cp .env.example .env
- Update the
.env
file with the following:TRACK_TIK_BASE_URL=https://smoke.staffr.net/rest TRACK_TIK_CLIENT_ID= TRACK_TIK_CLIENT_SECRET= TRACK_TIK_REFRESH_TOKEN=
- Run installation
composer install
- Generate app key
php artisan key:generate
- As of Laravel v11, it ships with SQLite as the default database. Proceed to run the migration to create the database tables.
php artisan migrate
- Start the application
php artisan serve
- Create Employees
POST /api/v1/employees
- Update Employee
PATCH /api/v1/employees?employee_id=1
- Provider One
{ "provider": "one", "first_name": "John", "last_name": "Doe", "email_address": "johndoe@gmail.com" }
- Provider Two
{ "provider": "two", "FirstName": "John", "LastName": "Doe", "EmailAddress": "johndoe@gmail.com" }