From 2ade5e8fb529af48ffe881c58f6b0568a3117f44 Mon Sep 17 00:00:00 2001 From: "gpt-engineer-app[bot]" <159125892+gpt-engineer-app[bot]@users.noreply.github.com> Date: Sat, 18 Apr 2026 18:45:29 +0000 Subject: [PATCH] Changes Co-authored-by: renee-png <262607627+renee-png@users.noreply.github.com> --- src/lib/docx-pleading.ts | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/src/lib/docx-pleading.ts b/src/lib/docx-pleading.ts index b687f02..484f737 100644 --- a/src/lib/docx-pleading.ts +++ b/src/lib/docx-pleading.ts @@ -386,6 +386,32 @@ export function buildPleadingDoc(input: PleadingInput): Document { }); } + // Service list (optional) — rendered on a fresh page at end + const serviceList = (input.serviceList || []).filter((c) => c.name.trim().length > 0); + if (serviceList.length > 0) { + const slTitle = (input.serviceListTitle || "SERVICE LIST").toUpperCase(); + bodyParagraphs.push( + new Paragraph({ + pageBreakBefore: true, + alignment: AlignmentType.CENTER, + children: [run(slTitle, { bold: true })], + }), + ); + bodyParagraphs.push(emptyP()); + serviceList.forEach((c, idx) => { + bodyParagraphs.push(p(c.name, { bold: true })); + if (c.role || c.company) { + bodyParagraphs.push(p([c.role, c.company].filter(Boolean).join(", "))); + } + if (c.address) { + c.address.split("\n").forEach((line) => bodyParagraphs.push(p(line))); + } + if (c.phone) bodyParagraphs.push(p(`Tel: ${c.phone}`)); + if (c.email) bodyParagraphs.push(p(`Email: ${c.email}`)); + if (idx < serviceList.length - 1) bodyParagraphs.push(emptyP()); + }); + } + return new Document({ styles: { default: { document: { run: { font: FONT, size: SIZE } } },