/salary-calculator

An algorithm to calculate estimate salary

Primary LanguageTypeScriptMIT LicenseMIT

Logo of the project

Salary Calculator · License: MIT Build status codecov

An algorithm to calculate estimate salary.

Usage

Insert your Google API key in the property googleApiKey in the package.json file.

Inside the folder metadata you will replace the user.json file with your informations. You can set the vehicle property with car or ````bus```. Here is an exemple:

{
  "name": "Peter Parker",
  "address": {
    "street": "Av. Brasil",
    "number": "1877",
    "neightborhood": "Savassi",
    "city": "Belo Horizonte",
    "state": "Minas Gerais",
    "zipCode": "30140001"
  },
  "vehicle": "car",
  "expense": [
    {
      "name": "Gym",
      "value": 79.90
    },
    {
      "name": "Lunch",
      "value": 800
    }
  ]
}

If you choose car you have to configure the car.json file:

{
  "carKilometersPerLiter": 10,
  "gasolinePrice": 4.79
}

If you choose bus you have to configure the bus.json file:

{
  "fare": 4.25
}

Also replace the places.json file with your trajectory. Her is an exemple:

{
  "places": [
    {
      "name": "Work",
      "address": {
        "street": "Av. Getúlio Vargas",
        "number": "291",
        "neightborhood": "Funcionários",
        "city": "Belo Horizonte",
        "state": "Minas Gerais",
        "zipCode": "30130160"
      }
    },
    {
      "name": "College",
      "address": {
        "street": "Avenida Presidente Antônio Carlos",
        "number": "6627",
        "neightborhood": "Pampulha",
        "city": "Belo Horizonte",
        "state": "Minas Gerais",
        "zipCode": "31270901"
      }
    }
  ]
}

Then run the command:

npm run salary

This command will show the appropriate salary in the console.

Developing

Built With

  • Node
  • Axios
  • Typescript
  • Lodash
  • Jest

Prerequisites

You will need install Node.

Deploying / Publishing

The project is build and release in Azure DevOps.

Versioning

This project is using the pattern MAJOR.MINOR.PATCH. You can read more in Semantic Versioning.

Tests

You can run:

npm run test

This command will run jest with code coverage.

This project is using ts-jest preset and run on src folder.

  "jest": {
    "preset": "ts-jest",
    "roots": [
      "src"
    ]
  }

Licensing

License under MIT.