Personal data · rule
data.retention_since
A retention's since: isn't one of the record's Instant fields.
Area 15, Personal data; not declinable; the next step is usually the agent's.
Why Jadpo refuses it
A retention keeps a value or a record for its after: period, counted
from a moment the record holds: when it was created, issued or last
seen. since: names that moment, so it must be one of the record's own
Instant fields. Here it names name, which is text, so there is no
time to count from and nothing would ever expire.
What it looks like
main.jadpo:
config { visitor_retention: Duration { default: 365d }}type VisitorName = Text { max_length: 80}entity Visitor { id: Uuid name: VisitorName created_at: Instant { generated: Generated.on_create } retention: { after: config.visitor_retention since: name }}
error name isn't a time
--> main.jadpo:20:16
|20 | since: name | ^^^^ a `VisitorName`
- reason
since:names theInstantfield a retention counts from: a value or record goes once that time is longer ago thanafter:.Visitor'sInstantfields arecreated_at.- next
- Name an
Instantfield of the record (agent) - rule
- data.
retention_ since - help
- https://jadpo.
dev/docs/errors/data. retention_ since
(agent) at the end of the next: line means your coding agent can make
the fix itself.
A since: naming a field the record doesn't have is refused the same
way, with the field it most likely means:
config { visitor_retention: Duration { default: 365d }}entity Visitor { id: Uuid created_at: Instant { generated: Generated.on_create } retention: { after: config.visitor_retention since: created }}
error Visitor has no field created
--> main.jadpo:15:16
|15 | since: created | ^^^^^^^ not declared
- reason
since:names one ofVisitor'sInstantfields, which arecreated_at. Did you meancreated_at?- next
- Use
created_atinstead ofcreated(agent) - rule
- data.
retention_ since - help
- https://jadpo.
dev/docs/errors/data. retention_ since
How to fix it
If the period counts from when the visitor was created, name that
Instant field:
entity Visitor { ... retention: { after: config.visitor_retention since: created_at }}
Each visitor is now deleted at the first hourly run once they were
created longer ago than visitor_retention.
Related
Markdown for agents: /docs/errors/data.retention_since.md.Built from Jadpo main at e00e61f.