Skip to content

feat(candidate-me): add DOCX export format - #107

Merged
datvt243 merged 1 commit into
stagingfrom
feat/export-docx
Sep 2, 2026
Merged

feat(candidate-me): add DOCX export format#107
datvt243 merged 1 commit into
stagingfrom
feat/export-docx

Conversation

@datvt243

@datvt243 datvt243 commented Sep 2, 2026

Copy link
Copy Markdown
Owner

Commits going into staging:

2c6e071 feat(candidate-me): add DOCX export format

Adds ?format=docx to GET /api/v1/download-pdf (alongside existing
pdf/json), via a new src/services/createDocx.ts using the docx
package. Reuses the existing handlerGetAboutMe data-fetch, no new query.
Node add-docx-export-format SEALED — see
agent-hub/evidence/verifier/2026-09-02/add-docx-export-format-seal.md.

Closes #76.

- src/services/createDocx.ts (new): buildDocxContent()/renderDocxDocument()
  content-model + renderer using the `docx` package; createCVDocx() packs
  and streams the response with the correct OOXML content-type/filename.
- src/candidate_me/index.ts: fnExportPDF gains a `format === 'docx'` branch,
  same shape/position as the existing `format === 'json'` branch, right
  before the PDF fallback — reuses the same handlerGetAboutMe() call, no
  duplicate data-fetch.
- src/routers/api/v1/index.ts: Swagger doc only — `/download-pdf`'s format
  enum [pdf, json] -> [pdf, json, docx], added the docx response content
  entry. No route/logic change.
- package.json/package-lock.json: added docx ^9.7.1 (MIT, no native deps).
- src/__tests__/services/createDocx.test.ts (new, 6 tests).
- agent-hub/haven/diagrams/dev-loop.prime-mermaid.md: add-docx-export-format
  node PENDING -> SEALED.

npx tsc --noEmit: clean.
npm test: Test Suites: 11 passed, 11 total / Tests: 60 passed, 60 total /
Time: 4.611 s.
npm run build: clean.

Live-verified: GET /download-pdf?format=docx returns a real .docx (file(1)
confirms "Microsoft Word 2007+", document.xml contains the candidate's
real data); ?format=json and no-format (PDF) paths unaffected.

Node: add-docx-export-format (SEALED)
Evidence: agent-hub/evidence/implementer/2026-09-02/add-docx-export-format-{plan,diff}.md
          agent-hub/evidence/verifier/2026-09-02/add-docx-export-format-seal.md

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@datvt243
datvt243 merged commit 737f76c into staging Sep 2, 2026
3 checks passed
@datvt243
datvt243 deleted the feat/export-docx branch September 2, 2026 16:17
@datvt243 datvt243 mentioned this pull request Sep 5, 2026
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