Erply Stockmann Integration

Erply Stockmann Integration is a software software application that outputs a daily report about usage of Stockmann loyalty card from Erply. The application contains user interface for setting up the integration between individual accounts. The application supports synchronisation between multiple accounts when working as a single instance. Single Erply account can be made to produce only single output file.

Working principles

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: