@llm4ts/shell 0.17.0 → 0.18.0
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.
- package/dist/Cli.d.ts +4 -0
- package/dist/Cli.d.ts.map +1 -1
- package/dist/Cli.js +69 -8
- package/dist/Cli.js.map +1 -1
- package/dist/FlowCatalog.d.ts +10 -4
- package/dist/FlowCatalog.d.ts.map +1 -1
- package/dist/FlowCatalog.js +25 -14
- package/dist/FlowCatalog.js.map +1 -1
- package/flows/epic-stories.js +1 -8
- package/flows/hello.js +15 -0
- package/flows/implement.js +1 -8
- package/flows/issue-pr.js +1 -8
- package/flows/judge-suite.js +1 -4
- package/flows/lib/epic-stories.js +3 -4
- package/flows/local.js +2 -5
- package/flows/modernize-bench.js +3 -12
- package/flows/modernize-extract.js +8 -18
- package/flows/modernize-implement.js +4 -15
- package/flows/modernize-pack-check.js +1 -8
- package/flows/modernize-review.js +4 -13
- package/flows/modernize-seed.js +3 -11
- package/flows/modernize-survey.js +0 -0
- package/flows/modernize-verify.js +5 -13
- package/flows/sdd.js +2 -12
- package/kits/j2ee-nextjs/README.md +29 -0
- package/kits/j2ee-nextjs/fixtures/demo-bank/RUNBOOK.md +156 -0
- package/kits/j2ee-nextjs/fixtures/demo-bank/legacy-j2ee/PAGES.md +67 -0
- package/kits/j2ee-nextjs/fixtures/demo-bank/legacy-j2ee/pom.xml +49 -0
- package/kits/j2ee-nextjs/fixtures/demo-bank/legacy-j2ee/src/main/java/com/demobank/legacy/dto/AcctOvwDTO.java +58 -0
- package/kits/j2ee-nextjs/fixtures/demo-bank/legacy-j2ee/src/main/java/com/demobank/legacy/dto/BenfDTO.java +49 -0
- package/kits/j2ee-nextjs/fixtures/demo-bank/legacy-j2ee/src/main/java/com/demobank/legacy/dto/TrfDTO.java +70 -0
- package/kits/j2ee-nextjs/fixtures/demo-bank/legacy-j2ee/src/main/java/com/demobank/legacy/esb/EsbAcctListService.java +53 -0
- package/kits/j2ee-nextjs/fixtures/demo-bank/legacy-j2ee/src/main/java/com/demobank/legacy/esb/EsbBenfListService.java +58 -0
- package/kits/j2ee-nextjs/fixtures/demo-bank/legacy-j2ee/src/main/java/com/demobank/legacy/esb/EsbBenfMaintService.java +58 -0
- package/kits/j2ee-nextjs/fixtures/demo-bank/legacy-j2ee/src/main/java/com/demobank/legacy/esb/EsbException.java +21 -0
- package/kits/j2ee-nextjs/fixtures/demo-bank/legacy-j2ee/src/main/java/com/demobank/legacy/esb/EsbGateway.java +44 -0
- package/kits/j2ee-nextjs/fixtures/demo-bank/legacy-j2ee/src/main/java/com/demobank/legacy/esb/EsbTrfExecService.java +53 -0
- package/kits/j2ee-nextjs/fixtures/demo-bank/legacy-j2ee/src/main/java/com/demobank/legacy/esb/EsbTrfValidateService.java +45 -0
- package/kits/j2ee-nextjs/fixtures/demo-bank/legacy-j2ee/src/main/java/com/demobank/legacy/web/AccountOverviewServlet.java +90 -0
- package/kits/j2ee-nextjs/fixtures/demo-bank/legacy-j2ee/src/main/java/com/demobank/legacy/web/BeneficiaryServlet.java +195 -0
- package/kits/j2ee-nextjs/fixtures/demo-bank/legacy-j2ee/src/main/java/com/demobank/legacy/web/TransferDraft.java +62 -0
- package/kits/j2ee-nextjs/fixtures/demo-bank/legacy-j2ee/src/main/java/com/demobank/legacy/web/TransferServlet.java +223 -0
- package/kits/j2ee-nextjs/fixtures/demo-bank/legacy-j2ee/src/main/webapp/WEB-INF/web.xml +59 -0
- package/kits/j2ee-nextjs/fixtures/demo-bank/legacy-j2ee/src/main/webapp/accountOverview.jsp +65 -0
- package/kits/j2ee-nextjs/fixtures/demo-bank/legacy-j2ee/src/main/webapp/beneficiaryEdit.jsp +70 -0
- package/kits/j2ee-nextjs/fixtures/demo-bank/legacy-j2ee/src/main/webapp/beneficiaryList.jsp +43 -0
- package/kits/j2ee-nextjs/fixtures/demo-bank/legacy-j2ee/src/main/webapp/css/bank.css +132 -0
- package/kits/j2ee-nextjs/fixtures/demo-bank/legacy-j2ee/src/main/webapp/dashboard.jsp +28 -0
- package/kits/j2ee-nextjs/fixtures/demo-bank/legacy-j2ee/src/main/webapp/footer.jsp +8 -0
- package/kits/j2ee-nextjs/fixtures/demo-bank/legacy-j2ee/src/main/webapp/header.jsp +22 -0
- package/kits/j2ee-nextjs/fixtures/demo-bank/legacy-j2ee/src/main/webapp/help.jsp +32 -0
- package/kits/j2ee-nextjs/fixtures/demo-bank/legacy-j2ee/src/main/webapp/js/jquery-1.12.4.min.js +1 -0
- package/kits/j2ee-nextjs/fixtures/demo-bank/legacy-j2ee/src/main/webapp/js/validate.js +79 -0
- package/kits/j2ee-nextjs/fixtures/demo-bank/legacy-j2ee/src/main/webapp/login.jsp +29 -0
- package/kits/j2ee-nextjs/fixtures/demo-bank/legacy-j2ee/src/main/webapp/messages.jsp +34 -0
- package/kits/j2ee-nextjs/fixtures/demo-bank/legacy-j2ee/src/main/webapp/nav.jsp +14 -0
- package/kits/j2ee-nextjs/fixtures/demo-bank/legacy-j2ee/src/main/webapp/oldTransfer.jsp +34 -0
- package/kits/j2ee-nextjs/fixtures/demo-bank/legacy-j2ee/src/main/webapp/profile.jsp +26 -0
- package/kits/j2ee-nextjs/fixtures/demo-bank/legacy-j2ee/src/main/webapp/promoQ3.jsp +23 -0
- package/kits/j2ee-nextjs/fixtures/demo-bank/legacy-j2ee/src/main/webapp/settings.jsp +34 -0
- package/kits/j2ee-nextjs/fixtures/demo-bank/legacy-j2ee/src/main/webapp/testHarness.jsp +39 -0
- package/kits/j2ee-nextjs/fixtures/demo-bank/legacy-j2ee/src/main/webapp/transferConfirm.jsp +35 -0
- package/kits/j2ee-nextjs/fixtures/demo-bank/legacy-j2ee/src/main/webapp/transferStep1.jsp +73 -0
- package/kits/j2ee-nextjs/fixtures/demo-bank/legacy-j2ee/src/main/webapp/transferStep2.jsp +40 -0
- package/kits/j2ee-nextjs/fixtures/demo-bank/nextjs/CONTRIBUTING.md +76 -0
- package/kits/j2ee-nextjs/fixtures/demo-bank/nextjs/README.md +46 -0
- package/kits/j2ee-nextjs/fixtures/demo-bank/nextjs/contracts/cards.openapi.yaml +57 -0
- package/kits/j2ee-nextjs/fixtures/demo-bank/nextjs/contracts/profile.openapi.yaml +73 -0
- package/kits/j2ee-nextjs/fixtures/demo-bank/nextjs/eslint.config.mjs +24 -0
- package/kits/j2ee-nextjs/fixtures/demo-bank/nextjs/next-env.d.ts +5 -0
- package/kits/j2ee-nextjs/fixtures/demo-bank/nextjs/next.config.mjs +10 -0
- package/kits/j2ee-nextjs/fixtures/demo-bank/nextjs/package.json +29 -0
- package/kits/j2ee-nextjs/fixtures/demo-bank/nextjs/pnpm-lock.yaml +2895 -0
- package/kits/j2ee-nextjs/fixtures/demo-bank/nextjs/src/app/cards/page.tsx +62 -0
- package/kits/j2ee-nextjs/fixtures/demo-bank/nextjs/src/app/layout.tsx +41 -0
- package/kits/j2ee-nextjs/fixtures/demo-bank/nextjs/src/app/page.tsx +26 -0
- package/kits/j2ee-nextjs/fixtures/demo-bank/nextjs/src/app/profile/page.tsx +134 -0
- package/kits/j2ee-nextjs/fixtures/demo-bank/nextjs/src/app/signed-in-badge.tsx +9 -0
- package/kits/j2ee-nextjs/fixtures/demo-bank/nextjs/src/auth/AuthProvider.tsx +36 -0
- package/kits/j2ee-nextjs/fixtures/demo-bank/nextjs/src/components/Button.tsx +27 -0
- package/kits/j2ee-nextjs/fixtures/demo-bank/nextjs/src/components/Card.tsx +18 -0
- package/kits/j2ee-nextjs/fixtures/demo-bank/nextjs/src/components/DataTable.tsx +57 -0
- package/kits/j2ee-nextjs/fixtures/demo-bank/nextjs/src/components/Field.tsx +34 -0
- package/kits/j2ee-nextjs/fixtures/demo-bank/nextjs/src/components/Form.tsx +70 -0
- package/kits/j2ee-nextjs/fixtures/demo-bank/nextjs/src/components/PageLayout.tsx +39 -0
- package/kits/j2ee-nextjs/fixtures/demo-bank/nextjs/src/components/Stepper.tsx +29 -0
- package/kits/j2ee-nextjs/fixtures/demo-bank/nextjs/src/components/index.ts +19 -0
- package/kits/j2ee-nextjs/fixtures/demo-bank/nextjs/src/services/cards/mock.ts +47 -0
- package/kits/j2ee-nextjs/fixtures/demo-bank/nextjs/src/services/cards/port.ts +31 -0
- package/kits/j2ee-nextjs/fixtures/demo-bank/nextjs/src/services/profile/mock.ts +45 -0
- package/kits/j2ee-nextjs/fixtures/demo-bank/nextjs/src/services/profile/port.ts +24 -0
- package/kits/j2ee-nextjs/fixtures/demo-bank/nextjs/src/services/registry.ts +20 -0
- package/kits/j2ee-nextjs/fixtures/demo-bank/nextjs/src/theme/components.css +269 -0
- package/kits/j2ee-nextjs/fixtures/demo-bank/nextjs/src/theme/tokens.css +38 -0
- package/kits/j2ee-nextjs/fixtures/demo-bank/nextjs/tests/cards.page.test.tsx +81 -0
- package/kits/j2ee-nextjs/fixtures/demo-bank/nextjs/tests/profile.page.test.tsx +87 -0
- package/kits/j2ee-nextjs/fixtures/demo-bank/nextjs/tsconfig.json +54 -0
- package/kits/j2ee-nextjs/fixtures/demo-bank/nextjs/vitest.config.ts +17 -0
- package/kits/j2ee-nextjs/fixtures/demo-bank/preflight.mjs +45 -0
- package/kits/j2ee-nextjs/fixtures/demo-bank/reset-demo.mjs +40 -0
- package/kits/j2ee-nextjs/fixtures/demo-bank/seed-legacy-j2ee.mjs +71 -0
- package/kits/j2ee-nextjs/fixtures/demo-bank/seed-nextjs.mjs +111 -0
- package/kits/j2ee-nextjs/fixtures/demo-bank/smoke-legacy-j2ee.mjs +144 -0
- package/kits/j2ee-nextjs/fixtures/demo-bank/smoke-nextjs.mjs +118 -0
- package/{flows → kits/j2ee-nextjs/flows}/convert-all.js +1 -7
- package/{flows → kits/j2ee-nextjs/flows}/convert-page.js +2 -6
- package/{flows → kits/j2ee-nextjs/flows}/lib/convert.js +6 -16
- package/{flows → kits/j2ee-nextjs}/packs/j2ee-nextjs-spa/pack.md +1 -1
- package/{flows → kits/j2ee-nextjs}/packs/jsp-bff-nextjs/pack.md +1 -1
- package/{flows → kits/j2ee-nextjs}/packs/jsp-nextjs/pack.md +1 -1
- package/kits/mainframe-java/README.md +31 -0
- package/{flows → kits/mainframe-java}/packs/ace-integration/pack.md +1 -1
- package/{flows → kits/mainframe-java}/packs/ace-kafka/pack.md +1 -1
- package/{flows → kits/mainframe-java}/packs/cobol-kafka/pack.md +1 -1
- package/{flows → kits/mainframe-java}/packs/cobol-springboot/pack.md +1 -1
- package/package.json +6 -6
- package/src/Cli.ts +92 -9
- package/src/FlowCatalog.ts +29 -13
- /package/{flows → kits/j2ee-nextjs}/packs/j2ee-nextjs-spa/patterns/PAT-J2EE-001-jstl-table.md +0 -0
- /package/{flows → kits/j2ee-nextjs}/packs/j2ee-nextjs-spa/patterns/PAT-J2EE-002-jquery-validation.md +0 -0
- /package/{flows → kits/j2ee-nextjs}/packs/j2ee-nextjs-spa/patterns/PAT-J2EE-003-session-stepper.md +0 -0
- /package/{flows → kits/j2ee-nextjs}/packs/j2ee-nextjs-spa/patterns/PAT-J2EE-004-esb-port.md +0 -0
- /package/{flows → kits/j2ee-nextjs}/packs/j2ee-nextjs-spa/patterns/PAT-J2EE-005-include-shell.md +0 -0
- /package/{flows → kits/j2ee-nextjs}/packs/j2ee-nextjs-spa/prompts/analysis.md +0 -0
- /package/{flows → kits/j2ee-nextjs}/packs/j2ee-nextjs-spa/prompts/bdd.md +0 -0
- /package/{flows → kits/j2ee-nextjs}/packs/j2ee-nextjs-spa/prompts/implement.md +0 -0
- /package/{flows → kits/j2ee-nextjs}/packs/j2ee-nextjs-spa/prompts/plan.md +0 -0
- /package/{flows → kits/j2ee-nextjs}/packs/j2ee-nextjs-spa/prompts/review.md +0 -0
- /package/{flows → kits/j2ee-nextjs}/packs/j2ee-nextjs-spa/prompts/spec.md +0 -0
- /package/{flows → kits/j2ee-nextjs}/packs/j2ee-nextjs-spa/prompts/survey-refine.md +0 -0
- /package/{flows → kits/j2ee-nextjs}/packs/j2ee-nextjs-spa/prompts/survey-triage.md +0 -0
- /package/{flows → kits/j2ee-nextjs}/packs/j2ee-nextjs-spa/reviewers/acl-purity.md +0 -0
- /package/{flows → kits/j2ee-nextjs}/packs/j2ee-nextjs-spa/reviewers/house-style.md +0 -0
- /package/{flows → kits/j2ee-nextjs}/packs/jsp-bff-nextjs/lessons.md +0 -0
- /package/{flows → kits/j2ee-nextjs}/packs/jsp-bff-nextjs/prompts/analysis.md +0 -0
- /package/{flows → kits/j2ee-nextjs}/packs/jsp-bff-nextjs/prompts/bdd.md +0 -0
- /package/{flows → kits/j2ee-nextjs}/packs/jsp-bff-nextjs/prompts/implement.md +0 -0
- /package/{flows → kits/j2ee-nextjs}/packs/jsp-bff-nextjs/prompts/plan.md +0 -0
- /package/{flows → kits/j2ee-nextjs}/packs/jsp-bff-nextjs/prompts/review.md +0 -0
- /package/{flows → kits/j2ee-nextjs}/packs/jsp-bff-nextjs/prompts/spec.md +0 -0
- /package/{flows → kits/j2ee-nextjs}/packs/jsp-bff-nextjs/prompts/survey-refine.md +0 -0
- /package/{flows → kits/j2ee-nextjs}/packs/jsp-bff-nextjs/prompts/survey-triage.md +0 -0
- /package/{flows → kits/j2ee-nextjs}/packs/jsp-bff-nextjs/reviewers/bff-boundary.md +0 -0
- /package/{flows/packs/ace-integration → kits/j2ee-nextjs/packs/jsp-bff-nextjs}/reviewers/traceability.md +0 -0
- /package/{flows → kits/j2ee-nextjs}/packs/jsp-nextjs/lessons.md +0 -0
- /package/{flows → kits/j2ee-nextjs}/packs/jsp-nextjs/prompts/analysis.md +0 -0
- /package/{flows → kits/j2ee-nextjs}/packs/jsp-nextjs/prompts/bdd.md +0 -0
- /package/{flows → kits/j2ee-nextjs}/packs/jsp-nextjs/prompts/implement.md +0 -0
- /package/{flows → kits/j2ee-nextjs}/packs/jsp-nextjs/prompts/plan.md +0 -0
- /package/{flows → kits/j2ee-nextjs}/packs/jsp-nextjs/prompts/review.md +0 -0
- /package/{flows → kits/j2ee-nextjs}/packs/jsp-nextjs/prompts/spec.md +0 -0
- /package/{flows → kits/j2ee-nextjs}/packs/jsp-nextjs/prompts/survey-refine.md +0 -0
- /package/{flows → kits/j2ee-nextjs}/packs/jsp-nextjs/prompts/survey-triage.md +0 -0
- /package/{flows/packs/ace-kafka → kits/j2ee-nextjs/packs/jsp-nextjs}/reviewers/traceability.md +0 -0
- /package/{flows → kits/j2ee-nextjs}/packs/jsp-nextjs/reviewers/ux-fidelity.md +0 -0
- /package/{flows/fixtures → kits/j2ee-nextjs}/scaffolds/nextjs-spa/README.md +0 -0
- /package/{flows/fixtures → kits/j2ee-nextjs}/scaffolds/nextjs-spa/app/layout.js +0 -0
- /package/{flows/fixtures → kits/j2ee-nextjs}/scaffolds/nextjs-spa/app/page.js +0 -0
- /package/{flows/fixtures/scaffolds/kafka-streams-service/src/test/resources/features → kits/j2ee-nextjs/scaffolds/nextjs-spa/docs/specs}/.gitkeep +0 -0
- /package/{flows/fixtures/scaffolds/nextjs-spa/docs/specs → kits/j2ee-nextjs/scaffolds/nextjs-spa/features}/.gitkeep +0 -0
- /package/{flows/fixtures → kits/j2ee-nextjs}/scaffolds/nextjs-spa/next.config.js +0 -0
- /package/{flows/fixtures → kits/j2ee-nextjs}/scaffolds/nextjs-spa/package.json +0 -0
- /package/{flows/fixtures → kits/j2ee-nextjs}/scaffolds/nextjs-spa/tests/smoke.test.js +0 -0
- /package/{flows/fixtures → kits/j2ee-nextjs}/scaffolds/spring-bff/README.md +0 -0
- /package/{flows/fixtures → kits/j2ee-nextjs}/scaffolds/spring-bff/frontend/app/layout.js +0 -0
- /package/{flows/fixtures → kits/j2ee-nextjs}/scaffolds/spring-bff/frontend/app/page.js +0 -0
- /package/{flows/fixtures → kits/j2ee-nextjs}/scaffolds/spring-bff/frontend/next.config.js +0 -0
- /package/{flows/fixtures → kits/j2ee-nextjs}/scaffolds/spring-bff/frontend/package.json +0 -0
- /package/{flows/fixtures → kits/j2ee-nextjs}/scaffolds/spring-bff/frontend/tests/smoke.test.js +0 -0
- /package/{flows/fixtures → kits/j2ee-nextjs}/scaffolds/spring-bff/pom.xml +0 -0
- /package/{flows/fixtures → kits/j2ee-nextjs}/scaffolds/spring-bff/scripts/test.sh +0 -0
- /package/{flows/fixtures → kits/j2ee-nextjs}/scaffolds/spring-bff/src/main/java/com/meridian/bff/Application.java +0 -0
- /package/{flows/fixtures → kits/j2ee-nextjs}/scaffolds/spring-bff/src/main/resources/application.yaml +0 -0
- /package/{flows/fixtures → kits/j2ee-nextjs}/scaffolds/spring-bff/src/test/java/com/meridian/bff/ApplicationTests.java +0 -0
- /package/{flows/fixtures/scaffolds/nextjs-spa → kits/j2ee-nextjs/scaffolds/spring-bff/src/test/resources}/features/.gitkeep +0 -0
- /package/{flows → kits/mainframe-java}/packs/ace-integration/lessons.md +0 -0
- /package/{flows → kits/mainframe-java}/packs/ace-integration/prompts/analysis.md +0 -0
- /package/{flows → kits/mainframe-java}/packs/ace-integration/prompts/bdd.md +0 -0
- /package/{flows → kits/mainframe-java}/packs/ace-integration/prompts/implement.md +0 -0
- /package/{flows → kits/mainframe-java}/packs/ace-integration/prompts/plan.md +0 -0
- /package/{flows → kits/mainframe-java}/packs/ace-integration/prompts/review.md +0 -0
- /package/{flows → kits/mainframe-java}/packs/ace-integration/prompts/spec.md +0 -0
- /package/{flows → kits/mainframe-java}/packs/ace-integration/reviewers/routing-fidelity.md +0 -0
- /package/{flows/packs/cobol-kafka → kits/mainframe-java/packs/ace-integration}/reviewers/traceability.md +0 -0
- /package/{flows → kits/mainframe-java}/packs/ace-kafka/lessons.md +0 -0
- /package/{flows → kits/mainframe-java}/packs/ace-kafka/prompts/analysis.md +0 -0
- /package/{flows → kits/mainframe-java}/packs/ace-kafka/prompts/bdd.md +0 -0
- /package/{flows → kits/mainframe-java}/packs/ace-kafka/prompts/implement.md +0 -0
- /package/{flows → kits/mainframe-java}/packs/ace-kafka/prompts/plan.md +0 -0
- /package/{flows → kits/mainframe-java}/packs/ace-kafka/prompts/review.md +0 -0
- /package/{flows → kits/mainframe-java}/packs/ace-kafka/prompts/spec.md +0 -0
- /package/{flows → kits/mainframe-java}/packs/ace-kafka/prompts/vectors.md +0 -0
- /package/{flows → kits/mainframe-java}/packs/ace-kafka/reviewers/event-contracts.md +0 -0
- /package/{flows → kits/mainframe-java}/packs/ace-kafka/reviewers/routing-fidelity.md +0 -0
- /package/{flows/packs/cobol-springboot → kits/mainframe-java/packs/ace-kafka}/reviewers/traceability.md +0 -0
- /package/{flows → kits/mainframe-java}/packs/cobol-kafka/lessons.md +0 -0
- /package/{flows → kits/mainframe-java}/packs/cobol-kafka/patterns/PAT-STREAM-001-record-to-event.md +0 -0
- /package/{flows → kits/mainframe-java}/packs/cobol-kafka/patterns/PAT-STREAM-002-job-step-topology.md +0 -0
- /package/{flows → kits/mainframe-java}/packs/cobol-kafka/patterns/PAT-STREAM-003-checkpoint-idempotence.md +0 -0
- /package/{flows → kits/mainframe-java}/packs/cobol-kafka/patterns/PAT-STREAM-004-eod-totals-window.md +0 -0
- /package/{flows → kits/mainframe-java}/packs/cobol-kafka/patterns/PAT-STREAM-005-reject-topic.md +0 -0
- /package/{flows → kits/mainframe-java}/packs/cobol-kafka/patterns/PAT-STREAM-006-keyed-state-store.md +0 -0
- /package/{flows → kits/mainframe-java}/packs/cobol-kafka/patterns/PAT-STREAM-007-outbox.md +0 -0
- /package/{flows → kits/mainframe-java}/packs/cobol-kafka/patterns/PAT-STREAM-008-partition-key.md +0 -0
- /package/{flows → kits/mainframe-java}/packs/cobol-kafka/patterns/PAT-STREAM-009-batch-window-cutoff.md +0 -0
- /package/{flows → kits/mainframe-java}/packs/cobol-kafka/patterns/PAT-STREAM-010-replay-backfill.md +0 -0
- /package/{flows → kits/mainframe-java}/packs/cobol-kafka/prompts/analysis.md +0 -0
- /package/{flows → kits/mainframe-java}/packs/cobol-kafka/prompts/bdd.md +0 -0
- /package/{flows → kits/mainframe-java}/packs/cobol-kafka/prompts/implement.md +0 -0
- /package/{flows → kits/mainframe-java}/packs/cobol-kafka/prompts/plan.md +0 -0
- /package/{flows → kits/mainframe-java}/packs/cobol-kafka/prompts/review.md +0 -0
- /package/{flows → kits/mainframe-java}/packs/cobol-kafka/prompts/spec.md +0 -0
- /package/{flows → kits/mainframe-java}/packs/cobol-kafka/prompts/survey-refine.md +0 -0
- /package/{flows → kits/mainframe-java}/packs/cobol-kafka/prompts/survey-triage.md +0 -0
- /package/{flows → kits/mainframe-java}/packs/cobol-kafka/prompts/vectors.md +0 -0
- /package/{flows → kits/mainframe-java}/packs/cobol-kafka/reviewers/cobol-fidelity.md +0 -0
- /package/{flows → kits/mainframe-java}/packs/cobol-kafka/reviewers/pattern-conformance.md +0 -0
- /package/{flows/packs/jsp-bff-nextjs → kits/mainframe-java/packs/cobol-kafka}/reviewers/traceability.md +0 -0
- /package/{flows → kits/mainframe-java}/packs/cobol-springboot/lessons.md +0 -0
- /package/{flows → kits/mainframe-java}/packs/cobol-springboot/prompts/analysis.md +0 -0
- /package/{flows → kits/mainframe-java}/packs/cobol-springboot/prompts/bdd.md +0 -0
- /package/{flows → kits/mainframe-java}/packs/cobol-springboot/prompts/implement.md +0 -0
- /package/{flows → kits/mainframe-java}/packs/cobol-springboot/prompts/plan.md +0 -0
- /package/{flows → kits/mainframe-java}/packs/cobol-springboot/prompts/review.md +0 -0
- /package/{flows → kits/mainframe-java}/packs/cobol-springboot/prompts/spec.md +0 -0
- /package/{flows → kits/mainframe-java}/packs/cobol-springboot/prompts/survey-refine.md +0 -0
- /package/{flows → kits/mainframe-java}/packs/cobol-springboot/prompts/survey-triage.md +0 -0
- /package/{flows → kits/mainframe-java}/packs/cobol-springboot/prompts/vectors.md +0 -0
- /package/{flows → kits/mainframe-java}/packs/cobol-springboot/reviewers/cobol-fidelity.md +0 -0
- /package/{flows → kits/mainframe-java}/packs/cobol-springboot/reviewers/pattern-conformance.md +0 -0
- /package/{flows/packs/jsp-nextjs → kits/mainframe-java/packs/cobol-springboot}/reviewers/traceability.md +0 -0
- /package/{flows → kits/mainframe-java}/patterns/PAT-COBOL-001-comp3-money.md +0 -0
- /package/{flows → kits/mainframe-java}/patterns/PAT-COBOL-002-redefines.md +0 -0
- /package/{flows → kits/mainframe-java}/patterns/PAT-COBOL-003-88-levels.md +0 -0
- /package/{flows → kits/mainframe-java}/patterns/PAT-COBOL-004-perform-thru.md +0 -0
- /package/{flows → kits/mainframe-java}/patterns/PAT-COBOL-005-file-status.md +0 -0
- /package/{flows → kits/mainframe-java}/patterns/PAT-COBOL-006-sqlcode.md +0 -0
- /package/{flows → kits/mainframe-java}/patterns/PAT-COBOL-007-validation-order.md +0 -0
- /package/{flows → kits/mainframe-java}/patterns/PAT-COBOL-008-zoned-decimal.md +0 -0
- /package/{flows → kits/mainframe-java}/patterns/PAT-COBOL-009-occurs-table.md +0 -0
- /package/{flows → kits/mainframe-java}/patterns/PAT-COBOL-010-copybook-record.md +0 -0
- /package/{flows → kits/mainframe-java}/patterns/PAT-COBOL-011-batch-counters.md +0 -0
- /package/{flows → kits/mainframe-java}/patterns/PAT-COBOL-012-commit-frequency.md +0 -0
- /package/{flows → kits/mainframe-java}/patterns/PAT-COBOL-013-abend.md +0 -0
- /package/{flows → kits/mainframe-java}/patterns/PAT-COBOL-014-reject-file.md +0 -0
- /package/{flows → kits/mainframe-java}/patterns/PAT-COBOL-015-accept-date.md +0 -0
- /package/{flows → kits/mainframe-java}/patterns/PAT-COBOL-016-string-building.md +0 -0
- /package/{flows → kits/mainframe-java}/patterns/PAT-COBOL-017-cursor-loop.md +0 -0
- /package/{flows → kits/mainframe-java}/patterns/PAT-COBOL-018-yn-switches.md +0 -0
- /package/{flows → kits/mainframe-java}/patterns/PAT-COBOL-019-shared-accumulators.md +0 -0
- /package/{flows → kits/mainframe-java}/patterns/PAT-COBOL-020-tiered-fees.md +0 -0
- /package/{flows → kits/mainframe-java}/patterns/PAT-COBOL-021-overdraft-floor.md +0 -0
- /package/{flows → kits/mainframe-java}/patterns/PAT-COBOL-022-jcl-job-net.md +0 -0
- /package/{flows → kits/mainframe-java}/patterns/PAT-COBOL-023-sort-step.md +0 -0
- /package/{flows → kits/mainframe-java}/patterns/PAT-COBOL-024-fixed-width-records.md +0 -0
- /package/{flows → kits/mainframe-java}/patterns/PAT-COBOL-025-audit-rows.md +0 -0
- /package/{flows/fixtures → kits/mainframe-java}/scaffolds/kafka-streams-service/README.md +0 -0
- /package/{flows/fixtures → kits/mainframe-java}/scaffolds/kafka-streams-service/pom.xml +0 -0
- /package/{flows/fixtures → kits/mainframe-java}/scaffolds/kafka-streams-service/scripts/replay.sh +0 -0
- /package/{flows/fixtures → kits/mainframe-java}/scaffolds/kafka-streams-service/src/main/java/com/meridian/scaffold/Application.java +0 -0
- /package/{flows/fixtures → kits/mainframe-java}/scaffolds/kafka-streams-service/src/test/java/com/meridian/scaffold/ApplicationTests.java +0 -0
- /package/{flows/fixtures/scaffolds/spring-bff → kits/mainframe-java/scaffolds/kafka-streams-service}/src/test/resources/features/.gitkeep +0 -0
- /package/{flows/fixtures → kits/mainframe-java}/scaffolds/spring-boot-service/README.md +0 -0
- /package/{flows/fixtures → kits/mainframe-java}/scaffolds/spring-boot-service/pom.xml +0 -0
- /package/{flows/fixtures → kits/mainframe-java}/scaffolds/spring-boot-service/scripts/replay.sh +0 -0
- /package/{flows/fixtures → kits/mainframe-java}/scaffolds/spring-boot-service/src/main/java/com/meridian/scaffold/Application.java +0 -0
- /package/{flows/fixtures → kits/mainframe-java}/scaffolds/spring-boot-service/src/main/resources/application.yaml +0 -0
- /package/{flows/fixtures → kits/mainframe-java}/scaffolds/spring-boot-service/src/test/java/com/meridian/scaffold/ApplicationTests.java +0 -0
- /package/{flows/fixtures → kits/mainframe-java}/scaffolds/spring-boot-service/src/test/resources/features/.gitkeep +0 -0
|
@@ -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
|
+
}
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
package com.demobank.legacy.web;
|
|
2
|
+
|
|
3
|
+
import java.io.IOException;
|
|
4
|
+
import java.util.ArrayList;
|
|
5
|
+
import java.util.List;
|
|
6
|
+
|
|
7
|
+
import javax.servlet.RequestDispatcher;
|
|
8
|
+
import javax.servlet.ServletException;
|
|
9
|
+
import javax.servlet.http.HttpServlet;
|
|
10
|
+
import javax.servlet.http.HttpServletRequest;
|
|
11
|
+
import javax.servlet.http.HttpServletResponse;
|
|
12
|
+
import javax.servlet.http.HttpSession;
|
|
13
|
+
|
|
14
|
+
import com.demobank.legacy.dto.BenfDTO;
|
|
15
|
+
import com.demobank.legacy.esb.EsbBenfListService;
|
|
16
|
+
import com.demobank.legacy.esb.EsbBenfMaintService;
|
|
17
|
+
import com.demobank.legacy.esb.EsbException;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* HERO 2 controller. Mapped on /beneficiary.
|
|
21
|
+
*
|
|
22
|
+
* GET ?action=list (default) -> beneficiaryList.jsp ("benfList")
|
|
23
|
+
* GET ?action=new -> beneficiaryEdit.jsp (empty "benf")
|
|
24
|
+
* GET ?action=edit&benfId=.. -> beneficiaryEdit.jsp (loaded "benf")
|
|
25
|
+
* GET ?action=delete&benfId= -> delete then redirect to list [sic: GET
|
|
26
|
+
* with side effect, kept legacy-faithful]
|
|
27
|
+
* POST -> server-side validation + ESB_BENF_MAINT
|
|
28
|
+
*
|
|
29
|
+
* Server-side validation deliberately overlaps but does not match the
|
|
30
|
+
* client rules in beneficiaryEdit.jsp / validate.js (see DB-2988, DB-3302):
|
|
31
|
+
* - name required, max 60 chars (client allows 70)
|
|
32
|
+
* - IBAN required, shape check, AND country must be IT/DE/FR (client
|
|
33
|
+
* checks shape only)
|
|
34
|
+
* - bank name required when ccy != EUR (client treats it as optional)
|
|
35
|
+
*
|
|
36
|
+
* ESB dependencies: ESB_BENF_LIST, ESB_BENF_MAINT.
|
|
37
|
+
*/
|
|
38
|
+
public class BeneficiaryServlet extends HttpServlet {
|
|
39
|
+
|
|
40
|
+
private static final long serialVersionUID = 1L;
|
|
41
|
+
|
|
42
|
+
private final EsbBenfListService listService = new EsbBenfListService();
|
|
43
|
+
private final EsbBenfMaintService maintService = new EsbBenfMaintService();
|
|
44
|
+
|
|
45
|
+
protected void doGet(HttpServletRequest request, HttpServletResponse response)
|
|
46
|
+
throws ServletException, IOException {
|
|
47
|
+
|
|
48
|
+
String custId = custId(request);
|
|
49
|
+
String action = request.getParameter("action");
|
|
50
|
+
if (action == null) action = "list";
|
|
51
|
+
|
|
52
|
+
try {
|
|
53
|
+
if ("new".equals(action)) {
|
|
54
|
+
BenfDTO empty = new BenfDTO();
|
|
55
|
+
empty.setCcyCd("EUR");
|
|
56
|
+
request.setAttribute("benf", empty);
|
|
57
|
+
forward(request, response, "/beneficiaryEdit.jsp");
|
|
58
|
+
} else if ("edit".equals(action)) {
|
|
59
|
+
BenfDTO benf = listService.getBeneficiary(custId,
|
|
60
|
+
request.getParameter("benfId"));
|
|
61
|
+
if (benf == null) {
|
|
62
|
+
response.sendRedirect("beneficiary");
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
request.setAttribute("benf", benf);
|
|
66
|
+
forward(request, response, "/beneficiaryEdit.jsp");
|
|
67
|
+
} else if ("delete".equals(action)) {
|
|
68
|
+
maintService.delete(custId, request.getParameter("benfId"));
|
|
69
|
+
request.getSession().setAttribute("flashOnce", "Beneficiary deleted.");
|
|
70
|
+
response.sendRedirect("beneficiary");
|
|
71
|
+
} else {
|
|
72
|
+
renderList(request, response, custId);
|
|
73
|
+
}
|
|
74
|
+
} catch (EsbException e) {
|
|
75
|
+
System.out.println("BENF esb failure rc=" + e.getEsbRc());
|
|
76
|
+
request.setAttribute("benfList", new ArrayList());
|
|
77
|
+
forward(request, response, "/beneficiaryList.jsp");
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
protected void doPost(HttpServletRequest request, HttpServletResponse response)
|
|
82
|
+
throws ServletException, IOException {
|
|
83
|
+
|
|
84
|
+
String custId = custId(request);
|
|
85
|
+
|
|
86
|
+
BenfDTO benf = new BenfDTO();
|
|
87
|
+
benf.setBenfId(trim(request.getParameter("benfId")));
|
|
88
|
+
benf.setBenfNm(trim(request.getParameter("benfNm")));
|
|
89
|
+
benf.setBenfIban(trim(request.getParameter("benfIban")));
|
|
90
|
+
benf.setBankNm(trim(request.getParameter("bankNm")));
|
|
91
|
+
benf.setCcyCd(trim(request.getParameter("ccyCd")));
|
|
92
|
+
|
|
93
|
+
List errs = validate(benf);
|
|
94
|
+
if (!errs.isEmpty()) {
|
|
95
|
+
request.setAttribute("srvErrs", errs);
|
|
96
|
+
request.setAttribute("benf", benf);
|
|
97
|
+
forward(request, response, "/beneficiaryEdit.jsp");
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
try {
|
|
102
|
+
String rc = maintService.save(custId, benf);
|
|
103
|
+
if (!"0000".equals(rc)) {
|
|
104
|
+
errs.add(hostMessage(rc));
|
|
105
|
+
request.setAttribute("srvErrs", errs);
|
|
106
|
+
request.setAttribute("benf", benf);
|
|
107
|
+
forward(request, response, "/beneficiaryEdit.jsp");
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
} catch (EsbException e) {
|
|
111
|
+
errs.add("Service temporarily unavailable, please retry (rc "
|
|
112
|
+
+ e.getEsbRc() + ").");
|
|
113
|
+
request.setAttribute("srvErrs", errs);
|
|
114
|
+
request.setAttribute("benf", benf);
|
|
115
|
+
forward(request, response, "/beneficiaryEdit.jsp");
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
request.getSession().setAttribute("flashOnce", "Beneficiary saved.");
|
|
120
|
+
response.sendRedirect("beneficiary");
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/** Server-side rules. Compare with the jQuery rules in the JSP. */
|
|
124
|
+
private List validate(BenfDTO benf) {
|
|
125
|
+
List errs = new ArrayList();
|
|
126
|
+
if (isEmpty(benf.getBenfNm())) {
|
|
127
|
+
errs.add("Beneficiary name is required.");
|
|
128
|
+
} else if (benf.getBenfNm().length() > 60) {
|
|
129
|
+
// client-side allows 70 -- host field is CHAR(60), see DB-2988
|
|
130
|
+
errs.add("Beneficiary name must not exceed 60 characters.");
|
|
131
|
+
}
|
|
132
|
+
String iban = benf.getBenfIban() == null
|
|
133
|
+
? "" : benf.getBenfIban().replaceAll(" ", "").toUpperCase();
|
|
134
|
+
if (iban.length() == 0) {
|
|
135
|
+
errs.add("IBAN is required.");
|
|
136
|
+
} else if (!iban.matches("[A-Z]{2}[0-9]{2}[A-Z0-9]{10,30}")) {
|
|
137
|
+
errs.add("IBAN format is not valid.");
|
|
138
|
+
} else {
|
|
139
|
+
String country = iban.substring(0, 2);
|
|
140
|
+
// client checks shape only; SEPA scheme subset enforced here
|
|
141
|
+
if (!"IT".equals(country) && !"DE".equals(country) && !"FR".equals(country)) {
|
|
142
|
+
errs.add("Only IT, DE and FR IBANs are accepted online.");
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
if (!"EUR".equals(benf.getCcyCd()) && isEmpty(benf.getBankNm())) {
|
|
146
|
+
// client treats bank name as always optional
|
|
147
|
+
errs.add("Bank name is required for non-EUR beneficiaries.");
|
|
148
|
+
}
|
|
149
|
+
return errs;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
private void renderList(HttpServletRequest request, HttpServletResponse response,
|
|
153
|
+
String custId) throws EsbException, ServletException, IOException {
|
|
154
|
+
List benfList = listService.listBeneficiaries(custId);
|
|
155
|
+
request.setAttribute("benfList", benfList);
|
|
156
|
+
HttpSession session = request.getSession();
|
|
157
|
+
Object flash = session.getAttribute("flashOnce");
|
|
158
|
+
if (flash != null) {
|
|
159
|
+
request.setAttribute("flashMsg", flash);
|
|
160
|
+
session.removeAttribute("flashOnce");
|
|
161
|
+
}
|
|
162
|
+
forward(request, response, "/beneficiaryList.jsp");
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
private String hostMessage(String rc) {
|
|
166
|
+
if ("0102".equals(rc)) return "A beneficiary with this IBAN already exists.";
|
|
167
|
+
if ("0107".equals(rc)) return "Beneficiary refused by compliance vetting.";
|
|
168
|
+
if ("0110".equals(rc)) return "Beneficiary book is full (max 50 entries).";
|
|
169
|
+
return "Operation refused by the bank host (code " + rc + ").";
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
private void forward(HttpServletRequest request, HttpServletResponse response,
|
|
173
|
+
String jsp) throws ServletException, IOException {
|
|
174
|
+
RequestDispatcher rd = request.getRequestDispatcher(jsp);
|
|
175
|
+
rd.forward(request, response);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
private String custId(HttpServletRequest request) {
|
|
179
|
+
HttpSession session = request.getSession(true);
|
|
180
|
+
String custId = (String) session.getAttribute("custId");
|
|
181
|
+
if (custId == null) {
|
|
182
|
+
custId = "CUST0042";
|
|
183
|
+
session.setAttribute("custId", custId);
|
|
184
|
+
}
|
|
185
|
+
return custId;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
private String trim(String s) {
|
|
189
|
+
return s == null ? null : s.trim();
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
private boolean isEmpty(String s) {
|
|
193
|
+
return s == null || s.trim().length() == 0;
|
|
194
|
+
}
|
|
195
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
package com.demobank.legacy.web;
|
|
2
|
+
|
|
3
|
+
import java.io.Serializable;
|
|
4
|
+
import java.math.BigDecimal;
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Wire transfer wizard state, held in HttpSession under attribute
|
|
8
|
+
* "trfDraft" between step 1 (entry), step 2 (review) and step 3
|
|
9
|
+
* (execution). Cleared by TransferServlet after execution or abandon.
|
|
10
|
+
*
|
|
11
|
+
* Serializable because the app servers replicate sessions across the
|
|
12
|
+
* cluster (session-timeout 10, see web.xml).
|
|
13
|
+
*
|
|
14
|
+
* @author lgreco (2011)
|
|
15
|
+
*/
|
|
16
|
+
public class TransferDraft implements Serializable {
|
|
17
|
+
|
|
18
|
+
private static final long serialVersionUID = 1L;
|
|
19
|
+
|
|
20
|
+
private String benfId;
|
|
21
|
+
private String benfNm;
|
|
22
|
+
private String benfIban;
|
|
23
|
+
private BigDecimal trfAmt;
|
|
24
|
+
private String trfCcy;
|
|
25
|
+
private String trfDesc;
|
|
26
|
+
private String valDt;
|
|
27
|
+
/** Fee computed by ESB_TRF_VAL, shown on the review screen. */
|
|
28
|
+
private BigDecimal feeAmt;
|
|
29
|
+
/** Validation token from ESB_TRF_VAL, required by ESB_TRF_EXEC. */
|
|
30
|
+
private String valToken;
|
|
31
|
+
|
|
32
|
+
public TransferDraft() {
|
|
33
|
+
// bean constructor
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
public String getBenfId() { return benfId; }
|
|
37
|
+
public void setBenfId(String benfId) { this.benfId = benfId; }
|
|
38
|
+
|
|
39
|
+
public String getBenfNm() { return benfNm; }
|
|
40
|
+
public void setBenfNm(String benfNm) { this.benfNm = benfNm; }
|
|
41
|
+
|
|
42
|
+
public String getBenfIban() { return benfIban; }
|
|
43
|
+
public void setBenfIban(String benfIban) { this.benfIban = benfIban; }
|
|
44
|
+
|
|
45
|
+
public BigDecimal getTrfAmt() { return trfAmt; }
|
|
46
|
+
public void setTrfAmt(BigDecimal trfAmt) { this.trfAmt = trfAmt; }
|
|
47
|
+
|
|
48
|
+
public String getTrfCcy() { return trfCcy; }
|
|
49
|
+
public void setTrfCcy(String trfCcy) { this.trfCcy = trfCcy; }
|
|
50
|
+
|
|
51
|
+
public String getTrfDesc() { return trfDesc; }
|
|
52
|
+
public void setTrfDesc(String trfDesc) { this.trfDesc = trfDesc; }
|
|
53
|
+
|
|
54
|
+
public String getValDt() { return valDt; }
|
|
55
|
+
public void setValDt(String valDt) { this.valDt = valDt; }
|
|
56
|
+
|
|
57
|
+
public BigDecimal getFeeAmt() { return feeAmt; }
|
|
58
|
+
public void setFeeAmt(BigDecimal feeAmt) { this.feeAmt = feeAmt; }
|
|
59
|
+
|
|
60
|
+
public String getValToken() { return valToken; }
|
|
61
|
+
public void setValToken(String valToken) { this.valToken = valToken; }
|
|
62
|
+
}
|