Integrity check: checks, owning models, scheduling
Structure of the integrity runner, the check codes and their owning models, the run log, the settings and system-level scheduling, and the permissions and content scope.
The integrity runner only reads: per check it lists the inconsistencies with a link to the place of the fix. The SQL of the checks lives in the owning models' getIntegrityFindings(); the report/integrity model selects, merges and logs. The settings screen keeps status, order and schedule per check; there is no create or delete, because a check is code.
Checks and owning models
| Code | Owning model |
|---|---|
orphan_settlement | finance/transaction |
orphan_item | finance/transaction |
settled_revocable | finance/transaction |
advance_payment | finance/transaction |
import_mismatch | bank/bankimport |
import_unbooked | bank/bankimport |
periodic_dates | finance/invoice |
open_cash | finance/invoice |
missing_partner | finance/invoice |
advance_final | finance/invoice |
partner_taxhu | finance/invoice |
storno_match | finance/invoice |
tech_partner | finance/invoice |
dup_number | finance/invoice |
doc_client | finance/invoice |
Data model
Table names carry the installation's own prefix in the database.
| Table | Role |
|---|---|
integrity_check | status, order, cron setting per check |
integrity_run | run log with source (manual, scheduled) |
cron_queue | system-level integrity_check templates |
Process
report/integrity.list: the chosen or all active checks on the set of allowed companies (a foreign company ID returns an empty result); withrun=1logged with sourcemanual, not when only viewing. Paging (includingall); per row a link to the transaction, import row or invoice if thelistpermission exists. Settings link ifcanSee(report/integritycheck, list).report/integritycheck.list: checks with schedule summary (from the scheduler rows, linked withcron/cronqueue+list) and last runs.report/integritycheck.save,enable,disable: status, order, cron on/off and shared timer (hourly, daily, weekly, monthly); the cron setting is written to the scheduler as a system-level (company_id = 0)integrity_checktemplate, deactivated when switched off.report/integritycheck.run: one check with sourcemanualon the user's allowed companies (super: all), logged.- Background:
integrity_checkjob → catalogmasterdata/cronqueue::runIntegrityChecks. A row from a template (payload.check_code) runs one check, for a client target only on its data; the hourly system row without payload runs the checks that have no own schedule. A successful run without inconsistencies sends no result e-mail.
Permissions
report/integrity:list,debug;report/integritycheck:list,edit(and basicmodify),run,debug. None classified in the seeds.- Content scope:
getCompanyGroupFilterwhen running. - Writing the cron template on save does not require
cron/cronqueue+edit; the form checks it only for display.