Skip to content

fix(agreements): fill merge fields at send and refuse placeholders (QA sweep DELIV-01) - #34

Merged
NCHILLC merged 2 commits into
mainfrom
fix/qa-deliv-01-agreement-placeholders
Oct 13, 2026
Merged

NCHILLC merged 2 commits into
mainfrom
fix/qa-deliv-01-agreement-placeholders

Conversation

@NCHILLC

@NCHILLC NCHILLC commented Oct 13, 2026

Copy link
Copy Markdown
Owner

What

QA sweep DELIV-01 (Blocker): the seeded Pre-Inspection Agreement could be sent and signed with raw [PLACEHOLDER] tokens and the admin "review before sending" notice inside the permanent content_snapshot.

Change

  • server/lib/agreement-tokens.ts (new): fillAgreementTokens, blockingAgreementIssues.
  • envelope-legacy.ts findOrCreate: fills inspector name, client name, amount (getEffectivePriceCents), property and date from the inspection; maps signature/sign-date tokens; throws 422 on any leftover [ALLCAPS] token or the starter notice. No envelope is created.
  • SendAgreementModal + inspector-portal: serverError prop, so the refusal shows inside the dialog instead of under the scrim.
  • Specs: 4 API unit, 2 component. Fork-log row with ceilings.

Ceilings

Lowercase/{{x}} fields in custom templates are not checked; check runs only on envelope creation; a priceless inspection blocks on [AMOUNT]; already-sent envelopes keep placeholders; refusal text is English only.

Checked

146 API unit files / 990 tests, 6 component files / 43, lint:gates 27/27, middleware budget, pre-commit hook. Seen once in the pane (dark, 1024 px); not light or phone width.

🤖 Generated with Claude Code

NCHILLC and others added 2 commits October 13, 2026 13:54
…ll has placeholders (QA sweep DELIV-01)

The starter Pre-Inspection Agreement could be sent and signed with every
merge field still in brackets and the admin-only "review before sending"
notice inside the permanent content_snapshot.

findOrCreate now fills [INSPECTOR_NAME], [CUSTOMER_NAME], [PROPERTY_ADDRESS],
[INSPECTION_DATE] and $[AMOUNT] from the inspection (amount via the P-4
authority chain) before the snapshot is frozen, and throws 422 naming any
bracketed token that is left or the starter notice, creating no envelope.
The hub's Send dialog shows that refusal inside itself; the page-level line
it replaces sat under the modal scrim, so Send looked like it did nothing.

Chrome: /inspections/:id — sent the unedited starter agreement from the Send for signing dialog on a local empty-D1 build, and the refusal about unfilled placeholders and the review-before-sending notice reads in red inside the dialog above Cancel and Send, dark theme at 1024 px; not seen: light theme, a phone width, the filled-in success path in the pane

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
STARTER_NOTICE_MARK was exported but only used in-file; the long-date
formatter is English-only on purpose (the body is frozen into
content_snapshot), so it carries an i18n-lint-ok note.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@NCHILLC
NCHILLC merged commit c6fa48b into main Oct 13, 2026
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant