1.5 KiB
1.5 KiB
Reason catalog: Control Tower → settings → MySQL (Pi)
Authority
- The canonical catalog lives in Control Tower:
org_settings.defaults_json.reasonCatalog(andreasonCatalogDataalias), merged in API responses with fallback fromdowntime_menu.md. - Each detail may include:
reasonCode: official printed code (e.g.DTPRC-01,MX001). If omitted, a slugCATEGORY__DETAILis derived for backward compatibility.active:falseto hide from operator pickers while keeping history/report labels. Never remove a code from JSON once used; only setactive: false.
Raspberry Pi
- Apply
scripts/mysql/reason_catalog_mirror.sqlon the same MySQL database used by Node-RED (node-red-node-mysql). - Deploy
flows_may_4_26.json. After each successful Apply settings + update UI, the flow emits a message on output 3 to Build reason catalog mirror SQL, which readsglobal.settings.reasonCatalogand runsINSERT ... ON DUPLICATE KEY UPDATEintoreason_catalog_row(no deletes).
Operator payloads (printed codes)
- On downtime acknowledge and scrap entry, send
reason.reasonCode(and labels) matching the printed sheet. Ingest already normalizes and stores uppercase codes. - Generate printable lists from the same JSON as CT:
scripts/export-reason-catalog-csv.mjs.
node scripts/export-reason-catalog-csv.mjs path/to/reasonCatalog.json > claves.csv