2026-05-13-report-business-footer-design.md 2.0 KB

Report Business Footer Design

Goal

Update exam sprint PDF reports so the repeated page header shows the concrete report type, and the repeated page footer supports optional business contact information on the left with page numbers aligned right.

Requirements

  • Achievement report header type text: 学习成果报告.
  • Outlook report header type text: 潜力展望报告.
  • Both report payloads accept optional BusinessInfo:
    • Name
    • Phone
    • Address
  • Footer layout:
    • Left: business info block.
    • Right: current page / total pages.
  • Business info text layout:
    • First line: Name Tel:Phone when both values exist.
    • Second line: Address when it exists.
  • If BusinessInfo is missing or all fields are blank, the entire left business info block is not rendered.
  • If some fields are blank, render only available fields and avoid dangling labels such as Tel: without a phone number.

Architecture

Keep the renderers responsible for report-specific text and business data. Each renderer writes the report type into the existing .header-report-type element and emits an optional .report-footer-business HTML block. DefaultPlaywrightPdfWorker remains transport/layout focused: it extracts .report-header into Chromium's native header template and extracts .report-footer-business into Chromium's native footer template beside the page-number placeholders.

Achievement report content is already modeled, so AchievementReportContent gets an optional nested BusinessInfo value. Outlook report rendering already deserializes the payload contract directly, so the renderer reads OutlookExamSprintReportPayload.businessInfo().

Validation

  • Contract/mapper tests prove optional BusinessInfo flows into domain/view rendering.
  • Renderer tests prove report type text and optional business footer markup render correctly.
  • PDF tests prove footer business info is left-side content and page numbers remain right-side content, while existing header/footer spacing tests continue to pass.