Migrate the daily posting pipeline (CBTRN01C, CBTRN02C) to com.carddemo.batch.posting - #188
Open
devanshi-gpta wants to merge 1 commit into
Conversation
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
Migrates the daily posting pipeline —
CBTRN01C(verification pass) andCBTRN02C(posting, JCLPOSTTRAN+DALYREJS) — intocom.carddemo.batch.posting. Rules live in@Services;DailyPostingJobConfigonly wires them into Spring Batch (dailyTransactionVerificationJob,postTransactionJob; DALYTRAN read ordered byDALYTRAN-ID, rejects to a flat file atcarddemo.batch.posting.reject-file). No shared entity/repository/pom changes.Behavioral details worth knowing, all taken literally from
1500-*/2000-*:PostingRejectReason): 100INVALID CARD NUMBER FOUND, 101/109ACCOUNT RECORD NOT FOUND, 102OVERLIMIT TRANSACTION, 103TRANSACTION RECEIVED AFTER ACCT EXPIRATION.1500-B-LOOKUP-ACCTevaluates the limit check then the expiry check into the same field, so a transaction that is both over limit and past expiry is rejected as 103 — reproduced by overwritingreason, not by short-circuiting.ACCT-CREDIT-LIMIT >= (cycCredit - cycDebit + amt), i.e. exactly-on-the-limit is accepted; expiry test is an alphanumeric compare ofACCT-EXPIRAION-DATEagainstDALYTRAN-ORIG-TS(1:10), so the expiration date itself is accepted.2800-UPDATE-ACCOUNT-RECadds the signed amount:currBal += amt, thenamt >= 0 ? cycCredit += amt : cycDebit += amt(a negative amount therefore decreases the cycle debit). Update order is preserved: TCATBAL (create-or-add) → ACCOUNT → TRANSACT.PostingResult.getAccountUpdateFailure()); the transaction is still written to TRANSACT and no reject record is produced, as in the COBOL.TransactionRejectRecordrenders the 430-byte DALYREJS record (350-byte CVTRA06Y image +PIC 9(04)reason +PIC X(76)desc), including zoned-decimal overpunch forDALYTRAN-AMT; a test round-trips a realapp/data/ASCII/dailytran.txtrecord through parse → render.TRAN-PROC-TSuses theZ-GET-DB2-FORMAT-TIMESTAMPlayoutEEEE-MM-DD-UU.MM.SS.HH0000, with an injectableClockfor tests.mvn -B clean verifypasses (28 tests; 18 new covering an accepted posting, each reject reason, the limit/expiry boundaries, the negative/zero-amount branches and reason 109).Link to Devin session: https://app.devin.ai/sessions/4ac427d3381745c0acad80fdc924e933
Requested by: @devanshi-gpta
Devin Review