TrackTik Assessment

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.

Task Overview

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.

Installation

Here is how you can run the project locally:

  1. Clone this repo
    git clone https://github.com/dotmarn/trackit-assessment.git
  2. Go into the project root directory
    cd trackit-assessment
  3. Copy .env.example file to .env file:
    cp .env.example .env
  4. 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=
  5. Run installation
    composer install
  6. Generate app key
    php artisan key:generate
  7. 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
    
  8. Start the application
    php artisan serve

API Endpoint (Create)

  1. Create Employees
    POST /api/v1/employees
  2. Update Employee
    PATCH /api/v1/employees?employee_id=1

Schema

  1. Provider One
    {
        "provider": "one",
        "first_name": "John",
        "last_name": "Doe",
        "email_address": "johndoe@gmail.com"
    }
  2. Provider Two
    {
        "provider": "two",
        "FirstName": "John",
        "LastName": "Doe",
        "EmailAddress": "johndoe@gmail.com"
    }