Events – data model, scope and endpoints
Storage of events, per-language descriptions, user roles and labels, the save and delete process, the scopes and the additional endpoints.
Overview
Events for a company and optionally a topic: date, title and content per language, responsible person, assignees, watchers, labels and a completed flag. Besides the admin screens, a token-link front portal reads them.
Data model
Table names carry the installation's own prefix in the database.
| Table | Role |
|---|---|
event | event (company, topic, date, responsible, completed, creator) |
event_description | title and content per language |
event_user | assignees and watchers |
company_object | link of the event to the company |
label_link | labels |
Process
- Save: the company is required and in scope; a title in at least one language. New:
addEvent(post, creator, 'admin'); existing:editEvent(). A super admin can set another creator (setCreatedBy). - Label creation (
labelcreate): an active label with the same name is returned; otherwise the label model'saddLabel()creates one in groupevent. - Completion (
complete):toggleCompleted(), logged. - Delete: events outside the scope are skipped; the event, its descriptions, user rows, company and label links are deleted.
Permissions
listwith the company scope, plus scope rulestopic/topic_id,event/event_id,user/user_id(own events are always visible).edit(form),canSave()+companyInScope()(save),complete(+ the event's company in scope),delete(+ per-row scope),debug.companysearchreturns only client companies within the scope.
Additional endpoints
event.exporttxt: text export of the filtered events by company → topic → open/completed; super admin only.event.portallink: the front portal link with the user's API key; generates a key if there is none (user/user::setApiKey); permissionlist.event.groupcompanies: shared company picker, permissionlist.
Known limitations
- The
addkey is not classified in the seeds; saving is decided bycanSave().