Add TemporalRepository<T> + ScopeGuardRepository<T> decorators #9
Loading…
Add table
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?
Builds on uwe.admin/webapp-scaffold#8. Adds the two cross-cutting decorators that wrap any
Repository<T>to enforce temporal versioning and resource-scope authorization respectively.Scope
TemporalRepository<TDto>(requiresTDto : ITemporalEntity)Repository<TDto>save: closes the previous version (setsvalid_until = now) and inserts a new row withvalid_from = now,valid_until = '9999-12-31T23:59:59Z'findByEntityId(at: TemporalAt): filters byvalid_from <= at < valid_untilIHistoryRepository<TDto>:history(entityId)returns all versions ordered byvalid_fromScopeGuardRepository<TDto>Repository<TDto>Out of scope
Acceptance
valid_until = sentinelAgent Evaluation
Drafted as part of the planning thread (parent: uwe.admin/fewo-webapp#458). Body above is the evaluation.
Feasibility: Straightforward — the temporal logic is well-understood (closes prior version on save, sentinel-based live read), and the scope-guard is a generic predicate wrapper. No SQL involved. Depends on uwe.admin/webapp-scaffold#8 landing first.
Impact: This is where the per-entity duplication finally collapses. Once both decorators are in scaffold, every concrete repo gets temporal + scoping for free.
Effort: Small–Medium. Two decorator classes plus unit tests against the in-memory fake from #8.
Recommendation: Accept. Implementation should not begin until #8 is merged.
Closed in favour of uwe.admin/oatpp-authkit#8 per the Option A decision (this issue's #8 thread). C++ work belongs in oatpp-authkit, not in this TypeScript scaffold package.