Services Overview
INFO
Services can be implemented either as part of/related to a specific collection type or completely independent from a collection type. If implemented as part of a collection type the route, controller and service files are stored under the collection type content folder src/api/collection-name/ respectively. If implemented independent of a collection type, the files are stored in the src/routes and src/controllers folder
| Collection | Servicename | Details | Functionality |
|---|---|---|---|
| Members | actualRuns | Implemented in: services/member.jsEndpoint: /members/:id/actual-runsController: controllers/actualRuns.js | calculate members actual_runscount |
generatePDF | Implemented in: services/singin.jsEndpoint: /members/download-pdfController: controllers/signin.js | create a PDF document for a run identified by run_date with the paper based sign-in sheet, for Beer and Non-Beer Members as well as guests | |
getSignInData | Implemented in: controllers/signin.jsEndpoint: /members/getsigninjsonController: controllers/signin.js | create a JSON object with the actual active members for a run identified by run_date. Required to load the data for the actual digital sign-in sheet. | |
| Hareline | runInfoComplex | Implemented in: services/run.jsEndpoint: /runs/run-info-complexController: controllers/runinfo.js | creates a JSON object including all run details between start_date and end_date; if only one date provided single run is returned. Used for the hero run on the frontend homepage. |
runInfo | Implemented in: services/run.jsEndpoint: /runs/run-infoController: controllers/runinfo.js | creates a JSON object including reduced run details between start_date and end_date; if only one date provided single run is returned. Used for the next run gallery on the frontend homepage | |
runPlanning | Implemented in: services/run.jsEndpoint: /runs/run-planningController: controllers/runinfo.js | creates information required for the run planning process of Trail Mistress (mainly last run set by a member); this service has been replaced by a Metabase query/dashboard and is deprecated | |
| Onsite Sales | generatePDF | Implemented in: services/financialReport.jsEndpoint: /onsite-sales/financial-reportController: controllers/financialReport.js | Create a PDF cash flow report for the run defined by start_date |
| No Collection | generate | Implemented in: controllers/metabase-tokenEndpoint: /metabase-tokenController: controllers/metabase-token.js | Sign the JWT token and create the dashboard URL for the Metabase reporting iFrame |
head | Implemented in: controllers/pingEndpoint: /pingController: controllers/ping.js | Minimal response to a ping request from the frontend in order to confirm that the frontend is online/offline |
