feat(documents): Phase A schema + service skeletons
Adds Phase A data model deltas to documents/templates and the new document_watchers table. Introduces createFromWizard/createFromUpload stubs, getDocumentDetail aggregator, cancelDocument flow, signed-doc email composer, reservation agreement context, and notifyDocumentEvent fan-out. Validator update accepts new template formats with html-only bodyHtml requirement. EOI cadence backfilled to 1 day to preserve current effective behaviour. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -432,8 +432,14 @@ export async function resolveTemplate(
|
||||
throw new ValidationError(`Missing required merge field values: ${missing.join(', ')}`);
|
||||
}
|
||||
|
||||
// HTML body is required for the html template format; non-html formats
|
||||
// resolve elsewhere (see template_format dispatch in PR6).
|
||||
if (template.bodyHtml === null) {
|
||||
throw new ValidationError('Template has no HTML body to render');
|
||||
}
|
||||
|
||||
// Interpolate all tokens
|
||||
let resolved = template.bodyHtml;
|
||||
let resolved: string = template.bodyHtml;
|
||||
for (const [token, value] of Object.entries(tokenMap)) {
|
||||
// Escape token for use in regex
|
||||
const escaped = token.replace(/[{}]/g, '\\$&');
|
||||
|
||||
Reference in New Issue
Block a user