Repository navigation
fix(agreements): fill merge fields at send and refuse placeholders (QA sweep DELIV-01) - #34
Merged
Merged
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 permanentcontent_snapshot.Change
server/lib/agreement-tokens.ts(new):fillAgreementTokens,blockingAgreementIssues.envelope-legacy.tsfindOrCreate: 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:serverErrorprop, so the refusal shows inside the dialog instead of under the scrim.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