You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
3.8 KiB
3.8 KiB
Task 4 Report: Issuance Application Workflow
Scope
Implemented Task 4 application commands, query views, commercial-bank orchestration, and the read-only central-bank query. No REST controller or interface DTO was added.
Changes
- Added create/update commands and commercial-bank inventory/request views under
issuance/application. - Added transactional commercial-bank operations for create, update, message preparation, SM3 digest recording, SM2 signing with
sm2-key-02, JSON packaging, and idempotent sending. - Generated request numbers as
ISSUE_REQ_followed by an upper-case UUID suffix. - Added request/inventory error mapping to
RESOURCE_NOT_FOUNDand domain argument/state error mapping toVALIDATION_ERROR. - Added a central-bank read-only query that exposes persisted request receipt state, receipt time, and payload data.
- Registered the message composer and SM3/SM2 signing service as Spring beans.
- Added focused application tests for end-to-end send visibility, repeated sends, invalid post-prepare update, central-bank payload/receipt lookup, and missing request mapping.
Test evidence
- RED:
mvn '-Dtest=CommercialBankIssuanceApplicationServiceTest,CentralBankIssuanceQueryServiceTest' test -Bfailed at test compilation before implementation because the application command, query, and service classes did not exist. - GREEN: the same focused command passed with 5 tests and 0 failures/errors.
- JDK 8:
mvn test -Busing Temurin1.8.0_502passed with 45 tests and 0 failures/errors. - During full-suite verification, Spring reported an ambiguous service constructor. The application-context failure reproduced the problem; annotating the intended three-dependency constructor with
@Autowiredrestored application-context startup. The focused and full JDK 8 suites were then rerun successfully. git diff --checkcompleted without whitespace errors.
Commit
feat: add issuance application workflow
Review and concerns
- The repository's existing MyBatis audit handler derives
created_byandupdated_byfrom the authenticated Spring Security account; application operation signatures retain the authenticated account name expected by the next REST layer. - JSON payload includes the required request identity, bank/organization fields, denomination rows, currency, timestamp, digest, and signature.
orgCodeandbankCodeboth carry the aggregate's commercial-bank code to support either naming convention at the integration boundary. - No known Task 4 scope issues remain.
Fix Round 1: Explicit Audit Actor
- Root cause: every commercial-bank write accepted
authenticatedAccountNamebut discarded it before repository persistence, allowing the MyBatis audit handler to use itsSYSTEMfallback whenever no Spring Security context was present. - Added an actor-aware repository save boundary. The commercial-bank service now passes its supplied authenticated account for create, draft update, message preparation, digest, signature, packaging, and send. The MyBatis repository writes that actor to both audit columns on insert and only
updated_byon later writes, preserving the original creator. - Added a persistence regression that exercises all of those operations through the Spring application service and reads the actual
issuance_requestrow after each operation. - RED:
mvn '-Dtest=MybatisIssuanceRequestRepositoryTest' test -Bfailed as expected withexpected: "creator" but was: "SYSTEM". - GREEN:
mvn '-Dtest=CommercialBankIssuanceApplicationServiceTest,CentralBankIssuanceQueryServiceTest,MybatisIssuanceRequestRepositoryTest' test -Bpassed with 10 tests and 0 failures/errors. - JDK 8:
mvn test -Busing Temurin1.8.0_502passed with 46 tests and 0 failures/errors. git diff --checkcompleted without whitespace errors before commit.