Module: EventService

Event Service Layer This service manages events in the CommTool system. Events are time-based activities linked to groups and event templates. Key concepts: - Events: Time-based activities with location, participants, and permissions - Event Templates: Define structure and UI for events - Groups: Events belong to groups for organization - Visibility: Controls who can see and edit events Database structure: - ObjectBase: Main table storing events with Type='event' - Member: Extended data including geo-location and custom fields - Links: Junction table linking events to templates and groups - Visible: Access control for events
Source:

Members

(static, constant) createEvent

Create a new event Creates an event with specified template and group association. Handles geo-location, visibility, and participant lists.
Source:

(static, constant) deleteEvent

Delete an event Removes event, associated links, visibility filters, and related jobs. Member data is retained for history.
Source:

(static, constant) getEvent

Get a single event by UID Retrieves complete event details including template data, group info, and responsible person assignments.
Source:

(static, constant) getEventListing

Get list of events with optional filtering and pagination Retrieves events with support for: - Custom data field selection via JSON paths - Date range filtering (after/before timestamps) - Geo-location data (lat/lng) - Responsible person information - User visibility filtering
Source:

(static, constant) updateEvent

Update an existing event Updates event data, template references, and group associations. Tracks changes using diff for audit purposes.
Source:

Methods

(async, inner) getListVisibleSql(req) → {Promise.<string>}

Get visibility SQL clause for event listing Generates SQL WHERE clause for filtering events based on user visibility. Admins see all events, regular users only see visible events.
Parameters:
Name Type Description
req ExpressRequestAuthorized Request object with session
Source:
Returns:
SQL clause for visibility filtering
Type
Promise.<string>