Well i have a very special clients... but here a tool for get reports from sales.
- One click report generator 🔮
- Filter by date (default set the current date) 📆
- Clean print 🖨
Install all dependencies
$ yarn install
ENV file
The env
file contains a series of variables that modify the behavior of the api.
AUTHORIZATION_KEY
env var, this var is a simple "token" for allowing requests to the API.
For development
$ yarn dev
Build
For created a production version
$ yarn build
Run Production
Remember set the AUTHORIZATION_KEY
How to set Token
$ yarn start
- Go to
.env
and generate a random key and set this toAUTHORIZATION_KEY
- Go to
http://localhost:5000/report
- In the browser open the developer console and go to
application -> Local Storage
and create a keytoken
and set as value theAUTHORIZATION_KEY
$ docker-compose -f docker-compose.dev.yml up --build
$ docker-compose up -d
http://localhost:5000/report
Filters
between
For example for check createdAt from 2020-09-01
to 2020-09-30
.
api/visits?createdAt=between:2020-09-01,2020-09-30
Like
For using like
operator you can pass search
query string var with where
for indicate columns.
api/visits?search=some&where=reasonVisit
This search for some
in reasonVisit
column.
Limit and offset
You can use limit
and offset
for pagination.
api/visits?limit=10&page=2
This example returns the records between 11 to 20
Order
Use -
sign for descending while +
for ascending, by default if sign is not presented it will automatically set to +
sign (ex: sort=-created_at
or sort=+created_at
). Value can be separated by a comma if multiple sort condition is needed (ex: sort=id,name
).
api/visits?sort=-created_at
More information: https://github.com/perbert27/sequelize-querystring-converter