CardDemo Java modernization: Spring Boot foundation (copybooks → JPA model) - #186
Open
devanshi-gpta wants to merge 1 commit into
Open
devanshi-gpta wants to merge 1 commit into
devanshi-gpta wants to merge 1 commit into
Conversation
Maven module under java/ with copybook-derived JPA entities, Spring Data repositories, COMMAREA DTO, zoned-decimal helpers and a loader for the sample VSAM extracts in app/data/ASCII. Co-Authored-By: Devanshi Gupta <devanshi.gupta@cognition.ai>
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
First layer of the COBOL → Java/Spring Boot migration: a standalone Maven module in
java/that carries the data model every migrated program depends on. Noapp/artifact is touched; the COBOL/CICS/VSAM/JCL sources remain the reference implementation.What it establishes:
app/cpy/*.cpyrecord layout becomes a JPA entity whose Javadoc names the copybook and VSAM file, and whose fields carry the original PIC clause:PIC X(n)→Stringwithlength = n,PIC 9(n)→Integer/Longby digit count,PIC S9(m)V99→BigDecimal(m+2, 2). Group keys (TRAN-CAT-KEY,DIS-GROUP-KEY) become@Embeddablecomposite ids.findByAccountIdOrderByCardNumberfor the CARDDATA/CARDXREF AIX paths).CardDemoCommareareproducesCOCOM01Yfield-for-field; pseudo-conversational state will live in the HTTP session underCardDemoCommarea.SESSION_KEYinstead of being passed onEXEC CICS RETURN.CobolUtils.decimaldecodes the sign overpunch in the sample extracts ({=+0,A–I=+1..+9,}=-0,J–R=-1..-9), so"0000009190}"at scale 2 →-919.00.rounded()gives COBOLROUNDED(HALF_UP) semantics for the interest math landing in a later PR.SeedDataLoader. Replaces ACCTFILE/CARDFILE/CUSTFILE/XREFFILE/DISCGRP/TCATBALF/TRANTYPE/TRANCATG/DUSRSECJ by parsingapp/data/ASCIIat startup (toggle:carddemo.data.load-on-startup).Worth flagging:
acctdata.txtputs the disclosure group value (A000000000) in theACCT-ADDR-ZIPbyte range and leavesACCT-GROUP-IDblank. The loader follows theCVACT01Yoffsets rather than "fixing" the data, so interest calculation will fall back to theDEFAULTdisclosure group exactly asCBACT04Cdoes on the mainframe.Tests:
CobolUtilsTest(overpunch/rounding/padding),SeedDataLoaderTest(each layout asserted against the real sample records), and a context test asserting 50 accounts/cards/customers load.Follow-up PRs (batch programs
CB*, online programsCO*) branch off this one.Link to Devin session: https://app.devin.ai/sessions/5409e398c7304f249331d08190d3abd3
Requested by: @devanshi-gpta
Devin Review