Giter VIP home page Giter VIP logo

price-table-manager's Introduction

Price Table Manager (PTM)

About

PTM is an API that aims for easy access to items and prices, according to interest rates that can be added later.

Routes

Create an item POST /item

Body:

"name": "name",
"price": 10000

Get all items GET /items

Returns a list of all items.

Result:

[
  {
    "id": 1,
    "name": "item",
    "price": 10000
  }
]

Get an item and fees GET /item/:id?fee=id

Get an item passing an item id through params and it's costs based on the fee id passed using query.

Result:

{
  "id": 2,
  "name": "item",
  "price": 1090,
  "fees": [
    {
      "id": 1,
      "totalMonths": 1,
      "valuePerMonth": 10520
    },
    {
      "id": 2,
      "totalMonths": 2,
      "valuePerMonth": 5533.52
    }

Create an institution POST /institution

Institutions are in charge of fees.

Body:

"name": "institution name"

Get all institutions GET /institutions

Returns a list of all institutions

Get institution's fees GET /institution/:id

Returns institution info and a list of available fees.

  • If the instutition has no fees registered, returns 404.
{
  "id": 2,
  "name": "Institution Name",
  "fees": [
    {
      "id": 1,
      "name": "Credit 1x-12x",
      "InitialFee": 0,
      "monthlyFee": 1.1,
      "maxNumOfInstallments": 12
    }
  ]
}

Create a fee POST /fee

body:

  "institution_id": 1,
  "initial_fee": 0,
  "monthly_fee": 1,
  "name": "Credit Card 1-12x",
  "max_num_installments": 12

Update a fee POST /fee/:id

body:

  "initial_fee": 0,
  "monthly_fee": 1,
  "name": "Credit Card 1-12x",
  "max_num_installments": 12

Delete a fee DELETE /fee/:id

Returns OK, HTTP Status 200.

price-table-manager's People

Contributors

macielvini avatar

Watchers

 avatar

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.