Fix incidents for bookings with break between See merge request saburly/psihologija!74
crm-integration
Integrate and customize CRM and ERP used by SimaSpace
Setup
- Run setup script :
npm run setup
This installs packages for server and client applications. Then builds docker image for database and starts container. Database name isCrmIntegration. Default username isdockerand default password isdocker.
NOTE : If migration fails, try executing migrations manually with npm run migrate
If everything works correctly, it is possible to connect to database with :
psql -d CrmIntegration -p 5432 -U docker -h localhost
-
Copy
environment.envfile to.envfile and make appropriate changes.
BASIC_AUTH_USERNAMEandBASIC_AUTH_PASSWORDare required for functional app. -
Start server :
npm run start-server -
Start client :
npm run start-client
Open app on http://localhost:3000
NOTE : command npm run check-booking-changes will check for booking changes and
create incidents (if needed)
Heroku Scheduler Setup
To setup booking change tracking, follow next steps :
- Add
Heroku Schedulerto your app (https://elements.heroku.com/addons/scheduler) - Open
Resourcestab - Select
Heroku Scheduler - Click
Add Job, tab on the right will open - Select interval and for command to execute, insert
npm run check-booking-changes - Hit
Save Job
Useful NPM scripts
There are few scripts to handle some operations faster, without copy-pasting commands to terminal
-
Build docker container :
npm run docker-build
If, for any reason, you need to build docker image, without running same image and migrations, use this script -
Start docker container :
npm run docker-stop
This script starts docker container if it is already built -
Stop docker container :
npm run docker-startThis script stops docker container -
Execute migrations :
npm run migrate