Concept: document composition (reports, invoices, preview) #18

Open
opened 2026-10-15 08:07:07 +02:00 by michael · 1 comment
Owner

Goal

berhtjan makes data visible -- not only as interactive views, but
also as non-interactive documents: reports, invoices, print and
screen preview. Domain programs (fragjan, steurjan, raidan, sprengaz)
deliver data and a declarative definition; berhtjan composes the
document with generic mechanisms only.

Concept: docs/CONCEPT-DOCUMENT-COMPOSITION.md (decided, working hypotheses,
open questions).

Principles (decided)

  • The domain program filters data for one audience and context;
    berhtjan never receives data it must not show
  • berhtjan knows no domain meaning
  • Definitions are declarative, no embedded language
  • A definition can never unlock data
  • Money only via daw.common.decimal

Findings from current code

  • contribution.json describes one record (groups, fields), not
    lists of records -> separate contract, not an extension
  • compose() returns groups as a map, iterated with pairs(); a
    document needs a fixed order
  • daw_field_type/v1 requires at least one acquisition path; reusing
    field types for display-only columns needs a solution

Acceptance criteria

  • Concept paper in docs/ reviewed
  • Open questions answered or moved to own issues
  • Data contract designed in DAW/daw-contracts#16
  • Decision: library inside berhtjan-core or separate module

Out of scope

  • Implementation before the contract exists
  • Renderers (PDF, print)

DAW/daw-contracts#16, DAW/fragjan#140

## Goal berhtjan makes data visible -- not only as interactive views, but also as non-interactive documents: reports, invoices, print and screen preview. Domain programs (fragjan, steurjan, raidan, sprengaz) deliver data and a declarative definition; berhtjan composes the document with generic mechanisms only. Concept: `docs/CONCEPT-DOCUMENT-COMPOSITION.md` (decided, working hypotheses, open questions). ## Principles (decided) - The domain program filters data for one audience and context; berhtjan never receives data it must not show - berhtjan knows no domain meaning - Definitions are declarative, no embedded language - A definition can never unlock data - Money only via daw.common.decimal ## Findings from current code - `contribution.json` describes one record (groups, fields), not lists of records -> separate contract, not an extension - `compose()` returns groups as a map, iterated with pairs(); a document needs a fixed order - `daw_field_type/v1` requires at least one acquisition path; reusing field types for display-only columns needs a solution ## Acceptance criteria - [ ] Concept paper in docs/ reviewed - [ ] Open questions answered or moved to own issues - [ ] Data contract designed in DAW/daw-contracts#16 - [ ] Decision: library inside berhtjan-core or separate module ## Out of scope - Implementation before the contract exists - Renderers (PDF, print) ## Related DAW/daw-contracts#16, DAW/fragjan#140
Author
Owner

Planned order and impact on this issue

Order (no dates):

  1. berhtjan: daw_error/v1 and daw_i18n/v1 migration (in progress)
  2. berhtjan: how presentation in the UI works
  3. berhtjan: route input through berhtjan
  4. berhtjan: permissions (maybe)
  5. module-manager rebuilt on berhtjan (first real consumer)
  6. fragjan

Documents are built after that, but step 2 should already know this
concept. Two findings affect screens as well, not only documents:

  • compose() returns groups as a map iterated with pairs(); views need
    a defined order just like documents
  • daw_field_type/v1 requires at least one acquisition path; read-only
    fields on screen have the same problem as display-only columns

For step 4, fix this boundary first:

  • permission to SEE data: decided by the domain program before data
    reaches berhtjan (see docs/CONCEPT-DOCUMENT-COMPOSITION.md, branch
    develop)
  • permission to ACT (edit a field, trigger an action): a UI concern,
    declared by the domain program, enforced by berhtjan

Acceptance test for the document capability stays: the fragjan
customer report renders byte-identical through berhtjan.

Refs: DAW/daw-contracts#16, DAW/fragjan#140

## Planned order and impact on this issue Order (no dates): 1. berhtjan: daw_error/v1 and daw_i18n/v1 migration (in progress) 2. berhtjan: how presentation in the UI works 3. berhtjan: route input through berhtjan 4. berhtjan: permissions (maybe) 5. module-manager rebuilt on berhtjan (first real consumer) 6. fragjan Documents are built after that, but step 2 should already know this concept. Two findings affect screens as well, not only documents: - compose() returns groups as a map iterated with pairs(); views need a defined order just like documents - daw_field_type/v1 requires at least one acquisition path; read-only fields on screen have the same problem as display-only columns For step 4, fix this boundary first: - permission to SEE data: decided by the domain program before data reaches berhtjan (see docs/CONCEPT-DOCUMENT-COMPOSITION.md, branch develop) - permission to ACT (edit a field, trigger an action): a UI concern, declared by the domain program, enforced by berhtjan Acceptance test for the document capability stays: the fragjan customer report renders byte-identical through berhtjan. Refs: DAW/daw-contracts#16, DAW/fragjan#140
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
DAW/daw-modul-berhtjan-core#18
No description provided.