@llm4ts/shell 0.17.0 → 0.18.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (269) hide show
  1. package/dist/Cli.d.ts +4 -0
  2. package/dist/Cli.d.ts.map +1 -1
  3. package/dist/Cli.js +69 -8
  4. package/dist/Cli.js.map +1 -1
  5. package/dist/FlowCatalog.d.ts +10 -4
  6. package/dist/FlowCatalog.d.ts.map +1 -1
  7. package/dist/FlowCatalog.js +25 -14
  8. package/dist/FlowCatalog.js.map +1 -1
  9. package/flows/epic-stories.js +1 -8
  10. package/flows/hello.js +15 -0
  11. package/flows/implement.js +1 -8
  12. package/flows/issue-pr.js +1 -8
  13. package/flows/judge-suite.js +1 -4
  14. package/flows/lib/epic-stories.js +3 -4
  15. package/flows/local.js +2 -5
  16. package/flows/modernize-bench.js +3 -12
  17. package/flows/modernize-extract.js +38 -20
  18. package/flows/modernize-implement.js +4 -15
  19. package/flows/modernize-pack-check.js +1 -8
  20. package/flows/modernize-review.js +4 -13
  21. package/flows/modernize-seed.js +3 -11
  22. package/flows/modernize-survey.js +0 -0
  23. package/flows/modernize-verify.js +5 -13
  24. package/flows/sdd.js +2 -12
  25. package/kits/j2ee-nextjs/README.md +29 -0
  26. package/kits/j2ee-nextjs/fixtures/demo-bank/RUNBOOK.md +232 -0
  27. package/kits/j2ee-nextjs/fixtures/demo-bank/legacy-j2ee/PAGES.md +67 -0
  28. package/kits/j2ee-nextjs/fixtures/demo-bank/legacy-j2ee/pom.xml +49 -0
  29. package/kits/j2ee-nextjs/fixtures/demo-bank/legacy-j2ee/src/main/java/com/demobank/legacy/dto/AcctOvwDTO.java +58 -0
  30. package/kits/j2ee-nextjs/fixtures/demo-bank/legacy-j2ee/src/main/java/com/demobank/legacy/dto/BenfDTO.java +49 -0
  31. package/kits/j2ee-nextjs/fixtures/demo-bank/legacy-j2ee/src/main/java/com/demobank/legacy/dto/TrfDTO.java +70 -0
  32. package/kits/j2ee-nextjs/fixtures/demo-bank/legacy-j2ee/src/main/java/com/demobank/legacy/esb/EsbAcctListService.java +53 -0
  33. package/kits/j2ee-nextjs/fixtures/demo-bank/legacy-j2ee/src/main/java/com/demobank/legacy/esb/EsbBenfListService.java +58 -0
  34. package/kits/j2ee-nextjs/fixtures/demo-bank/legacy-j2ee/src/main/java/com/demobank/legacy/esb/EsbBenfMaintService.java +58 -0
  35. package/kits/j2ee-nextjs/fixtures/demo-bank/legacy-j2ee/src/main/java/com/demobank/legacy/esb/EsbException.java +21 -0
  36. package/kits/j2ee-nextjs/fixtures/demo-bank/legacy-j2ee/src/main/java/com/demobank/legacy/esb/EsbGateway.java +44 -0
  37. package/kits/j2ee-nextjs/fixtures/demo-bank/legacy-j2ee/src/main/java/com/demobank/legacy/esb/EsbTrfExecService.java +53 -0
  38. package/kits/j2ee-nextjs/fixtures/demo-bank/legacy-j2ee/src/main/java/com/demobank/legacy/esb/EsbTrfValidateService.java +45 -0
  39. package/kits/j2ee-nextjs/fixtures/demo-bank/legacy-j2ee/src/main/java/com/demobank/legacy/web/AccountOverviewServlet.java +90 -0
  40. package/kits/j2ee-nextjs/fixtures/demo-bank/legacy-j2ee/src/main/java/com/demobank/legacy/web/BeneficiaryServlet.java +195 -0
  41. package/kits/j2ee-nextjs/fixtures/demo-bank/legacy-j2ee/src/main/java/com/demobank/legacy/web/TransferDraft.java +62 -0
  42. package/kits/j2ee-nextjs/fixtures/demo-bank/legacy-j2ee/src/main/java/com/demobank/legacy/web/TransferServlet.java +223 -0
  43. package/kits/j2ee-nextjs/fixtures/demo-bank/legacy-j2ee/src/main/webapp/WEB-INF/web.xml +59 -0
  44. package/kits/j2ee-nextjs/fixtures/demo-bank/legacy-j2ee/src/main/webapp/accountOverview.jsp +65 -0
  45. package/kits/j2ee-nextjs/fixtures/demo-bank/legacy-j2ee/src/main/webapp/beneficiaryEdit.jsp +70 -0
  46. package/kits/j2ee-nextjs/fixtures/demo-bank/legacy-j2ee/src/main/webapp/beneficiaryList.jsp +43 -0
  47. package/kits/j2ee-nextjs/fixtures/demo-bank/legacy-j2ee/src/main/webapp/css/bank.css +132 -0
  48. package/kits/j2ee-nextjs/fixtures/demo-bank/legacy-j2ee/src/main/webapp/dashboard.jsp +28 -0
  49. package/kits/j2ee-nextjs/fixtures/demo-bank/legacy-j2ee/src/main/webapp/footer.jsp +8 -0
  50. package/kits/j2ee-nextjs/fixtures/demo-bank/legacy-j2ee/src/main/webapp/header.jsp +22 -0
  51. package/kits/j2ee-nextjs/fixtures/demo-bank/legacy-j2ee/src/main/webapp/help.jsp +32 -0
  52. package/kits/j2ee-nextjs/fixtures/demo-bank/legacy-j2ee/src/main/webapp/js/jquery-1.12.4.min.js +1 -0
  53. package/kits/j2ee-nextjs/fixtures/demo-bank/legacy-j2ee/src/main/webapp/js/validate.js +79 -0
  54. package/kits/j2ee-nextjs/fixtures/demo-bank/legacy-j2ee/src/main/webapp/login.jsp +29 -0
  55. package/kits/j2ee-nextjs/fixtures/demo-bank/legacy-j2ee/src/main/webapp/messages.jsp +34 -0
  56. package/kits/j2ee-nextjs/fixtures/demo-bank/legacy-j2ee/src/main/webapp/nav.jsp +14 -0
  57. package/kits/j2ee-nextjs/fixtures/demo-bank/legacy-j2ee/src/main/webapp/oldTransfer.jsp +34 -0
  58. package/kits/j2ee-nextjs/fixtures/demo-bank/legacy-j2ee/src/main/webapp/profile.jsp +26 -0
  59. package/kits/j2ee-nextjs/fixtures/demo-bank/legacy-j2ee/src/main/webapp/promoQ3.jsp +23 -0
  60. package/kits/j2ee-nextjs/fixtures/demo-bank/legacy-j2ee/src/main/webapp/settings.jsp +34 -0
  61. package/kits/j2ee-nextjs/fixtures/demo-bank/legacy-j2ee/src/main/webapp/testHarness.jsp +39 -0
  62. package/kits/j2ee-nextjs/fixtures/demo-bank/legacy-j2ee/src/main/webapp/transferConfirm.jsp +35 -0
  63. package/kits/j2ee-nextjs/fixtures/demo-bank/legacy-j2ee/src/main/webapp/transferStep1.jsp +73 -0
  64. package/kits/j2ee-nextjs/fixtures/demo-bank/legacy-j2ee/src/main/webapp/transferStep2.jsp +40 -0
  65. package/kits/j2ee-nextjs/fixtures/demo-bank/nextjs/CONTRIBUTING.md +76 -0
  66. package/kits/j2ee-nextjs/fixtures/demo-bank/nextjs/README.md +46 -0
  67. package/kits/j2ee-nextjs/fixtures/demo-bank/nextjs/contracts/cards.openapi.yaml +57 -0
  68. package/kits/j2ee-nextjs/fixtures/demo-bank/nextjs/contracts/profile.openapi.yaml +73 -0
  69. package/kits/j2ee-nextjs/fixtures/demo-bank/nextjs/eslint.config.mjs +24 -0
  70. package/kits/j2ee-nextjs/fixtures/demo-bank/nextjs/next-env.d.ts +5 -0
  71. package/kits/j2ee-nextjs/fixtures/demo-bank/nextjs/next.config.mjs +10 -0
  72. package/kits/j2ee-nextjs/fixtures/demo-bank/nextjs/package.json +29 -0
  73. package/kits/j2ee-nextjs/fixtures/demo-bank/nextjs/pnpm-lock.yaml +2895 -0
  74. package/kits/j2ee-nextjs/fixtures/demo-bank/nextjs/src/app/cards/page.tsx +62 -0
  75. package/kits/j2ee-nextjs/fixtures/demo-bank/nextjs/src/app/layout.tsx +41 -0
  76. package/kits/j2ee-nextjs/fixtures/demo-bank/nextjs/src/app/page.tsx +26 -0
  77. package/kits/j2ee-nextjs/fixtures/demo-bank/nextjs/src/app/profile/page.tsx +134 -0
  78. package/kits/j2ee-nextjs/fixtures/demo-bank/nextjs/src/app/signed-in-badge.tsx +9 -0
  79. package/kits/j2ee-nextjs/fixtures/demo-bank/nextjs/src/auth/AuthProvider.tsx +36 -0
  80. package/kits/j2ee-nextjs/fixtures/demo-bank/nextjs/src/components/Button.tsx +27 -0
  81. package/kits/j2ee-nextjs/fixtures/demo-bank/nextjs/src/components/Card.tsx +18 -0
  82. package/kits/j2ee-nextjs/fixtures/demo-bank/nextjs/src/components/DataTable.tsx +57 -0
  83. package/kits/j2ee-nextjs/fixtures/demo-bank/nextjs/src/components/Field.tsx +34 -0
  84. package/kits/j2ee-nextjs/fixtures/demo-bank/nextjs/src/components/Form.tsx +70 -0
  85. package/kits/j2ee-nextjs/fixtures/demo-bank/nextjs/src/components/PageLayout.tsx +39 -0
  86. package/kits/j2ee-nextjs/fixtures/demo-bank/nextjs/src/components/Stepper.tsx +29 -0
  87. package/kits/j2ee-nextjs/fixtures/demo-bank/nextjs/src/components/index.ts +19 -0
  88. package/kits/j2ee-nextjs/fixtures/demo-bank/nextjs/src/services/cards/mock.ts +47 -0
  89. package/kits/j2ee-nextjs/fixtures/demo-bank/nextjs/src/services/cards/port.ts +31 -0
  90. package/kits/j2ee-nextjs/fixtures/demo-bank/nextjs/src/services/profile/mock.ts +45 -0
  91. package/kits/j2ee-nextjs/fixtures/demo-bank/nextjs/src/services/profile/port.ts +24 -0
  92. package/kits/j2ee-nextjs/fixtures/demo-bank/nextjs/src/services/registry.ts +20 -0
  93. package/kits/j2ee-nextjs/fixtures/demo-bank/nextjs/src/theme/components.css +269 -0
  94. package/kits/j2ee-nextjs/fixtures/demo-bank/nextjs/src/theme/tokens.css +38 -0
  95. package/kits/j2ee-nextjs/fixtures/demo-bank/nextjs/tests/cards.page.test.tsx +81 -0
  96. package/kits/j2ee-nextjs/fixtures/demo-bank/nextjs/tests/profile.page.test.tsx +87 -0
  97. package/kits/j2ee-nextjs/fixtures/demo-bank/nextjs/tsconfig.json +54 -0
  98. package/kits/j2ee-nextjs/fixtures/demo-bank/nextjs/vitest.config.ts +17 -0
  99. package/kits/j2ee-nextjs/fixtures/demo-bank/preflight.mjs +53 -0
  100. package/kits/j2ee-nextjs/fixtures/demo-bank/reset-demo.mjs +40 -0
  101. package/kits/j2ee-nextjs/fixtures/demo-bank/seed-legacy-j2ee.mjs +71 -0
  102. package/kits/j2ee-nextjs/fixtures/demo-bank/seed-nextjs.mjs +111 -0
  103. package/kits/j2ee-nextjs/fixtures/demo-bank/smoke-legacy-j2ee.mjs +144 -0
  104. package/kits/j2ee-nextjs/fixtures/demo-bank/smoke-nextjs.mjs +118 -0
  105. package/{flows → kits/j2ee-nextjs/flows}/convert-all.js +1 -7
  106. package/{flows → kits/j2ee-nextjs/flows}/convert-page.js +2 -6
  107. package/{flows → kits/j2ee-nextjs/flows}/lib/convert.js +6 -16
  108. package/{flows → kits/j2ee-nextjs}/packs/j2ee-nextjs-spa/pack.md +2 -1
  109. package/{flows → kits/j2ee-nextjs}/packs/j2ee-nextjs-spa/prompts/spec.md +5 -1
  110. package/{flows → kits/j2ee-nextjs}/packs/jsp-bff-nextjs/pack.md +1 -1
  111. package/{flows → kits/j2ee-nextjs}/packs/jsp-nextjs/pack.md +1 -1
  112. package/kits/mainframe-java/README.md +31 -0
  113. package/{flows → kits/mainframe-java}/packs/ace-integration/pack.md +1 -1
  114. package/{flows → kits/mainframe-java}/packs/ace-kafka/pack.md +1 -1
  115. package/{flows → kits/mainframe-java}/packs/cobol-kafka/pack.md +1 -1
  116. package/{flows → kits/mainframe-java}/packs/cobol-springboot/pack.md +1 -1
  117. package/package.json +6 -6
  118. package/src/Cli.ts +92 -9
  119. package/src/FlowCatalog.ts +29 -13
  120. /package/{flows → kits/j2ee-nextjs}/packs/j2ee-nextjs-spa/patterns/PAT-J2EE-001-jstl-table.md +0 -0
  121. /package/{flows → kits/j2ee-nextjs}/packs/j2ee-nextjs-spa/patterns/PAT-J2EE-002-jquery-validation.md +0 -0
  122. /package/{flows → kits/j2ee-nextjs}/packs/j2ee-nextjs-spa/patterns/PAT-J2EE-003-session-stepper.md +0 -0
  123. /package/{flows → kits/j2ee-nextjs}/packs/j2ee-nextjs-spa/patterns/PAT-J2EE-004-esb-port.md +0 -0
  124. /package/{flows → kits/j2ee-nextjs}/packs/j2ee-nextjs-spa/patterns/PAT-J2EE-005-include-shell.md +0 -0
  125. /package/{flows → kits/j2ee-nextjs}/packs/j2ee-nextjs-spa/prompts/analysis.md +0 -0
  126. /package/{flows → kits/j2ee-nextjs}/packs/j2ee-nextjs-spa/prompts/bdd.md +0 -0
  127. /package/{flows → kits/j2ee-nextjs}/packs/j2ee-nextjs-spa/prompts/implement.md +0 -0
  128. /package/{flows → kits/j2ee-nextjs}/packs/j2ee-nextjs-spa/prompts/plan.md +0 -0
  129. /package/{flows → kits/j2ee-nextjs}/packs/j2ee-nextjs-spa/prompts/review.md +0 -0
  130. /package/{flows → kits/j2ee-nextjs}/packs/j2ee-nextjs-spa/prompts/survey-refine.md +0 -0
  131. /package/{flows → kits/j2ee-nextjs}/packs/j2ee-nextjs-spa/prompts/survey-triage.md +0 -0
  132. /package/{flows → kits/j2ee-nextjs}/packs/j2ee-nextjs-spa/reviewers/acl-purity.md +0 -0
  133. /package/{flows → kits/j2ee-nextjs}/packs/j2ee-nextjs-spa/reviewers/house-style.md +0 -0
  134. /package/{flows → kits/j2ee-nextjs}/packs/jsp-bff-nextjs/lessons.md +0 -0
  135. /package/{flows → kits/j2ee-nextjs}/packs/jsp-bff-nextjs/prompts/analysis.md +0 -0
  136. /package/{flows → kits/j2ee-nextjs}/packs/jsp-bff-nextjs/prompts/bdd.md +0 -0
  137. /package/{flows → kits/j2ee-nextjs}/packs/jsp-bff-nextjs/prompts/implement.md +0 -0
  138. /package/{flows → kits/j2ee-nextjs}/packs/jsp-bff-nextjs/prompts/plan.md +0 -0
  139. /package/{flows → kits/j2ee-nextjs}/packs/jsp-bff-nextjs/prompts/review.md +0 -0
  140. /package/{flows → kits/j2ee-nextjs}/packs/jsp-bff-nextjs/prompts/spec.md +0 -0
  141. /package/{flows → kits/j2ee-nextjs}/packs/jsp-bff-nextjs/prompts/survey-refine.md +0 -0
  142. /package/{flows → kits/j2ee-nextjs}/packs/jsp-bff-nextjs/prompts/survey-triage.md +0 -0
  143. /package/{flows → kits/j2ee-nextjs}/packs/jsp-bff-nextjs/reviewers/bff-boundary.md +0 -0
  144. /package/{flows/packs/ace-integration → kits/j2ee-nextjs/packs/jsp-bff-nextjs}/reviewers/traceability.md +0 -0
  145. /package/{flows → kits/j2ee-nextjs}/packs/jsp-nextjs/lessons.md +0 -0
  146. /package/{flows → kits/j2ee-nextjs}/packs/jsp-nextjs/prompts/analysis.md +0 -0
  147. /package/{flows → kits/j2ee-nextjs}/packs/jsp-nextjs/prompts/bdd.md +0 -0
  148. /package/{flows → kits/j2ee-nextjs}/packs/jsp-nextjs/prompts/implement.md +0 -0
  149. /package/{flows → kits/j2ee-nextjs}/packs/jsp-nextjs/prompts/plan.md +0 -0
  150. /package/{flows → kits/j2ee-nextjs}/packs/jsp-nextjs/prompts/review.md +0 -0
  151. /package/{flows → kits/j2ee-nextjs}/packs/jsp-nextjs/prompts/spec.md +0 -0
  152. /package/{flows → kits/j2ee-nextjs}/packs/jsp-nextjs/prompts/survey-refine.md +0 -0
  153. /package/{flows → kits/j2ee-nextjs}/packs/jsp-nextjs/prompts/survey-triage.md +0 -0
  154. /package/{flows/packs/ace-kafka → kits/j2ee-nextjs/packs/jsp-nextjs}/reviewers/traceability.md +0 -0
  155. /package/{flows → kits/j2ee-nextjs}/packs/jsp-nextjs/reviewers/ux-fidelity.md +0 -0
  156. /package/{flows/fixtures → kits/j2ee-nextjs}/scaffolds/nextjs-spa/README.md +0 -0
  157. /package/{flows/fixtures → kits/j2ee-nextjs}/scaffolds/nextjs-spa/app/layout.js +0 -0
  158. /package/{flows/fixtures → kits/j2ee-nextjs}/scaffolds/nextjs-spa/app/page.js +0 -0
  159. /package/{flows/fixtures/scaffolds/kafka-streams-service/src/test/resources/features → kits/j2ee-nextjs/scaffolds/nextjs-spa/docs/specs}/.gitkeep +0 -0
  160. /package/{flows/fixtures/scaffolds/nextjs-spa/docs/specs → kits/j2ee-nextjs/scaffolds/nextjs-spa/features}/.gitkeep +0 -0
  161. /package/{flows/fixtures → kits/j2ee-nextjs}/scaffolds/nextjs-spa/next.config.js +0 -0
  162. /package/{flows/fixtures → kits/j2ee-nextjs}/scaffolds/nextjs-spa/package.json +0 -0
  163. /package/{flows/fixtures → kits/j2ee-nextjs}/scaffolds/nextjs-spa/tests/smoke.test.js +0 -0
  164. /package/{flows/fixtures → kits/j2ee-nextjs}/scaffolds/spring-bff/README.md +0 -0
  165. /package/{flows/fixtures → kits/j2ee-nextjs}/scaffolds/spring-bff/frontend/app/layout.js +0 -0
  166. /package/{flows/fixtures → kits/j2ee-nextjs}/scaffolds/spring-bff/frontend/app/page.js +0 -0
  167. /package/{flows/fixtures → kits/j2ee-nextjs}/scaffolds/spring-bff/frontend/next.config.js +0 -0
  168. /package/{flows/fixtures → kits/j2ee-nextjs}/scaffolds/spring-bff/frontend/package.json +0 -0
  169. /package/{flows/fixtures → kits/j2ee-nextjs}/scaffolds/spring-bff/frontend/tests/smoke.test.js +0 -0
  170. /package/{flows/fixtures → kits/j2ee-nextjs}/scaffolds/spring-bff/pom.xml +0 -0
  171. /package/{flows/fixtures → kits/j2ee-nextjs}/scaffolds/spring-bff/scripts/test.sh +0 -0
  172. /package/{flows/fixtures → kits/j2ee-nextjs}/scaffolds/spring-bff/src/main/java/com/meridian/bff/Application.java +0 -0
  173. /package/{flows/fixtures → kits/j2ee-nextjs}/scaffolds/spring-bff/src/main/resources/application.yaml +0 -0
  174. /package/{flows/fixtures → kits/j2ee-nextjs}/scaffolds/spring-bff/src/test/java/com/meridian/bff/ApplicationTests.java +0 -0
  175. /package/{flows/fixtures/scaffolds/nextjs-spa → kits/j2ee-nextjs/scaffolds/spring-bff/src/test/resources}/features/.gitkeep +0 -0
  176. /package/{flows → kits/mainframe-java}/packs/ace-integration/lessons.md +0 -0
  177. /package/{flows → kits/mainframe-java}/packs/ace-integration/prompts/analysis.md +0 -0
  178. /package/{flows → kits/mainframe-java}/packs/ace-integration/prompts/bdd.md +0 -0
  179. /package/{flows → kits/mainframe-java}/packs/ace-integration/prompts/implement.md +0 -0
  180. /package/{flows → kits/mainframe-java}/packs/ace-integration/prompts/plan.md +0 -0
  181. /package/{flows → kits/mainframe-java}/packs/ace-integration/prompts/review.md +0 -0
  182. /package/{flows → kits/mainframe-java}/packs/ace-integration/prompts/spec.md +0 -0
  183. /package/{flows → kits/mainframe-java}/packs/ace-integration/reviewers/routing-fidelity.md +0 -0
  184. /package/{flows/packs/cobol-kafka → kits/mainframe-java/packs/ace-integration}/reviewers/traceability.md +0 -0
  185. /package/{flows → kits/mainframe-java}/packs/ace-kafka/lessons.md +0 -0
  186. /package/{flows → kits/mainframe-java}/packs/ace-kafka/prompts/analysis.md +0 -0
  187. /package/{flows → kits/mainframe-java}/packs/ace-kafka/prompts/bdd.md +0 -0
  188. /package/{flows → kits/mainframe-java}/packs/ace-kafka/prompts/implement.md +0 -0
  189. /package/{flows → kits/mainframe-java}/packs/ace-kafka/prompts/plan.md +0 -0
  190. /package/{flows → kits/mainframe-java}/packs/ace-kafka/prompts/review.md +0 -0
  191. /package/{flows → kits/mainframe-java}/packs/ace-kafka/prompts/spec.md +0 -0
  192. /package/{flows → kits/mainframe-java}/packs/ace-kafka/prompts/vectors.md +0 -0
  193. /package/{flows → kits/mainframe-java}/packs/ace-kafka/reviewers/event-contracts.md +0 -0
  194. /package/{flows → kits/mainframe-java}/packs/ace-kafka/reviewers/routing-fidelity.md +0 -0
  195. /package/{flows/packs/cobol-springboot → kits/mainframe-java/packs/ace-kafka}/reviewers/traceability.md +0 -0
  196. /package/{flows → kits/mainframe-java}/packs/cobol-kafka/lessons.md +0 -0
  197. /package/{flows → kits/mainframe-java}/packs/cobol-kafka/patterns/PAT-STREAM-001-record-to-event.md +0 -0
  198. /package/{flows → kits/mainframe-java}/packs/cobol-kafka/patterns/PAT-STREAM-002-job-step-topology.md +0 -0
  199. /package/{flows → kits/mainframe-java}/packs/cobol-kafka/patterns/PAT-STREAM-003-checkpoint-idempotence.md +0 -0
  200. /package/{flows → kits/mainframe-java}/packs/cobol-kafka/patterns/PAT-STREAM-004-eod-totals-window.md +0 -0
  201. /package/{flows → kits/mainframe-java}/packs/cobol-kafka/patterns/PAT-STREAM-005-reject-topic.md +0 -0
  202. /package/{flows → kits/mainframe-java}/packs/cobol-kafka/patterns/PAT-STREAM-006-keyed-state-store.md +0 -0
  203. /package/{flows → kits/mainframe-java}/packs/cobol-kafka/patterns/PAT-STREAM-007-outbox.md +0 -0
  204. /package/{flows → kits/mainframe-java}/packs/cobol-kafka/patterns/PAT-STREAM-008-partition-key.md +0 -0
  205. /package/{flows → kits/mainframe-java}/packs/cobol-kafka/patterns/PAT-STREAM-009-batch-window-cutoff.md +0 -0
  206. /package/{flows → kits/mainframe-java}/packs/cobol-kafka/patterns/PAT-STREAM-010-replay-backfill.md +0 -0
  207. /package/{flows → kits/mainframe-java}/packs/cobol-kafka/prompts/analysis.md +0 -0
  208. /package/{flows → kits/mainframe-java}/packs/cobol-kafka/prompts/bdd.md +0 -0
  209. /package/{flows → kits/mainframe-java}/packs/cobol-kafka/prompts/implement.md +0 -0
  210. /package/{flows → kits/mainframe-java}/packs/cobol-kafka/prompts/plan.md +0 -0
  211. /package/{flows → kits/mainframe-java}/packs/cobol-kafka/prompts/review.md +0 -0
  212. /package/{flows → kits/mainframe-java}/packs/cobol-kafka/prompts/spec.md +0 -0
  213. /package/{flows → kits/mainframe-java}/packs/cobol-kafka/prompts/survey-refine.md +0 -0
  214. /package/{flows → kits/mainframe-java}/packs/cobol-kafka/prompts/survey-triage.md +0 -0
  215. /package/{flows → kits/mainframe-java}/packs/cobol-kafka/prompts/vectors.md +0 -0
  216. /package/{flows → kits/mainframe-java}/packs/cobol-kafka/reviewers/cobol-fidelity.md +0 -0
  217. /package/{flows → kits/mainframe-java}/packs/cobol-kafka/reviewers/pattern-conformance.md +0 -0
  218. /package/{flows/packs/jsp-bff-nextjs → kits/mainframe-java/packs/cobol-kafka}/reviewers/traceability.md +0 -0
  219. /package/{flows → kits/mainframe-java}/packs/cobol-springboot/lessons.md +0 -0
  220. /package/{flows → kits/mainframe-java}/packs/cobol-springboot/prompts/analysis.md +0 -0
  221. /package/{flows → kits/mainframe-java}/packs/cobol-springboot/prompts/bdd.md +0 -0
  222. /package/{flows → kits/mainframe-java}/packs/cobol-springboot/prompts/implement.md +0 -0
  223. /package/{flows → kits/mainframe-java}/packs/cobol-springboot/prompts/plan.md +0 -0
  224. /package/{flows → kits/mainframe-java}/packs/cobol-springboot/prompts/review.md +0 -0
  225. /package/{flows → kits/mainframe-java}/packs/cobol-springboot/prompts/spec.md +0 -0
  226. /package/{flows → kits/mainframe-java}/packs/cobol-springboot/prompts/survey-refine.md +0 -0
  227. /package/{flows → kits/mainframe-java}/packs/cobol-springboot/prompts/survey-triage.md +0 -0
  228. /package/{flows → kits/mainframe-java}/packs/cobol-springboot/prompts/vectors.md +0 -0
  229. /package/{flows → kits/mainframe-java}/packs/cobol-springboot/reviewers/cobol-fidelity.md +0 -0
  230. /package/{flows → kits/mainframe-java}/packs/cobol-springboot/reviewers/pattern-conformance.md +0 -0
  231. /package/{flows/packs/jsp-nextjs → kits/mainframe-java/packs/cobol-springboot}/reviewers/traceability.md +0 -0
  232. /package/{flows → kits/mainframe-java}/patterns/PAT-COBOL-001-comp3-money.md +0 -0
  233. /package/{flows → kits/mainframe-java}/patterns/PAT-COBOL-002-redefines.md +0 -0
  234. /package/{flows → kits/mainframe-java}/patterns/PAT-COBOL-003-88-levels.md +0 -0
  235. /package/{flows → kits/mainframe-java}/patterns/PAT-COBOL-004-perform-thru.md +0 -0
  236. /package/{flows → kits/mainframe-java}/patterns/PAT-COBOL-005-file-status.md +0 -0
  237. /package/{flows → kits/mainframe-java}/patterns/PAT-COBOL-006-sqlcode.md +0 -0
  238. /package/{flows → kits/mainframe-java}/patterns/PAT-COBOL-007-validation-order.md +0 -0
  239. /package/{flows → kits/mainframe-java}/patterns/PAT-COBOL-008-zoned-decimal.md +0 -0
  240. /package/{flows → kits/mainframe-java}/patterns/PAT-COBOL-009-occurs-table.md +0 -0
  241. /package/{flows → kits/mainframe-java}/patterns/PAT-COBOL-010-copybook-record.md +0 -0
  242. /package/{flows → kits/mainframe-java}/patterns/PAT-COBOL-011-batch-counters.md +0 -0
  243. /package/{flows → kits/mainframe-java}/patterns/PAT-COBOL-012-commit-frequency.md +0 -0
  244. /package/{flows → kits/mainframe-java}/patterns/PAT-COBOL-013-abend.md +0 -0
  245. /package/{flows → kits/mainframe-java}/patterns/PAT-COBOL-014-reject-file.md +0 -0
  246. /package/{flows → kits/mainframe-java}/patterns/PAT-COBOL-015-accept-date.md +0 -0
  247. /package/{flows → kits/mainframe-java}/patterns/PAT-COBOL-016-string-building.md +0 -0
  248. /package/{flows → kits/mainframe-java}/patterns/PAT-COBOL-017-cursor-loop.md +0 -0
  249. /package/{flows → kits/mainframe-java}/patterns/PAT-COBOL-018-yn-switches.md +0 -0
  250. /package/{flows → kits/mainframe-java}/patterns/PAT-COBOL-019-shared-accumulators.md +0 -0
  251. /package/{flows → kits/mainframe-java}/patterns/PAT-COBOL-020-tiered-fees.md +0 -0
  252. /package/{flows → kits/mainframe-java}/patterns/PAT-COBOL-021-overdraft-floor.md +0 -0
  253. /package/{flows → kits/mainframe-java}/patterns/PAT-COBOL-022-jcl-job-net.md +0 -0
  254. /package/{flows → kits/mainframe-java}/patterns/PAT-COBOL-023-sort-step.md +0 -0
  255. /package/{flows → kits/mainframe-java}/patterns/PAT-COBOL-024-fixed-width-records.md +0 -0
  256. /package/{flows → kits/mainframe-java}/patterns/PAT-COBOL-025-audit-rows.md +0 -0
  257. /package/{flows/fixtures → kits/mainframe-java}/scaffolds/kafka-streams-service/README.md +0 -0
  258. /package/{flows/fixtures → kits/mainframe-java}/scaffolds/kafka-streams-service/pom.xml +0 -0
  259. /package/{flows/fixtures → kits/mainframe-java}/scaffolds/kafka-streams-service/scripts/replay.sh +0 -0
  260. /package/{flows/fixtures → kits/mainframe-java}/scaffolds/kafka-streams-service/src/main/java/com/meridian/scaffold/Application.java +0 -0
  261. /package/{flows/fixtures → kits/mainframe-java}/scaffolds/kafka-streams-service/src/test/java/com/meridian/scaffold/ApplicationTests.java +0 -0
  262. /package/{flows/fixtures/scaffolds/spring-bff → kits/mainframe-java/scaffolds/kafka-streams-service}/src/test/resources/features/.gitkeep +0 -0
  263. /package/{flows/fixtures → kits/mainframe-java}/scaffolds/spring-boot-service/README.md +0 -0
  264. /package/{flows/fixtures → kits/mainframe-java}/scaffolds/spring-boot-service/pom.xml +0 -0
  265. /package/{flows/fixtures → kits/mainframe-java}/scaffolds/spring-boot-service/scripts/replay.sh +0 -0
  266. /package/{flows/fixtures → kits/mainframe-java}/scaffolds/spring-boot-service/src/main/java/com/meridian/scaffold/Application.java +0 -0
  267. /package/{flows/fixtures → kits/mainframe-java}/scaffolds/spring-boot-service/src/main/resources/application.yaml +0 -0
  268. /package/{flows/fixtures → kits/mainframe-java}/scaffolds/spring-boot-service/src/test/java/com/meridian/scaffold/ApplicationTests.java +0 -0
  269. /package/{flows/fixtures → kits/mainframe-java}/scaffolds/spring-boot-service/src/test/resources/features/.gitkeep +0 -0
@@ -0,0 +1,49 @@
1
+ package com.demobank.legacy.dto;
2
+
3
+ import java.io.Serializable;
4
+
5
+ /**
6
+ * Beneficiary DTO for list and maintenance (ESB_BENF_LIST / ESB_BENF_MAINT).
7
+ * Field abbreviations follow host copybook CBBENF02.
8
+ *
9
+ * @author rmasi (2010)
10
+ */
11
+ public class BenfDTO implements Serializable {
12
+
13
+ private static final long serialVersionUID = 1L;
14
+
15
+ /** Beneficiary id assigned by the host, e.g. "B0001". */
16
+ private String benfId;
17
+ /** Beneficiary display name, host field CHAR(60). */
18
+ private String benfNm;
19
+ /** Beneficiary IBAN, stored without spaces on the host. */
20
+ private String benfIban;
21
+ /** Beneficiary bank display name (optional for EUR/SEPA). */
22
+ private String bankNm;
23
+ /** Preferred currency for transfers to this beneficiary. */
24
+ private String ccyCd;
25
+ /** Y when the beneficiary passed host-side vetting. */
26
+ private String vrfFlg;
27
+
28
+ public BenfDTO() {
29
+ // bean constructor
30
+ }
31
+
32
+ public String getBenfId() { return benfId; }
33
+ public void setBenfId(String benfId) { this.benfId = benfId; }
34
+
35
+ public String getBenfNm() { return benfNm; }
36
+ public void setBenfNm(String benfNm) { this.benfNm = benfNm; }
37
+
38
+ public String getBenfIban() { return benfIban; }
39
+ public void setBenfIban(String benfIban) { this.benfIban = benfIban; }
40
+
41
+ public String getBankNm() { return bankNm; }
42
+ public void setBankNm(String bankNm) { this.bankNm = bankNm; }
43
+
44
+ public String getCcyCd() { return ccyCd; }
45
+ public void setCcyCd(String ccyCd) { this.ccyCd = ccyCd; }
46
+
47
+ public String getVrfFlg() { return vrfFlg; }
48
+ public void setVrfFlg(String vrfFlg) { this.vrfFlg = vrfFlg; }
49
+ }
@@ -0,0 +1,70 @@
1
+ package com.demobank.legacy.dto;
2
+
3
+ import java.io.Serializable;
4
+ import java.math.BigDecimal;
5
+
6
+ /**
7
+ * Wire transfer result DTO, populated from ESB_TRF_VAL / ESB_TRF_EXEC
8
+ * responses (host copybook CBTRF03). Rendered by transferConfirm.jsp.
9
+ *
10
+ * @author lgreco (2011)
11
+ */
12
+ public class TrfDTO implements Serializable {
13
+
14
+ private static final long serialVersionUID = 1L;
15
+
16
+ /** Host transfer reference, e.g. "TRF20130115000042". */
17
+ private String trfRef;
18
+ /** OK or KO after execution. */
19
+ private String status;
20
+ /** Host return code, "0000" on success. */
21
+ private String hostRc;
22
+ /** Host message text (uppercase, host encoding). */
23
+ private String hostMsg;
24
+ /** Echoed beneficiary name. */
25
+ private String benfNm;
26
+ /** Echoed beneficiary IBAN. */
27
+ private String benfIban;
28
+ /** Transfer amount. */
29
+ private BigDecimal trfAmt;
30
+ /** Transfer currency (EUR only online). */
31
+ private String trfCcy;
32
+ /** Settlement value date, dd/MM/yyyy presentation form. */
33
+ private String valDt;
34
+ /** Fee charged, standard SEPA schedule. */
35
+ private BigDecimal feeAmt;
36
+
37
+ public TrfDTO() {
38
+ // bean constructor
39
+ }
40
+
41
+ public String getTrfRef() { return trfRef; }
42
+ public void setTrfRef(String trfRef) { this.trfRef = trfRef; }
43
+
44
+ public String getStatus() { return status; }
45
+ public void setStatus(String status) { this.status = status; }
46
+
47
+ public String getHostRc() { return hostRc; }
48
+ public void setHostRc(String hostRc) { this.hostRc = hostRc; }
49
+
50
+ public String getHostMsg() { return hostMsg; }
51
+ public void setHostMsg(String hostMsg) { this.hostMsg = hostMsg; }
52
+
53
+ public String getBenfNm() { return benfNm; }
54
+ public void setBenfNm(String benfNm) { this.benfNm = benfNm; }
55
+
56
+ public String getBenfIban() { return benfIban; }
57
+ public void setBenfIban(String benfIban) { this.benfIban = benfIban; }
58
+
59
+ public BigDecimal getTrfAmt() { return trfAmt; }
60
+ public void setTrfAmt(BigDecimal trfAmt) { this.trfAmt = trfAmt; }
61
+
62
+ public String getTrfCcy() { return trfCcy; }
63
+ public void setTrfCcy(String trfCcy) { this.trfCcy = trfCcy; }
64
+
65
+ public String getValDt() { return valDt; }
66
+ public void setValDt(String valDt) { this.valDt = valDt; }
67
+
68
+ public BigDecimal getFeeAmt() { return feeAmt; }
69
+ public void setFeeAmt(BigDecimal feeAmt) { this.feeAmt = feeAmt; }
70
+ }
@@ -0,0 +1,53 @@
1
+ package com.demobank.legacy.esb;
2
+
3
+ import java.math.BigDecimal;
4
+ import java.util.ArrayList;
5
+ import java.util.HashMap;
6
+ import java.util.List;
7
+ import java.util.Map;
8
+
9
+ import com.demobank.legacy.dto.AcctOvwDTO;
10
+
11
+ /**
12
+ * Wrapper around host service ESB_ACCT_LIST (account position inquiry,
13
+ * Cobol routine ACCTLST on the core banking host).
14
+ *
15
+ * Request copybook fields: CUST-ID.
16
+ * Response: repeating group ACCT-ROW (ACCT-NO, ACCT-IBAN, ACCT-DESC,
17
+ * CCY-CD, CUR-BAL, AVL-BAL, STA-CD), max 20 occurrences.
18
+ *
19
+ * @author gferri (2008)
20
+ */
21
+ public class EsbAcctListService {
22
+
23
+ public static final String SVC_ID = "ESB_ACCT_LIST";
24
+
25
+ /**
26
+ * List all accounts for a customer, closed ones excluded host-side.
27
+ */
28
+ public List listAccounts(String custId) throws EsbException {
29
+ Map in = new HashMap();
30
+ in.put("CUST-ID", custId);
31
+
32
+ Map out = EsbGateway.getInstance().invoke(SVC_ID, in);
33
+
34
+ List rows = (List) out.get("ACCT-ROW");
35
+ List result = new ArrayList();
36
+ if (rows != null) {
37
+ for (int i = 0; i < rows.size(); i++) {
38
+ Map r = (Map) rows.get(i);
39
+ AcctOvwDTO dto = new AcctOvwDTO();
40
+ dto.setAcctNo((String) r.get("ACCT-NO"));
41
+ dto.setAcctIban((String) r.get("ACCT-IBAN"));
42
+ dto.setAcctDesc((String) r.get("ACCT-DESC"));
43
+ dto.setCcyCd((String) r.get("CCY-CD"));
44
+ // Host sends amounts as implied-decimal strings.
45
+ dto.setCurBal(new BigDecimal((String) r.get("CUR-BAL")));
46
+ dto.setAvlBal(new BigDecimal((String) r.get("AVL-BAL")));
47
+ dto.setStaCd((String) r.get("STA-CD"));
48
+ result.add(dto);
49
+ }
50
+ }
51
+ return result;
52
+ }
53
+ }
@@ -0,0 +1,58 @@
1
+ package com.demobank.legacy.esb;
2
+
3
+ import java.util.ArrayList;
4
+ import java.util.HashMap;
5
+ import java.util.List;
6
+ import java.util.Map;
7
+
8
+ import com.demobank.legacy.dto.BenfDTO;
9
+
10
+ /**
11
+ * Wrapper around host service ESB_BENF_LIST (beneficiary book inquiry,
12
+ * Cobol routine BENFLST).
13
+ *
14
+ * Request: CUST-ID, optional BENF-ID for a single-row read.
15
+ * Response: repeating group BENF-ROW (BENF-ID, BENF-NM, BENF-IBAN,
16
+ * BANK-NM, CCY-CD, VRF-FLG), max 50 occurrences.
17
+ *
18
+ * @author rmasi (2010)
19
+ */
20
+ public class EsbBenfListService {
21
+
22
+ public static final String SVC_ID = "ESB_BENF_LIST";
23
+
24
+ public List listBeneficiaries(String custId) throws EsbException {
25
+ Map in = new HashMap();
26
+ in.put("CUST-ID", custId);
27
+ Map out = EsbGateway.getInstance().invoke(SVC_ID, in);
28
+ return toDtos((List) out.get("BENF-ROW"));
29
+ }
30
+
31
+ /** Single beneficiary read; returns null when the host says not found. */
32
+ public BenfDTO getBeneficiary(String custId, String benfId) throws EsbException {
33
+ Map in = new HashMap();
34
+ in.put("CUST-ID", custId);
35
+ in.put("BENF-ID", benfId);
36
+ Map out = EsbGateway.getInstance().invoke(SVC_ID, in);
37
+ List dtos = toDtos((List) out.get("BENF-ROW"));
38
+ return dtos.isEmpty() ? null : (BenfDTO) dtos.get(0);
39
+ }
40
+
41
+ private List toDtos(List rows) {
42
+ List result = new ArrayList();
43
+ if (rows != null) {
44
+ for (int i = 0; i < rows.size(); i++) {
45
+ Map r = (Map) rows.get(i);
46
+ BenfDTO dto = new BenfDTO();
47
+ dto.setBenfId((String) r.get("BENF-ID"));
48
+ dto.setBenfNm((String) r.get("BENF-NM"));
49
+ dto.setBenfIban((String) r.get("BENF-IBAN"));
50
+ dto.setBankNm((String) r.get("BANK-NM"));
51
+ dto.setCcyCd((String) r.get("CCY-CD"));
52
+ dto.setVrfFlg((String) r.get("VRF-FLG"));
53
+ result.add(dto);
54
+ }
55
+ }
56
+ return result;
57
+ }
58
+ }
@@ -0,0 +1,58 @@
1
+ package com.demobank.legacy.esb;
2
+
3
+ import java.util.HashMap;
4
+ import java.util.Map;
5
+
6
+ import com.demobank.legacy.dto.BenfDTO;
7
+
8
+ /**
9
+ * Wrapper around host service ESB_BENF_MAINT (beneficiary maintenance,
10
+ * Cobol routine BENFMNT). One service, three ops -- the host multiplexes
11
+ * on MAINT-OP: I=insert, U=update, D=delete.
12
+ *
13
+ * Business return codes seen in the wild:
14
+ * 0000 ok
15
+ * 0102 duplicate IBAN for customer
16
+ * 0107 beneficiary vetting failed (embargo list)
17
+ * 0110 book full (max 50 beneficiaries)
18
+ *
19
+ * @author rmasi (2010)
20
+ */
21
+ public class EsbBenfMaintService {
22
+
23
+ public static final String SVC_ID = "ESB_BENF_MAINT";
24
+
25
+ /** Insert or update depending on whether dto.benfId is set. */
26
+ public String save(String custId, BenfDTO dto) throws EsbException {
27
+ Map in = new HashMap();
28
+ in.put("CUST-ID", custId);
29
+ in.put("MAINT-OP", isEmpty(dto.getBenfId()) ? "I" : "U");
30
+ in.put("BENF-ID", dto.getBenfId());
31
+ in.put("BENF-NM", dto.getBenfNm());
32
+ // Host stores the IBAN without spaces.
33
+ in.put("BENF-IBAN", dto.getBenfIban() == null
34
+ ? null : dto.getBenfIban().replaceAll(" ", ""));
35
+ in.put("BANK-NM", dto.getBankNm());
36
+ in.put("CCY-CD", dto.getCcyCd());
37
+
38
+ Map out = EsbGateway.getInstance().invoke(SVC_ID, in);
39
+ String rc = (String) out.get("HOST-RC");
40
+ if (!"0000".equals(rc)) {
41
+ return rc; // business rejection, servlet renders the message
42
+ }
43
+ return "0000";
44
+ }
45
+
46
+ public String delete(String custId, String benfId) throws EsbException {
47
+ Map in = new HashMap();
48
+ in.put("CUST-ID", custId);
49
+ in.put("MAINT-OP", "D");
50
+ in.put("BENF-ID", benfId);
51
+ Map out = EsbGateway.getInstance().invoke(SVC_ID, in);
52
+ return (String) out.get("HOST-RC");
53
+ }
54
+
55
+ private boolean isEmpty(String s) {
56
+ return s == null || s.trim().length() == 0;
57
+ }
58
+ }
@@ -0,0 +1,21 @@
1
+ package com.demobank.legacy.esb;
2
+
3
+ /**
4
+ * Transport-level ESB failure (router down, timeout, bridge error).
5
+ * Business return codes travel inside the response map instead.
6
+ */
7
+ public class EsbException extends Exception {
8
+
9
+ private static final long serialVersionUID = 1L;
10
+
11
+ private final String esbRc;
12
+
13
+ public EsbException(String message, String esbRc) {
14
+ super(message);
15
+ this.esbRc = esbRc;
16
+ }
17
+
18
+ public String getEsbRc() {
19
+ return esbRc;
20
+ }
21
+ }
@@ -0,0 +1,44 @@
1
+ package com.demobank.legacy.esb;
2
+
3
+ import java.util.Map;
4
+
5
+ /**
6
+ * Thin client for the DemoBank ESB router. Every host service is addressed
7
+ * by its service id (the Cobol-ish routine name, e.g. "ESB_ACCT_LIST").
8
+ *
9
+ * In production this speaks the fixed-length message protocol over the
10
+ * MQ bridge (endpoint from context-param demobank.esb.endpoint). In this
11
+ * synthetic fixture it is a stub: the wrappers are what matter, the wire
12
+ * never happens.
13
+ *
14
+ * @author esb-team (2007)
15
+ */
16
+ public final class EsbGateway {
17
+
18
+ private static final EsbGateway INSTANCE = new EsbGateway();
19
+
20
+ public static EsbGateway getInstance() {
21
+ return INSTANCE;
22
+ }
23
+
24
+ private EsbGateway() {
25
+ // singleton since 2007; the app server pools nothing here
26
+ }
27
+
28
+ /**
29
+ * Invoke a host service. Input and output are flat field maps keyed by
30
+ * copybook field name; conversion to/from the fixed-length host record
31
+ * is done by the (notional) message dictionary.
32
+ *
33
+ * @param svcId host service id, e.g. "ESB_TRF_EXEC"
34
+ * @param in request fields (copybook names)
35
+ * @return response fields, always containing HOST-RC and HOST-MSG
36
+ * @throws EsbException when the router is unreachable or times out
37
+ */
38
+ public Map invoke(String svcId, Map in) throws EsbException {
39
+ // Fixture stub. Real implementation: build fixed-length record,
40
+ // send via MQ bridge, parse response, map RC != 0000 to EsbException
41
+ // for transport-level codes only (90xx range).
42
+ throw new EsbException("ESB router not available in fixture", "9001");
43
+ }
44
+ }
@@ -0,0 +1,53 @@
1
+ package com.demobank.legacy.esb;
2
+
3
+ import java.math.BigDecimal;
4
+ import java.util.HashMap;
5
+ import java.util.Map;
6
+
7
+ import com.demobank.legacy.dto.TrfDTO;
8
+ import com.demobank.legacy.web.TransferDraft;
9
+
10
+ /**
11
+ * Wrapper around host service ESB_TRF_EXEC (wire transfer execution,
12
+ * Cobol routine TRFEXC). Debits the account and books the SEPA payment.
13
+ * MUST be preceded by a successful ESB_TRF_VAL in the same session --
14
+ * the host cross-checks the validation token (VAL-TOKEN).
15
+ *
16
+ * Idempotency: the host dedupes on (CUST-ID, VAL-TOKEN), so a double
17
+ * submit of step 3 returns the original reference instead of paying twice.
18
+ *
19
+ * @author lgreco (2011)
20
+ */
21
+ public class EsbTrfExecService {
22
+
23
+ public static final String SVC_ID = "ESB_TRF_EXEC";
24
+
25
+ public TrfDTO execute(String custId, TransferDraft draft) throws EsbException {
26
+ Map in = new HashMap();
27
+ in.put("CUST-ID", custId);
28
+ in.put("VAL-TOKEN", draft.getValToken());
29
+ in.put("BENF-ID", draft.getBenfId());
30
+ in.put("TRF-AMT", draft.getTrfAmt().toPlainString());
31
+ in.put("TRF-CCY", draft.getTrfCcy());
32
+ in.put("TRF-DESC", draft.getTrfDesc());
33
+ in.put("VAL-DT", draft.getValDt());
34
+
35
+ Map out = EsbGateway.getInstance().invoke(SVC_ID, in);
36
+
37
+ TrfDTO res = new TrfDTO();
38
+ String rc = (String) out.get("HOST-RC");
39
+ res.setHostRc(rc);
40
+ res.setHostMsg((String) out.get("HOST-MSG"));
41
+ res.setStatus("0000".equals(rc) ? "OK" : "KO");
42
+ if ("0000".equals(rc)) {
43
+ res.setTrfRef((String) out.get("TRF-REF"));
44
+ res.setBenfNm(draft.getBenfNm());
45
+ res.setBenfIban(draft.getBenfIban());
46
+ res.setTrfAmt(draft.getTrfAmt());
47
+ res.setTrfCcy(draft.getTrfCcy());
48
+ res.setValDt((String) out.get("VAL-DT"));
49
+ res.setFeeAmt(new BigDecimal((String) out.get("FEE-AMT")));
50
+ }
51
+ return res;
52
+ }
53
+ }
@@ -0,0 +1,45 @@
1
+ package com.demobank.legacy.esb;
2
+
3
+ import java.math.BigDecimal;
4
+ import java.util.HashMap;
5
+ import java.util.Map;
6
+
7
+ import com.demobank.legacy.web.TransferDraft;
8
+
9
+ /**
10
+ * Wrapper around host service ESB_TRF_VAL (wire transfer pre-validation,
11
+ * Cobol routine TRFVAL). Checks funds, limits, embargo, cut-off; computes
12
+ * the fee and the first available value date. Does NOT move money.
13
+ *
14
+ * The draft is enriched in place with FEE-AMT and VAL-DT from the host so
15
+ * step 2 (review) shows exactly what execution will use.
16
+ *
17
+ * @author lgreco (2011)
18
+ */
19
+ public class EsbTrfValidateService {
20
+
21
+ public static final String SVC_ID = "ESB_TRF_VAL";
22
+
23
+ /**
24
+ * @return host RC: "0000" when the transfer may proceed, otherwise a
25
+ * business rejection (e.g. 0201 insufficient funds, 0205 daily
26
+ * limit exceeded, 0207 embargo hit).
27
+ */
28
+ public String validate(String custId, TransferDraft draft) throws EsbException {
29
+ Map in = new HashMap();
30
+ in.put("CUST-ID", custId);
31
+ in.put("BENF-ID", draft.getBenfId());
32
+ in.put("TRF-AMT", draft.getTrfAmt().toPlainString());
33
+ in.put("TRF-CCY", draft.getTrfCcy());
34
+ in.put("TRF-DESC", draft.getTrfDesc());
35
+ in.put("VAL-DT", draft.getValDt());
36
+
37
+ Map out = EsbGateway.getInstance().invoke(SVC_ID, in);
38
+ String rc = (String) out.get("HOST-RC");
39
+ if ("0000".equals(rc)) {
40
+ draft.setFeeAmt(new BigDecimal((String) out.get("FEE-AMT")));
41
+ draft.setValDt((String) out.get("VAL-DT"));
42
+ }
43
+ return rc;
44
+ }
45
+ }
@@ -0,0 +1,90 @@
1
+ package com.demobank.legacy.web;
2
+
3
+ import java.io.IOException;
4
+ import java.io.PrintWriter;
5
+ import java.text.SimpleDateFormat;
6
+ import java.util.Date;
7
+ import java.util.List;
8
+
9
+ import javax.servlet.RequestDispatcher;
10
+ import javax.servlet.ServletException;
11
+ import javax.servlet.http.HttpServlet;
12
+ import javax.servlet.http.HttpServletRequest;
13
+ import javax.servlet.http.HttpServletResponse;
14
+ import javax.servlet.http.HttpSession;
15
+
16
+ import com.demobank.legacy.dto.AcctOvwDTO;
17
+ import com.demobank.legacy.esb.EsbAcctListService;
18
+ import com.demobank.legacy.esb.EsbException;
19
+
20
+ /**
21
+ * HERO 1 controller. GET /accountOverview
22
+ *
23
+ * Two response modes on the same mapping (period-typical):
24
+ * - default: fetch positions, put "accts" + "asOfTs" in request scope,
25
+ * forward to accountOverview.jsp (server-rendered JSTL table)
26
+ * - fmt=json: hand-rolled JSON for the jQuery balance refresh
27
+ *
28
+ * ESB dependency: ESB_ACCT_LIST via EsbAcctListService.
29
+ */
30
+ public class AccountOverviewServlet extends HttpServlet {
31
+
32
+ private static final long serialVersionUID = 1L;
33
+
34
+ private final EsbAcctListService acctListService = new EsbAcctListService();
35
+
36
+ protected void doGet(HttpServletRequest request, HttpServletResponse response)
37
+ throws ServletException, IOException {
38
+
39
+ HttpSession session = request.getSession(true);
40
+ String custId = (String) session.getAttribute("custId");
41
+ if (custId == null) {
42
+ custId = "CUST0042"; // fixture default, real portal redirects to login
43
+ session.setAttribute("custId", custId);
44
+ }
45
+
46
+ List accts;
47
+ try {
48
+ accts = acctListService.listAccounts(custId);
49
+ } catch (EsbException e) {
50
+ // Legacy behaviour: log to stdout and render an empty list.
51
+ System.out.println("ESB_ACCT_LIST failed rc=" + e.getEsbRc()
52
+ + " msg=" + e.getMessage());
53
+ accts = new java.util.ArrayList();
54
+ }
55
+
56
+ String asOfTs = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss").format(new Date());
57
+
58
+ if ("json".equals(request.getParameter("fmt"))) {
59
+ writeJson(response, accts, asOfTs);
60
+ return;
61
+ }
62
+
63
+ request.setAttribute("accts", accts);
64
+ request.setAttribute("asOfTs", asOfTs);
65
+ RequestDispatcher rd = request.getRequestDispatcher("/accountOverview.jsp");
66
+ rd.forward(request, response);
67
+ }
68
+
69
+ /**
70
+ * Hand-rolled JSON (predates any JSON library approval, DB-1893).
71
+ * Escaping is minimal because host descriptions are uppercase A-Z0-9.
72
+ */
73
+ private void writeJson(HttpServletResponse response, List accts, String asOfTs)
74
+ throws IOException {
75
+ response.setContentType("application/json");
76
+ response.setHeader("Cache-Control", "no-cache");
77
+ PrintWriter out = response.getWriter();
78
+ out.print("{\"asOfTs\":\"" + asOfTs + "\",\"accts\":[");
79
+ for (int i = 0; i < accts.size(); i++) {
80
+ AcctOvwDTO a = (AcctOvwDTO) accts.get(i);
81
+ if (i > 0) out.print(",");
82
+ out.print("{\"acctNo\":\"" + a.getAcctNo() + "\"");
83
+ out.print(",\"ccyCd\":\"" + a.getCcyCd() + "\"");
84
+ out.print(",\"curBal\":\"" + a.getCurBal().toPlainString() + "\"");
85
+ out.print(",\"avlBal\":\"" + a.getAvlBal().toPlainString() + "\"}");
86
+ }
87
+ out.print("]}");
88
+ out.flush();
89
+ }
90
+ }