Adrian-Garcia / ExamenIngresoBackendSofex

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Sofex Employee Registration

This application was developed as an entrance exam for the company Sofex. The purpose of this project is to manage the company's employee registration only from the backend. For this, a REST system was developed in which the following requests can be made:

  • Employee CRUD
  • Week CRUD
  • Day CRUD
  • Week Start and Restart
  • Check In
  • Check Out
  • Employee Payment Calculations

Database schema

database schema

Development

Setup the project

  1. Clone this repository
git clone https://github.com/Adrian-Garcia/ExamenIngresoBackendSofex.git
  1. Install dependencies
npm i

Run the project

  1. Start application
nodemon start
  1. Start Database
docker-compose up -d postgres
  1. Setup environment variables in .env file

  2. Start localhost database (http://localhost:5050/)

docker-compose up -d pgadmin
  1. Go to local and configure a new database. Documentation here

  2. Test API in http://localhost:3000/api/v1/

Main APIs

Employee

{
    "id": "abcd1234",
    "firstName": "Luke",
    "lastName":  "Skywalker",
    "positionName": "Programer",
    "hourlyWage": 200
}
{
    "firstName": "Luke",
    "lastName":  "Skywalker",
    "positionName": "Programer",
    "hourlyWage": 200
}
{
    "time": "2023-01-02T00:00:00.000Z"
}
{
    "time": "2023-01-02T00:00:00.000Z"
}

Week

{
    "startWeek": "2023-01-02T00:00:00.000Z",
    "endWeek": "2023-01-06T00:00:00.000Z",
    "finalWeekPayment":  10000,
    "employeeId": "abcd1234"
}
{
    "startWeek": "2023-01-02T00:00:00.000Z",
    "endWeek": "2023-01-06T00:00:00.000Z",
    "finalWeekPayment":  10000,
    "employeeId": "abcd1234"
}

Day

{
    "arrivalTime": "2023-01-02T00:00:00.000Z",
    "departureTime": "2023-01-06T00:10:00.000Z",
    "weekId":  1
}
{
    "arrivalTime": "2023-01-02T00:00:00.000Z",
    "departureTime": "2023-01-02T10:00:00.000Z",
    "weekId":  1
}

About


Languages

Language:JavaScript 99.7%Language:Shell 0.3%