Phase 1.1 — Foundation: AuditEvent enum + JSON snapshot migration#90
Draft
sjelfull wants to merge 1 commit into
Draft
Phase 1.1 — Foundation: AuditEvent enum + JSON snapshot migration#90sjelfull wants to merge 1 commit into
sjelfull wants to merge 1 commit into
Conversation
This was referenced Apr 26, 2026
- Add src/enums/AuditEvent.php — backed enum with 45 cases mirroring existing AuditModel::EVENT_* string constants (same backing values for DB backward compat). Provides label() and tryFromString(). - Deprecate AuditModel::EVENT_* constants via docblock; kept for BC. - Refactor AuditModel::createFromRecord() to decode snapshot as JSON (Json::decode with try/catch) instead of legacy base64(serialize()). Populate new $eventEnum property via AuditEvent::tryFromString(). - Update AuditService::saveRecord to write snapshot as Json::encode() instead of base64(serialize()) — matches the reader. - Install.php: snapshot + location now $this->json(); add changedFields (JSON) and request (string(10)) columns; add composite indexes on (dateCreated, event) and (userId, dateCreated). - New migration m260421_000000_snapshot_to_json.php: converts legacy base64(serialize()) / serialize() / JSON rows into a shadow JSON column, renames, same for location, adds composite indexes. Failed rows preserved with _migrationError marker. - AuditRecord.php: docblock notes snapshot is JSON on disk. - Test fixture updated to use plain JSON snapshot string. Tests: 49 passed, 1 skipped (unchanged from baseline).
e395b1c to
5606bcd
Compare
This was referenced Apr 27, 2026
Draft
Owner
Author
📚 Stack navigationPart of the FRE-56 v3 refactor — 12-branch stack via git-spice. Merge in order: bottom-up, each PR rebases the next.
Quick jump← (bottom of stack — branches off 📌 Reviewing: focus on the single commit. BC preserved via @deprecated delegators. Tests: 49 → 131 across the full stack, fresh-DB-verified per branch. CI: ECS + PHPStan green per branch. |
Owner
Author
This was referenced Apr 28, 2026
This was referenced May 14, 2026
7e937d3 to
5606bcd
Compare
This was referenced May 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of the v3 refactor stack for FRE-56. Closes FRE-124.
Diff: 7 files changed, 317 insertions(+), 11 deletions(-)
Tests: 49 → 69 (+20)
Verified on fresh DB:
DROP DATABASE; pestgreenStack navigation
↑ Bottom of the stack — branches off
v3↓ Followed by #91
core-services-recorder(P1.2)Review notes
AuditServiceAPI still works via @deprecated delegators