Skip to content

Microservice for getting the info of the employees from the ERP Odoo

Notifications You must be signed in to change notification settings

Caresle/microservice-employees-odoo

Repository files navigation

Microservice Employees Odoo

A simple microservice for getting information about employees from the ERP odoo.

Table of contents

List of endpoints

The current available endpoint for the api are the next one:

Employees

/employees : GET

# Request params
id - numeric (optional)
name - string (optional)
email - string (optional)
company - string (optional)

JSON Response

{
  "status": 200,
  "msg": "success",
  "data": [
    {
      "id": 1,
      "name": "Administrator",
      "job_id": null,
      "job_title": null,
      "department_id": 1,
      "department": "Administration",
      "parent_id": null,
      "parent_name": null,
      "coach_id": null,
      "company_id": 1,
      "company": "Caresle Company",
      "work_email": "[email protected]",
      "work_phone": null,
      "mobile_phone": null,
      "pin": null
    }
  ]
}

Deploy

Requirements

You need to have a odoo database for the project to work, also see Docker if you want to deploy the project using docker.

Steps to install the project

  1. Clone the repository
  2. Install the dependencies with:
npm i
  1. Copy .env.example and rename for .env
  2. Set up the .env variables
  3. Build the project with:
npm run build
  1. Start the project with:
npm run start

Docker

If you want to use docker follow the previous step, just run these additional commands.

  1. For building the docker image
docker build -t odoo_microservice ./
  1. For start the container (remember that the odoo db need to be running)
docker run --name employees_microservice -p 3005:3005 -d odoo_microservice

Replace the -p with <PORT_HOST>:<PORT_IN_THE_ENV_FILE> for the app to run