From 10affbc6291c187ada65f99bb5f06e686a6b61de Mon Sep 17 00:00:00 2001 From: nfel Date: Sun, 30 Aug 2026 14:46:47 +0330 Subject: [PATCH] docs(auth): record domain foundation checkpoint --- REFACTORING-AUDIT.md | 8 ++++++++ REFACTORING-TODO.md | 4 +++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/REFACTORING-AUDIT.md b/REFACTORING-AUDIT.md index 2e1cf61..21163f7 100644 --- a/REFACTORING-AUDIT.md +++ b/REFACTORING-AUDIT.md @@ -261,6 +261,14 @@ Global config removal remains the separate follow-up `C002`. The current composition root is `cmd/serve.go`; `repository.System` aggregates PostgreSQL, Redis, and upstream service ports, while `usecase.useCase` currently implements both generated gRPC server interfaces. External provider selection is configuration-driven (`ShahkarProvider`), and the Wallet/Notification clients are gRPC dependencies. This map is the baseline for A002–A008 package extraction. +### `A002` — Auth domain entities and repository ports + +- Added `auth/domain/model` with transport/persistence-independent User, Identity, Session, Permission, Role, RolePermission, and BankInfo entities. +- Added validated `NationalID`, `MobileNumber`, and `BirthDate` value objects plus domain-level user status values. +- Added `auth/domain/ports` repository and cache interfaces using only standard library types and domain models. +- Focused value-object tests and the full Auth test suite pass; commit `32f182b`. +- Existing `domain/db` remains the legacy persistence mapping until A003 introduces explicit infrastructure mappings. + ### `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 de621a5..2fd02b3 100644 --- a/REFACTORING-TODO.md +++ b/REFACTORING-TODO.md @@ -105,7 +105,7 @@ This is the authoritative execution tracker for the refactor. Work is performed | ID | Status | Task | Acceptance check / note | |---|---|---|---| | 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 | `TODO` | Introduce auth domain entities, value objects, errors, and repository ports. | Domain packages contain no gRPC, GORM, Redis, or framework imports. | +| A002 | `DONE` | Introduce auth domain entities, value objects, errors, and repository ports. | Added pure Auth entities/value objects and inward-facing repository/cache ports with no gRPC, GORM, Redis, or framework imports; committed as `32f182b`. | | A003 | `TODO` | Move auth persistence and Redis implementations into infrastructure. | Explicit persistence/domain mappings exist and repository tests pass. | | 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. | @@ -285,3 +285,5 @@ Append one row whenever a task changes status. Existing rows are never rewritten | 2026-08-30 | L010 | `STARTED` | `DONE` | Full GL tests, race tests, vet, and build pass; replay/idempotency, rollback, conservation/load, ordering, and recovery paths are covered. | | 2026-08-30 | A001 | `TODO` | `STARTED` | Began the method-level Auth RPC and dependency migration map before package moves. | | 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, and repository/cache ports; focused and full Auth tests pass in `32f182b`. |