Undefined inspector names in client agreement merge fields
Objective
- Ensure inspector list merge fields on client agreements render real inspector names (or a deliberate fallback), never the literal "undefined", in the client portal.
Background
- Inspectors are assigned on the job, but agreement rendering still shows broken text—this damages trust on legal documents.
Scope
Frontend
- Merge-field resolution for
inspector-listinattik-frontend/src/components/conditions/templatingData.ts(and any agreement-specific templating path that reuses it). - Client agreement / portal inspection fetch: align with the observation that
GET inspection/slug/:slugmay omitpopulate=inspectors.
Backend
- Inspection-by-slug handler in
attik-backendshould either populate inspector docs for agreement rendering or expose a stable display-name helper (e.g.inspectorDisplayNamepattern referenced in existing notes).
References
attik-frontend/src/components/conditions/templatingData.ts(keyinspector-list)attik-backend/src/routes/(inspection slug route—locateinspection/slughandler)
Original description
Users have reported that the inspector list merge field on agreements sometimes shows the word "undefined" in the client agreement view, even when inspectors are assigned to the job. They expect agreement text to show the actual inspector names (or a sensible fallback), especially in the client portal when reviewing or signing.
Why it matters: Wrong or broken text on legal agreements undermines trust and forces staff to fix documents manually.
Engineering scope (for implementation):
- Client agreement page loads inspection via
GET inspection/slug/:slugwithoutpopulate=inspectors, so_inspectorIdis often raw ids, not populated inspector docs. - Frontend
inspector-listintemplatingData.tsuses onlyinspector.name; string ids yield template literal"undefined". Align with backendinspectorDisplayName(firstName/lastName, then name, then email) and/or ensure portal inspection fetch populates inspectors when rendering agreements.
Status: Completed
Log in to comment and vote
No comments yet
Be the first to share your thoughts.