Git Product home page Git Product logo

mindex-codechallenge's Introduction

Developers Notes

Considerations and Assumptions

  • Each task type could have been its own service, controller, and test suite. I opted to keep them together to keep the like domain items together. Both Compensation and ReportingStructure are weak entities, tied back to employee
  • There was an assumption made that the compensation endpoint could return multiple results, because of the effective date.
  • Added two users to the data, to test circular dependencies with the direct reports
  • I changed how the test suite behaves, I changed the set up and tear down methods to be changed on each test rather than class instansiation. This guaranteed all tests would run the same each time they ran.

Potential Improvements

  • Implement unit tests as well as integration tests. Would have been easier and more trivial to test some of the more naunced features like circular dependencies or constraints, using mocks and stubs.
  • The foreign key checks written for EF do not work with in memory databases (dotnet/efcore#2166, https://docs.microsoft.com/en-us/ef/core/miscellaneous/testing/in-memory) it maybe advantageous to use a relational database such as Sqlite.
  • Better understanding of the business requirements and goals of this project - Depending on the use cases, better attention can be given to efficiency, performance and code organization.

New Endpoints

Create Compensation

HTTP Method: POST 
URL: localhost:8080/api/employee/compensation
PAYLOAD: Compensation
RESPONSE: Compensation

Get Compensations

HTTP Method: GET
URL: localhost:8080/api/employee/compensation/{employeeId}
RESPONSE: List of Compensation

Get Number of Reports

HTTP Method: GET
URL: localhost:8080/api/employee/numberOfReports/{employeeId}
RESPONSE: ReportingStructure

New Data Types

Compensation

{
  "type":"Compensation",
  "properties": {
    "compensationId": {
      "type": "string"
    },
    "employeeId": {
      "type": "string"
    },
    "salary": {
      "type": "decimal"
    },
    "effectiveDate": {
          "type": "datetime"
    },
    "employee": {
          "type": "Employee"
    }
  }
}

ReportingStructure

{
  "type":"ReportingStructure",
  "properties": {
    "Employee": {
      "type": "Employee"
    },
    "numberOfReports": {
      "type": "int"
    }
  }
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.