From 88a0307c4a9ff4eecfc87fd6c0871807944781cf Mon Sep 17 00:00:00 2001 From: nfel Date: Sun, 30 Aug 2026 14:49:16 +0330 Subject: [PATCH] docs(auth): track persistence migration checkpoint --- REFACTORING-AUDIT.md | 7 +++++++ REFACTORING-TODO.md | 3 ++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/REFACTORING-AUDIT.md b/REFACTORING-AUDIT.md index cad1a23..4218a1e 100644 --- a/REFACTORING-AUDIT.md +++ b/REFACTORING-AUDIT.md @@ -270,6 +270,13 @@ The current composition root is `cmd/serve.go`; `repository.System` aggregates P - Focused value-object/domain tests and the full Auth test suite pass; commits `32f182b` and `d292822`. - Existing `domain/db` remains the legacy persistence mapping until A003 introduces explicit infrastructure mappings. +### `A003` — Auth persistence migration checkpoint + +- Added `auth/infrastructure/persistence` with explicit User and Identity mappings between legacy GORM records and the pure domain model. +- Mapping validates domain value objects at the boundary and preserves timestamps, roles, public keys, identity validation timestamps, and birth-date representation. +- Focused mapping tests and the full Auth test suite pass; commit `58f6a43`. +- A003 remains in progress: PostgreSQL/Redis adapter ownership and use-case integration still need to move out of the legacy `repository/db` composition. + ### `I001` — publisher-backed ICO purchase map - Compatibility entrypoints remain `WalletService.CalcBuyAsset` and `WalletService.BuyAsset`; API routes and existing request fields do not move. diff --git a/REFACTORING-TODO.md b/REFACTORING-TODO.md index a86dde6..6ba74b5 100644 --- a/REFACTORING-TODO.md +++ b/REFACTORING-TODO.md @@ -106,7 +106,7 @@ This is the authoritative execution tracker for the refactor. Work is performed |---|---|---|---| | A001 | `DONE` | Map every auth RPC to business operations and dependencies. | Method-level migration map is recorded in `REFACTORING-AUDIT.md`; completed on `2026-08-30`. | | A002 | `DONE` | Introduce auth domain entities, value objects, errors, and repository ports. | Added pure Auth entities/value objects, domain errors, and inward-facing repository/cache ports with no gRPC, GORM, Redis, or framework imports; committed as `32f182b`/`d292822`. | -| A003 | `TODO` | Move auth persistence and Redis implementations into infrastructure. | Explicit persistence/domain mappings exist and repository tests pass. | +| A003 | `STARTED` | Move auth persistence and Redis implementations into infrastructure. | Explicit persistence/domain mappings are now established; remaining adapter relocation and repository integration are in progress. | | A004 | `TODO` | Extract OTP application use cases and thin gRPC adapters. | OTP behavior and status mapping remain compatible. | | A005 | `TODO` | Extract authentication/JWT application use cases and adapters. | Token behavior, validation, and status mapping remain compatible. | | A006 | `TODO` | Extract identity and permission use cases and adapters. | Public and internal authorization services pass tests. | @@ -287,3 +287,4 @@ Append one row whenever a task changes status. Existing rows are never rewritten | 2026-08-30 | A001 | `STARTED` | `DONE` | Mapped every public/internal RPC to its use-case operation, persistence ports, external providers, cache, wallet, notification, and configuration dependencies in `REFACTORING-AUDIT.md`. | | 2026-08-30 | A002 | `TODO` | `STARTED` | Began the pure Auth domain model and port foundation. | | 2026-08-30 | A002 | `STARTED` | `DONE` | Added transport/persistence-independent entities, NationalID/Mobile/BirthDate value objects, domain errors, and repository/cache ports; focused and full Auth tests pass in `32f182b`/`d292822`. | +| 2026-08-30 | A003 | `TODO` | `STARTED` | Added infrastructure persistence mappings between legacy database records and the new Auth domain entities; mapping tests and full Auth tests pass in `58f6a43`. |