Skip to content

Services Overview

INFO

Services can be implemented either as part of 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 src/api/collection-name/. If implemented independent of a collection type, the files are stored in the src/routes and src/controllers folder.

CollectionServiceDetailsFunctionality
CardsbulkCreateGuestCardsImplemented in:
services/card.js
Endpoint:
POST /cards/guest/bulk
Controller:
controllers/card.js
Creates multiple guest cards with a continuous guest_number sequence, starting from the current maximum. The card_uid for each card is generated automatically by the card beforeCreate lifecycle hook.
deactivateCardImplemented in:
services/card.js
Endpoint:
PUT /cards/:documentId/deactivate
Controller:
controllers/card.js
Deactivates a card by setting is_active to false. Returns null if no card with the given documentId exists.
generateMemberCardImageImplemented in:
services/cardImage.js
Endpoint:
GET /cards/image-preview
Controller:
controllers/card.js
Generate a PNG image of a member card identical in layout to the PDF version.
generateCardsPDFImplemented in:
services/cardPdf.js
Endpoint:
GET /cards/print
Controller:
controllers/card.js
Generate a DIN-A4 PDF of member and/or guest cards. Each card is printed twice side-by-side per A4 row with dashed cut guides.
MembersactualRunsImplemented in:
services/member.js
Endpoint:
GET /members/:id/actual-runs
Controller:
controllers/actualruns.js
Retrieves the actual number of runs for a given member id.
generateMemberCardsPDFImplemented in:
services/memberCards.js
Endpoint:
GET /members/membership-cards
Controller:
controllers/member-cards.js
Generate a DIN-A4 PDF with two business-card-sized membership cards side-by-side per row, colour-coded by member_type.
generateGuestCardsPDFImplemented in:
services/memberCards.js
Endpoint:
GET /members/guest-cards
Controller:
controllers/member-cards.js
Generate a DIN-A4 PDF with 5 × 2 "Honored Guest" cards. IDs run G0001–G0005, body colour #263238, Guest_Hare.png as photo.
generatePDFImplemented in:
services/signin.js
Endpoint:
GET /members/download-pdf
Controller:
controllers/signin.js
Generates a PDF document containing sign-in sheets for members and guests.
This function creates a PDF with separate pages for beer and non-beer drinker member categories, as well as a page for guests. Each page includes a header and a data table. If the number of rows in the table is less than 35, row heights are adjusted to fill the page; otherwise, additional pages are created.
getSignInDataImplemented in:
services/signin.js
Endpoint:
GET /members/getsigninjson
Controller:
controllers/signin.js
Fetches all active members based on their join/rejoin dates, and also marks members on LOA.
WARNING: this function is implemented directly in the controller, this is a dummy only
Onsite SalesgeneratePDFImplemented in:
services/financialReport.js
Endpoint:
GET /onsite-sales/financial-report
Controller:
controllers/financial-report.js
Generates a PDF report document for a specific run date.
This function creates a PDF document consisting of a financial report page and an appendix page containing the transaction details. The document is formatted with specific layout dimensions and includes headers, tables, and fonts. Financial data is fetched based on the provided run date, and the resulting PDF is returned as a buffer.
HarelinerunInfoComplexImplemented in:
services/run.js
Endpoint:
GET /runs/run-info-complex
Controller:
controllers/runinfo.js
Retrieve all runs within the given date range with additional information on the previous run's hare and hare's runs, the location and the OnOn.
runInfoImplemented in:
services/run.js
Endpoint:
GET /runs/run-info
Controller:
controllers/runinfo.js
Retrieves an array of run summaries between the given start and end dates.
The run summaries are objects containing the run number, date, special event flag, guest fee, hare information (name, image), and an array of run details (date, start time, location, hare, and special event flag). The location is linked to the location detail page.
runPlanningImplemented in:
services/run.js
Endpoint:
GET /runs/run-planning
Controller:
controllers/runinfo.js
Retrieves data for run planning.
No CollectiongenerateEndpoint:
GET /metabase-token
Controller:
controllers/metabase-token.js
Signs a JWT token and returns the Metabase embed URL for the requested dashboard.
headEndpoint:
HEAD /ping
Controller:
controllers/ping.js
Minimal 204 response used by the frontend to detect online/offline status.

Released under the MIT License.