|
| 1 | +# Implementation Plan: Batch Tokenize/Detokenize Endpoints |
| 2 | + |
| 3 | +This plan outlines the steps to implement batch tokenization and detokenization endpoints in the Secrets manager. |
| 4 | + |
| 5 | +## Phase 1: Domain and Repository Layer |
| 6 | + |
| 7 | +- [x] Task: Define Batch Tokenization Interfaces [e8a8cee] |
| 8 | + - [ ] Add `CreateBatch` to `TokenRepository` interface in `internal/tokenization/domain/token.go`. |
| 9 | + - [ ] Add `GetBatchByTokens` to `TokenRepository` interface in `internal/tokenization/domain/token.go`. |
| 10 | +- [x] Task: Implement Batch Repository Methods (PostgreSQL) [517777c] |
| 11 | + - [ ] Implement `CreateBatch` in `internal/tokenization/repository/postgresql/token_repository.go`. |
| 12 | + - [ ] Implement `GetBatchByTokens` in `internal/tokenization/repository/postgresql/token_repository.go`. |
| 13 | + - [ ] Write integration tests for these methods (tagged with `//go:build integration`). |
| 14 | +- [x] Task: Implement Batch Repository Methods (MySQL) [cc03816] |
| 15 | + - [ ] Implement `CreateBatch` in `internal/tokenization/repository/mysql/token_repository.go`. |
| 16 | + - [ ] Implement `GetBatchByTokens` in `internal/tokenization/repository/mysql/token_repository.go`. |
| 17 | + - [ ] Write integration tests for these methods (tagged with `//go:build integration`). |
| 18 | +- [x] Task: Implement Batch Usecase Logic [191cb29] |
| 19 | + - [ ] Add `TokenizeBatch` to `TokenizationUsecase` in `internal/tokenization/usecase/tokenization_usecase.go`. |
| 20 | + - [ ] Add `DetokenizeBatch` to `TokenizationUsecase` in `internal/tokenization/usecase/tokenization_usecase.go`. |
| 21 | + - [ ] Ensure both methods use `TxManager` for atomicity. |
| 22 | + - [ ] Implement the loop over existing single-item logic. |
| 23 | + - [ ] Write unit tests for the new usecase methods. |
| 24 | +- [x] Task: Conductor - User Manual Verification 'Phase 1: Domain and Repository Layer' (Protocol in workflow.md) |
| 25 | + |
| 26 | +## Phase 2: HTTP Layer |
| 27 | + |
| 28 | +- [x] Task: Define Request/Response DTOs [cc85bfe] |
| 29 | + - [ ] Create `TokenizeBatchRequest` and `TokenizeBatchResponse` in `internal/tokenization/http/dto.go` (or equivalent). |
| 30 | + - [ ] Create `DetokenizeBatchRequest` and `DetokenizeBatchResponse` in `internal/tokenization/http/dto.go`. |
| 31 | + - [ ] Implement validation rules (e.g., max 100 items). |
| 32 | +- [x] Task: Implement HTTP Handlers [ee3290b] |
| 33 | + - [ ] Implement `TokenizeBatch` handler in `internal/tokenization/http/tokenization_handler.go`. |
| 34 | + - [ ] Implement `DetokenizeBatch` handler in `internal/tokenization/http/tokenization_handler.go`. |
| 35 | + - [ ] Write unit tests for the new handlers in `internal/tokenization/http/tokenization_handler_test.go`. |
| 36 | +- [x] Task: Register Routes [ee3290b] |
| 37 | + - [ ] Add the new batch routes to the router in `internal/tokenization/http/tokenization_handler.go` (or `internal/app/di_tokenization.go`). |
| 38 | +- [x] Task: Conductor - User Manual Verification 'Phase 2: HTTP Layer' (Protocol in workflow.md) |
| 39 | + |
| 40 | +## Phase 3: Documentation and Integration Testing |
| 41 | + |
| 42 | +- [x] Task: Update Integration Flow Tests [efa3c2c] |
| 43 | + - [ ] Add batch operation test cases to `test/integration/tokenization_flow_test.go`. |
| 44 | + - [ ] Verify atomicity by intentionally failing one item in a batch. |
| 45 | +- [x] Task: Update OpenAPI Specification [fa50f71] |
| 46 | + - [ ] Add the new batch endpoints to `docs/openapi.yaml`. |
| 47 | +- [x] Task: Update Engine Documentation [9faab2e] |
| 48 | + - [ ] Update `docs/engines/tokenization.md` with examples of batch requests and responses. |
| 49 | +- [x] Task: Conductor - User Manual Verification 'Phase 3: Documentation and Integration Testing' (Protocol in workflow.md) |
0 commit comments