API Rest in NodeJS with express, express-cache and MySQL 10.0
Cron to daily update the Invoices table based on a CSV file by external url, configured in the .env environment variables The cron is executed every 2 hours from 5:00 to 11:00, validating if the synchronization of the day has already been carried out.
- Install Docker & Docker Compose (Dev).
- Clone repository.
- Copy .env.example file to .env and edit database credentials there
- Run in cmd:
docker compose up --build -d
- Run in cmd:
npm install sequelize-cli -g
npm install
sequelize db:migrate
npm run dev
- Run api
- Documentation
Field | Type | Required | Description |
---|---|---|---|
id | integer | yes | primary key |
name | String | yes | Name of client |
internalCode | integer | yes | Internal code of client |
taxId | integer | yes | Tax id of client |
currency | String | yes | Client's currency (USD, EUR or CLP) |
quota | integer | yes | Limit quota of request |
bankRegisters | Array[integer] | yes | Array with list bankId |
Field | Type | Required | Description |
---|---|---|---|
id | integer | yes | primary key |
vendorId | integer | yes | Vendor id |
number | String | yes | Invoice number |
date | Date | yes | date |
total | decimal | yes | total |
paymentTotal | decimal | yes | Payment total |
creditTotal | decimal | yes | Credit total |
bankId | id | yes | Bank id |
dueDate | Date | no | Due date |
paymentDate | Date | yes | Payment date |
currency | string | yes | Invoice currency |
Field | Type | Required | Description |
---|---|---|---|
name | String | yes | Name of migrate file |