Async jobs and notifications: data model, endpoints, permissions
Data model of main jobs and notifications, how the NAV query is started and its time budget, the bell endpoints, per-user filtering and the classification of the permission keys.
The async "main job" list shows the progress, state and queue item counters of NAV invoice queries; the header bell and the Notifications list are two views of the same notification table. The super administrator sees all jobs, other users their own; notifications are always the user's own.
Data model
Table names carry the installation's own prefix in the database.
| Table | Role | Relation |
|---|---|---|
job | main job: type, progress, state, user | queue items belong to the job |
cron_queue | the job's items | job ID |
notification | notifications: type, read and delivered state, source link | user_id, job ID |
Endpoints
| Endpoint | Behaviour | Permission |
|---|---|---|
job.list, .progress, .cancel, .notificationspage | paged list; progress map; stop (record and downloaded result remain); redirect to notifications with filter_job_id | list |
job.delete | deletes the selected jobs with own-or-super filtering | delete |
job.navquery | NAV query from the invoice filter: time windows per company (active, with tax number and NAV login only), then the worker is triggered within the synchronous budget (job_sync_budget setting, default 8 s); immediate reply if finished, otherwise 202 Accepted | finance/invoice + navdata |
job.testquery | diagnostic test job with a fixed company and a fixed period | finance/invoice + navdata |
job.notifications | the user's undelivered notifications (at most 20) for pop-ups, then marked delivered | login |
job.bell | unread count, 5 latest, 10 undelivered (marked delivered) | login |
job.bellread | all own notifications read | login |
notification.list, .markread, .markreadall | filter: type, read state, job; viewing does not mark as read | list |
notification.delete | physical delete of selected own notifications | delete |
notification.deleteall | deletes all own notifications, with a count | deleteall (BASE) |
The source link is built by a safe link builder.
Permissions
system/job:listunclassified,deleteanddebugnot in the seeds.system/notification:listunclassified,deleteallBASE,deleteanddebugnot in the seeds.- Content scope: the job model filters by
user_idand super; the notification model by the ownuser_idon every action.
Known limitations
job.testquery runs with a fixed company ID and a fixed period, for diagnostics only.