From 7f58c31d6b408a3cc893c14556a203c1fea1ed7e Mon Sep 17 00:00:00 2001 From: nfel Date: Sun, 30 Aug 2026 19:23:43 +0330 Subject: [PATCH] docs: start wallet transaction extraction --- REFACTORING-AUDIT.md | 6 ++++++ REFACTORING-TODO.md | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/REFACTORING-AUDIT.md b/REFACTORING-AUDIT.md index f0ab4fb..d6dffd5 100644 --- a/REFACTORING-AUDIT.md +++ b/REFACTORING-AUDIT.md @@ -405,3 +405,9 @@ Migration order implied by the map: isolate shared infrastructure constructors ( - Auth has no active federation implementation; its wallet federation client is commented/dead code. Auth’s identity service should remain the owner of identity and national-ID data. - The proposed target is reasonable only after consumers are migrated: `user_id → identity_id → wallet_id`, with `wallet_id` still scoped to `asset_id` and Stellar key derivation/custody explicitly preserved. W013 must first identify whether federation addresses or transaction routing are actually supported in production, then remove or retain the model based on evidence and a data/API compatibility plan. - Per the requested migration, federation is fully removed from active Wallet/Auth/API code and the shared wallet protobuf: no federation creation/lookup, persistence adapter/model, wallet field, transaction field/filter, generated message, stale API route, or runtime reference remains. New wallet creation uses user/asset identity; wallet records remain asset-scoped. Wallet/Auth/API contracts were regenerated and all service tests pass. The database must be migrated separately to drop legacy federation columns/tables in deployed environments. + +### `W006` — deposit/withdrawal/transaction boundary checkpoint + +- Added `application/withdrawal` with the IRT amount reconciliation policy and focused tests for the one-unit balance threshold. +- `WithdrawIRTInit` continues to own the gRPC/payment flow but delegates amount policy through the application package; full Wallet tests pass in `16ebd2d`. +- Deposit/payment idempotency, transaction persistence, queue publication, and failure orchestration remain for subsequent W006 increments. diff --git a/REFACTORING-TODO.md b/REFACTORING-TODO.md index 86f6203..f8fac86 100644 --- a/REFACTORING-TODO.md +++ b/REFACTORING-TODO.md @@ -123,7 +123,7 @@ This is the authoritative execution tracker for the refactor. Work is performed | W003 | `DONE` | Move PostgreSQL, Redis, RabbitMQ, external client, and Stellar adapters into infrastructure. | PostgreSQL/Redis, RabbitMQ Watermill, external service, and Stellar/Horizon implementations are infrastructure-owned; legacy implementation imports are removed; full tests, race tests, vet, and build pass. | | W004 | `DONE` | Extract read-only wallet use cases and gRPC adapters. | Asset, commission, network, price, health, balance, check-balance, transaction-list, asset-catalog, and blockchain-balance reads delegate through `application/walletread`; protobuf conversion and error mapping remain compatible. Wallet-balance synchronization is an explicit mutation deferred to later wallet work. | | W005 | `STARTED` | Extract wallet initialization and asset/trustline use cases. | Initialization preconditions and trustline-limit policy now use `application/walletinit`; transaction, key-generation, trustline, and rollback orchestration remains in progress. | -| W006 | `TODO` | Extract deposit, withdrawal, and transaction use cases. | Idempotency, balances, queues, and failure behavior are tested. | +| W006 | `STARTED` | Extract deposit, withdrawal, and transaction use cases. | IRT withdrawal amount reconciliation now uses `application/withdrawal`; deposit/payment, transaction persistence, idempotency, balances, queues, and failure behavior remain in progress. | | W007 | `TODO` | Extract market use cases and adapters. | Pricing and market operations remain compatible. | | W008 | `TODO` | Extract alert use cases and adapters. | Alert persistence, delivery, and error behavior remain compatible. | | W009 | `TODO` | Extract internal-wallet use cases and adapters. | Internal RPC contracts remain compatible. | @@ -325,3 +325,4 @@ Append one row whenever a task changes status. Existing rows are never rewritten | 2026-08-30 | A009 | `TODO` | `DONE` | Removed Auth's commented/dead wallet federation client; Auth tests pass with writable cache in `508a239`. | | 2026-08-30 | W013 | `TODO` | `STARTED` | Removed automatic federation creation and federation lookup from wallet initialization; new wallet records no longer receive a federation assignment; full Wallet tests pass in `97dd9d9`. Remaining schema/API/transaction-field cleanup is pending. | | 2026-08-30 | W013 | `STARTED` | `DONE` | Removed federation persistence/model code, wallet and transaction federation fields, federation protobuf messages, stale API route/docs, and remaining runtime references; regenerated Wallet contracts for Wallet/Auth/API; Wallet, Auth, and API tests pass. Wallet `a38501d`/`7ae90cc`, Auth `446e875`, API `c450264`/`c2c076c`. | +| 2026-08-30 | W006 | `TODO` | `STARTED` | Added `application/withdrawal` and routed IRT amount reconciliation through it; focused and full Wallet tests pass in `16ebd2d`. Deposit/payment and transaction orchestration remain. |