Erply Stockmann Integration is a software application that outputs a daily report about the usage of Stockmann loyalty card from Erply. The application contains a clean user interface for setting up the integration between individual accounts. The application supports synchronization between multiple accounts when working as a single instance. Single Erply account can be made to produce only a single output file.
The application fetches data from Erply API over HTTPS pushes the report to a Stockmann SFTP endpoint.
The sync needs to be enabled by connecting the Erply account to a SFTP endpoint. This is done using the UI accessible through public/index.php. Credentials are encrypted using encryption_key.
Azure Scheduler is setup to invoke public/runAutoScheduler.php. This script will go through all stored Erply accounts and add sync jobs to the queue (Azure Storage Queue).
Azure App Service will take care of running enough instances of workers located at wwwroot/App_Data/jobs/continuous/syncWorker/run.php (Azure specific location). The worker instances will take jobs from the queue and execute them using job specific handlers.
Worker is initialized with job handlers and exception handlers. There is single job handler as only single report is produced. If there is an exception during the handling of the job, then the exception is passed to one or more exception handlers which determine the actions taken.
The possible actions are:
- logging to account specific problem log
- logging to general error log and sending the error over email
- retying the job
- marking the job finished / canceled
- pausing the sync for this account