Skip to content

subit-io/subit-backend-interview-task

Repository files navigation

Subit backend interview live-coding task

The task

We want to implement a new feature to display absence-quota information to our teacher end-users. To do so, we need to import the data from their salary-system (OPUS). Your task is to implement code to import the data.

You must:

  • Create a migration to store the absence-quota. The absence quota should be related by a foreign key to the schools and teachers tables. All other considerations, including normalization is up to you.
  • Create a model AbsenceQuota with relationships to the School and Teacher models.
  • Implement the functionality to import the data in OpusAbsenceQuotaImportService. You should match schools and teacher by the institutionCode and employeeNumber fields.
  • The import implementation should be runnable multiple times, so daysRemaining can be updated in our system, as it changes in the salary system.

You should take the following things into consideration:

  • Normalization of the data model
  • Performance of the import
  • Data consistency and constraints

Setup

You can use any database you have on your computer. The following instructions assume the use of sqlite:

  • Run composer install
  • Run touch database/database.sqlite
  • Copy .env.example to .env
  • Replace {ADD ABSOLUTE PATH HERE} in your .env file to point to the database
  • Run php artisan migrate
  • Run php artisan db:seed --class=DataSeeder

Helper

Use php artisan app:absence-quota-import-command to run the implementation.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors