Add TemporalRepository<T> + ScopeGuardRepository<T> decorators #8
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?
Migrated from uwe.admin/webapp-scaffold#9 per the Option A decision. Builds on uwe.admin/oatpp-authkit#7.
Decorators land under
oatpp-authkit/include/oatpp-authkit/repo/next to the interfaces.Builds on uwe.admin/oatpp-authkit#7. 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 = sentinelEvaluation carried over from closed uwe.admin/webapp-scaffold#9; the migration comment at the top of this issue body summarises the prior eval. No additional design questions remain.
Implemented #8 → commit
08cd324—TemporalRepository<T>+ScopeGuardRepository<T>underinclude/oatpp-authkit/repo/. All five acceptance criteria from the issue covered intest/test_repository_decorators.cpp; ctest now 6/6 green. README updated. Unblocks the fewo-webapp pilot at uwe.admin/fewo-webapp#457.