Skip to content

feature: translate COACTUPC account update transaction to Spring Boot service - #199

Open
devin-ai-integration[bot] wants to merge 2 commits into
mainfrom
devin/1789402481-coactupc-spring-boot
Open

devin-ai-integration[bot] wants to merge 2 commits into
mainfrom
devin/1789402481-coactupc-spring-boot

Conversation

@devin-ai-integration

Copy link
Copy Markdown

Summary

Adds java/coactupc-service/, a Spring Boot 2.7 (Java 11) module that re-implements the CICS transaction CAUP / program COACTUPC (account + customer update) with the same business rules, and documents the translation in docs/COACTUPC-field-mapping.md.

Shape of the translation

  • Copybooks → JPA entities, PIC widths preserved as column widths/precision: CVACT01YAccountRecord, CVCUS01YCustomerRecord, CVACT03YCardXrefRecord (the CXACAIX alternate index becomes findFirstByAcctId). S9(10)V99BigDecimal(12,2); X(10) dates stay YYYY-MM-DD strings. FILLER dropped.
  • ACUP-OLD/NEW-DETAILS (the COMMAREA screen snapshot) → AccountUpdateDetails, all-String fields with dates split Y/M/D, SSN split 3/2/4, phones split (AAA)BBB-CCCC, exactly as the COBOL stores them.
  • Paragraphs → methods on AccountUpdateService / FieldEditor (1200-EDIT-MAP-INPUTSeditMapInputs, 1205-COMPARE-OLD-NEWcompareOldNew, 9600-WRITE-PROCESSINGwriteProcessing, 1220-EDIT-YESNOeditYesNo, …). Edit order, first-error-wins (WS-RETURN-MSG-OFF) semantics, per-field VALID/NOT_OK/BLANK flags, and message literals are preserved. CSLKPCDY lookup lists (general-purpose area codes, state codes, state+zip2 combos) are generated into lookup/*.
  • ACUP-CHANGE-ACTIONChangeAction enum (S/E/N/C/L/F); WS-INFO-MSG/WS-RETURN-MSG 88s → Messages.
  • CICS → Spring: READfindById, READ UPDATE@Lock(PESSIMISTIC_WRITE), 9700-CHECK-CHANGE-IN-REC optimistic check → DATA_CHANGED, REWRITE×2 + SYNCPOINT ROLLBACK → one @Transactional method.

HTTP surface (AccountUpdateController)

GET  /api/v1/accounts/{id}            fetch (ENTER on search)  200 | 400 bad id | 404 xref/acct/cust not found
POST /api/v1/accounts/{id}/validate   ENTER with edits         200 always: NO_CHANGE / CHANGES_NOT_OK / CHANGES_OK_NOT_CONFIRMED
PUT  /api/v1/accounts/{id}            PF5 save                 200 done | 409 record changed underneath | 423 lock | 500 rewrite failed

PF3/PF12 are pure navigation (PF12 = client re-issues GET) and are documented rather than implemented.

Deliberate deviations (all in doc §7)

  • ACCT-UPDATE-RECORD in the COBOL omits ACCT-ADDR-ZIP, so ACCT-UPDATE-GROUP-ID lands at offset 102 — the REWRITE overwrites the zip with the group id and blanks the real group id. The Java writes groupId to the right column and leaves addrZip untouched (intent-preserving, defect not reproduced).
  • Money values with >10 integer digits are rejected ("is not valid") instead of silently truncated by MOVE.
  • RESP/RESP2 codes are not echoed in not-found messages; the WS-RETURN-MSG 88 texts are used.
  • 999 is accepted as an area code because it is present in the copybook's VALID-GENERAL-PURP-CODE list.

Tests: 76 JUnit 5 tests — CobolNumericTest (NUMVAL-C), FieldEditorTest (each edit paragraph incl. century/leap-year/DOB rules), AccountUpdateServiceTest (H2: fetch, not-found paths, no-change, first-error ordering, confirm+persist formats, stale-record 409, lock errors), AccountUpdateControllerTest (status mapping).

Run: cd java/coactupc-service && mvn test

Devin-Org: engineering

Link to Devin session: https://app.devin.ai/sessions/01a88c7fe88b4a1882290d650c00b721
Open in Devin Desktop: https://app.devin.ai/desktop/session/01a88c7fe88b4a1882290d650c00b721?variant=devin
Requested by: @rushcromer


Note

Devin errored when opening this Pull Request as rushcromer.
As a fallback, Devin opened this PR as itself.

devin-ai-integration Bot and others added 2 commits September 14, 2026 16:19
Co-Authored-By: Rush Cromer II <rush.cromerii@cognition.ai>
Co-Authored-By: Rush Cromer II <rush.cromerii@cognition.ai>
@devin-ai-integration

Copy link
Copy Markdown
Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants