Giter VIP home page Giter VIP logo

outlet-omzet-api's Introduction

Outlet Omzet Api

majoo-backend-test

How to run

make run

API Endpoints

Login

POST /login

Form Data:

  • username
  • password

Request

curl -XPOST 'localhost:9000/login' -d 'username=admin1' -d 'password=admin1'

Response

{
  "message": "Success",
  "data": {
    "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MSwidXNlcl9uYW1lIjoiYWRtaW4xIiwiZXhwIjoxNjQ4MzkyMjk2fQ.EkEzYvvPu9NbpxeMC6PvJvFuWYuJ27-XlhN93rUo8To",
    "id": 1,
    "name": "Admin 1",
    "user_name": "admin1"
  }
}

Merchant Report

GET /report/merchant/:merchant_id/omzet

Query Params:

  • start_date (YYYY-MM-DD) default: today's date
  • end_date (YYYY-MM-DD) default: today's date
  • page default: 1
  • count default: 20

Request

curl -XGET 'localhost:9000/report/merchant/1/omzet?start_date=2021-11-01&end_date=2021-11-30&page=1&count=5' \
-H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MSwidXNlcl9uYW1lIjoiYWRtaW4xIiwiZXhwIjoxNjQ4MzkyMjk2fQ.EkEzYvvPu9NbpxeMC6PvJvFuWYuJ27-XlhN93rUo8To'

Response

{
  "message": "",
  "data": {
    "merchant_id": 1,
    "outlet_id": 0,
    "merchant_name": "merchant 1",
    "outlet_name": "",
    "omzets": [
      {
        "date": "2021-11-01T00:00:00Z",
        "total": 4500
      },
      {
        "date": "2021-11-02T00:00:00Z",
        "total": 6000
      },
      {
        "date": "2021-11-03T00:00:00Z",
        "total": 2500
      },
      {
        "date": "2021-11-04T00:00:00Z",
        "total": 6000
      },
      {
        "date": "2021-11-05T00:00:00Z",
        "total": 14000
      }
    ],
    "total_data": 30,
    "filters": {
      "count": 5,
      "page": 1
    }
  }
}

Outlet Report

GET /report/outlet/:outlet_id/omzet

Query Params:

  • start_date (YYYY-MM-DD) default: today's date
  • end_date (YYYY-MM-DD) default: today's date
  • page default: 1
  • count default: 20

Request

curl -XGET 'localhost:9000/report/outlet/3/omzet?start_date=2021-11-01&end_date=2021-11-20&page=2&count=3' \
-H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MSwidXNlcl9uYW1lIjoiYWRtaW4xIiwiZXhwIjoxNjQ4MzkyMjk2fQ.EkEzYvvPu9NbpxeMC6PvJvFuWYuJ27-XlhN93rUo8To'

Response

{
  "message": "",
  "data": {
    "merchant_id": 1,
    "outlet_id": 3,
    "merchant_name": "merchant 1",
    "outlet_name": "Outlet 2",
    "omzets": [
      {
        "date": "2021-11-04T00:00:00Z",
        "total": 5000
      },
      {
        "date": "2021-11-05T00:00:00Z",
        "total": 7000
      },
      {
        "date": "2021-11-06T00:00:00Z",
          "total": 0
      }
    ],
    "total_data": 20,
    "filters": {
      "count": 3,
      "page": 2
    }
  }
}

outlet-omzet-api's People

Contributors

seno-ark 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.