Reports and emails as document kinds, the two stages #133 deferred #162
Labels
No labels
accessibility
authentication
breaking change
bug
documentation
enhancement
interface
internationalisation
observability
security
tier
1
tier
2
tier
3
tier/4
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Postulo/postulo#162
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Observation
#133 asks for five document kinds and proposes doing them in three stages, in this order:
Stage one shipped with #133. This is stages two and three, kept apart because they turn
on two different unanswered questions.
What exists after #133
documents/kinds.pysays what each kind is,whether Postulo composes one, and which theme vocabulary sets it. The
kindcolumns taketheir choices from it through a callable, so a kind a plugin registers reaches every
picker and every store's per-kind switch with no migration.
CVKindon the model that already selects from the careerrecord, with their own theme vocabulary and a shipped theme in each family.
download_url_name,archive_originandarchived_at; a third thing that holds a file needs no branch instores.pyat all, and there is a test proving it with a classstores.pyhas neverheard of.
So the polymorphic link, the theme rule and the vocabulary are all in place. What is left is
the two kinds whose content raises a question the machinery does not answer.
Reports
Most of this is already answered. #56 shipped the report — the period, the cadence, the
evidence list, the PDF and the CSV — and settled the hard part in advance:
What adopting it as a kind would add is the delivery half: a report that has been produced
becomes a
RenderedDocumentfiled under a report kind, and is therefore copied to aPaperless the way a CV is. A report handed to an employment office is exactly the document
somebody would want filed.
The question to settle first: a report snapshot and a report page are not the same
thing, and freezing one on every view would fill the store with near-identical PDFs. Is a
report frozen when somebody presses Download PDF, or never? The first is probably right —
that is the moment it becomes evidence somebody handed over — but it should be decided
rather than assumed.
Emails
This is the one that is genuinely undecided, and #133 says so:
Two more things worth having in view when it is decided:
composes mail and a transport that carries it are not the same concern, and conflating
them would put a document feature behind an account-recovery lock.
is what
RenderedDocumentalready does for a letter: the text as sent, frozen, with achecksum. A follow-up note is already a
LetterKind, and it is an email in all butname.
So the smallest honest version might be: no email kind at all, and instead a way to
freeze what was actually sent through a transport as a rendered document. That is worth
considering before a fifth kind is built.
Worth being careful about
The wide contract #133 describes is still not built, deliberately. A kind that declares
a model, a template per theme, a starter, how it renders and how it snapshots would be a
much larger surface than any other plugin kind here — and most of it already lives somewhere
better: a theme declares its own templates (#132), a
LETTER_STARTERS-shaped map declareswhat a new one starts as, rendering goes through
documents.rendering. Building that surfacebefore anything outside asks for it would be designing against a guess.
documents/kinds.pyanswers the part that was actually missing and says this in its docstring.
Classification
Enhancement, for 0.4.0. Two kinds, and the reports half is much closer than the emails half.
Depends on
#133 (done). #56 for the report content (done).