Documents
The document-service renders member-facing documents (policy schedules, EOBs, welcome and renewal letters) from market-keyed templates.
Field reference: full columns, types and nullability live in the catalog: glossary terms
Document,Template. This page is the narrative.
Template → Document
Templateis a reusable HTML layout keyed by(market_code, template_type)(UNIQUEper market + type), holding thecontent_html.market_codeties a template to a market profile.Documentis a rendered instance for a member: alocator, theparty_locatorit is for, thetemplate_typeandmarket_codeit was rendered from, and the rendered bytes.
Document bytes are stored inline, not in object storage
Document.content is a BYTEA column; the rendered bytes live in the database row, not behind an S3/SSE-KMS URL. There is no object-store reference today.
Invariants
- A
Templateis unique per(market_code, template_type). - A
Documentis rendered from the template selected by its(market_code, template_type); itslocatoris unique.
Caveats
party_locator/market_codeare text references, not UUID FKs.- The member-portal
DocumentSummary(a metadata-only list view, no bytes) is aspirational, a BFF projection, not a table.
