diff --git a/bus-update-card-status/.dockerignore b/bus-update-card-status/.dockerignore new file mode 100644 index 0000000..e69de29 diff --git a/bus-update-card-status/.gitattributes b/bus-update-card-status/.gitattributes new file mode 100644 index 0000000..2125666 --- /dev/null +++ b/bus-update-card-status/.gitattributes @@ -0,0 +1 @@ +* text=auto \ No newline at end of file diff --git a/bus-update-card-status/.gitignore b/bus-update-card-status/.gitignore new file mode 100644 index 0000000..6ebc5dd --- /dev/null +++ b/bus-update-card-status/.gitignore @@ -0,0 +1,49 @@ +/target/ +!.mvn/wrapper/maven-wrapper.jar + +### STS ### +.apt_generated +.classpath +.factorypath +.project +.settings +.springBeans +.sts4-cache + +### IntelliJ IDEA ### +.idea +*.iws +*.iml +*.ipr + +### NetBeans ### +/nbproject/private/ +/build/ +/nbbuild/ +/dist/ +/nbdist/ +/.nb-gradle/ + +### Eclipse ### +.apt_generated +.classpath +.factorypath +.project +.settings +.springBeans +.sts4-cache + + +### VS Code ### +.vscode/ + +### Mac OS ### +.DS_Store + +### Config ### +.mvn/* +dependency-reduced-pom.xml +## no track +application-local.yaml +application-local.properties +*:Zone.Identifier \ No newline at end of file diff --git a/bus-update-card-status/.gitmodules b/bus-update-card-status/.gitmodules new file mode 100644 index 0000000..e69de29 diff --git a/bus-update-card-status/.pre-commit-config.yaml b/bus-update-card-status/.pre-commit-config.yaml new file mode 100644 index 0000000..e69de29 diff --git a/bus-update-card-status/CHANGES.md b/bus-update-card-status/CHANGES.md new file mode 100644 index 0000000..497a019 --- /dev/null +++ b/bus-update-card-status/CHANGES.md @@ -0,0 +1,9 @@ +boveda_express_ +======================= + +Here you can see the full list of changes between each Flask-RESTful release. + +Version 0.1 +------------- + +First public release diff --git a/bus-update-card-status/CONTRIBUTING.md b/bus-update-card-status/CONTRIBUTING.md new file mode 100644 index 0000000..e69de29 diff --git a/bus-update-card-status/Dockerfile b/bus-update-card-status/Dockerfile new file mode 100644 index 0000000..edc78b0 --- /dev/null +++ b/bus-update-card-status/Dockerfile @@ -0,0 +1,14 @@ +## Build stage ## +FROM default-route-openshift-image-registry.apps.desplakur3.desintra.banesco.com/runners-gitlab/openjdk-17:1.20-2.1721752931 AS build +COPY . /home/default/ +COPY pom.xml /home/default +COPY settings.xml /home/default +RUN mvn -s /home/default/settings.xml -f /home/default/pom.xml -Dmaven.wagon.http.ssl.insecure=true -Dmaven.wagon.http.ssl.allowall=true -Dmaven.wagon.http.ssl.ignore.validity.dates=true -DskipTests=true clean package +RUN ls -ltra /home/default/target/ + +### Package stage ### +FROM default-route-openshift-image-registry.apps.desplakur3.desintra.banesco.com/runners-gitlab/openjdk-17:1.20-2.1721752931 +WORKDIR /home/default +CMD ["ls"] +COPY --from=build /home/default/target/*.jar app.jar +CMD ["java","-jar","app.jar"] diff --git a/bus-update-card-status/HELP.md b/bus-update-card-status/HELP.md new file mode 100644 index 0000000..bcdd8ac --- /dev/null +++ b/bus-update-card-status/HELP.md @@ -0,0 +1,18 @@ +# Getting Started + +### Reference Documentation + +For further reference, please consider the following sections: + +* [Official Apache Maven documentation](https://maven.apache.org/guides/index.html) +* [Spring Boot Maven Plugin Reference Guide](https://docs.spring.io/spring-boot/3.3.2/maven-plugin) +* [Create an OCI image](https://docs.spring.io/spring-boot/3.3.2/maven-plugin/build-image.html) + +### Maven Parent overrides + +Due to Maven's design, elements are inherited from the parent POM to the project POM. +While most of the inheritance is fine, it also inherits unwanted elements like `` and `` from the +parent. +To prevent this, the project POM contains empty overrides for these elements. +If you manually switch to a different parent and actually want the inheritance, you need to remove those overrides. + diff --git a/bus-update-card-status/LICENSE b/bus-update-card-status/LICENSE new file mode 100644 index 0000000..1773f19 --- /dev/null +++ b/bus-update-card-status/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2024 Banesco Banco Universal, C.A. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/bus-update-card-status/README.md b/bus-update-card-status/README.md new file mode 100644 index 0000000..61fa9d9 --- /dev/null +++ b/bus-update-card-status/README.md @@ -0,0 +1,24 @@ +# Banesco + +> Application: + +## Distribution + +The project is composed or will be distributed under the following organisational scheme: + +1. apps (Folder containing all available applications and apis) +2. config (Folder containing initial system configuration) +3. config/main (Folder containing static files and media files) + 1. media (folder containing filed upload by user) + 2. private (folder containing css, images, js) + 3. static (folder that will contain all the collectstatic generated from the private folder for production display) + 4. templates +4. requirements (folder containter requirements necesaries for proyect) + +## How to install? + +You will need to fill in all the configuration necessary to build this project and how it is configured for use. + +Go, enjoy! + +### Banesco Banco Universal, C.A. \ No newline at end of file diff --git a/bus-update-card-status/docker-compose.yml b/bus-update-card-status/docker-compose.yml new file mode 100644 index 0000000..e69de29 diff --git a/bus-update-card-status/mvnw b/bus-update-card-status/mvnw new file mode 100644 index 0000000..d7c358e --- /dev/null +++ b/bus-update-card-status/mvnw @@ -0,0 +1,259 @@ +#!/bin/sh +# ---------------------------------------------------------------------------- +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# ---------------------------------------------------------------------------- + +# ---------------------------------------------------------------------------- +# Apache Maven Wrapper startup batch script, version 3.3.2 +# +# Optional ENV vars +# ----------------- +# JAVA_HOME - location of a JDK home dir, required when download maven via java source +# MVNW_REPOURL - repo url base for downloading maven distribution +# MVNW_USERNAME/MVNW_PASSWORD - user and password for downloading maven +# MVNW_VERBOSE - true: enable verbose log; debug: trace the mvnw script; others: silence the output +# ---------------------------------------------------------------------------- + +set -euf +[ "${MVNW_VERBOSE-}" != debug ] || set -x + +# OS specific support. +native_path() { printf %s\\n "$1"; } +case "$(uname)" in +CYGWIN* | MINGW*) + [ -z "${JAVA_HOME-}" ] || JAVA_HOME="$(cygpath --unix "$JAVA_HOME")" + native_path() { cygpath --path --windows "$1"; } + ;; +esac + +# set JAVACMD and JAVACCMD +set_java_home() { + # For Cygwin and MinGW, ensure paths are in Unix format before anything is touched + if [ -n "${JAVA_HOME-}" ]; then + if [ -x "$JAVA_HOME/jre/sh/java" ]; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + JAVACCMD="$JAVA_HOME/jre/sh/javac" + else + JAVACMD="$JAVA_HOME/bin/java" + JAVACCMD="$JAVA_HOME/bin/javac" + + if [ ! -x "$JAVACMD" ] || [ ! -x "$JAVACCMD" ]; then + echo "The JAVA_HOME environment variable is not defined correctly, so mvnw cannot run." >&2 + echo "JAVA_HOME is set to \"$JAVA_HOME\", but \"\$JAVA_HOME/bin/java\" or \"\$JAVA_HOME/bin/javac\" does not exist." >&2 + return 1 + fi + fi + else + JAVACMD="$( + 'set' +e + 'unset' -f command 2>/dev/null + 'command' -v java + )" || : + JAVACCMD="$( + 'set' +e + 'unset' -f command 2>/dev/null + 'command' -v javac + )" || : + + if [ ! -x "${JAVACMD-}" ] || [ ! -x "${JAVACCMD-}" ]; then + echo "The java/javac command does not exist in PATH nor is JAVA_HOME set, so mvnw cannot run." >&2 + return 1 + fi + fi +} + +# hash string like Java String::hashCode +hash_string() { + str="${1:-}" h=0 + while [ -n "$str" ]; do + char="${str%"${str#?}"}" + h=$(((h * 31 + $(LC_CTYPE=C printf %d "'$char")) % 4294967296)) + str="${str#?}" + done + printf %x\\n $h +} + +verbose() { :; } +[ "${MVNW_VERBOSE-}" != true ] || verbose() { printf %s\\n "${1-}"; } + +die() { + printf %s\\n "$1" >&2 + exit 1 +} + +trim() { + # MWRAPPER-139: + # Trims trailing and leading whitespace, carriage returns, tabs, and linefeeds. + # Needed for removing poorly interpreted newline sequences when running in more + # exotic environments such as mingw bash on Windows. + printf "%s" "${1}" | tr -d '[:space:]' +} + +# parse distributionUrl and optional distributionSha256Sum, requires .mvn/wrapper/maven-wrapper.properties +while IFS="=" read -r key value; do + case "${key-}" in + distributionUrl) distributionUrl=$(trim "${value-}") ;; + distributionSha256Sum) distributionSha256Sum=$(trim "${value-}") ;; + esac +done <"${0%/*}/.mvn/wrapper/maven-wrapper.properties" +[ -n "${distributionUrl-}" ] || die "cannot read distributionUrl property in ${0%/*}/.mvn/wrapper/maven-wrapper.properties" + +case "${distributionUrl##*/}" in +maven-mvnd-*bin.*) + MVN_CMD=mvnd.sh _MVNW_REPO_PATTERN=/maven/mvnd/ + case "${PROCESSOR_ARCHITECTURE-}${PROCESSOR_ARCHITEW6432-}:$(uname -a)" in + *AMD64:CYGWIN* | *AMD64:MINGW*) distributionPlatform=windows-amd64 ;; + :Darwin*x86_64) distributionPlatform=darwin-amd64 ;; + :Darwin*arm64) distributionPlatform=darwin-aarch64 ;; + :Linux*x86_64*) distributionPlatform=linux-amd64 ;; + *) + echo "Cannot detect native platform for mvnd on $(uname)-$(uname -m), use pure java version" >&2 + distributionPlatform=linux-amd64 + ;; + esac + distributionUrl="${distributionUrl%-bin.*}-$distributionPlatform.zip" + ;; +maven-mvnd-*) MVN_CMD=mvnd.sh _MVNW_REPO_PATTERN=/maven/mvnd/ ;; +*) MVN_CMD="mvn${0##*/mvnw}" _MVNW_REPO_PATTERN=/org/apache/maven/ ;; +esac + +# apply MVNW_REPOURL and calculate MAVEN_HOME +# maven home pattern: ~/.m2/wrapper/dists/{apache-maven-,maven-mvnd--}/ +[ -z "${MVNW_REPOURL-}" ] || distributionUrl="$MVNW_REPOURL$_MVNW_REPO_PATTERN${distributionUrl#*"$_MVNW_REPO_PATTERN"}" +distributionUrlName="${distributionUrl##*/}" +distributionUrlNameMain="${distributionUrlName%.*}" +distributionUrlNameMain="${distributionUrlNameMain%-bin}" +MAVEN_USER_HOME="${MAVEN_USER_HOME:-${HOME}/.m2}" +MAVEN_HOME="${MAVEN_USER_HOME}/wrapper/dists/${distributionUrlNameMain-}/$(hash_string "$distributionUrl")" + +exec_maven() { + unset MVNW_VERBOSE MVNW_USERNAME MVNW_PASSWORD MVNW_REPOURL || : + exec "$MAVEN_HOME/bin/$MVN_CMD" "$@" || die "cannot exec $MAVEN_HOME/bin/$MVN_CMD" +} + +if [ -d "$MAVEN_HOME" ]; then + verbose "found existing MAVEN_HOME at $MAVEN_HOME" + exec_maven "$@" +fi + +case "${distributionUrl-}" in +*?-bin.zip | *?maven-mvnd-?*-?*.zip) ;; +*) die "distributionUrl is not valid, must match *-bin.zip or maven-mvnd-*.zip, but found '${distributionUrl-}'" ;; +esac + +# prepare tmp dir +if TMP_DOWNLOAD_DIR="$(mktemp -d)" && [ -d "$TMP_DOWNLOAD_DIR" ]; then + clean() { rm -rf -- "$TMP_DOWNLOAD_DIR"; } + trap clean HUP INT TERM EXIT +else + die "cannot create temp dir" +fi + +mkdir -p -- "${MAVEN_HOME%/*}" + +# Download and Install Apache Maven +verbose "Couldn't find MAVEN_HOME, downloading and installing it ..." +verbose "Downloading from: $distributionUrl" +verbose "Downloading to: $TMP_DOWNLOAD_DIR/$distributionUrlName" + +# select .zip or .tar.gz +if ! command -v unzip >/dev/null; then + distributionUrl="${distributionUrl%.zip}.tar.gz" + distributionUrlName="${distributionUrl##*/}" +fi + +# verbose opt +__MVNW_QUIET_WGET=--quiet __MVNW_QUIET_CURL=--silent __MVNW_QUIET_UNZIP=-q __MVNW_QUIET_TAR='' +[ "${MVNW_VERBOSE-}" != true ] || __MVNW_QUIET_WGET='' __MVNW_QUIET_CURL='' __MVNW_QUIET_UNZIP='' __MVNW_QUIET_TAR=v + +# normalize http auth +case "${MVNW_PASSWORD:+has-password}" in +'') MVNW_USERNAME='' MVNW_PASSWORD='' ;; +has-password) [ -n "${MVNW_USERNAME-}" ] || MVNW_USERNAME='' MVNW_PASSWORD='' ;; +esac + +if [ -z "${MVNW_USERNAME-}" ] && command -v wget >/dev/null; then + verbose "Found wget ... using wget" + wget ${__MVNW_QUIET_WGET:+"$__MVNW_QUIET_WGET"} "$distributionUrl" -O "$TMP_DOWNLOAD_DIR/$distributionUrlName" || die "wget: Failed to fetch $distributionUrl" +elif [ -z "${MVNW_USERNAME-}" ] && command -v curl >/dev/null; then + verbose "Found curl ... using curl" + curl ${__MVNW_QUIET_CURL:+"$__MVNW_QUIET_CURL"} -f -L -o "$TMP_DOWNLOAD_DIR/$distributionUrlName" "$distributionUrl" || die "curl: Failed to fetch $distributionUrl" +elif set_java_home; then + verbose "Falling back to use Java to download" + javaSource="$TMP_DOWNLOAD_DIR/Downloader.java" + targetZip="$TMP_DOWNLOAD_DIR/$distributionUrlName" + cat >"$javaSource" <<-END + public class Downloader extends java.net.Authenticator + { + protected java.net.PasswordAuthentication getPasswordAuthentication() + { + return new java.net.PasswordAuthentication( System.getenv( "MVNW_USERNAME" ), System.getenv( "MVNW_PASSWORD" ).toCharArray() ); + } + public static void main( String[] args ) throws Exception + { + setDefault( new Downloader() ); + java.nio.file.Files.copy( java.net.URI.create( args[0] ).toURL().openStream(), java.nio.file.Paths.get( args[1] ).toAbsolutePath().normalize() ); + } + } + END + # For Cygwin/MinGW, switch paths to Windows format before running javac and java + verbose " - Compiling Downloader.java ..." + "$(native_path "$JAVACCMD")" "$(native_path "$javaSource")" || die "Failed to compile Downloader.java" + verbose " - Running Downloader.java ..." + "$(native_path "$JAVACMD")" -cp "$(native_path "$TMP_DOWNLOAD_DIR")" Downloader "$distributionUrl" "$(native_path "$targetZip")" +fi + +# If specified, validate the SHA-256 sum of the Maven distribution zip file +if [ -n "${distributionSha256Sum-}" ]; then + distributionSha256Result=false + if [ "$MVN_CMD" = mvnd.sh ]; then + echo "Checksum validation is not supported for maven-mvnd." >&2 + echo "Please disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties." >&2 + exit 1 + elif command -v sha256sum >/dev/null; then + if echo "$distributionSha256Sum $TMP_DOWNLOAD_DIR/$distributionUrlName" | sha256sum -c >/dev/null 2>&1; then + distributionSha256Result=true + fi + elif command -v shasum >/dev/null; then + if echo "$distributionSha256Sum $TMP_DOWNLOAD_DIR/$distributionUrlName" | shasum -a 256 -c >/dev/null 2>&1; then + distributionSha256Result=true + fi + else + echo "Checksum validation was requested but neither 'sha256sum' or 'shasum' are available." >&2 + echo "Please install either command, or disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties." >&2 + exit 1 + fi + if [ $distributionSha256Result = false ]; then + echo "Error: Failed to validate Maven distribution SHA-256, your Maven distribution might be compromised." >&2 + echo "If you updated your Maven version, you need to update the specified distributionSha256Sum property." >&2 + exit 1 + fi +fi + +# unzip and move +if command -v unzip >/dev/null; then + unzip ${__MVNW_QUIET_UNZIP:+"$__MVNW_QUIET_UNZIP"} "$TMP_DOWNLOAD_DIR/$distributionUrlName" -d "$TMP_DOWNLOAD_DIR" || die "failed to unzip" +else + tar xzf${__MVNW_QUIET_TAR:+"$__MVNW_QUIET_TAR"} "$TMP_DOWNLOAD_DIR/$distributionUrlName" -C "$TMP_DOWNLOAD_DIR" || die "failed to untar" +fi +printf %s\\n "$distributionUrl" >"$TMP_DOWNLOAD_DIR/$distributionUrlNameMain/mvnw.url" +mv -- "$TMP_DOWNLOAD_DIR/$distributionUrlNameMain" "$MAVEN_HOME" || [ -d "$MAVEN_HOME" ] || die "fail to move MAVEN_HOME" + +clean || : +exec_maven "$@" diff --git a/bus-update-card-status/mvnw.cmd b/bus-update-card-status/mvnw.cmd new file mode 100644 index 0000000..6f779cf --- /dev/null +++ b/bus-update-card-status/mvnw.cmd @@ -0,0 +1,149 @@ +<# : batch portion +@REM ---------------------------------------------------------------------------- +@REM Licensed to the Apache Software Foundation (ASF) under one +@REM or more contributor license agreements. See the NOTICE file +@REM distributed with this work for additional information +@REM regarding copyright ownership. The ASF licenses this file +@REM to you under the Apache License, Version 2.0 (the +@REM "License"); you may not use this file except in compliance +@REM with the License. You may obtain a copy of the License at +@REM +@REM https://www.apache.org/licenses/LICENSE-2.0 +@REM +@REM Unless required by applicable law or agreed to in writing, +@REM software distributed under the License is distributed on an +@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +@REM KIND, either express or implied. See the License for the +@REM specific language governing permissions and limitations +@REM under the License. +@REM ---------------------------------------------------------------------------- + +@REM ---------------------------------------------------------------------------- +@REM Apache Maven Wrapper startup batch script, version 3.3.2 +@REM +@REM Optional ENV vars +@REM MVNW_REPOURL - repo url base for downloading maven distribution +@REM MVNW_USERNAME/MVNW_PASSWORD - user and password for downloading maven +@REM MVNW_VERBOSE - true: enable verbose log; others: silence the output +@REM ---------------------------------------------------------------------------- + +@IF "%__MVNW_ARG0_NAME__%"=="" (SET __MVNW_ARG0_NAME__=%~nx0) +@SET __MVNW_CMD__= +@SET __MVNW_ERROR__= +@SET __MVNW_PSMODULEP_SAVE=%PSModulePath% +@SET PSModulePath= +@FOR /F "usebackq tokens=1* delims==" %%A IN (`powershell -noprofile "& {$scriptDir='%~dp0'; $script='%__MVNW_ARG0_NAME__%'; icm -ScriptBlock ([Scriptblock]::Create((Get-Content -Raw '%~f0'))) -NoNewScope}"`) DO @( + IF "%%A"=="MVN_CMD" (set __MVNW_CMD__=%%B) ELSE IF "%%B"=="" (echo %%A) ELSE (echo %%A=%%B) +) +@SET PSModulePath=%__MVNW_PSMODULEP_SAVE% +@SET __MVNW_PSMODULEP_SAVE= +@SET __MVNW_ARG0_NAME__= +@SET MVNW_USERNAME= +@SET MVNW_PASSWORD= +@IF NOT "%__MVNW_CMD__%"=="" (%__MVNW_CMD__% %*) +@echo Cannot start maven from wrapper >&2 && exit /b 1 +@GOTO :EOF +: end batch / begin powershell #> + +$ErrorActionPreference = "Stop" +if ($env:MVNW_VERBOSE -eq "true") { + $VerbosePreference = "Continue" +} + +# calculate distributionUrl, requires .mvn/wrapper/maven-wrapper.properties +$distributionUrl = (Get-Content -Raw "$scriptDir/.mvn/wrapper/maven-wrapper.properties" | ConvertFrom-StringData).distributionUrl +if (!$distributionUrl) { + Write-Error "cannot read distributionUrl property in $scriptDir/.mvn/wrapper/maven-wrapper.properties" +} + +switch -wildcard -casesensitive ( $($distributionUrl -replace '^.*/','') ) { + "maven-mvnd-*" { + $USE_MVND = $true + $distributionUrl = $distributionUrl -replace '-bin\.[^.]*$',"-windows-amd64.zip" + $MVN_CMD = "mvnd.cmd" + break + } + default { + $USE_MVND = $false + $MVN_CMD = $script -replace '^mvnw','mvn' + break + } +} + +# apply MVNW_REPOURL and calculate MAVEN_HOME +# maven home pattern: ~/.m2/wrapper/dists/{apache-maven-,maven-mvnd--}/ +if ($env:MVNW_REPOURL) { + $MVNW_REPO_PATTERN = if ($USE_MVND) { "/org/apache/maven/" } else { "/maven/mvnd/" } + $distributionUrl = "$env:MVNW_REPOURL$MVNW_REPO_PATTERN$($distributionUrl -replace '^.*'+$MVNW_REPO_PATTERN,'')" +} +$distributionUrlName = $distributionUrl -replace '^.*/','' +$distributionUrlNameMain = $distributionUrlName -replace '\.[^.]*$','' -replace '-bin$','' +$MAVEN_HOME_PARENT = "$HOME/.m2/wrapper/dists/$distributionUrlNameMain" +if ($env:MAVEN_USER_HOME) { + $MAVEN_HOME_PARENT = "$env:MAVEN_USER_HOME/wrapper/dists/$distributionUrlNameMain" +} +$MAVEN_HOME_NAME = ([System.Security.Cryptography.MD5]::Create().ComputeHash([byte[]][char[]]$distributionUrl) | ForEach-Object {$_.ToString("x2")}) -join '' +$MAVEN_HOME = "$MAVEN_HOME_PARENT/$MAVEN_HOME_NAME" + +if (Test-Path -Path "$MAVEN_HOME" -PathType Container) { + Write-Verbose "found existing MAVEN_HOME at $MAVEN_HOME" + Write-Output "MVN_CMD=$MAVEN_HOME/bin/$MVN_CMD" + exit $? +} + +if (! $distributionUrlNameMain -or ($distributionUrlName -eq $distributionUrlNameMain)) { + Write-Error "distributionUrl is not valid, must end with *-bin.zip, but found $distributionUrl" +} + +# prepare tmp dir +$TMP_DOWNLOAD_DIR_HOLDER = New-TemporaryFile +$TMP_DOWNLOAD_DIR = New-Item -Itemtype Directory -Path "$TMP_DOWNLOAD_DIR_HOLDER.dir" +$TMP_DOWNLOAD_DIR_HOLDER.Delete() | Out-Null +trap { + if ($TMP_DOWNLOAD_DIR.Exists) { + try { Remove-Item $TMP_DOWNLOAD_DIR -Recurse -Force | Out-Null } + catch { Write-Warning "Cannot remove $TMP_DOWNLOAD_DIR" } + } +} + +New-Item -Itemtype Directory -Path "$MAVEN_HOME_PARENT" -Force | Out-Null + +# Download and Install Apache Maven +Write-Verbose "Couldn't find MAVEN_HOME, downloading and installing it ..." +Write-Verbose "Downloading from: $distributionUrl" +Write-Verbose "Downloading to: $TMP_DOWNLOAD_DIR/$distributionUrlName" + +$webclient = New-Object System.Net.WebClient +if ($env:MVNW_USERNAME -and $env:MVNW_PASSWORD) { + $webclient.Credentials = New-Object System.Net.NetworkCredential($env:MVNW_USERNAME, $env:MVNW_PASSWORD) +} +[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 +$webclient.DownloadFile($distributionUrl, "$TMP_DOWNLOAD_DIR/$distributionUrlName") | Out-Null + +# If specified, validate the SHA-256 sum of the Maven distribution zip file +$distributionSha256Sum = (Get-Content -Raw "$scriptDir/.mvn/wrapper/maven-wrapper.properties" | ConvertFrom-StringData).distributionSha256Sum +if ($distributionSha256Sum) { + if ($USE_MVND) { + Write-Error "Checksum validation is not supported for maven-mvnd. `nPlease disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties." + } + Import-Module $PSHOME\Modules\Microsoft.PowerShell.Utility -Function Get-FileHash + if ((Get-FileHash "$TMP_DOWNLOAD_DIR/$distributionUrlName" -Algorithm SHA256).Hash.ToLower() -ne $distributionSha256Sum) { + Write-Error "Error: Failed to validate Maven distribution SHA-256, your Maven distribution might be compromised. If you updated your Maven version, you need to update the specified distributionSha256Sum property." + } +} + +# unzip and move +Expand-Archive "$TMP_DOWNLOAD_DIR/$distributionUrlName" -DestinationPath "$TMP_DOWNLOAD_DIR" | Out-Null +Rename-Item -Path "$TMP_DOWNLOAD_DIR/$distributionUrlNameMain" -NewName $MAVEN_HOME_NAME | Out-Null +try { + Move-Item -Path "$TMP_DOWNLOAD_DIR/$MAVEN_HOME_NAME" -Destination $MAVEN_HOME_PARENT | Out-Null +} catch { + if (! (Test-Path -Path "$MAVEN_HOME" -PathType Container)) { + Write-Error "fail to move MAVEN_HOME" + } +} finally { + try { Remove-Item $TMP_DOWNLOAD_DIR -Recurse -Force | Out-Null } + catch { Write-Warning "Cannot remove $TMP_DOWNLOAD_DIR" } +} + +Write-Output "MVN_CMD=$MAVEN_HOME/bin/$MVN_CMD" diff --git a/bus-update-card-status/pom.xml b/bus-update-card-status/pom.xml new file mode 100644 index 0000000..b63c4bd --- /dev/null +++ b/bus-update-card-status/pom.xml @@ -0,0 +1,242 @@ + + + 4.0.0 + com.banesco + bus-update-card-status + 1.0-native-quarkus-jdk17 + bus-update-card-status + API Business - Update card status + + 17 + 17 + 3.13.0 + 17 + UTF-8 + UTF-8 + quarkus-bom + io.quarkus.platform + 3.19.3 + true + 3.5.2 + com.banesco.BusUpdateCardStatusApplication + + + + + + ${quarkus.platform.group-id} + ${quarkus.platform.artifact-id} + ${quarkus.platform.version} + pom + import + + + ${quarkus.platform.group-id} + quarkus-camel-bom + ${quarkus.platform.version} + pom + import + + + + + + + com.banesco + commons-bian + 1.0 + + + io.quarkus + quarkus-core + + + io.quarkus + quarkus-rest + + + io.quarkus + quarkus-rest-client + + + io.quarkus + quarkus-redis-client + + + io.quarkus + quarkus-rest-client-jackson + + + io.quarkus + quarkus-config-yaml + + + io.quarkus + quarkus-rest-jsonb + + + io.quarkus + quarkus-smallrye-openapi + + + io.quarkus + quarkus-swagger-ui + + + io.quarkus + quarkus-smallrye-health + + + io.quarkus + quarkus-arc + + + + io.quarkus + quarkus-junit5 + test + + + io.quarkus + quarkus-junit5-mockito + test + + + com.fasterxml.jackson.datatype + jackson-datatype-jsr310 + 2.17.2 + + + + io.rest-assured + rest-assured + test + + + org.projectlombok + lombok + 1.18.34 + provided + + + org.jboss.logmanager + jboss-logmanager + 3.0.6.Final + + + org.jboss.logging + jboss-logging + 3.6.0.Final + + + org.slf4j + slf4j-api + 2.0.13 + + + + + + + + org.eclipse.jkube + openshift-maven-plugin + 1.0.0 + + + + + maven-volumen + /root/.m2 + + + + + + + ${quarkus.platform.group-id} + quarkus-maven-plugin + ${quarkus.platform.version} + true + + + + build + generate-code + generate-code-tests + native-image-agent + + + + + + + maven-compiler-plugin + ${compiler-plugin.version} + + true + + + + org.apache.maven.plugins + maven-surefire-plugin + 3.1.2 + + + org.jboss.logmanager.LogManager + ${maven.home} + + + + + maven-failsafe-plugin + 3.0.0-M5 + + + + integration-test + verify + + + + + + ${project.build.directory}/${project.build.finalName}-runner + + org.jboss.logmanager.LogManager + ${maven.home} + + + + + + + + + native + + + native + + + + false + native + true + + + + + src/main/resources + + application-dev.yaml + application-local.yaml + + + + + + + diff --git a/bus-update-card-status/scripts/native/Dockerfile b/bus-update-card-status/scripts/native/Dockerfile new file mode 100644 index 0000000..b445f86 --- /dev/null +++ b/bus-update-card-status/scripts/native/Dockerfile @@ -0,0 +1,31 @@ +#### +# This Dockerfile is used in order to build a container that runs the Quarkus application in native (no JVM) mode. +# It uses a micro base image, tuned for Quarkus native executables. +# It reduces the size of the resulting container image. +# Check https://quarkus.io/guides/quarkus-runtime-base-image for further information about this image. +# +# Before building the container image run: +# +# ./mvnw package -Dnative +# +# Then, build the image with: +# +# docker build -f src/main/docker/Dockerfile.native-micro -t quarkus/rec-update-card-status . +# +# Then run the container using: +# +# docker run -i --rm -p 8080:8080 quarkus/rec-update-card-transaction-switch +# +### +FROM quay.io/quarkus/quarkus-micro-image:2.0 +RUN mkdir -p /work +ENV TZ="America/Caracas" +ENV LANGUAGE='en_US:en' +VOLUME /tmp +COPY /file/*-runner /work/recUpdateCardStatus +RUN chmod -R 775 /work +RUN ls -ltra /work/ +EXPOSE 8080 +WORKDIR /work/ + +ENTRYPOINT ["./recUpdateCardStatus", "-Dquarkus.http.host=0.0.0.0"] \ No newline at end of file diff --git a/bus-update-card-status/src/main/docker/Dockerfile.jvm b/bus-update-card-status/src/main/docker/Dockerfile.jvm new file mode 100644 index 0000000..f75486c --- /dev/null +++ b/bus-update-card-status/src/main/docker/Dockerfile.jvm @@ -0,0 +1,97 @@ +#### +# This Dockerfile_mvn is used in order to build a container that runs the Quarkus application in JVM mode +# +# Before building the container image run: +# +# ./mvnw package +# +# Then, build the image with: +# +# docker build -f src/main/docker/Dockerfile_mvn.jvm -t quarkus/prv-send-mail-jvm . +# +# Then run the container using: +# +# docker run -i --rm -p 8080:8080 quarkus/prv-send-mail-jvm +# +# If you want to include the debug port into your docker image +# you will have to expose the debug port (default 5005 being the default) like this : EXPOSE 8080 5005. +# Additionally you will have to set -e JAVA_DEBUG=true and -e JAVA_DEBUG_PORT=*:5005 +# when running the container +# +# Then run the container using : +# +# docker run -i --rm -p 8080:8080 quarkus/prv-send-mail-jvm +# +# This image uses the `run-java.sh` script to run the application. +# This scripts computes the command line to execute your Java application, and +# includes memory/GC tuning. +# You can configure the behavior using the following environment properties: +# - JAVA_OPTS: JVM options passed to the `java` command (example: "-verbose:class") +# - JAVA_OPTS_APPEND: User specified Java options to be appended to generated options +# in JAVA_OPTS (example: "-Dsome.property=foo") +# - JAVA_MAX_MEM_RATIO: Is used when no `-Xmx` option is given in JAVA_OPTS. This is +# used to calculate a default maximal heap memory based on a containers restriction. +# If used in a container without any memory constraints for the container then this +# option has no effect. If there is a memory constraint then `-Xmx` is set to a ratio +# of the container available memory as set here. The default is `50` which means 50% +# of the available memory is used as an upper boundary. You can skip this mechanism by +# setting this value to `0` in which case no `-Xmx` option is added. +# - JAVA_INITIAL_MEM_RATIO: Is used when no `-Xms` option is given in JAVA_OPTS. This +# is used to calculate a default initial heap memory based on the maximum heap memory. +# If used in a container without any memory constraints for the container then this +# option has no effect. If there is a memory constraint then `-Xms` is set to a ratio +# of the `-Xmx` memory as set here. The default is `25` which means 25% of the `-Xmx` +# is used as the initial heap size. You can skip this mechanism by setting this value +# to `0` in which case no `-Xms` option is added (example: "25") +# - JAVA_MAX_INITIAL_MEM: Is used when no `-Xms` option is given in JAVA_OPTS. +# This is used to calculate the maximum value of the initial heap memory. If used in +# a container without any memory constraints for the container then this option has +# no effect. If there is a memory constraint then `-Xms` is limited to the value set +# here. The default is 4096MB which means the calculated value of `-Xms` never will +# be greater than 4096MB. The value of this variable is expressed in MB (example: "4096") +# - JAVA_DIAGNOSTICS: Set this to get some diagnostics information to standard output +# when things are happening. This option, if set to true, will set +# `-XX:+UnlockDiagnosticVMOptions`. Disabled by default (example: "true"). +# - JAVA_DEBUG: If set remote debugging will be switched on. Disabled by default (example: +# true"). +# - JAVA_DEBUG_PORT: Port used for remote debugging. Defaults to 5005 (example: "8787"). +# - CONTAINER_CORE_LIMIT: A calculated core limit as described in +# https://www.kernel.org/doc/Documentation/scheduler/sched-bwc.txt. (example: "2") +# - CONTAINER_MAX_MEMORY: Memory limit given to the container (example: "1024"). +# - GC_MIN_HEAP_FREE_RATIO: Minimum percentage of heap free after GC to avoid expansion. +# (example: "20") +# - GC_MAX_HEAP_FREE_RATIO: Maximum percentage of heap free after GC to avoid shrinking. +# (example: "40") +# - GC_TIME_RATIO: Specifies the ratio of the time spent outside the garbage collection. +# (example: "4") +# - GC_ADAPTIVE_SIZE_POLICY_WEIGHT: The weighting given to the current GC time versus +# previous GC times. (example: "90") +# - GC_METASPACE_SIZE: The initial metaspace size. (example: "20") +# - GC_MAX_METASPACE_SIZE: The maximum metaspace size. (example: "100") +# - GC_CONTAINER_OPTIONS: Specify Java GC to use. The value of this variable should +# contain the necessary JRE command-line options to specify the required GC, which +# will override the default of `-XX:+UseParallelGC` (example: -XX:+UseG1GC). +# - HTTPS_PROXY: The location of the https proxy. (example: "myuser@127.0.0.1:8080") +# - HTTP_PROXY: The location of the http proxy. (example: "myuser@127.0.0.1:8080") +# - NO_PROXY: A comma separated lists of hosts, IP addresses or domains that can be +# accessed directly. (example: "foo.example.com,bar.example.com") +# +### +FROM registry.access.redhat.com/ubi8/openjdk-17:1.20 + +ENV LANGUAGE='en_US:en' + + +# We make four distinct layers so if there are application changes the library layers can be re-used +COPY --chown=185 target/quarkus-app/lib/ /deployments/lib/ +COPY --chown=185 target/quarkus-app/*.jar /deployments/ +COPY --chown=185 target/quarkus-app/app/ /deployments/app/ +COPY --chown=185 target/quarkus-app/quarkus/ /deployments/quarkus/ + +EXPOSE 8080 +USER 185 +ENV JAVA_OPTS_APPEND="-Dquarkus.http.host=0.0.0.0 -Djava.util.logging.manager=org.jboss.logmanager.LogManager" +ENV JAVA_APP_JAR="/deployments/quarkus-run.jar" + +ENTRYPOINT [ "/opt/jboss/container/java/run/run-java.sh" ] + diff --git a/bus-update-card-status/src/main/docker/Dockerfile.legacy-jar b/bus-update-card-status/src/main/docker/Dockerfile.legacy-jar new file mode 100644 index 0000000..21bfb9e --- /dev/null +++ b/bus-update-card-status/src/main/docker/Dockerfile.legacy-jar @@ -0,0 +1,93 @@ +#### +# This Dockerfile_mvn is used in order to build a container that runs the Quarkus application in JVM mode +# +# Before building the container image run: +# +# ./mvnw package -Dquarkus.package.jar.type=legacy-jar +# +# Then, build the image with: +# +# docker build -f src/main/docker/Dockerfile_mvn.legacy-jar -t quarkus/prv-send-mail-legacy-jar . +# +# Then run the container using: +# +# docker run -i --rm -p 8080:8080 quarkus/prv-send-mail-legacy-jar +# +# If you want to include the debug port into your docker image +# you will have to expose the debug port (default 5005 being the default) like this : EXPOSE 8080 5005. +# Additionally you will have to set -e JAVA_DEBUG=true and -e JAVA_DEBUG_PORT=*:5005 +# when running the container +# +# Then run the container using : +# +# docker run -i --rm -p 8080:8080 quarkus/prv-send-mail-legacy-jar +# +# This image uses the `run-java.sh` script to run the application. +# This scripts computes the command line to execute your Java application, and +# includes memory/GC tuning. +# You can configure the behavior using the following environment properties: +# - JAVA_OPTS: JVM options passed to the `java` command (example: "-verbose:class") +# - JAVA_OPTS_APPEND: User specified Java options to be appended to generated options +# in JAVA_OPTS (example: "-Dsome.property=foo") +# - JAVA_MAX_MEM_RATIO: Is used when no `-Xmx` option is given in JAVA_OPTS. This is +# used to calculate a default maximal heap memory based on a containers restriction. +# If used in a container without any memory constraints for the container then this +# option has no effect. If there is a memory constraint then `-Xmx` is set to a ratio +# of the container available memory as set here. The default is `50` which means 50% +# of the available memory is used as an upper boundary. You can skip this mechanism by +# setting this value to `0` in which case no `-Xmx` option is added. +# - JAVA_INITIAL_MEM_RATIO: Is used when no `-Xms` option is given in JAVA_OPTS. This +# is used to calculate a default initial heap memory based on the maximum heap memory. +# If used in a container without any memory constraints for the container then this +# option has no effect. If there is a memory constraint then `-Xms` is set to a ratio +# of the `-Xmx` memory as set here. The default is `25` which means 25% of the `-Xmx` +# is used as the initial heap size. You can skip this mechanism by setting this value +# to `0` in which case no `-Xms` option is added (example: "25") +# - JAVA_MAX_INITIAL_MEM: Is used when no `-Xms` option is given in JAVA_OPTS. +# This is used to calculate the maximum value of the initial heap memory. If used in +# a container without any memory constraints for the container then this option has +# no effect. If there is a memory constraint then `-Xms` is limited to the value set +# here. The default is 4096MB which means the calculated value of `-Xms` never will +# be greater than 4096MB. The value of this variable is expressed in MB (example: "4096") +# - JAVA_DIAGNOSTICS: Set this to get some diagnostics information to standard output +# when things are happening. This option, if set to true, will set +# `-XX:+UnlockDiagnosticVMOptions`. Disabled by default (example: "true"). +# - JAVA_DEBUG: If set remote debugging will be switched on. Disabled by default (example: +# true"). +# - JAVA_DEBUG_PORT: Port used for remote debugging. Defaults to 5005 (example: "8787"). +# - CONTAINER_CORE_LIMIT: A calculated core limit as described in +# https://www.kernel.org/doc/Documentation/scheduler/sched-bwc.txt. (example: "2") +# - CONTAINER_MAX_MEMORY: Memory limit given to the container (example: "1024"). +# - GC_MIN_HEAP_FREE_RATIO: Minimum percentage of heap free after GC to avoid expansion. +# (example: "20") +# - GC_MAX_HEAP_FREE_RATIO: Maximum percentage of heap free after GC to avoid shrinking. +# (example: "40") +# - GC_TIME_RATIO: Specifies the ratio of the time spent outside the garbage collection. +# (example: "4") +# - GC_ADAPTIVE_SIZE_POLICY_WEIGHT: The weighting given to the current GC time versus +# previous GC times. (example: "90") +# - GC_METASPACE_SIZE: The initial metaspace size. (example: "20") +# - GC_MAX_METASPACE_SIZE: The maximum metaspace size. (example: "100") +# - GC_CONTAINER_OPTIONS: Specify Java GC to use. The value of this variable should +# contain the necessary JRE command-line options to specify the required GC, which +# will override the default of `-XX:+UseParallelGC` (example: -XX:+UseG1GC). +# - HTTPS_PROXY: The location of the https proxy. (example: "myuser@127.0.0.1:8080") +# - HTTP_PROXY: The location of the http proxy. (example: "myuser@127.0.0.1:8080") +# - NO_PROXY: A comma separated lists of hosts, IP addresses or domains that can be +# accessed directly. (example: "foo.example.com,bar.example.com") +# +### +FROM registry.access.redhat.com/ubi8/openjdk-17:1.20 + +ENV LANGUAGE='en_US:en' + + +COPY target/lib/* /deployments/lib/ +COPY target/*-runner.jar /deployments/quarkus-run.jar + +EXPOSE 8080 +USER 185 +ENV JAVA_OPTS_APPEND="-Dquarkus.http.host=0.0.0.0 -Djava.util.logging.manager=org.jboss.logmanager.LogManager" +ENV JAVA_APP_JAR="/deployments/quarkus-run.jar" + +ENTRYPOINT [ "/opt/jboss/container/java/run/run-java.sh" ] diff --git a/bus-update-card-status/src/main/docker/Dockerfile.native b/bus-update-card-status/src/main/docker/Dockerfile.native new file mode 100644 index 0000000..b698d4e --- /dev/null +++ b/bus-update-card-status/src/main/docker/Dockerfile.native @@ -0,0 +1,29 @@ +#### +# This Dockerfile_mvn is used in order to build a container that runs the Quarkus application in native (no JVM) mode. +# +# Before building the container image run: +# +# ./mvnw package -Dnative +# +# Then, build the image with: +# +# docker build -f src/main/docker/Dockerfile_mvn.native -t quarkus/prv-send-mail . +# +# Then run the container using: +# +# docker run -i --rm -p 8080:8080 quarkus/prv-send-mail +# +### +FROM registry.access.redhat.com/ubi8/ubi-minimal:8.10 +WORKDIR /work/ +RUN ls -ltra /work +RUN ls -ltra target/ +RUN chown 1001 /work \ + && chmod "g+rwX" /work \ + && chown 1001:root /work +COPY --chown=1001:root target/*-runner /work/application + +EXPOSE 8080 +USER 1001 + +ENTRYPOINT ["./application", "-Dquarkus.http.host=0.0.0.0"] diff --git a/bus-update-card-status/src/main/docker/Dockerfile.native-micro b/bus-update-card-status/src/main/docker/Dockerfile.native-micro new file mode 100644 index 0000000..3ca02d3 --- /dev/null +++ b/bus-update-card-status/src/main/docker/Dockerfile.native-micro @@ -0,0 +1,30 @@ +#### +# This Dockerfile_mvn is used in order to build a container that runs the Quarkus application in native (no JVM) mode. +# It uses a micro base image, tuned for Quarkus native executables. +# It reduces the size of the resulting container image. +# Check https://quarkus.io/guides/quarkus-runtime-base-image for further information about this image. +# +# Before building the container image run: +# +# ./mvnw package -Dnative +# +# Then, build the image with: +# +# docker build -f src/main/docker/Dockerfile_mvn.native-micro -t quarkus/prv-send-mail . +# +# Then run the container using: +# +# docker run -i --rm -p 8080:8080 quarkus/prv-send-mail +# +### +FROM quay.io/quarkus/quarkus-micro-image:2.0 +WORKDIR /work/ +RUN chown 1001 /work \ + && chmod "g+rwX" /work \ + && chown 1001:root /work +COPY --chown=1001:root target/*-runner /work/application + +EXPOSE 8080 +USER 1001 + +ENTRYPOINT ["./application", "-Dquarkus.http.host=0.0.0.0"] diff --git a/bus-update-card-status/src/main/java/com/banesco/BusUpdateCardStatusApplication.java b/bus-update-card-status/src/main/java/com/banesco/BusUpdateCardStatusApplication.java new file mode 100644 index 0000000..eba346c --- /dev/null +++ b/bus-update-card-status/src/main/java/com/banesco/BusUpdateCardStatusApplication.java @@ -0,0 +1,13 @@ +package com.banesco; + +import io.quarkus.runtime.Quarkus; +import io.quarkus.runtime.annotations.QuarkusMain; + +@QuarkusMain +public class BusUpdateCardStatusApplication { + + public static void main(String[] args) { + System.out.println("Starting Business Update Card Status ..........."); + Quarkus.run(); + } +} \ No newline at end of file diff --git a/bus-update-card-status/src/main/java/com/banesco/application/UpdateConfigResponse.java b/bus-update-card-status/src/main/java/com/banesco/application/UpdateConfigResponse.java new file mode 100644 index 0000000..c54e00a --- /dev/null +++ b/bus-update-card-status/src/main/java/com/banesco/application/UpdateConfigResponse.java @@ -0,0 +1,42 @@ +package com.banesco.application; + +import io.quarkus.runtime.annotations.RegisterForReflection; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.List; + + +@Data +@RegisterForReflection +public class UpdateConfigResponse { + + private String result; + private List configMapList; + private String error; + + + @Data + @AllArgsConstructor + @NoArgsConstructor + public static class ConfigModel { + private String namespace; + private String configMapName; + private List properties; + + + @Data + @AllArgsConstructor + @NoArgsConstructor + public static class PropertyChange { + private String name; + private String oldValue; + private String newValue; + private String withError; + } + + } + + +} diff --git a/bus-update-card-status/src/main/java/com/banesco/application/helper/UpdateCardStatusRequestValidator.java b/bus-update-card-status/src/main/java/com/banesco/application/helper/UpdateCardStatusRequestValidator.java new file mode 100644 index 0000000..1a92b57 --- /dev/null +++ b/bus-update-card-status/src/main/java/com/banesco/application/helper/UpdateCardStatusRequestValidator.java @@ -0,0 +1,95 @@ +package com.banesco.application.helper; + + +import com.banesco.common.application.exception.BanRuntimeException; +import com.banesco.common.domain.dto.bian.device.StringHelper; +import com.banesco.commons.config.StatusCodes; +import com.banesco.domain.bian.request.BusUpdateCardStatusRequest; +import jakarta.enterprise.context.ApplicationScoped; + +@ApplicationScoped +public class UpdateCardStatusRequestValidator { + + // Function to check invalid fields + public void validatedRequest( + BusUpdateCardStatusRequest request + ) { + + if (request == null) { + throw new BanRuntimeException(StatusCodes.FIELD_REQUIRED, "body"); + } + //check header + if (StringHelper.isEmpty(request.getCustomerReferenceFintechId())) { + throw new BanRuntimeException(StatusCodes.FIELD_REQUIRED, "customerReferenceFintechId"); + } + + if (StringHelper.isEmpty(request.getRequestId())) { + throw new BanRuntimeException(StatusCodes.FIELD_REQUIRED, "requestId"); + } + + + // Device + if (request.getDevice() == null) { + throw new BanRuntimeException(StatusCodes.FIELD_REQUIRED, "device"); + } + + if (StringHelper.isEmpty(request.getDevice().getDeviceType())) { + throw new BanRuntimeException(StatusCodes.FIELD_REQUIRED, "device.deviceType"); + } + + if (StringHelper.isEmpty(request.getDevice().getDeviceDescription())) { + throw new BanRuntimeException(StatusCodes.FIELD_REQUIRED, "device.deviceDescription"); + } + + + if (StringHelper.isEmpty(request.getDevice().getDeviceSessionReference())) { + throw new BanRuntimeException(StatusCodes.FIELD_REQUIRED, "device.deviceSessionReference"); + } + + + // Customer + + var customerReference = request.getCustomerReference(); + if (customerReference == null) { + throw new BanRuntimeException(StatusCodes.FIELD_REQUIRED, "customerReference"); + } + + if (StringHelper.isEmpty(customerReference.getCustomerIdType())) { + throw new BanRuntimeException(StatusCodes.FIELD_REQUIRED, "customerReference.customerIdType"); + } + + // Card + + + var paymentCard = request.getCardReference(); + if (paymentCard == null) { + throw new BanRuntimeException(StatusCodes.FIELD_REQUIRED, "cardReference.paymentCard"); + } + + if (StringHelper.isEmpty(paymentCard.getCardType())) { + throw new BanRuntimeException(StatusCodes.FIELD_REQUIRED, "cardReference.cardType"); + } + + + if (StringHelper.isEmpty(paymentCard.getCardNumber())) { + throw new BanRuntimeException(StatusCodes.FIELD_REQUIRED, "cardReference.cardNumber"); + } + + + if (StringHelper.isEmpty(paymentCard.getCardStatusCode())) { + throw new BanRuntimeException(StatusCodes.FIELD_REQUIRED, "cardReference.cardStatusCode"); + } + + if (StringHelper.isEmpty(paymentCard.getCardStatusAction())) { + throw new BanRuntimeException(StatusCodes.FIELD_REQUIRED, "cardReference.cardStatusAction"); + } + + + if (StringHelper.isEmpty(paymentCard.getCardStatusReason())) { + throw new BanRuntimeException(StatusCodes.FIELD_REQUIRED, "cardReference.cardStatusReason"); + } + + + } + +} diff --git a/bus-update-card-status/src/main/java/com/banesco/application/rest/controllers/UpdateCardStatusController.java b/bus-update-card-status/src/main/java/com/banesco/application/rest/controllers/UpdateCardStatusController.java new file mode 100644 index 0000000..c0e32eb --- /dev/null +++ b/bus-update-card-status/src/main/java/com/banesco/application/rest/controllers/UpdateCardStatusController.java @@ -0,0 +1,217 @@ +package com.banesco.application.rest.controllers; + +import com.banesco.application.helper.UpdateCardStatusRequestValidator; +import com.banesco.common.application.exception.BanBackendException; +import com.banesco.common.application.exception.BanRuntimeException; +import com.banesco.common.domain.dto.bian.device.JsonHelper; +import com.banesco.common.domain.dto.bian.device.LoggerHelper; +import com.banesco.common.domain.dto.bian.response.StatusResponse; +import com.banesco.commons.config.AppConf; +import com.banesco.commons.config.StatusCodes; +import com.banesco.domain.bian.request.BusUpdateCardStatusRequest; +import com.banesco.domain.bian.response.BusUpdateCardStatusResponse; +import com.banesco.domain.ports.inbound.UpdateCardStatusUseCase; +import jakarta.inject.Inject; +import jakarta.ws.rs.Consumes; +import jakarta.ws.rs.PUT; +import jakarta.ws.rs.Path; +import jakarta.ws.rs.Produces; +import jakarta.ws.rs.core.MediaType; +import jakarta.ws.rs.core.Response; +import lombok.extern.slf4j.Slf4j; +import org.eclipse.microprofile.openapi.annotations.OpenAPIDefinition; +import org.eclipse.microprofile.openapi.annotations.Operation; +import org.eclipse.microprofile.openapi.annotations.info.Info; +import org.eclipse.microprofile.openapi.annotations.media.Content; +import org.eclipse.microprofile.openapi.annotations.media.ExampleObject; +import org.eclipse.microprofile.openapi.annotations.media.Schema; +import org.eclipse.microprofile.openapi.annotations.parameters.RequestBody; +import org.eclipse.microprofile.openapi.annotations.responses.APIResponse; +import org.eclipse.microprofile.openapi.annotations.responses.APIResponses; + +@OpenAPIDefinition(info = @Info( + title = "bus-update-card-status", + version = "1.0", + description = "API Business - Cancelación de TDD") +) +@Path("/card/status/update") +@Consumes(MediaType.APPLICATION_JSON) +@Produces(MediaType.APPLICATION_JSON) +@Slf4j +public class UpdateCardStatusController { + + private final UpdateCardStatusRequestValidator updateCardStatusRequestValidator; + private final UpdateCardStatusUseCase updateCardStatusUseCase; + + + @Inject + AppConf appConf; + + @Inject + public UpdateCardStatusController( + UpdateCardStatusRequestValidator updateCardStatusRequestValidator, + UpdateCardStatusUseCase updateCardStatusUseCase + ) { + + this.updateCardStatusRequestValidator = updateCardStatusRequestValidator; + this.updateCardStatusUseCase = updateCardStatusUseCase; + } + + @PUT + @Operation( + summary = "updateCardStatus", + description = "Permite cambiar el estatus de las tarjetas de los clientes." + ) + @RequestBody( + description = "Datos de la solicitud para actualizar el estatus de la tarjeta", + required = true, + content = @Content( + mediaType = MediaType.APPLICATION_JSON, + schema = @Schema(implementation = BusUpdateCardStatusRequest.class), + examples = { + @ExampleObject( + name = "Ejemplo exitoso", + summary = "Petición con datos válidos", + value = "{\n" + + " \"requestId\": \"Req123\",\n" + + " \"customerReferenceFintechId \": \"500634269\"\n" + + " \"customerReference\": {\n" + + " \"customerIdType\": \"J\",\n" + + " \"customerId\": \"500634269\"\n" + + " },\n" + + " \"device\": {\n" + + " \"deviceType\": \"Mobile\",\n" + + " \"deviceDescription\": \"Xiaomi Note 11 PRO\",\n" + + " \"deviceIp\": \"127.0.0.1\",\n" + + " \"deviceSessionReference\": \"12345678901304\"\n" + + " },\n" + + " \"cardReference\": {\n" + + " \"cardType\": \"DebitCard\",\n" + + " \"cardNumber\": \"6012-8862-0791-7605\",\n" + + " \"cardStatusCode\": \"52\",\n" + + " \"cardStatusAction\": \"CV\",\n" + + " \"cardStatusReason\": \"Bloqueo Temporal\"\n" + + " }\n" + + "}" + ), + @ExampleObject( + name = "Ejemplo Error de validación", + summary = "Petición con formato inválido", + value = "{\n" + + " \"requestId\": \"Req123\",\n" + + " \"customerReferenceFintechId \": \"500634269\"\n" + + " \"customerReference\": {\n" + + " \"customerIdType\": \"V\",\n" + + " \"customerId\": \"500634269\"\n" + + " },\n" + + " \"device\": {\n" + + " \"deviceType\": \"Mobile\",\n" + + " \"deviceDescription\": \"Xiaomi Note 11 PRO\",\n" + + " \"deviceIp\": \"127.0.0.1\",\n" + + " \"deviceSessionReference\": \"12345678901304\"\n" + + " },\n" + + " \"cardReference\": {\n" + + " \"cardType\": \"DebitCard\",\n" + + " \"cardNumber\": \"6012886207917605\",\n" + + " \"cardStatusCode\": \"52\",\n" + + " \"cardStatusAction\": \"CV\",\n" + + " \"cardStatusReason\": \"Bloqueo Temporal\"\n" + + " }\n" + + "}" + ) + } + ) + ) + @APIResponses(value = { + @APIResponse( + responseCode = "200", + description = "Operación exitosa", + + content = @Content( + mediaType = MediaType.APPLICATION_JSON, + schema = @Schema(implementation = BusUpdateCardStatusResponse.class), + examples = @ExampleObject( + name = "Ejemplo exitoso", + value = "{\"statusResponse\":{\"status\":\"ok\",\"statusCode\":\"200\",\"message\":\"Operacion exitosa\",\"requestId\":\"UCSS123456789\"}}" + ) + ) + ), + @APIResponse( + responseCode = "400", + description = "Error en formato o campo requerido", + content = @Content( + mediaType = MediaType.APPLICATION_JSON, + schema = @Schema(implementation = BusUpdateCardStatusResponse.class), + examples = @ExampleObject( + name = "Ejemplo Error de validación", + value = "{\"statusResponse\":{\"status\":\"error\",\"statusCode\":\"VDE02\",\"message\":\"VDE02 - Error en formato del campo: cardReference.cardNumber\",\"requestId\":\"UCSS123456789\"}}" + ) + ) + ) + }) + public Response updateCardStatus( + BusUpdateCardStatusRequest request) { + + + BusUpdateCardStatusResponse dataResponse = null; + log.info("INICIO =>"); + String requestId = request.getRequestId(); + log.info(LoggerHelper.buildInfoRequest(requestId, JsonHelper.getJsonFromObject(request))); + + String backendCode = StatusCodes.INTERNAL_ERROR.getStatusCode(); + String backendDesc = StatusCodes.INTERNAL_ERROR.getStatusDesc(); + String target = null; + + try { + // Validate Request + updateCardStatusRequestValidator.validatedRequest(request); + + updateCardStatusUseCase.execute(request); + + backendCode = StatusCodes.SUCCESS_OPERATION.getStatusCode(); + backendDesc = StatusCodes.SUCCESS_OPERATION.getStatusDesc(); + } catch (BanRuntimeException e) { + backendCode = e.getStatusCode().getStatusCode(); + + log.error(LoggerHelper.buildError(requestId, backendCode + " - " + e.getMessage())); + if (e.getTarget() != null) { + backendDesc = e.getStatusCode().getStatusDesc().formatted(e.getTarget()); + } else { + backendDesc = e.getStatusCode().getStatusDesc(); + } + + + } catch (BanBackendException e) { + backendCode = e.getBackendCode(); + log.error(LoggerHelper.buildError(requestId, backendCode + " - " + e.getMessage())); + if (e.getTarget() != null) { + backendDesc = e.getBackendDesc() + " - " + e.getTarget(); + } else { + backendDesc = e.getBackendDesc(); + } + + } catch (Exception e) { + log.error(LoggerHelper.buildError(requestId, backendCode + " - " + e.getMessage())); + } + + BusUpdateCardStatusResponse response = new BusUpdateCardStatusResponse(); + response.setStatusResponse( + new StatusResponse( + backendCode.equals(StatusCodes.SUCCESS_OPERATION.getStatusCode()) ? "ok" : "error", + backendCode, + backendDesc, + requestId + ) + ); + + String outputJson = response.toString(); + + log.info(LoggerHelper.buildInfoResponse(requestId, outputJson)); + + return Response.status(200) + .entity(outputJson) + .build(); + } + + +} diff --git a/bus-update-card-status/src/main/java/com/banesco/commons/config/AppConf.java b/bus-update-card-status/src/main/java/com/banesco/commons/config/AppConf.java new file mode 100644 index 0000000..a8bf2ff --- /dev/null +++ b/bus-update-card-status/src/main/java/com/banesco/commons/config/AppConf.java @@ -0,0 +1,97 @@ +package com.banesco.commons.config; + +import com.banesco.common.application.exception.BanRuntimeException; +import com.banesco.common.domain.dto.bian.device.DateHelper; +import com.banesco.common.domain.dto.bian.device.JsonHelper; +import com.banesco.common.domain.dto.bian.device.RequestHelper; +import com.banesco.common.domain.model.ApiConfig; +import com.banesco.commons.exceptions.BanConfigException; +import com.banesco.domain.models.CurrentState; +import jakarta.inject.Singleton; +import lombok.Getter; +import lombok.extern.slf4j.Slf4j; +import org.eclipse.microprofile.config.Config; +import org.eclipse.microprofile.config.ConfigProvider; + +import java.time.LocalDateTime; +import java.util.NoSuchElementException; + + +@Singleton +@Getter +@Slf4j +public class AppConf { + + private static AppConf _INSTANCE; + + private final String appSourceId; + private final Config configEnv; + private final RequestHelper requestHelper; + + public String soapDomainCurrent; + + DateHelper dateHelper = DateHelper.getInstance(); + + public static void getInstance() { + + synchronized (AppConf.class) { + if (_INSTANCE == null) { + log.info("AppConf getInstance-->"); + _INSTANCE = new AppConf(); + } + } + } + + public AppConf() { + + log.info("NEW INSTANCE AppConf**********************************"); + try { + + configEnv = ConfigProvider.getConfig(); + + requestHelper = new RequestHelper(); + + soapDomainCurrent = configEnv.getValue("soap.domain.current", String.class); + + appSourceId = configEnv.getValue("api.source-id", String.class); + + _INSTANCE = this; + } catch (NoSuchElementException e) { + String errorMessage = "[ERROR CONFIG]: [%s]".formatted(e.getMessage()); + log.error(errorMessage); + throw new BanConfigException(errorMessage); + } catch (Exception e) { + String errorMessage = "[ERROR CONFIG]: [%s]".formatted(e.getMessage()); + log.error(errorMessage); + throw new BanConfigException(errorMessage); + } + + } + + + public ApiConfig loadApiConfig(String apiName) { + + try { + + log.info("Loading APIConfig with key:{}", apiName); + String apiConfig = configEnv.getValue(apiName, String.class); + return JsonHelper.getObjectFromJson(apiConfig, ApiConfig.class); + } catch (Exception e) { + log.error("Error Loading API Config: {} -> {}", apiName, e.getMessage()); + throw new BanRuntimeException(StatusCodes.INTERNAL_ERROR); + } + + } + + + public CurrentState getCurrentState(String requestId) { + + LocalDateTime now = dateHelper.getCurrentDateTime(); + return new CurrentState( + dateHelper.getDate(now), + dateHelper.getTime(now), + requestId + ); + } + +} diff --git a/bus-update-card-status/src/main/java/com/banesco/commons/config/StatusCodes.java b/bus-update-card-status/src/main/java/com/banesco/commons/config/StatusCodes.java new file mode 100644 index 0000000..3275f5f --- /dev/null +++ b/bus-update-card-status/src/main/java/com/banesco/commons/config/StatusCodes.java @@ -0,0 +1,28 @@ +package com.banesco.commons.config; + + +import com.banesco.common.domain.interfaces.BaseStatusCodesEnum; +import lombok.Getter; + +/** + * Clase para definir Status de Respuesta. + */ +@Getter +public enum StatusCodes implements BaseStatusCodesEnum { + + SUCCESS_OPERATION("OK", "Operación exitosa"), + REDIS_DATA_NOT_FOUND("R404", "Datos de validación no encontrado."), + FIELD_REQUIRED("VDE01", "ERROR CAMPO REQUERIDO: %s"), + INVALID_FORMAT("VDE02", "ERROR EN FORMATO DEL CAMPO: %s"), + INTERNAL_ERROR("500", "ERROR INTERNO"), + FAILED_DEPENDENCY("424", "FALLA DE DEPENDENCIA"); + + private String statusCode; + private String statusDesc; + + StatusCodes(String statusCode, String statusDesc) { + this.statusCode = statusCode; + this.statusDesc = statusDesc; + } + +} diff --git a/bus-update-card-status/src/main/java/com/banesco/commons/exceptions/BanConfigException.java b/bus-update-card-status/src/main/java/com/banesco/commons/exceptions/BanConfigException.java new file mode 100644 index 0000000..cc9a486 --- /dev/null +++ b/bus-update-card-status/src/main/java/com/banesco/commons/exceptions/BanConfigException.java @@ -0,0 +1,9 @@ +package com.banesco.commons.exceptions; + +public class BanConfigException extends RuntimeException { + + public BanConfigException(String message) { + super(message); + } + +} diff --git a/bus-update-card-status/src/main/java/com/banesco/commons/exceptions/InternalExceptionMapper.java b/bus-update-card-status/src/main/java/com/banesco/commons/exceptions/InternalExceptionMapper.java new file mode 100644 index 0000000..70dffff --- /dev/null +++ b/bus-update-card-status/src/main/java/com/banesco/commons/exceptions/InternalExceptionMapper.java @@ -0,0 +1,55 @@ +package com.banesco.commons.exceptions; + +import com.banesco.common.domain.dto.bian.response.StatusResponse; +import com.banesco.domain.bian.response.BusUpdateCardStatusResponse; +import io.vertx.ext.web.RoutingContext; +import jakarta.inject.Inject; +import jakarta.ws.rs.core.Response; +import lombok.extern.slf4j.Slf4j; +import org.jboss.resteasy.reactive.server.ServerExceptionMapper; +import org.jboss.resteasy.reactive.server.UnwrapException; + +import java.util.HashMap; +import java.util.Map; +import java.util.concurrent.CompletionException; + +@UnwrapException({CompletionException.class, BanConfigException.class}) +@Slf4j +public class InternalExceptionMapper { + + @Inject + RoutingContext routingContext; // Injecting the RoutingContext + + @ServerExceptionMapper + public Response handleConfigException(Exception ex) { + String uri = routingContext.request().uri(); + + switch (uri) { + + case "/card/status/update": + BusUpdateCardStatusResponse response = new BusUpdateCardStatusResponse(); + response.setStatusResponse( + new StatusResponse( + "error", + "CONFLICT", + "Uso interno", + null + ) + ); + return Response.status(Response.Status.INTERNAL_SERVER_ERROR) + .entity(response.toString()) + .build(); + default: + + + } + + Map errorMap = new HashMap<>(); + errorMap.put("error", "USO INTERNO"); + + + return Response.status(Response.Status.INTERNAL_SERVER_ERROR) + .entity(errorMap).build(); + } + +} \ No newline at end of file diff --git a/bus-update-card-status/src/main/java/com/banesco/commons/exceptions/MalformedPayloadExceptionMapper.java b/bus-update-card-status/src/main/java/com/banesco/commons/exceptions/MalformedPayloadExceptionMapper.java new file mode 100644 index 0000000..0e2b663 --- /dev/null +++ b/bus-update-card-status/src/main/java/com/banesco/commons/exceptions/MalformedPayloadExceptionMapper.java @@ -0,0 +1,46 @@ +package com.banesco.commons.exceptions; + +import com.banesco.common.domain.dto.bian.response.StatusResponse; +import com.banesco.commons.config.StatusCodes; +import com.banesco.domain.bian.response.BusUpdateCardStatusResponse; +import io.vertx.core.http.HttpServerRequest; +import io.vertx.ext.web.RoutingContext; +import jakarta.inject.Inject; +import jakarta.json.bind.JsonbException; +import jakarta.ws.rs.core.Response; +import jakarta.ws.rs.ext.ExceptionMapper; +import jakarta.ws.rs.ext.Provider; +import lombok.extern.slf4j.Slf4j; + +@Provider +@Slf4j +public class MalformedPayloadExceptionMapper implements ExceptionMapper { + + @Inject + RoutingContext routingContext; // Injecting the RoutingContext + + @Override + public Response toResponse(JsonbException exception) { + + HttpServerRequest headers = routingContext.request(); + log.error("INICIO ERROR => {}", exception.getMessage()); + log.error("[HEADERS {}]: [\nfintechId: {}\nappId: {}]", + headers.getHeader("fintechId"), + headers.getHeader("appId")); + + + String jsonResult = (new BusUpdateCardStatusResponse( new StatusResponse( + "error", + StatusCodes.INVALID_FORMAT.getStatusCode(), + StatusCodes.INVALID_FORMAT.getStatusDesc().formatted("body"), + null + ))).toString(); + + log.error("[RESPONSE]: [{}]", jsonResult); + return Response.status(Response.Status.BAD_REQUEST) + .entity( + jsonResult + ) + .build(); + } +} \ No newline at end of file diff --git a/bus-update-card-status/src/main/java/com/banesco/commons/utils/ResponseUtil.java b/bus-update-card-status/src/main/java/com/banesco/commons/utils/ResponseUtil.java new file mode 100644 index 0000000..ca387f5 --- /dev/null +++ b/bus-update-card-status/src/main/java/com/banesco/commons/utils/ResponseUtil.java @@ -0,0 +1,12 @@ +package com.banesco.commons.utils; + +import com.banesco.common.domain.dto.bian.response.StatusResponse; +import com.banesco.commons.config.StatusCodes; + + +public class ResponseUtil { + + public static StatusResponse mapErrorResponse(String requestId, StatusCodes statusCodes) { + return new StatusResponse("error", statusCodes.getStatusCode(), statusCodes.getStatusDesc(), requestId); + } +} diff --git a/bus-update-card-status/src/main/java/com/banesco/domain/bian/dto/CardReference.java b/bus-update-card-status/src/main/java/com/banesco/domain/bian/dto/CardReference.java new file mode 100644 index 0000000..57d9ae0 --- /dev/null +++ b/bus-update-card-status/src/main/java/com/banesco/domain/bian/dto/CardReference.java @@ -0,0 +1,17 @@ +package com.banesco.domain.bian.dto; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + + +@Data +@NoArgsConstructor +@AllArgsConstructor +public class CardReference { + String cardType; + String cardNumber; + String cardStatusCode; + String cardStatusAction; + String cardStatusReason; +} diff --git a/bus-update-card-status/src/main/java/com/banesco/domain/bian/request/BusUpdateCardStatusRequest.java b/bus-update-card-status/src/main/java/com/banesco/domain/bian/request/BusUpdateCardStatusRequest.java new file mode 100644 index 0000000..1383253 --- /dev/null +++ b/bus-update-card-status/src/main/java/com/banesco/domain/bian/request/BusUpdateCardStatusRequest.java @@ -0,0 +1,20 @@ +package com.banesco.domain.bian.request; + +import com.banesco.common.domain.dto.bian.customer.CustomerReference; +import com.banesco.common.domain.dto.bian.device.Device; +import com.banesco.domain.bian.dto.CardReference; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + + +@Data +@AllArgsConstructor +@NoArgsConstructor +public class BusUpdateCardStatusRequest { + String requestId; + String customerReferenceFintechId; + CustomerReference customerReference; + Device device; + CardReference cardReference; +} diff --git a/bus-update-card-status/src/main/java/com/banesco/domain/bian/response/BusUpdateCardStatusResponse.java b/bus-update-card-status/src/main/java/com/banesco/domain/bian/response/BusUpdateCardStatusResponse.java new file mode 100644 index 0000000..9df57df --- /dev/null +++ b/bus-update-card-status/src/main/java/com/banesco/domain/bian/response/BusUpdateCardStatusResponse.java @@ -0,0 +1,28 @@ +package com.banesco.domain.bian.response; + + +import com.banesco.common.domain.dto.bian.response.BaseResponse; +import com.banesco.common.domain.dto.bian.response.StatusResponse; +import io.quarkus.runtime.annotations.RegisterForReflection; +import lombok.EqualsAndHashCode; + + +@RegisterForReflection +@EqualsAndHashCode(callSuper = false) +public class BusUpdateCardStatusResponse extends BaseResponse { + + public BusUpdateCardStatusResponse() { + super(); + } + + public BusUpdateCardStatusResponse(StatusResponse statusResponse) { + super(statusResponse); + } + + @Override + public String toString() { + + return "{\"statusResponse\":%s}".formatted(statusResponse.toString()); + } + +} diff --git a/bus-update-card-status/src/main/java/com/banesco/domain/models/CurrentState.java b/bus-update-card-status/src/main/java/com/banesco/domain/models/CurrentState.java new file mode 100644 index 0000000..cc07d1d --- /dev/null +++ b/bus-update-card-status/src/main/java/com/banesco/domain/models/CurrentState.java @@ -0,0 +1,13 @@ +package com.banesco.domain.models; + +import io.quarkus.runtime.annotations.RegisterForReflection; + +@RegisterForReflection +public record CurrentState(String date, String time, String requestId) { + + + public String getTransactionDate() { + return date.concat("T".concat(time)); + } + +} diff --git a/bus-update-card-status/src/main/java/com/banesco/domain/ports/inbound/UpdateCardStatusUseCase.java b/bus-update-card-status/src/main/java/com/banesco/domain/ports/inbound/UpdateCardStatusUseCase.java new file mode 100644 index 0000000..a50f3fb --- /dev/null +++ b/bus-update-card-status/src/main/java/com/banesco/domain/ports/inbound/UpdateCardStatusUseCase.java @@ -0,0 +1,10 @@ +package com.banesco.domain.ports.inbound; + +import com.banesco.domain.bian.request.BusUpdateCardStatusRequest; + +public interface UpdateCardStatusUseCase { + + void execute( + BusUpdateCardStatusRequest request + ); +} diff --git a/bus-update-card-status/src/main/java/com/banesco/domain/ports/outbound/PaymentCardPort.java b/bus-update-card-status/src/main/java/com/banesco/domain/ports/outbound/PaymentCardPort.java new file mode 100644 index 0000000..1bc47c0 --- /dev/null +++ b/bus-update-card-status/src/main/java/com/banesco/domain/ports/outbound/PaymentCardPort.java @@ -0,0 +1,9 @@ +package com.banesco.domain.ports.outbound; + +import com.banesco.common.domain.dto.bian.response.StatusResponse; +import com.banesco.domain.bian.request.BusUpdateCardStatusRequest; + +public interface PaymentCardPort { + + StatusResponse updateCardStatus(String productAccountId, BusUpdateCardStatusRequest request); +} diff --git a/bus-update-card-status/src/main/java/com/banesco/domain/ports/outbound/RedisPort.java b/bus-update-card-status/src/main/java/com/banesco/domain/ports/outbound/RedisPort.java new file mode 100644 index 0000000..ec17dd6 --- /dev/null +++ b/bus-update-card-status/src/main/java/com/banesco/domain/ports/outbound/RedisPort.java @@ -0,0 +1,8 @@ +package com.banesco.domain.ports.outbound; + +public interface RedisPort { + + String findValue(String key); + + void setValue(String key, String objectStr, long expiration); +} diff --git a/bus-update-card-status/src/main/java/com/banesco/domain/services/UpdateCardStatusService.java b/bus-update-card-status/src/main/java/com/banesco/domain/services/UpdateCardStatusService.java new file mode 100644 index 0000000..747ae5a --- /dev/null +++ b/bus-update-card-status/src/main/java/com/banesco/domain/services/UpdateCardStatusService.java @@ -0,0 +1,90 @@ +package com.banesco.domain.services; + +import com.banesco.common.application.exception.BanBackendException; +import com.banesco.common.application.exception.BanRuntimeException; +import com.banesco.common.domain.dto.bian.customer.CustomerReference; +import com.banesco.common.domain.dto.bian.device.JsonHelper; +import com.banesco.common.domain.dto.bian.device.StringHelper; +import com.banesco.common.domain.dto.bian.response.StatusResponse; +import com.banesco.common.domain.model.RedisParam; +import com.banesco.commons.config.AppConf; +import com.banesco.commons.config.StatusCodes; +import com.banesco.domain.bian.request.BusUpdateCardStatusRequest; +import com.banesco.domain.ports.inbound.UpdateCardStatusUseCase; +import com.banesco.domain.ports.outbound.PaymentCardPort; +import com.banesco.domain.ports.outbound.RedisPort; +import com.banesco.infrastructure.dtos.CustomerProduct; +import jakarta.enterprise.context.ApplicationScoped; +import jakarta.inject.Inject; + +import java.util.List; + +@ApplicationScoped +public class UpdateCardStatusService implements UpdateCardStatusUseCase { + + + private final PaymentCardPort paymentCardPort; + private final String RESULT_OK = StatusCodes.SUCCESS_OPERATION.getStatusCode(); + + private final RedisParam redisParam; + + private final RedisPort redisPort; + + @Inject + public UpdateCardStatusService(AppConf appConf, PaymentCardPort paymentCardPort, RedisPort redisPort) { + this.paymentCardPort = paymentCardPort; + this.redisPort = redisPort; + redisParam = JsonHelper.getObjectFromJson(appConf.getConfigEnv().getValue("api.redis.get-evaluate-customer-product", String.class), RedisParam.class); + + } + + + @Override + public void execute(BusUpdateCardStatusRequest request) { + + + CustomerProduct customerProduct = getCustomerProductByCardNumber(request.getCustomerReference(), + request.getDevice().getDeviceSessionReference(), + request.getCardReference().getCardNumber()); + + + StatusResponse statusResponse = paymentCardPort.updateCardStatus(customerProduct.getClearAccount(), request); + + if (!statusResponse.statusCode().equals(RESULT_OK)) { + throw new BanBackendException(statusResponse.statusCode(), statusResponse.message()); + } + + } + + private CustomerProduct getCustomerProductByCardNumber(CustomerReference customerReference, String deviceSessionReference, String cardNumber) { + String redisKey = redisParam.getPrefix().formatted(customerReference.getCustomerIdType(), + customerReference.getCustomerId(), + deviceSessionReference); + + String products = redisPort.findValue(redisKey); + + if (products == null) { + throw new BanRuntimeException(StatusCodes.REDIS_DATA_NOT_FOUND); + } + CustomerProduct customerProduct = null; + try { + List productList = JsonHelper.getListFromJson(products, CustomerProduct.class); + if (productList != null) { + customerProduct = productList.stream().filter(account -> account.getMaskedAccount().equals(cardNumber)) + .findFirst() + .orElse(null); + } + } catch (Exception e) { + throw new BanRuntimeException(StatusCodes.INTERNAL_ERROR, "Error parsing customer products from Redis"); + } + + if (customerProduct == null || StringHelper.isEmpty(customerProduct.getClearAccount())) { + throw new BanRuntimeException(StatusCodes.REDIS_DATA_NOT_FOUND); + } + + return customerProduct; + + } + + +} diff --git a/bus-update-card-status/src/main/java/com/banesco/infrastructure/dtos/CustomerProduct.java b/bus-update-card-status/src/main/java/com/banesco/infrastructure/dtos/CustomerProduct.java new file mode 100644 index 0000000..e679cee --- /dev/null +++ b/bus-update-card-status/src/main/java/com/banesco/infrastructure/dtos/CustomerProduct.java @@ -0,0 +1,24 @@ +package com.banesco.infrastructure.dtos; + + +import io.quarkus.runtime.annotations.RegisterForReflection; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@AllArgsConstructor +@NoArgsConstructor +@RegisterForReflection +public class CustomerProduct { + String id; + String sid; + String customerId; + String clearAccount; + String maskedAccount; + String currency; + String accountType; + String otp; + String username; + +} diff --git a/bus-update-card-status/src/main/java/com/banesco/infrastructure/dtos/card/UpdateCardStatusRequest.java b/bus-update-card-status/src/main/java/com/banesco/infrastructure/dtos/card/UpdateCardStatusRequest.java new file mode 100644 index 0000000..63a3518 --- /dev/null +++ b/bus-update-card-status/src/main/java/com/banesco/infrastructure/dtos/card/UpdateCardStatusRequest.java @@ -0,0 +1,22 @@ +package com.banesco.infrastructure.dtos.card; + + +import com.banesco.common.domain.dto.bian.customer.CustomerReference; +import com.banesco.common.domain.dto.bian.device.Device; +import com.banesco.domain.bian.dto.CardReference; +import io.quarkus.runtime.annotations.RegisterForReflection; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +@RegisterForReflection +@Data +@AllArgsConstructor +@NoArgsConstructor +public class UpdateCardStatusRequest { + String requestId; + String fintechId; + CustomerReference customerReference; + Device device; + CardReference cardReference; +} diff --git a/bus-update-card-status/src/main/java/com/banesco/infrastructure/dtos/card/UpdateCardStatusResponse.java b/bus-update-card-status/src/main/java/com/banesco/infrastructure/dtos/card/UpdateCardStatusResponse.java new file mode 100644 index 0000000..66116b9 --- /dev/null +++ b/bus-update-card-status/src/main/java/com/banesco/infrastructure/dtos/card/UpdateCardStatusResponse.java @@ -0,0 +1,22 @@ +package com.banesco.infrastructure.dtos.card; + + +import com.banesco.common.domain.dto.bian.response.BaseResponse; +import com.banesco.common.domain.dto.bian.response.StatusResponse; +import io.quarkus.runtime.annotations.RegisterForReflection; +import lombok.Data; +import lombok.EqualsAndHashCode; + +@RegisterForReflection +@Data +@EqualsAndHashCode(callSuper = false) +public class UpdateCardStatusResponse extends BaseResponse { + public UpdateCardStatusResponse() { + super(); + } + + public UpdateCardStatusResponse(StatusResponse statusResponse) { + super(statusResponse); + } + +} diff --git a/bus-update-card-status/src/main/java/com/banesco/infrastructure/dtos/osb/AdditionalStatus.java b/bus-update-card-status/src/main/java/com/banesco/infrastructure/dtos/osb/AdditionalStatus.java new file mode 100644 index 0000000..5d0c9af --- /dev/null +++ b/bus-update-card-status/src/main/java/com/banesco/infrastructure/dtos/osb/AdditionalStatus.java @@ -0,0 +1,141 @@ +package com.banesco.infrastructure.dtos.osb; + +import io.quarkus.runtime.annotations.RegisterForReflection; + +@RegisterForReflection +public class AdditionalStatus { + + + protected String statusType; + + protected String statusCode; + + protected String statusDesc; + + protected String validationType; + + protected String severity; + + protected String lineNumber; + + /** + * Gets the value of the statusType property. + * + * @return possible object is + * {@link String } + */ + public String getStatusType() { + return statusType; + } + + /** + * Sets the value of the statusType property. + * + * @param value allowed object is + * {@link String } + */ + public void setStatusType(String value) { + this.statusType = value; + } + + /** + * Gets the value of the statusCode property. + * + * @return possible object is + * {@link String } + */ + public String getStatusCode() { + return statusCode; + } + + /** + * Sets the value of the statusCode property. + * + * @param value allowed object is + * {@link String } + */ + public void setStatusCode(String value) { + this.statusCode = value; + } + + /** + * Gets the value of the statusDesc property. + * + * @return possible object is + * {@link String } + */ + public String getStatusDesc() { + return statusDesc; + } + + /** + * Sets the value of the statusDesc property. + * + * @param value allowed object is + * {@link String } + */ + public void setStatusDesc(String value) { + this.statusDesc = value; + } + + /** + * Gets the value of the validationType property. + * + * @return possible object is + * {@link String } + */ + public String getValidationType() { + return validationType; + } + + /** + * Sets the value of the validationType property. + * + * @param value allowed object is + * {@link String } + */ + public void setValidationType(String value) { + this.validationType = value; + } + + /** + * Gets the value of the severity property. + * + * @return possible object is + * {@link String } + */ + public String getSeverity() { + return severity; + } + + /** + * Sets the value of the severity property. + * + * @param value allowed object is + * {@link String } + */ + public void setSeverity(String value) { + this.severity = value; + } + + /** + * Gets the value of the lineNumber property. + * + * @return possible object is + * {@link String } + */ + public String getLineNumber() { + return lineNumber; + } + + /** + * Sets the value of the lineNumber property. + * + * @param value allowed object is + * {@link String } + */ + public void setLineNumber(String value) { + this.lineNumber = value; + } + +} diff --git a/bus-update-card-status/src/main/java/com/banesco/infrastructure/dtos/osb/ApplicantData.java b/bus-update-card-status/src/main/java/com/banesco/infrastructure/dtos/osb/ApplicantData.java new file mode 100644 index 0000000..b0b4435 --- /dev/null +++ b/bus-update-card-status/src/main/java/com/banesco/infrastructure/dtos/osb/ApplicantData.java @@ -0,0 +1,40 @@ +package com.banesco.infrastructure.dtos.osb; + +import io.quarkus.runtime.annotations.RegisterForReflection; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@RegisterForReflection +@NoArgsConstructor +public class ApplicantData implements Cloneable { + + + protected String enterpriseCode; + + protected String privateChannelId; + + protected String ipAddress; + + protected String hostName; + + protected String stadisticId; + + protected String application; + + protected String nationality; + + protected String idDocument; + + protected String rolType; + + protected String planCode; + + protected String channel; + + @Override + public Object clone() throws CloneNotSupportedException { + return super.clone(); + } + +} diff --git a/bus-update-card-status/src/main/java/com/banesco/infrastructure/dtos/osb/MsgRqHdr.java b/bus-update-card-status/src/main/java/com/banesco/infrastructure/dtos/osb/MsgRqHdr.java new file mode 100644 index 0000000..d3922e1 --- /dev/null +++ b/bus-update-card-status/src/main/java/com/banesco/infrastructure/dtos/osb/MsgRqHdr.java @@ -0,0 +1,523 @@ +package com.banesco.infrastructure.dtos.osb; + +import io.quarkus.runtime.annotations.RegisterForReflection; +import jakarta.xml.bind.annotation.XmlAccessType; +import jakarta.xml.bind.annotation.XmlAccessorType; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlType; + +import java.util.ArrayList; +import java.util.List; + + +/** + *

Java class for MsgRqHdr complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="MsgRqHdr">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="MessageDate" type="{http://xmlns.banesco.com/EnterpriseObjects/MsgRqHdr}datePattern" minOccurs="0"/>
+ *         <element name="MessageTime" type="{http://xmlns.banesco.com/EnterpriseObjects/MsgRqHdr}timePattern" minOccurs="0"/>
+ *         <element name="RequestId" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="LastStatusRequest" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="FinalStatusRequest" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="ResumeId" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="ReverseId" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="LineId" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="SourceChannelCode" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="SupervisorCode" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="OperatorCode" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="RequestedOperationType" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="NetworkTrnInfo" type="{http://xmlns.banesco.com/EnterpriseObjects/MsgRqHdr}NetworkTrnInfo" maxOccurs="unbounded" minOccurs="0"/>
+ *         <element name="ApplicantData" type="{http://xmlns.banesco.com/EnterpriseObjects/MsgRqHdr}ApplicantData" minOccurs="0"/>
+ *         <element name="RecCtrlIn" type="{http://xmlns.banesco.com/EnterpriseObjects/MsgRqHdr}RecCtrlIn" minOccurs="0"/>
+ *         <element name="ReturnValue" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="MessageId" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="Priority" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="VBProtocol" type="{http://xmlns.banesco.com/EnterpriseObjects/MsgRqHdr}VBProtocol" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "MsgRqHdr", propOrder = { + "messageDate", + "messageTime", + "requestId", + "lastStatusRequest", + "finalStatusRequest", + "resumeId", + "reverseId", + "lineId", + "sourceChannelCode", + "supervisorCode", + "operatorCode", + "requestedOperationType", + "networkTrnInfo", + "applicantData", + "recCtrlIn", + "returnValue", + "messageId", + "priority", + "vbProtocol" +}) +@RegisterForReflection +public class MsgRqHdr implements Cloneable { + + @XmlElement(name = "MessageDate") + protected String messageDate; + @XmlElement(name = "MessageTime") + protected String messageTime; + @XmlElement(name = "RequestId") + protected String requestId; + @XmlElement(name = "LastStatusRequest") + protected String lastStatusRequest; + @XmlElement(name = "FinalStatusRequest") + protected String finalStatusRequest; + @XmlElement(name = "ResumeId") + protected String resumeId; + @XmlElement(name = "ReverseId") + protected String reverseId; + @XmlElement(name = "LineId") + protected String lineId; + @XmlElement(name = "SourceChannelCode") + protected String sourceChannelCode; + @XmlElement(name = "SupervisorCode") + protected String supervisorCode; + @XmlElement(name = "OperatorCode") + protected String operatorCode; + @XmlElement(name = "RequestedOperationType") + protected String requestedOperationType; + @XmlElement(name = "NetworkTrnInfo") + protected List networkTrnInfo; + @XmlElement(name = "ApplicantData") + protected ApplicantData applicantData; + @XmlElement(name = "RecCtrlIn") + protected RecCtrlIn recCtrlIn; + @XmlElement(name = "ReturnValue") + protected String returnValue; + @XmlElement(name = "MessageId") + protected String messageId; + @XmlElement(name = "Priority") + protected String priority; + @XmlElement(name = "VBProtocol") + protected VBProtocol vbProtocol; + + /** + * Gets the value of the messageDate property. + * + * @return possible object is + * {@link String } + */ + public String getMessageDate() { + return messageDate; + } + + /** + * Sets the value of the messageDate property. + * + * @param value allowed object is + * {@link String } + */ + public void setMessageDate(String value) { + this.messageDate = value; + } + + /** + * Gets the value of the messageTime property. + * + * @return possible object is + * {@link String } + */ + public String getMessageTime() { + return messageTime; + } + + /** + * Sets the value of the messageTime property. + * + * @param value allowed object is + * {@link String } + */ + public void setMessageTime(String value) { + this.messageTime = value; + } + + /** + * Gets the value of the requestId property. + * + * @return possible object is + * {@link String } + */ + public String getRequestId() { + return requestId; + } + + /** + * Sets the value of the requestId property. + * + * @param value allowed object is + * {@link String } + */ + public void setRequestId(String value) { + this.requestId = value; + } + + /** + * Gets the value of the lastStatusRequest property. + * + * @return possible object is + * {@link String } + */ + public String getLastStatusRequest() { + return lastStatusRequest; + } + + /** + * Sets the value of the lastStatusRequest property. + * + * @param value allowed object is + * {@link String } + */ + public void setLastStatusRequest(String value) { + this.lastStatusRequest = value; + } + + /** + * Gets the value of the finalStatusRequest property. + * + * @return possible object is + * {@link String } + */ + public String getFinalStatusRequest() { + return finalStatusRequest; + } + + /** + * Sets the value of the finalStatusRequest property. + * + * @param value allowed object is + * {@link String } + */ + public void setFinalStatusRequest(String value) { + this.finalStatusRequest = value; + } + + /** + * Gets the value of the resumeId property. + * + * @return possible object is + * {@link String } + */ + public String getResumeId() { + return resumeId; + } + + /** + * Sets the value of the resumeId property. + * + * @param value allowed object is + * {@link String } + */ + public void setResumeId(String value) { + this.resumeId = value; + } + + /** + * Gets the value of the reverseId property. + * + * @return possible object is + * {@link String } + */ + public String getReverseId() { + return reverseId; + } + + /** + * Sets the value of the reverseId property. + * + * @param value allowed object is + * {@link String } + */ + public void setReverseId(String value) { + this.reverseId = value; + } + + /** + * Gets the value of the lineId property. + * + * @return possible object is + * {@link String } + */ + public String getLineId() { + return lineId; + } + + /** + * Sets the value of the lineId property. + * + * @param value allowed object is + * {@link String } + */ + public void setLineId(String value) { + this.lineId = value; + } + + /** + * Gets the value of the sourceChannelCode property. + * + * @return possible object is + * {@link String } + */ + public String getSourceChannelCode() { + return sourceChannelCode; + } + + /** + * Sets the value of the sourceChannelCode property. + * + * @param value allowed object is + * {@link String } + */ + public void setSourceChannelCode(String value) { + this.sourceChannelCode = value; + } + + /** + * Gets the value of the supervisorCode property. + * + * @return possible object is + * {@link String } + */ + public String getSupervisorCode() { + return supervisorCode; + } + + /** + * Sets the value of the supervisorCode property. + * + * @param value allowed object is + * {@link String } + */ + public void setSupervisorCode(String value) { + this.supervisorCode = value; + } + + /** + * Gets the value of the operatorCode property. + * + * @return possible object is + * {@link String } + */ + public String getOperatorCode() { + return operatorCode; + } + + /** + * Sets the value of the operatorCode property. + * + * @param value allowed object is + * {@link String } + */ + public void setOperatorCode(String value) { + this.operatorCode = value; + } + + /** + * Gets the value of the requestedOperationType property. + * + * @return possible object is + * {@link String } + */ + public String getRequestedOperationType() { + return requestedOperationType; + } + + /** + * Sets the value of the requestedOperationType property. + * + * @param value allowed object is + * {@link String } + */ + public void setRequestedOperationType(String value) { + this.requestedOperationType = value; + } + + /** + * Gets the value of the networkTrnInfo property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the Jakarta XML Binding object. + * This is why there is not a set method for the networkTrnInfo property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getNetworkTrnInfo().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link NetworkTrnInfo } + */ + public List getNetworkTrnInfo() { + if (networkTrnInfo == null) { + networkTrnInfo = new ArrayList(); + } + return this.networkTrnInfo; + } + + /** + * Gets the value of the applicantData property. + * + * @return possible object is + * {@link ApplicantData } + */ + public ApplicantData getApplicantData() { + return applicantData; + } + + /** + * Sets the value of the applicantData property. + * + * @param value allowed object is + * {@link ApplicantData } + */ + public void setApplicantData(ApplicantData value) { + this.applicantData = value; + } + + /** + * Gets the value of the recCtrlIn property. + * + * @return possible object is + * {@link RecCtrlIn } + */ + public RecCtrlIn getRecCtrlIn() { + return recCtrlIn; + } + + /** + * Sets the value of the recCtrlIn property. + * + * @param value allowed object is + * {@link RecCtrlIn } + */ + public void setRecCtrlIn(RecCtrlIn value) { + this.recCtrlIn = value; + } + + /** + * Gets the value of the returnValue property. + * + * @return possible object is + * {@link String } + */ + public String getReturnValue() { + return returnValue; + } + + /** + * Sets the value of the returnValue property. + * + * @param value allowed object is + * {@link String } + */ + public void setReturnValue(String value) { + this.returnValue = value; + } + + /** + * Gets the value of the messageId property. + * + * @return possible object is + * {@link String } + */ + public String getMessageId() { + return messageId; + } + + /** + * Sets the value of the messageId property. + * + * @param value allowed object is + * {@link String } + */ + public void setMessageId(String value) { + this.messageId = value; + } + + /** + * Gets the value of the priority property. + * + * @return possible object is + * {@link String } + */ + public String getPriority() { + return priority; + } + + /** + * Sets the value of the priority property. + * + * @param value allowed object is + * {@link String } + */ + public void setPriority(String value) { + this.priority = value; + } + + /** + * Gets the value of the vbProtocol property. + * + * @return possible object is + * {@link VBProtocol } + */ + public VBProtocol getVBProtocol() { + return vbProtocol; + } + + + public void setTransactionCode(String transactionCode) { + this.getNetworkTrnInfo().get(0).setTransactionCode(transactionCode); + } + + public void setNetworkTrnInfo(List networkTrnInfo) { + this.networkTrnInfo = networkTrnInfo; + } + /* public void setVBProtocol(VBProtocol value) { + this.vbProtocol = value; + } +*/ + public void setVbprotocol(VBProtocol value) { + this.vbProtocol = value; + } + + public void setVbProtocol(VBProtocol value) { + this.vbProtocol = value; + } + + + @Override + public MsgRqHdr clone() throws CloneNotSupportedException { + MsgRqHdr msgRqHdrClone = (MsgRqHdr) super.clone(); + msgRqHdrClone.applicantData = (ApplicantData) applicantData.clone(); + msgRqHdrClone.vbProtocol = (VBProtocol) vbProtocol.clone(); + + msgRqHdrClone.networkTrnInfo = new ArrayList<>(); + + for (NetworkTrnInfo trnInfo : networkTrnInfo) { + msgRqHdrClone.networkTrnInfo.add((NetworkTrnInfo) trnInfo.clone()); + } + return msgRqHdrClone; + } +} diff --git a/bus-update-card-status/src/main/java/com/banesco/infrastructure/dtos/osb/MsgRsHdr.java b/bus-update-card-status/src/main/java/com/banesco/infrastructure/dtos/osb/MsgRsHdr.java new file mode 100644 index 0000000..ccc9d68 --- /dev/null +++ b/bus-update-card-status/src/main/java/com/banesco/infrastructure/dtos/osb/MsgRsHdr.java @@ -0,0 +1,527 @@ +package com.banesco.infrastructure.dtos.osb; + + +import io.quarkus.runtime.annotations.RegisterForReflection; + +import java.util.ArrayList; +import java.util.List; + + +@RegisterForReflection +public class MsgRsHdr { + + + protected String privateChannelId; + + protected String finalStatusRequest; + + protected String countDataOut; + + protected String headerTypeReg; + + protected String detailTypeReg; + + protected String transactionCode; + + protected String supervisorCode; + + protected String operationType; + + protected String transactionConsecutive; + + protected String detailReg; + + protected List registerNumber; + + protected String transactionType; + + protected String requestId; + + protected String requestedOperationType; + + protected String messageDate; + + protected String transactionTime; + + protected String lastStatusRequest; + + protected String returnValue; + + protected String requestStatus; + + protected String messageTime; + + protected String transacctionDate; + + protected String requestNumber; + + protected String appName; + + /** + * Gets the value of the privateChannelId property. + * + * @return possible object is + * {@link String } + */ + public String getPrivateChannelId() { + return privateChannelId; + } + + /** + * Sets the value of the privateChannelId property. + * + * @param value allowed object is + * {@link String } + */ + public void setPrivateChannelId(String value) { + this.privateChannelId = value; + } + + /** + * Gets the value of the finalStatusRequest property. + * + * @return possible object is + * {@link String } + */ + public String getFinalStatusRequest() { + return finalStatusRequest; + } + + /** + * Sets the value of the finalStatusRequest property. + * + * @param value allowed object is + * {@link String } + */ + public void setFinalStatusRequest(String value) { + this.finalStatusRequest = value; + } + + /** + * Gets the value of the countDataOut property. + * + * @return possible object is + * {@link String } + */ + public String getCountDataOut() { + return countDataOut; + } + + /** + * Sets the value of the countDataOut property. + * + * @param value allowed object is + * {@link String } + */ + public void setCountDataOut(String value) { + this.countDataOut = value; + } + + /** + * Gets the value of the headerTypeReg property. + * + * @return possible object is + * {@link String } + */ + public String getHeaderTypeReg() { + return headerTypeReg; + } + + /** + * Sets the value of the headerTypeReg property. + * + * @param value allowed object is + * {@link String } + */ + public void setHeaderTypeReg(String value) { + this.headerTypeReg = value; + } + + /** + * Gets the value of the detailTypeReg property. + * + * @return possible object is + * {@link String } + */ + public String getDetailTypeReg() { + return detailTypeReg; + } + + /** + * Sets the value of the detailTypeReg property. + * + * @param value allowed object is + * {@link String } + */ + public void setDetailTypeReg(String value) { + this.detailTypeReg = value; + } + + /** + * Gets the value of the transactionCode property. + * + * @return possible object is + * {@link String } + */ + public String getTransactionCode() { + return transactionCode; + } + + /** + * Sets the value of the transactionCode property. + * + * @param value allowed object is + * {@link String } + */ + public void setTransactionCode(String value) { + this.transactionCode = value; + } + + /** + * Gets the value of the supervisorCode property. + * + * @return possible object is + * {@link String } + */ + public String getSupervisorCode() { + return supervisorCode; + } + + /** + * Sets the value of the supervisorCode property. + * + * @param value allowed object is + * {@link String } + */ + public void setSupervisorCode(String value) { + this.supervisorCode = value; + } + + /** + * Gets the value of the operationType property. + * + * @return possible object is + * {@link String } + */ + public String getOperationType() { + return operationType; + } + + /** + * Sets the value of the operationType property. + * + * @param value allowed object is + * {@link String } + */ + public void setOperationType(String value) { + this.operationType = value; + } + + /** + * Gets the value of the transactionConsecutive property. + * + * @return possible object is + * {@link String } + */ + public String getTransactionConsecutive() { + return transactionConsecutive; + } + + /** + * Sets the value of the transactionConsecutive property. + * + * @param value allowed object is + * {@link String } + */ + public void setTransactionConsecutive(String value) { + this.transactionConsecutive = value; + } + + /** + * Gets the value of the detailReg property. + * + * @return possible object is + * {@link String } + */ + public String getDetailReg() { + return detailReg; + } + + /** + * Sets the value of the detailReg property. + * + * @param value allowed object is + * {@link String } + */ + public void setDetailReg(String value) { + this.detailReg = value; + } + + /** + * Gets the value of the registerNumber property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the Jakarta XML Binding object. + * This is why there is not a set method for the registerNumber property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getRegisterNumber().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link String } + */ + public List getRegisterNumber() { + if (registerNumber == null) { + registerNumber = new ArrayList(); + } + return this.registerNumber; + } + + /** + * Gets the value of the transactionType property. + * + * @return possible object is + * {@link String } + */ + public String getTransactionType() { + return transactionType; + } + + /** + * Sets the value of the transactionType property. + * + * @param value allowed object is + * {@link String } + */ + public void setTransactionType(String value) { + this.transactionType = value; + } + + /** + * Gets the value of the requestId property. + * + * @return possible object is + * {@link String } + */ + public String getRequestId() { + return requestId; + } + + /** + * Sets the value of the requestId property. + * + * @param value allowed object is + * {@link String } + */ + public void setRequestId(String value) { + this.requestId = value; + } + + /** + * Gets the value of the requestedOperationType property. + * + * @return possible object is + * {@link String } + */ + public String getRequestedOperationType() { + return requestedOperationType; + } + + /** + * Sets the value of the requestedOperationType property. + * + * @param value allowed object is + * {@link String } + */ + public void setRequestedOperationType(String value) { + this.requestedOperationType = value; + } + + /** + * Gets the value of the messageDate property. + * + * @return possible object is + * {@link String } + */ + public String getMessageDate() { + return messageDate; + } + + /** + * Sets the value of the messageDate property. + * + * @param value allowed object is + * {@link String } + */ + public void setMessageDate(String value) { + this.messageDate = value; + } + + /** + * Gets the value of the transactionTime property. + * + * @return possible object is + * {@link String } + */ + public String getTransactionTime() { + return transactionTime; + } + + /** + * Sets the value of the transactionTime property. + * + * @param value allowed object is + * {@link String } + */ + public void setTransactionTime(String value) { + this.transactionTime = value; + } + + /** + * Gets the value of the lastStatusRequest property. + * + * @return possible object is + * {@link String } + */ + public String getLastStatusRequest() { + return lastStatusRequest; + } + + /** + * Sets the value of the lastStatusRequest property. + * + * @param value allowed object is + * {@link String } + */ + public void setLastStatusRequest(String value) { + this.lastStatusRequest = value; + } + + /** + * Gets the value of the returnValue property. + * + * @return possible object is + * {@link String } + */ + public String getReturnValue() { + return returnValue; + } + + /** + * Sets the value of the returnValue property. + * + * @param value allowed object is + * {@link String } + */ + public void setReturnValue(String value) { + this.returnValue = value; + } + + /** + * Gets the value of the requestStatus property. + * + * @return possible object is + * {@link String } + */ + public String getRequestStatus() { + return requestStatus; + } + + /** + * Sets the value of the requestStatus property. + * + * @param value allowed object is + * {@link String } + */ + public void setRequestStatus(String value) { + this.requestStatus = value; + } + + /** + * Gets the value of the messageTime property. + * + * @return possible object is + * {@link String } + */ + public String getMessageTime() { + return messageTime; + } + + /** + * Sets the value of the messageTime property. + * + * @param value allowed object is + * {@link String } + */ + public void setMessageTime(String value) { + this.messageTime = value; + } + + /** + * Gets the value of the transacctionDate property. + * + * @return possible object is + * {@link String } + */ + public String getTransacctionDate() { + return transacctionDate; + } + + /** + * Sets the value of the transacctionDate property. + * + * @param value allowed object is + * {@link String } + */ + public void setTransacctionDate(String value) { + this.transacctionDate = value; + } + + /** + * Gets the value of the requestNumber property. + * + * @return possible object is + * {@link String } + */ + public String getRequestNumber() { + return requestNumber; + } + + /** + * Sets the value of the requestNumber property. + * + * @param value allowed object is + * {@link String } + */ + public void setRequestNumber(String value) { + this.requestNumber = value; + } + + /** + * Gets the value of the appName property. + * + * @return possible object is + * {@link String } + */ + public String getAppName() { + return appName; + } + + /** + * Sets the value of the appName property. + * + * @param value allowed object is + * {@link String } + */ + public void setAppName(String value) { + this.appName = value; + } + +} diff --git a/bus-update-card-status/src/main/java/com/banesco/infrastructure/dtos/osb/NetworkTrnInfo.java b/bus-update-card-status/src/main/java/com/banesco/infrastructure/dtos/osb/NetworkTrnInfo.java new file mode 100644 index 0000000..cd3e605 --- /dev/null +++ b/bus-update-card-status/src/main/java/com/banesco/infrastructure/dtos/osb/NetworkTrnInfo.java @@ -0,0 +1,412 @@ +package com.banesco.infrastructure.dtos.osb; + +import io.quarkus.runtime.annotations.RegisterForReflection; +import jakarta.xml.bind.annotation.XmlAccessType; +import jakarta.xml.bind.annotation.XmlAccessorType; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlType; + + +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "NetworkTrnInfo", propOrder = { + "transactionConsecutive", + "registerNumber", + "originatorName", + "operationType", + "transactionType", + "transactionCode", + "transactionDate", + "transactionTime", + "bankId", + "agencyCode", + "channelId", + "channelUserId", + "operationExecIndicator", + "configuredTransactionCode", + "desc", + "userId", + "userType" +}) +@RegisterForReflection +public class NetworkTrnInfo implements Cloneable { + + @XmlElement(name = "TransactionConsecutive") + protected String transactionConsecutive; + @XmlElement(name = "RegisterNumber") + protected String registerNumber; + @XmlElement(name = "OriginatorName") + protected String originatorName; + @XmlElement(name = "OperationType") + protected String operationType; + @XmlElement(name = "TransactionType") + protected String transactionType; + @XmlElement(name = "TransactionCode") + protected String transactionCode; + @XmlElement(name = "TransactionDate") + protected String transactionDate; + @XmlElement(name = "TransactionTime") + protected String transactionTime; + @XmlElement(name = "BankId") + protected String bankId; + @XmlElement(name = "AgencyCode") + protected String agencyCode; + @XmlElement(name = "ChannelId") + protected String channelId; + @XmlElement(name = "ChannelUserId") + protected String channelUserId; + @XmlElement(name = "OperationExecIndicator") + protected String operationExecIndicator; + @XmlElement(name = "ConfiguredTransactionCode") + protected String configuredTransactionCode; + @XmlElement(name = "Desc") + protected String desc; + @XmlElement(name = "UserId") + protected String userId; + @XmlElement(name = "UserType") + protected String userType; + + /** + * Gets the value of the transactionConsecutive property. + * + * @return possible object is + * {@link String } + */ + public String getTransactionConsecutive() { + return transactionConsecutive; + } + + /** + * Sets the value of the transactionConsecutive property. + * + * @param value allowed object is + * {@link String } + */ + public void setTransactionConsecutive(String value) { + this.transactionConsecutive = value; + } + + /** + * Gets the value of the registerNumber property. + * + * @return possible object is + * {@link String } + */ + public String getRegisterNumber() { + return registerNumber; + } + + /** + * Sets the value of the registerNumber property. + * + * @param value allowed object is + * {@link String } + */ + public void setRegisterNumber(String value) { + this.registerNumber = value; + } + + /** + * Gets the value of the originatorName property. + * + * @return possible object is + * {@link String } + */ + public String getOriginatorName() { + return originatorName; + } + + /** + * Sets the value of the originatorName property. + * + * @param value allowed object is + * {@link String } + */ + public void setOriginatorName(String value) { + this.originatorName = value; + } + + /** + * Gets the value of the operationType property. + * + * @return possible object is + * {@link String } + */ + public String getOperationType() { + return operationType; + } + + /** + * Sets the value of the operationType property. + * + * @param value allowed object is + * {@link String } + */ + public void setOperationType(String value) { + this.operationType = value; + } + + /** + * Gets the value of the transactionType property. + * + * @return possible object is + * {@link String } + */ + public String getTransactionType() { + return transactionType; + } + + /** + * Sets the value of the transactionType property. + * + * @param value allowed object is + * {@link String } + */ + public void setTransactionType(String value) { + this.transactionType = value; + } + + /** + * Gets the value of the transactionCode property. + * + * @return possible object is + * {@link String } + */ + public String getTransactionCode() { + return transactionCode; + } + + /** + * Sets the value of the transactionCode property. + * + * @param value allowed object is + * {@link String } + */ + public void setTransactionCode(String value) { + this.transactionCode = value; + } + + /** + * Gets the value of the transactionDate property. + * + * @return possible object is + * {@link String } + */ + public String getTransactionDate() { + return transactionDate; + } + + /** + * Sets the value of the transactionDate property. + * + * @param value allowed object is + * {@link String } + */ + public void setTransactionDate(String value) { + this.transactionDate = value; + } + + /** + * Gets the value of the transactionTime property. + * + * @return possible object is + * {@link String } + */ + public String getTransactionTime() { + return transactionTime; + } + + /** + * Sets the value of the transactionTime property. + * + * @param value allowed object is + * {@link String } + */ + public void setTransactionTime(String value) { + this.transactionTime = value; + } + + /** + * Gets the value of the bankId property. + * + * @return possible object is + * {@link String } + */ + public String getBankId() { + return bankId; + } + + /** + * Sets the value of the bankId property. + * + * @param value allowed object is + * {@link String } + */ + public void setBankId(String value) { + this.bankId = value; + } + + /** + * Gets the value of the agencyCode property. + * + * @return possible object is + * {@link String } + */ + public String getAgencyCode() { + return agencyCode; + } + + /** + * Sets the value of the agencyCode property. + * + * @param value allowed object is + * {@link String } + */ + public void setAgencyCode(String value) { + this.agencyCode = value; + } + + /** + * Gets the value of the channelId property. + * + * @return possible object is + * {@link String } + */ + public String getChannelId() { + return channelId; + } + + /** + * Sets the value of the channelId property. + * + * @param value allowed object is + * {@link String } + */ + public void setChannelId(String value) { + this.channelId = value; + } + + /** + * Gets the value of the channelUserId property. + * + * @return possible object is + * {@link String } + */ + public String getChannelUserId() { + return channelUserId; + } + + /** + * Sets the value of the channelUserId property. + * + * @param value allowed object is + * {@link String } + */ + public void setChannelUserId(String value) { + this.channelUserId = value; + } + + /** + * Gets the value of the operationExecIndicator property. + * + * @return possible object is + * {@link String } + */ + public String getOperationExecIndicator() { + return operationExecIndicator; + } + + /** + * Sets the value of the operationExecIndicator property. + * + * @param value allowed object is + * {@link String } + */ + public void setOperationExecIndicator(String value) { + this.operationExecIndicator = value; + } + + /** + * Gets the value of the configuredTransactionCode property. + * + * @return possible object is + * {@link String } + */ + public String getConfiguredTransactionCode() { + return configuredTransactionCode; + } + + /** + * Sets the value of the configuredTransactionCode property. + * + * @param value allowed object is + * {@link String } + */ + public void setConfiguredTransactionCode(String value) { + this.configuredTransactionCode = value; + } + + /** + * Gets the value of the desc property. + * + * @return possible object is + * {@link String } + */ + public String getDesc() { + return desc; + } + + /** + * Sets the value of the desc property. + * + * @param value allowed object is + * {@link String } + */ + public void setDesc(String value) { + this.desc = value; + } + + /** + * Gets the value of the userId property. + * + * @return possible object is + * {@link String } + */ + public String getUserId() { + return userId; + } + + /** + * Sets the value of the userId property. + * + * @param value allowed object is + * {@link String } + */ + public void setUserId(String value) { + this.userId = value; + } + + /** + * Gets the value of the userType property. + * + * @return possible object is + * {@link String } + */ + public String getUserType() { + return userType; + } + + /** + * Sets the value of the userType property. + * + * @param value allowed object is + * {@link String } + */ + public void setUserType(String value) { + this.userType = value; + } + + @Override + public Object clone() throws CloneNotSupportedException { + return super.clone(); + } +} diff --git a/bus-update-card-status/src/main/java/com/banesco/infrastructure/dtos/osb/RecCtrlIn.java b/bus-update-card-status/src/main/java/com/banesco/infrastructure/dtos/osb/RecCtrlIn.java new file mode 100644 index 0000000..1090260 --- /dev/null +++ b/bus-update-card-status/src/main/java/com/banesco/infrastructure/dtos/osb/RecCtrlIn.java @@ -0,0 +1,23 @@ +package com.banesco.infrastructure.dtos.osb; + + +import io.quarkus.runtime.annotations.RegisterForReflection; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@RegisterForReflection +@NoArgsConstructor +@AllArgsConstructor +public class RecCtrlIn implements Cloneable { + + + protected String maxRec; + + @Override + public Object clone() throws CloneNotSupportedException { + return super.clone(); + } + +} diff --git a/bus-update-card-status/src/main/java/com/banesco/infrastructure/dtos/osb/Status.java b/bus-update-card-status/src/main/java/com/banesco/infrastructure/dtos/osb/Status.java new file mode 100644 index 0000000..9143652 --- /dev/null +++ b/bus-update-card-status/src/main/java/com/banesco/infrastructure/dtos/osb/Status.java @@ -0,0 +1,218 @@ +package com.banesco.infrastructure.dtos.osb; + +import io.quarkus.runtime.annotations.RegisterForReflection; + +import java.math.BigInteger; +import java.util.ArrayList; +import java.util.List; + +@RegisterForReflection +public class Status { + + + protected String statusType; + + protected String statusCode; + + protected String statusDesc; + + protected String applicationName; + + protected BigInteger lineNumber; + + protected List additionalStatus; + + protected String severity; + + protected String statusInd; + + protected String logId; + + /** + * Gets the value of the statusType property. + * + * @return possible object is + * {@link String } + */ + public String getStatusType() { + return statusType; + } + + /** + * Sets the value of the statusType property. + * + * @param value allowed object is + * {@link String } + */ + public void setStatusType(String value) { + this.statusType = value; + } + + /** + * Gets the value of the statusCode property. + * + * @return possible object is + * {@link String } + */ + public String getStatusCode() { + return statusCode; + } + + /** + * Sets the value of the statusCode property. + * + * @param value allowed object is + * {@link String } + */ + public void setStatusCode(String value) { + this.statusCode = value; + } + + /** + * Gets the value of the statusDesc property. + * + * @return possible object is + * {@link String } + */ + public String getStatusDesc() { + return statusDesc; + } + + /** + * Sets the value of the statusDesc property. + * + * @param value allowed object is + * {@link String } + */ + public void setStatusDesc(String value) { + this.statusDesc = value; + } + + /** + * Gets the value of the applicationName property. + * + * @return possible object is + * {@link String } + */ + public String getApplicationName() { + return applicationName; + } + + /** + * Sets the value of the applicationName property. + * + * @param value allowed object is + * {@link String } + */ + public void setApplicationName(String value) { + this.applicationName = value; + } + + /** + * Gets the value of the lineNumber property. + * + * @return possible object is + * {@link BigInteger } + */ + public BigInteger getLineNumber() { + return lineNumber; + } + + /** + * Sets the value of the lineNumber property. + * + * @param value allowed object is + * {@link BigInteger } + */ + public void setLineNumber(BigInteger value) { + this.lineNumber = value; + } + + /** + * Gets the value of the additionalStatus property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the Jakarta XML Binding object. + * This is why there is not a set method for the additionalStatus property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getAdditionalStatus().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link AdditionalStatus } + */ + public List getAdditionalStatus() { + if (additionalStatus == null) { + additionalStatus = new ArrayList(); + } + return this.additionalStatus; + } + + /** + * Gets the value of the severity property. + * + * @return possible object is + * {@link String } + */ + public String getSeverity() { + return severity; + } + + /** + * Sets the value of the severity property. + * + * @param value allowed object is + * {@link String } + */ + public void setSeverity(String value) { + this.severity = value; + } + + /** + * Gets the value of the statusInd property. + * + * @return possible object is + * {@link String } + */ + public String getStatusInd() { + return statusInd; + } + + /** + * Sets the value of the statusInd property. + * + * @param value allowed object is + * {@link String } + */ + public void setStatusInd(String value) { + this.statusInd = value; + } + + /** + * Gets the value of the logId property. + * + * @return possible object is + * {@link String } + */ + public String getLogId() { + return logId; + } + + /** + * Sets the value of the logId property. + * + * @param value allowed object is + * {@link String } + */ + public void setLogId(String value) { + this.logId = value; + } + +} diff --git a/bus-update-card-status/src/main/java/com/banesco/infrastructure/dtos/osb/VBProtocol.java b/bus-update-card-status/src/main/java/com/banesco/infrastructure/dtos/osb/VBProtocol.java new file mode 100644 index 0000000..d48f218 --- /dev/null +++ b/bus-update-card-status/src/main/java/com/banesco/infrastructure/dtos/osb/VBProtocol.java @@ -0,0 +1,77 @@ +package com.banesco.infrastructure.dtos.osb; + +import io.quarkus.runtime.annotations.RegisterForReflection; +import jakarta.xml.bind.annotation.XmlAccessType; +import jakarta.xml.bind.annotation.XmlAccessorType; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlType; + + +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "VBProtocol", propOrder = { + "vbProtocolInd", + "transactionInd" +}) +@RegisterForReflection +public class VBProtocol implements Cloneable { + + @XmlElement(name = "VBProtocolInd", defaultValue = "false") + protected Boolean vbProtocolInd; + @XmlElement(name = "TransactionInd", defaultValue = "false") + protected Boolean transactionInd; + + /** + * Gets the value of the vbProtocolInd property. + * + * @return possible object is + * {@link Boolean } + */ + public Boolean isVBProtocolInd() { + return vbProtocolInd; + } + + /** + * Sets the value of the vbProtocolInd property. + * + * @param value allowed object is + * {@link Boolean } + */ + public void setVBProtocolInd(Boolean value) { + this.vbProtocolInd = value; + } + + /* public void setVbprotocolInd(Boolean vbprotocolInd) { + this.vbProtocolInd = vbprotocolInd; + }*/ + + public void setVbProtocolInd(Boolean vbprotocolInd) { + this.vbProtocolInd = vbprotocolInd; + } + + /** + * Gets the value of the transactionInd property. + * + * @return possible object is + * {@link Boolean } + */ + public Boolean isTransactionInd() { + return transactionInd; + } + + /** + * Sets the value of the transactionInd property. + * + * @param value allowed object is + * {@link Boolean } + */ + public void setTransactionInd(Boolean value) { + this.transactionInd = value; + } + + @Override + public Object clone() throws CloneNotSupportedException { + return super.clone(); + } + + +} diff --git a/bus-update-card-status/src/main/java/com/banesco/infrastructure/healthcheck/ApplicationLivenessCheck.java b/bus-update-card-status/src/main/java/com/banesco/infrastructure/healthcheck/ApplicationLivenessCheck.java new file mode 100644 index 0000000..22b940e --- /dev/null +++ b/bus-update-card-status/src/main/java/com/banesco/infrastructure/healthcheck/ApplicationLivenessCheck.java @@ -0,0 +1,38 @@ +package com.banesco.infrastructure.healthcheck; + +import jakarta.enterprise.context.ApplicationScoped; +import lombok.extern.slf4j.Slf4j; +import org.eclipse.microprofile.config.inject.ConfigProperty; +import org.eclipse.microprofile.health.HealthCheck; +import org.eclipse.microprofile.health.HealthCheckResponse; +import org.eclipse.microprofile.health.Liveness; + +@Liveness +@ApplicationScoped +@Slf4j +public class ApplicationLivenessCheck implements HealthCheck { + + private final String applicationName; + private final String applicationVersion; + + + public ApplicationLivenessCheck( + @ConfigProperty(name = "quarkus.application.name", defaultValue = "api-application") String applicationName, + @ConfigProperty(name = "quarkus.application.version", defaultValue = "unknown") String applicationVersion) { + this.applicationName = applicationName; + this.applicationVersion = applicationVersion; + } + + @Override + public HealthCheckResponse call() { + log.debug("Ejecutando liveness health check: {}", System.currentTimeMillis()); + // Simplemente reportamos que la aplicación está activa + // Si este código se ejecuta, significa que la JVM está funcionando + return HealthCheckResponse.named("API") + .up() + .withData("application", applicationName) + .withData("version", applicationVersion) + .withData("timestamp", System.currentTimeMillis()) + .build(); + } +} \ No newline at end of file diff --git a/bus-update-card-status/src/main/java/com/banesco/infrastructure/healthcheck/ConfigHealthCheck.java b/bus-update-card-status/src/main/java/com/banesco/infrastructure/healthcheck/ConfigHealthCheck.java new file mode 100644 index 0000000..dabe00e --- /dev/null +++ b/bus-update-card-status/src/main/java/com/banesco/infrastructure/healthcheck/ConfigHealthCheck.java @@ -0,0 +1,69 @@ +package com.banesco.infrastructure.healthcheck; + +import com.banesco.commons.config.AppConf; +import jakarta.enterprise.context.ApplicationScoped; +import jakarta.inject.Inject; +import lombok.extern.slf4j.Slf4j; +import org.eclipse.microprofile.health.HealthCheck; +import org.eclipse.microprofile.health.HealthCheckResponse; +import org.eclipse.microprofile.health.Readiness; + +import java.util.concurrent.Semaphore; + + +@SuppressWarnings("unused") +@Readiness +@Slf4j +@ApplicationScoped +public class ConfigHealthCheck implements HealthCheck { + + + // Semáforo para evitar múltiples health checks simultáneos + private final Semaphore healthCheckSemaphore = new Semaphore(1); + + @Inject + public ConfigHealthCheck() { + log.info("ConfigHealthCheck inicializado"); + } + + @Override + public HealthCheckResponse call() { + + if (!healthCheckSemaphore.tryAcquire()) { + log.debug("Health check en progreso, saltando esta invocación"); + return HealthCheckResponse.builder() + .name("ApiConfig") + .withData("AppConf", "progressing") + .withData("timestamp", System.currentTimeMillis()) + .build(); + } + + try { + AppConf.getInstance(); + return buildResponse(null); + } catch (Exception e) { + return buildResponse(e.getMessage()); + } finally { + healthCheckSemaphore.release(); + } + } + + private HealthCheckResponse buildResponse(String errorMessage) { + var responseBuilder = HealthCheckResponse.named("ApiConfig"); + + if (errorMessage == null) { + return responseBuilder.up() + .withData("AppConf", "configured") + .withData("timestamp", System.currentTimeMillis()) + .build(); + + } + + return responseBuilder.down() + .withData("AppConf", "wrong") + .withData("timestamp", System.currentTimeMillis()) + .withData("errorMessage", errorMessage) + .build(); + + } +} \ No newline at end of file diff --git a/bus-update-card-status/src/main/java/com/banesco/infrastructure/redis/RedisAdapter.java b/bus-update-card-status/src/main/java/com/banesco/infrastructure/redis/RedisAdapter.java new file mode 100644 index 0000000..330ba57 --- /dev/null +++ b/bus-update-card-status/src/main/java/com/banesco/infrastructure/redis/RedisAdapter.java @@ -0,0 +1,34 @@ +package com.banesco.infrastructure.redis; + +import com.banesco.domain.ports.outbound.RedisPort; +import io.quarkus.redis.datasource.RedisDataSource; +import io.quarkus.redis.datasource.value.SetArgs; +import jakarta.enterprise.context.ApplicationScoped; +import lombok.extern.slf4j.Slf4j; + +@ApplicationScoped +@Slf4j +public class RedisAdapter implements RedisPort { + + + private final RedisDataSource redisDataSource; + + public RedisAdapter(RedisDataSource redisDataSource) { + this.redisDataSource = redisDataSource; + } + + @Override + public String findValue(String key) { + String result = redisDataSource.value(String.class).get(key); + log.info("REDIS FIND key: [{}] value: [{}]", key, result); + return result; + } + + @Override + public void setValue(String key, String objectStr, long expiration) { + SetArgs setArgs = new SetArgs(); + setArgs.ex(expiration); + log.info("REDIS SAVE key: [{}] value: [{}]", key, objectStr); + redisDataSource.value(String.class).set(key, objectStr, setArgs); + } +} diff --git a/bus-update-card-status/src/main/java/com/banesco/infrastructure/rest/PaymentCardAdapter.java b/bus-update-card-status/src/main/java/com/banesco/infrastructure/rest/PaymentCardAdapter.java new file mode 100644 index 0000000..d6a61ee --- /dev/null +++ b/bus-update-card-status/src/main/java/com/banesco/infrastructure/rest/PaymentCardAdapter.java @@ -0,0 +1,52 @@ +package com.banesco.infrastructure.rest; + +import com.banesco.common.domain.dto.bian.response.StatusResponse; +import com.banesco.common.domain.model.ApiConfig; +import com.banesco.commons.config.AppConf; +import com.banesco.domain.bian.request.BusUpdateCardStatusRequest; +import com.banesco.domain.ports.outbound.PaymentCardPort; +import com.banesco.infrastructure.rest.mappers.PaymentCardMapper; +import com.banesco.infrastructure.rest.repositories.PaymentCardRepository; +import jakarta.enterprise.context.ApplicationScoped; +import jakarta.inject.Inject; +import lombok.extern.slf4j.Slf4j; + + +@ApplicationScoped +@Slf4j +public class PaymentCardAdapter implements PaymentCardPort { + + + private final PaymentCardRepository paymentRepository; + private final PaymentCardMapper paymentCardMapper; + + private final String OPERATION_NAME = "update-card-status"; + AppConf appConf; + + @Inject + public PaymentCardAdapter(AppConf appConf, + PaymentCardMapper paymentCardMapper) { + + this.appConf = appConf; + this.paymentCardMapper = paymentCardMapper; + ApiConfig apiConfig = appConf.loadApiConfig("api.rest-client." + OPERATION_NAME); + paymentRepository = new PaymentCardRepository(apiConfig); + + } + + + public StatusResponse updateCardStatus(String productAccountId, BusUpdateCardStatusRequest request) { + + + return paymentRepository.updateCardStatus( + this.paymentCardMapper.toBusinessRequest( + appConf.getCurrentState(request.getRequestId()), + request + ) + ); + + + } + + +} diff --git a/bus-update-card-status/src/main/java/com/banesco/infrastructure/rest/RegisterSecurityAdapter.java b/bus-update-card-status/src/main/java/com/banesco/infrastructure/rest/RegisterSecurityAdapter.java new file mode 100644 index 0000000..fa0049d --- /dev/null +++ b/bus-update-card-status/src/main/java/com/banesco/infrastructure/rest/RegisterSecurityAdapter.java @@ -0,0 +1,73 @@ +package com.banesco.infrastructure.rest; + +import com.banesco.common.domain.dto.bian.device.LoggerHelper; +import com.banesco.common.domain.model.ApiConfig; +import com.banesco.commons.config.AppConf; +import jakarta.enterprise.context.ApplicationScoped; +import jakarta.inject.Inject; +import jakarta.ws.rs.core.Response; +import lombok.extern.slf4j.Slf4j; +import org.eclipse.microprofile.rest.client.RestClientBuilder; + +import java.net.URI; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.TimeUnit; + + +@ApplicationScoped +@Slf4j +public class RegisterSecurityAdapter implements RegisterSecurityPort { + + private final RegisterSecurityRestClient restClient; + + private final String registerSecuritySP; + private final String registerSecurityEventCod; + private final String registerSecurityBankCod; + private final String registerSecurityCurCOd; + + + @Inject + public RegisterSecurityAdapter(AppConf appConf) { + + ApiConfig apiConfig = appConf.loadApiConfig("api.rest-client.register-security"); + + restClient = RestClientBuilder.newBuilder().baseUri( + URI.create(apiConfig.getUrl()) + ). + connectTimeout(apiConfig.getTimeout().getConnect(), TimeUnit.MILLISECONDS) + .readTimeout(apiConfig.getTimeout().getResponse(), TimeUnit.MILLISECONDS) + .build(RegisterSecurityRestClient.class); + + registerSecuritySP = apiConfig.getConfig().get("sp"); + registerSecurityEventCod = apiConfig.getConfig().get("eventCod"); + registerSecurityBankCod = apiConfig.getConfig().get("bankCod"); + registerSecurityCurCOd = apiConfig.getConfig().get("curCod"); + } + + + public void writeTrace(String requestId, RegisterSecurityRq request) { + + request.setSp(registerSecuritySP); + request.setCodEve(registerSecurityEventCod); + request.setCodEve2(registerSecurityEventCod); + request.setCodBan(registerSecurityBankCod); + request.setCodMon(registerSecurityCurCOd); + log.info(LoggerHelper.buildInfoPrivateRequest(requestId, "REGISTER_SECURITY", request)); + + CompletableFuture.supplyAsync(() -> { + // Simulate some processing + try { + Response responseHttp = restClient.invoke(request); + Object response = responseHttp.readEntity(Object.class); + log.info(LoggerHelper.buildInfoPrivateResponse(requestId, "REGISTER_SECURITY", response != null ? response.toString() : "null")); + } catch (Exception e) { + log.error(LoggerHelper.buildError("REGISTER_SECURITY - " + requestId, "Error calling API: " + e.getMessage())); + log.error("Error writing trace: {}", e.getMessage()); + } + return null; + }); + + } + + +} diff --git a/bus-update-card-status/src/main/java/com/banesco/infrastructure/rest/clients/BusUpdateCardStatusRestClient.java b/bus-update-card-status/src/main/java/com/banesco/infrastructure/rest/clients/BusUpdateCardStatusRestClient.java new file mode 100644 index 0000000..f403f69 --- /dev/null +++ b/bus-update-card-status/src/main/java/com/banesco/infrastructure/rest/clients/BusUpdateCardStatusRestClient.java @@ -0,0 +1,22 @@ +package com.banesco.infrastructure.rest.clients; + +import com.banesco.infrastructure.dtos.card.UpdateCardStatusRequest; +import io.quarkus.runtime.annotations.RegisterForReflection; +import jakarta.ws.rs.Consumes; +import jakarta.ws.rs.PUT; +import jakarta.ws.rs.Produces; +import jakarta.ws.rs.core.MediaType; +import jakarta.ws.rs.core.Response; +import org.eclipse.microprofile.rest.client.inject.RegisterRestClient; + +@RegisterForReflection +@RegisterRestClient +public interface BusUpdateCardStatusRestClient { + + + @PUT + @Consumes(MediaType.APPLICATION_JSON) + @Produces(MediaType.APPLICATION_JSON) + Response invoke(UpdateCardStatusRequest request); + +} diff --git a/bus-update-card-status/src/main/java/com/banesco/infrastructure/rest/mappers/PaymentCardMapper.java b/bus-update-card-status/src/main/java/com/banesco/infrastructure/rest/mappers/PaymentCardMapper.java new file mode 100644 index 0000000..975aec3 --- /dev/null +++ b/bus-update-card-status/src/main/java/com/banesco/infrastructure/rest/mappers/PaymentCardMapper.java @@ -0,0 +1,30 @@ +package com.banesco.infrastructure.rest.mappers; + +import com.banesco.domain.bian.request.BusUpdateCardStatusRequest; +import com.banesco.domain.models.CurrentState; +import com.banesco.infrastructure.dtos.card.UpdateCardStatusRequest; +import jakarta.enterprise.context.ApplicationScoped; + +@ApplicationScoped +public class PaymentCardMapper { + + + public UpdateCardStatusRequest toBusinessRequest( + CurrentState currentState, + BusUpdateCardStatusRequest receptionRequest + ) { + + UpdateCardStatusRequest request = new UpdateCardStatusRequest( + currentState.requestId(), + receptionRequest.getCustomerReferenceFintechId(), + receptionRequest.getCustomerReference(), + receptionRequest.getDevice(), + receptionRequest.getCardReference() + + ); + + + return request; + + } +} diff --git a/bus-update-card-status/src/main/java/com/banesco/infrastructure/rest/repositories/PaymentCardRepository.java b/bus-update-card-status/src/main/java/com/banesco/infrastructure/rest/repositories/PaymentCardRepository.java new file mode 100644 index 0000000..0c47272 --- /dev/null +++ b/bus-update-card-status/src/main/java/com/banesco/infrastructure/rest/repositories/PaymentCardRepository.java @@ -0,0 +1,122 @@ +package com.banesco.infrastructure.rest.repositories; + +import com.banesco.common.domain.dto.bian.device.JsonHelper; +import com.banesco.common.domain.dto.bian.device.LoggerHelper; +import com.banesco.common.domain.dto.bian.response.StatusResponse; +import com.banesco.common.domain.model.ApiConfig; +import com.banesco.commons.config.StatusCodes; +import com.banesco.commons.utils.ResponseUtil; +import com.banesco.infrastructure.dtos.card.UpdateCardStatusRequest; +import com.banesco.infrastructure.dtos.card.UpdateCardStatusResponse; +import com.banesco.infrastructure.dtos.osb.AdditionalStatus; +import com.banesco.infrastructure.dtos.osb.Status; +import com.banesco.infrastructure.rest.clients.BusUpdateCardStatusRestClient; +import io.quarkus.runtime.annotations.RegisterForReflection; +import jakarta.ws.rs.ClientErrorException; +import jakarta.ws.rs.core.Response; +import lombok.extern.slf4j.Slf4j; +import org.eclipse.microprofile.rest.client.RestClientBuilder; + +import java.net.URI; +import java.util.HashMap; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import java.util.stream.Collectors; + + +@RegisterForReflection +@Slf4j +public class PaymentCardRepository { + + + private final BusUpdateCardStatusRestClient restClient; + + private final String OPERATION_NAME = "BUS_UPDATE_CARD_STATUS"; + + + public PaymentCardRepository(ApiConfig apiConfig) { + + restClient = RestClientBuilder.newBuilder().baseUri( + URI.create(apiConfig.getUrl()) + ). + connectTimeout(apiConfig.getTimeout().getConnect(), TimeUnit.MILLISECONDS) + .readTimeout(apiConfig.getTimeout().getResponse(), TimeUnit.MILLISECONDS) + .build(BusUpdateCardStatusRestClient.class); + + } + + + public StatusResponse updateCardStatus(UpdateCardStatusRequest request) { + + try { + + + log.info(LoggerHelper.buildInfoPrivateRequest(request.getRequestId(), OPERATION_NAME, JsonHelper.getJsonFromObject(request))); + + Response responseHttp = restClient.invoke(request); + + UpdateCardStatusResponse response = responseHttp.readEntity(UpdateCardStatusResponse.class); + log.info(LoggerHelper.buildInfoPrivateResponse(request.getRequestId(), OPERATION_NAME, JsonHelper.getJsonFromObject(response))); + /* + + if (response.getStatus().getStatusCode() != null && + response.getStatus().getStatusCode().equals("000")) { + return ResponseUtil.mapResponse(request.getRequestId(), StatusCodes.SUCCESS_OPERATION); + } + + return validateSoapResponseStatus(request.getRequestId(), response.getStatus()); + */ + return null; + + + } catch (ClientErrorException e) { + log.error(LoggerHelper.buildError(OPERATION_NAME + " - " + request.getRequestId(), "Error calling API: " + e.getMessage())); + return ResponseUtil.mapErrorResponse(request.getRequestId(), StatusCodes.FAILED_DEPENDENCY); + } catch (Exception e) { + log.error(LoggerHelper.buildError(OPERATION_NAME + " - " + request.getRequestId(), "Error interno callig API: " + e.getMessage())); + return ResponseUtil.mapErrorResponse(request.getRequestId(), StatusCodes.INTERNAL_ERROR); + } + + } + + + /** + * Validate Property Status If has some error and throw Exception with Code or join(-) codes is no equals to 000 + * + * @param status + */ + private StatusResponse validateSoapResponseStatus(String requestId, Status status) { + + // Get Back Error + Map errors = new HashMap<>(); + AdditionalStatus additionalStatus = null; + if (status.getAdditionalStatus() != null) { + for (AdditionalStatus additionalStatusCurrent : status.getAdditionalStatus()) { + if (additionalStatusCurrent.getStatusCode().equals("000")) { + break; + } else { + errors.put(additionalStatusCurrent.getStatusCode(), additionalStatusCurrent.getStatusCode()); + if (additionalStatus == null) { + additionalStatus = additionalStatusCurrent; + } + } + } + + } + if (!errors.values().isEmpty()) { + /** + * Concat errors + */ + return new StatusResponse( + "error", + errors.values().stream().collect(Collectors.joining("-")).toString(), + additionalStatus.getStatusDesc(), + requestId + ); + } + + return ResponseUtil.mapErrorResponse(requestId, StatusCodes.INTERNAL_ERROR); + + + } +} diff --git a/bus-update-card-status/src/main/resources/application-dev.yaml b/bus-update-card-status/src/main/resources/application-dev.yaml new file mode 100644 index 0000000..d62a277 --- /dev/null +++ b/bus-update-card-status/src/main/resources/application-dev.yaml @@ -0,0 +1,25 @@ +quarkus: + http: + port: 8080 + idle-timeout: 30s + thread-pool: + max-threads: 100 + core-threads: 1 + redis: + hosts: redis://redis-qa.apps.desplakur3.desintra.banesco.com:32229 + password: redis + # 4 minutes 60*4*1000 (MS) + timeout: 240000 +api: + source-id: UCSS + rest-client: + update-card-status: + endpoint: '{"url":"http://localhost:8082/card/status/update","timeout":{"connect":20000,"response":20000},"config":{}}' + msgRqHdr: '{"networkTrnInfo":[{"bankId":"01","transactionCode":"8741"}],"applicantData":{"application":"APIMGMT"},"vbProtocol":{"vbProtocolInd":"true","transactionInd":"false"},"operatorCode":"BAN1738A02","sourceChannelCode":"INT"}' + redis: + #expiration with Zero, not apply Redis + get-evaluate-customer-product: '{"prefix":"%s%d%s","expiration":0}' +soap: + domain: + current: osbp2p + diff --git a/bus-update-card-status/src/main/resources/application.yaml b/bus-update-card-status/src/main/resources/application.yaml new file mode 100644 index 0000000..b1e3391 --- /dev/null +++ b/bus-update-card-status/src/main/resources/application.yaml @@ -0,0 +1,33 @@ +quarkus: + http: + non-application-root-path: actuator + log: + level: INFO + console: + enable: true + profile: dev + debug: + print-startup-times: true + reflection: false + native: + file-encoding: UTF-8 + container-build: true + builder-image: quay.io/quarkus/ubi-quarkus-mandrel-builder-image:23.0.5.0-Final-java17 + container-runtime: docker + additional-build-args: + - -H:InitialCollectionPolicy=com.oracle.svm.core.genscavenge.CollectionPolicy\$BySpaceAndTime + - -H:ReflectionConfigurationFiles=reflect-config.json + native-image-xmx: 6G + resources: + excludes: resources/*.yaml + # Enable OpenAPI + smallrye-openapi: + path: /openapi + enable: 'true' + swagger-ui: + path: /swagger-ui + always-include: 'true' + application: + name: bus-update-card-status + version: 1.0.0 + #remove to compile \ No newline at end of file diff --git a/bus-update-card-status/src/main/resources/errors-mapping/recUpdateCardStatusSwitch.json b/bus-update-card-status/src/main/resources/errors-mapping/recUpdateCardStatusSwitch.json new file mode 100644 index 0000000..68e0b72 --- /dev/null +++ b/bus-update-card-status/src/main/resources/errors-mapping/recUpdateCardStatusSwitch.json @@ -0,0 +1,98 @@ +[ + { + "backendCode": "200", + "httpCode": 200, + "statusCode": "200", + "description": "Operacion exitosa" + }, + { + "backendCode": "503", + "httpCode": 503, + "statusCode": "503", + "description": "Uso interno" + }, + { + "backendCode": "422", + "httpCode": 422, + "statusCode": "422", + "description": "Uso interno" + }, + { + "backendCode": "SERVICE_UNAVAILABLE", + "httpCode": 500, + "statusCode": "500", + "description": "Uso interno" + }, + { + "backendCode": "100", + "httpCode": 503, + "statusCode": "503", + "description": "VDR13 - OSB Disponible" + }, + { + "backendCode": "OSB-382505", + "httpCode": 503, + "statusCode": "503", + "description": "VDR13 - OSB Disponible" + }, + { + "backendCode": "OSB-380002", + "httpCode": 503, + "statusCode": "503", + "description": "VDR13 - OSB Disponible" + }, + { + "backendCode": "ERROR", + "httpCode": 400, + "statusCode": "400", + "description": "Uso interno" + }, + { + "backendCode": "400", + "httpCode": 400, + "statusCode": "400", + "description": "Uso interno" + }, + { + "backendCode": "401", + "httpCode": 401, + "statusCode": "401", + "description": "Uso interno" + }, + { + "backendCode": "403", + "httpCode": 403, + "statusCode": "403", + "description": "Uso interno" + }, + { + "backendCode": "404", + "httpCode": 404, + "statusCode": "404", + "description": "Uso interno" + }, + { + "backendCode": "default", + "httpCode": 409, + "statusCode": "409", + "description": "Conflicto" + }, + { + "backendCode": "424", + "httpCode": 424, + "statusCode": "424", + "description": "Error de dependencia" + }, + { + "backendCode": "VDE01", + "httpCode": 400, + "statusCode": "VDE01", + "description": "VDE01 - Error en dato de entrada obligatorio: %s" + }, + { + "backendCode": "VDE02", + "httpCode": 400, + "statusCode": "VDE02", + "description": "VDE02 - Error en valor permitido para campo: %s" + } +] \ No newline at end of file diff --git a/bus-update-card-status/src/main/resources/examples/requestError.json b/bus-update-card-status/src/main/resources/examples/requestError.json new file mode 100644 index 0000000..514d2f7 --- /dev/null +++ b/bus-update-card-status/src/main/resources/examples/requestError.json @@ -0,0 +1,21 @@ + + +{ + "customerReference": { + "customerIdType": "V", + "customerId": "500634269" + }, + "device": { + "deviceType": "Mobile", + "deviceDescription": "Xiaomi Note 11 PRO", + "deviceIp": "127.0.0.1", + "deviceSessionReference": "12345678901304" + }, + "cardReference": { + "cardType": "DebitCard", + "cardNumber": "6012-8862-0791-7605", + "cardStatusCode": "52", + "cardStatusAction": "CV", + "cardStatusReason": "Bloqueo Temporal" + } +} \ No newline at end of file diff --git a/bus-update-card-status/src/main/resources/examples/requestSuccess.json b/bus-update-card-status/src/main/resources/examples/requestSuccess.json new file mode 100644 index 0000000..f068061 --- /dev/null +++ b/bus-update-card-status/src/main/resources/examples/requestSuccess.json @@ -0,0 +1,21 @@ + + +{ + "customerReference": { + "customerIdType": "J", + "customerId": "500634269" + }, + "device": { + "deviceType": "Mobile", + "deviceDescription": "Xiaomi Note 11 PRO", + "deviceIp": "127.0.0.1", + "deviceSessionReference": "12345678901304" + }, + "cardReference": { + "cardType": "DebitCard", + "cardNumber": "6012-8862-0791-7605", + "cardStatusCode": "52", + "cardStatusAction": "CV", + "cardStatusReason": "Bloqueo Temporal" + } +} \ No newline at end of file diff --git a/bus-update-card-status/src/main/resources/reflect-config.json b/bus-update-card-status/src/main/resources/reflect-config.json new file mode 100644 index 0000000..10827d2 --- /dev/null +++ b/bus-update-card-status/src/main/resources/reflect-config.json @@ -0,0 +1,56 @@ +[ + { + "name": "com.banesco.commons.config.AppConf", + "allDeclaredConstructors": true, + "allDeclaredMethods": true, + "allDeclaredFields": true + }, + { + "name": "com.banesco.common.domain.model.BackResponse", + "allDeclaredConstructors": true, + "allDeclaredMethods": true, + "allDeclaredFields": true + }, + { + "name": "com.banesco.common.domain.dto.bian.device.Device", + "allDeclaredConstructors": true, + "allDeclaredMethods": true, + "allDeclaredFields": true + }, + { + "name": "com.banesco.common.domain.model.RedisParam", + "allDeclaredConstructors": true, + "allDeclaredMethods": true, + "allDeclaredFields": true + }, + { + "name": "com.banesco.common.domain.model.ApiConfig", + "allDeclaredConstructors": true, + "allDeclaredMethods": true, + "allDeclaredFields": true + }, + { + "name": "com.banesco.common.domain.model.ApiTimeout", + "allDeclaredConstructors": true, + "allDeclaredMethods": true, + "allDeclaredFields": true + }, + { + "name": "com.banesco.common.domain.dto.bian.response.StatusResponse", + "allDeclaredConstructors": true, + "allDeclaredMethods": true, + "allDeclaredFields": true + }, + { + "name": "com.banesco.common.domain.dto.bian.response.MetadataResponse", + "allDeclaredConstructors": true, + "allDeclaredMethods": true, + "allDeclaredFields": true + }, + { + "name": "com.banesco.common.domain.dto.bian.customer.CustomerReference", + "allDeclaredConstructors": true, + "allDeclaredMethods": true, + "allDeclaredFields": true + } +] diff --git a/bus-update-card-status/src/test/java/com/banesco/tests/BanTestWatcher.java b/bus-update-card-status/src/test/java/com/banesco/tests/BanTestWatcher.java new file mode 100644 index 0000000..0e72b16 --- /dev/null +++ b/bus-update-card-status/src/test/java/com/banesco/tests/BanTestWatcher.java @@ -0,0 +1,27 @@ +package com.banesco.tests; + +import org.junit.jupiter.api.extension.ExtensionContext; +import org.junit.jupiter.api.extension.TestWatcher; + +import java.util.Optional; + +public class BanTestWatcher implements TestWatcher { + private static final String ANSI_GREEN = "\u001B[32m"; + private static final String ANSI_RED = "\u001B[31m"; + private static final String ANSI_RESET = "\u001B[0m"; + + @Override + public void testSuccessful(ExtensionContext context) { + System.out.println(ANSI_GREEN + "Test successful: " + context.getDisplayName() + ANSI_RESET); + } + + @Override + public void testFailed(ExtensionContext context, Throwable cause) { + System.out.println(ANSI_RED + "Test failed: " + context.getDisplayName() + " - " + cause.getMessage() + ANSI_RESET); + } + + @Override + public void testDisabled(ExtensionContext context, Optional reason) { + System.out.println("Test disabled: " + context.getDisplayName() + " - " + reason.orElse("No reason given")); + } +} \ No newline at end of file diff --git a/commons-bian/.gitignore b/commons-bian/.gitignore new file mode 100644 index 0000000..5ff6309 --- /dev/null +++ b/commons-bian/.gitignore @@ -0,0 +1,38 @@ +target/ +!.mvn/wrapper/maven-wrapper.jar +!**/src/main/**/target/ +!**/src/test/**/target/ + +### IntelliJ IDEA ### +.idea/modules.xml +.idea/jarRepositories.xml +.idea/compiler.xml +.idea/libraries/ +*.iws +*.iml +*.ipr + +### Eclipse ### +.apt_generated +.classpath +.factorypath +.project +.settings +.springBeans +.sts4-cache + +### NetBeans ### +/nbproject/private/ +/nbbuild/ +/dist/ +/nbdist/ +/.nb-gradle/ +build/ +!**/src/main/**/build/ +!**/src/test/**/build/ + +### VS Code ### +.vscode/ + +### Mac OS ### +.DS_Store \ No newline at end of file diff --git a/commons-bian/.idea/.gitignore b/commons-bian/.idea/.gitignore new file mode 100644 index 0000000..26d3352 --- /dev/null +++ b/commons-bian/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/commons-bian/.idea/encodings.xml b/commons-bian/.idea/encodings.xml new file mode 100644 index 0000000..aa00ffa --- /dev/null +++ b/commons-bian/.idea/encodings.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/commons-bian/.idea/misc.xml b/commons-bian/.idea/misc.xml new file mode 100644 index 0000000..463551f --- /dev/null +++ b/commons-bian/.idea/misc.xml @@ -0,0 +1,14 @@ + + + + + + + + + + \ No newline at end of file diff --git a/commons-bian/.idea/vcs.xml b/commons-bian/.idea/vcs.xml new file mode 100644 index 0000000..d843f34 --- /dev/null +++ b/commons-bian/.idea/vcs.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/commons-bian/CHANGELOG.md b/commons-bian/CHANGELOG.md new file mode 100644 index 0000000..a36c9bf --- /dev/null +++ b/commons-bian/CHANGELOG.md @@ -0,0 +1,10 @@ +# Changelog + +Todos los cambios notables en este proyecto se documentarán en este archivo. + +El formato se basa en [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), +y este proyecto se adhiere a [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [UNRELEASE] + +- Base inicial commons nativo (Java) \ No newline at end of file diff --git a/commons-bian/LICENCE b/commons-bian/LICENCE new file mode 100644 index 0000000..1773f19 --- /dev/null +++ b/commons-bian/LICENCE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2024 Banesco Banco Universal, C.A. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/commons-bian/README.md b/commons-bian/README.md new file mode 100644 index 0000000..7cd195f --- /dev/null +++ b/commons-bian/README.md @@ -0,0 +1,10 @@ + +![Logo](https://upload.wikimedia.org/wikipedia/commons/thumb/7/74/Banesco_logo.svg/2560px-Banesco_logo.svg.png) + + +# Commons + +Este proyecto utiliza Java nativo como librería commons + + +- Banesco Banco Universal © Todos los Derechos Reservados. \ No newline at end of file diff --git a/commons-bian/pom.xml b/commons-bian/pom.xml new file mode 100644 index 0000000..f335f34 --- /dev/null +++ b/commons-bian/pom.xml @@ -0,0 +1,66 @@ + + 4.0.0 + + com.banesco + commons-bian + 1.0 + jar + + commons-bian + http://maven.apache.org + + + UTF-8 + 17 + 17 + 17 + + + + + + com.fasterxml.jackson.core + jackson-databind + 2.15.4 + compile + + + + javax.servlet + javax.servlet-api + 4.0.1 + provided + + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.11.0 + + 17 + 17 + 17 + + + + org.apache.maven.plugins + maven-jar-plugin + 3.3.0 + + + org.apache.maven.plugins + maven-resources-plugin + 3.3.1 + + + + \ No newline at end of file diff --git a/commons-bian/src/main/java/com/banesco/CommonsBian.java b/commons-bian/src/main/java/com/banesco/CommonsBian.java new file mode 100644 index 0000000..b2506bb --- /dev/null +++ b/commons-bian/src/main/java/com/banesco/CommonsBian.java @@ -0,0 +1,8 @@ +package com.banesco; + +public class CommonsBian { + + public static void main(String[] args) { + System.out.println("Commons BIAN..."); + } +} diff --git a/commons-bian/src/main/java/com/banesco/common/application/exception/BanBackendException.java b/commons-bian/src/main/java/com/banesco/common/application/exception/BanBackendException.java new file mode 100644 index 0000000..a30c0a2 --- /dev/null +++ b/commons-bian/src/main/java/com/banesco/common/application/exception/BanBackendException.java @@ -0,0 +1,33 @@ +package com.banesco.common.application.exception; + +public class BanBackendException extends RuntimeException { + + protected String backendCode; + protected String backendDesc; + protected String target; + + public BanBackendException(String backendCode, String backendDesc) { + super(backendDesc); + this.backendCode = backendCode; + this.backendDesc = backendDesc; + } + + public BanBackendException(String backendCode, String backendDesc, String target) { + super(backendDesc.formatted(target) + ", Target:" + target); + this.backendCode = backendCode; + this.backendDesc = backendDesc; + this.target = target; + } + + public String getBackendCode() { + return backendCode; + } + + public String getBackendDesc() { + return backendDesc; + } + + public String getTarget() { + return target; + } +} diff --git a/commons-bian/src/main/java/com/banesco/common/application/exception/BanRuntimeException.java b/commons-bian/src/main/java/com/banesco/common/application/exception/BanRuntimeException.java new file mode 100644 index 0000000..8548009 --- /dev/null +++ b/commons-bian/src/main/java/com/banesco/common/application/exception/BanRuntimeException.java @@ -0,0 +1,32 @@ +package com.banesco.common.application.exception; + +import com.banesco.common.domain.interfaces.BaseStatusCodesEnum; + +public class BanRuntimeException extends RuntimeException { + + protected BaseStatusCodesEnum statusCode; + protected String target; + + public BanRuntimeException() { + super("Internal Error"); + } + + public BanRuntimeException(BaseStatusCodesEnum statusCode, String target) { + super(statusCode.getStatusDesc().formatted(target) + ", Target:" + target); + this.statusCode = statusCode; + this.target = target; + } + + public BanRuntimeException(BaseStatusCodesEnum statusCode) { + super(statusCode.getStatusDesc()); + this.statusCode = statusCode; + } + + public BaseStatusCodesEnum getStatusCode() { + return statusCode; + } + + public String getTarget() { + return target; + } +} diff --git a/commons-bian/src/main/java/com/banesco/common/application/helper/DeviceHelper.java b/commons-bian/src/main/java/com/banesco/common/application/helper/DeviceHelper.java new file mode 100644 index 0000000..71f1b07 --- /dev/null +++ b/commons-bian/src/main/java/com/banesco/common/application/helper/DeviceHelper.java @@ -0,0 +1,51 @@ +package com.banesco.common.application.helper; + +import com.banesco.common.domain.dto.bian.device.Device; +import com.banesco.common.domain.dto.bian.device.DeviceTypeValues; +import com.banesco.common.domain.dto.bian.device.StringHelper; + +import java.util.Objects; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +public class DeviceHelper { + + + private static final Logger logger = Logger.getLogger(DeviceHelper.class.getName()); + + + public static DeviceTypeValues getDeviceTypeValue( + Device device + ) { + var deviceTypeValue = DeviceTypeValues.Unknown; + + if (!Objects.isNull(device) && !StringHelper.isEmpty(device.getDeviceType())) { + try { + deviceTypeValue = DeviceTypeValues.valueOf(device.getDeviceType()); + } catch (Exception e) { + logger.log(Level.WARNING, "Error Mapping Device Type: %s -> %s".formatted(device.getDeviceType(), e.getMessage())); + } + } + + return deviceTypeValue; + } + + public static boolean isValidDeviceType(String type) { + + for (DeviceTypeValues deviceType : DeviceTypeValues.values()) { + if (deviceType.name().equals(type)) { + return true; + } + } + return false; + } + + public static String getDeviceTypes() { + return Stream.of(DeviceTypeValues.values()).map(Enum::name).collect( + Collectors.joining(", ") + ); + } + +} diff --git a/commons-bian/src/main/java/com/banesco/common/application/helper/PaymentCardHelper.java b/commons-bian/src/main/java/com/banesco/common/application/helper/PaymentCardHelper.java new file mode 100644 index 0000000..7c34e94 --- /dev/null +++ b/commons-bian/src/main/java/com/banesco/common/application/helper/PaymentCardHelper.java @@ -0,0 +1,16 @@ +package com.banesco.common.application.helper; + +import com.banesco.common.domain.dto.bian.device.DeviceTypeValues; +import com.banesco.common.domain.dto.bian.paymentCard.CardTypeValues; + +public class PaymentCardHelper { + + public static boolean isValidCardType(String type) { + for (CardTypeValues cardTypeValue : CardTypeValues.values()) { + if (cardTypeValue.name().equals(type)) { + return true; + } + } + return false; + } +} diff --git a/commons-bian/src/main/java/com/banesco/common/domain/dto/bian/customer/CustomerReference.java b/commons-bian/src/main/java/com/banesco/common/domain/dto/bian/customer/CustomerReference.java new file mode 100644 index 0000000..fbb91b3 --- /dev/null +++ b/commons-bian/src/main/java/com/banesco/common/domain/dto/bian/customer/CustomerReference.java @@ -0,0 +1,36 @@ +package com.banesco.common.domain.dto.bian.customer; + +public class CustomerReference { + String customerIdType; + String customerId; + + public CustomerReference() { + } + + public CustomerReference(String customerIdType, String customerId) { + this.customerIdType = customerIdType; + this.customerId = customerId; + } + + public String getCustomerIdType() { + return customerIdType; + } + + public void setCustomerIdType(String customerIdType) { + this.customerIdType = customerIdType; + } + + public String getCustomerId() { + return customerId; + } + + public void setCustomerId(String customerId) { + this.customerId = customerId; + } + + @Override + public String toString() { + return "{\"customerIdType\":\"%s\",\"customerId\":\"%s\"}" + .formatted(customerIdType, customerId); + } +} diff --git a/commons-bian/src/main/java/com/banesco/common/domain/dto/bian/device/AccountHelper.java b/commons-bian/src/main/java/com/banesco/common/domain/dto/bian/device/AccountHelper.java new file mode 100644 index 0000000..49d3e8e --- /dev/null +++ b/commons-bian/src/main/java/com/banesco/common/domain/dto/bian/device/AccountHelper.java @@ -0,0 +1,21 @@ +package com.banesco.common.domain.dto.bian.device; + + +/** + * Clase utilitaria para operaciones relacionadas con cuentas bancarias. + * Proporciona métodos para manipular y formatear información de cuentas. + */ +public class AccountHelper { + + /** + * Enmascara un número de cuenta, mostrando solo los primeros 4 + * y últimos 4 Los dígitos intermedios son reemplazados por asteriscos para proteger la + * información sensible del cliente. + * + * @param clearAccountId El número de cuenta completo sin enmascarar + * @return El número de cuenta enmascarado en formato "XXXX************YYYY" + */ + public static String getMaskedAccountId(String clearAccountId) { + return clearAccountId.substring(0, 4) + "************" + clearAccountId.substring(clearAccountId.length() - 4); + } +} \ No newline at end of file diff --git a/commons-bian/src/main/java/com/banesco/common/domain/dto/bian/device/DateHelper.java b/commons-bian/src/main/java/com/banesco/common/domain/dto/bian/device/DateHelper.java new file mode 100644 index 0000000..0f96ae8 --- /dev/null +++ b/commons-bian/src/main/java/com/banesco/common/domain/dto/bian/device/DateHelper.java @@ -0,0 +1,163 @@ +package com.banesco.common.domain.dto.bian.device; + +import java.time.DateTimeException; +import java.time.LocalDate; +import java.time.LocalDateTime; +import java.time.ZoneId; +import java.time.format.DateTimeFormatter; +import java.time.temporal.ChronoUnit; +import java.util.logging.Level; +import java.util.logging.Logger; + +/** + * Clase utilitaria para operaciones relacionadas con fechas y horas. + * Proporciona métodos para validar, comparar y calcular períodos entre fechas. + */ +public class DateHelper { + + + private final Logger logger = Logger.getLogger(DateHelper.class.getName()); + private final ZoneId currentZone = ZoneId.of("America/Caracas"); + private final DateTimeFormatter DATE_YYYY_MM_DD = DateTimeFormatter.ofPattern("yyyy-MM-dd"); + private final DateTimeFormatter TIME_HH_MM_SS = DateTimeFormatter.ofPattern("HH:mm:ss"); + + private static class SingletonHelper { + private static final DateHelper INSTANCE = new DateHelper(); + } + + + /** + * Constructo private to no allow other Instances + */ + private DateHelper() { + // not public instance + } + + /** + * Get Instance Singleton + * + * @return + */ + public static DateHelper getInstance() { + return SingletonHelper.INSTANCE; + } + + /** + * Permite obtener la Fecha Hora Actual + * + * @return + */ + public LocalDateTime getCurrentDateTime() { + return LocalDateTime.now(currentZone); + } + + /** + * Permite Obtener la Hora para una FechaHora, en caso de ser null se obtiene la hora actual + * + * @param now Feha Hora Local + * @return + */ + public String getTime(LocalDateTime now) { + if (now == null) { + now = LocalDateTime.now(currentZone); + } + return now.format(TIME_HH_MM_SS); + } + + /** + * Permite Obtener la Fecha para una FechaHora, en caso de ser null se obtiene la fecha actual + * + * @param now Feha Hora Local + * @return + */ + public String getDate(LocalDateTime now) { + if (now == null) { + now = LocalDateTime.now(currentZone); + } + return now.format(DATE_YYYY_MM_DD); + } + + /** + * Check is Current Hour is in Hour Range passed by parameters + * if Parameters are equal then return false + * + * @param rangeHourBegin Cadena de la hora de inicio del Rango + * @param rangeHourFinish Candena de la hora de fin del Rango + * @param hourStrToCheck Hora en cadena para evaluar si se encuentra entre el rango de parametros + * @return boolean + */ + public boolean isHourInRange(String rangeHourBegin, String rangeHourFinish, String hourStrToCheck) { + + return isHourInRange(Integer.parseInt(rangeHourBegin.replace(":", "")), + Integer.parseInt(rangeHourFinish.replace(":", "")), + hourStrToCheck + ); + + } + + /** + * Check is Current Hour is in Hour Range passed by parameters + * if Parameters are equal then return false + * + * @param rangeHourBegin Numero entero de la hora de inicio del Rango + * @param rangeHourFinish Numero entero de la hora de fin del Rango + * @param hourStrToCheck Hora en cadena para evaluar si se encuentra entre el rango de parametros + * @return boolean + */ + public boolean isHourInRange(int rangeHourBegin, int rangeHourFinish, String hourStrToCheck) { + boolean mustValidateService = false; + + if (rangeHourBegin == rangeHourFinish) { + return mustValidateService; + } + + int currentHour = Integer.parseInt(hourStrToCheck.replace(":", "")); + + + if (rangeHourBegin > rangeHourFinish) { // hour end is less than hour start, => then validate next day + + if (currentHour <= rangeHourFinish || currentHour >= rangeHourBegin) { + mustValidateService = true; + } + } else if (currentHour >= rangeHourBegin && currentHour <= rangeHourFinish) { // Hour the same day + mustValidateService = true; + } + logger.log(Level.INFO, "La hora (%s => %d) %sesta entre %d y %d ".formatted( + hourStrToCheck, + currentHour, + (mustValidateService ? "" : "NO "), + rangeHourBegin, + rangeHourFinish)); + + return mustValidateService; + } + + /** + * Calcula el número de días entre dos fechas. + * + * @param startDate Fecha de inicio en formato ISO (yyyy-MM-dd) + * @param endDate Fecha de fin en formato ISO (yyyy-MM-dd) + * @return El número de días entre las fechas o -1 si ocurre un error al + * procesar las fechas + */ + public long daysBetweenTwoDates(String startDate, String endDate) { + try { + return ChronoUnit.DAYS.between(LocalDate.parse(startDate), LocalDate.parse(endDate)); + } catch (DateTimeException dte) { + return -1L; + } + } + + /** + * Verifica si la fecha de inicio es anterior o igual a la fecha de fin. + * + * @param startDate Fecha de inicio en formato ISO (yyyy-MM-dd) + * @param endDate Fecha de fin en formato ISO (yyyy-MM-dd) + * @return true si startDate es anterior o igual a endDate, false en caso + * contrario + */ + public boolean isStartDateBeforeEndDate(String startDate, String endDate) { + return LocalDate.parse(startDate).isBefore(LocalDate.parse(endDate)) + || LocalDate.parse(startDate).isEqual(LocalDate.parse(endDate)); + } +} diff --git a/commons-bian/src/main/java/com/banesco/common/domain/dto/bian/device/Device.java b/commons-bian/src/main/java/com/banesco/common/domain/dto/bian/device/Device.java new file mode 100644 index 0000000..86fd941 --- /dev/null +++ b/commons-bian/src/main/java/com/banesco/common/domain/dto/bian/device/Device.java @@ -0,0 +1,59 @@ +package com.banesco.common.domain.dto.bian.device; + + + +public class Device { + String deviceType; + String deviceDescription; + String deviceIp; + String deviceSessionReference; + + public Device() { + + } + + public Device(String deviceType, String deviceDescription, String deviceIp, String deviceSessionReference) { + this.deviceType = deviceType; + this.deviceDescription = deviceDescription; + this.deviceIp = deviceIp; + this.deviceSessionReference = deviceSessionReference; + } + + public String getDeviceType() { + return deviceType; + } + + public void setDeviceType(String deviceType) { + this.deviceType = deviceType; + } + + public String getDeviceDescription() { + return deviceDescription; + } + + public void setDeviceDescription(String deviceDescription) { + this.deviceDescription = deviceDescription; + } + + public String getDeviceIp() { + return deviceIp; + } + + public void setDeviceIp(String deviceIp) { + this.deviceIp = deviceIp; + } + + public String getDeviceSessionReference() { + return deviceSessionReference; + } + + public void setDeviceSessionReference(String deviceSessionReference) { + this.deviceSessionReference = deviceSessionReference; + } + + public String toString() { + return "{\"deviceType\":\"%s\",\"deviceDescription\":\"%s\",\"deviceIp\":\"%s\",\"deviceSessionReference\":\"%s\"}" + .formatted(deviceType, deviceDescription, deviceIp, deviceSessionReference); + } + +} diff --git a/commons-bian/src/main/java/com/banesco/common/domain/dto/bian/device/DeviceTypeValues.java b/commons-bian/src/main/java/com/banesco/common/domain/dto/bian/device/DeviceTypeValues.java new file mode 100644 index 0000000..2de439b --- /dev/null +++ b/commons-bian/src/main/java/com/banesco/common/domain/dto/bian/device/DeviceTypeValues.java @@ -0,0 +1,20 @@ +package com.banesco.common.domain.dto.bian.device; + +public enum DeviceTypeValues { + Mobile, + Tablet, + PersonalComputer, + SecureCardReader, + NonSecureCardReader, + OtherNational, + OtherPrivate, + Wearable, + Vehicle, + Embedded, + KeyFob, + Jewellery, + Sticker, + GamingDevice, + Watch, + Unknown +} diff --git a/commons-bian/src/main/java/com/banesco/common/domain/dto/bian/device/JsonHelper.java b/commons-bian/src/main/java/com/banesco/common/domain/dto/bian/device/JsonHelper.java new file mode 100644 index 0000000..5dd0e40 --- /dev/null +++ b/commons-bian/src/main/java/com/banesco/common/domain/dto/bian/device/JsonHelper.java @@ -0,0 +1,93 @@ +package com.banesco.common.domain.dto.bian.device; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.DeserializationFeature; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.SerializationFeature; + +import java.io.IOException; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.List; +import java.util.logging.Level; +import java.util.logging.Logger; + +public class JsonHelper { + + private static final Logger logger = Logger.getLogger(JsonHelper.class.getName()); + public static final ObjectMapper MAPPER = new ObjectMapper(); + + static { + MAPPER.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false); + MAPPER.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); + } + + /** + * Convert Object to jsonString + * + * @param object El objeto a convertir en JSON. + * @return La cadena JSON resultante o null si ocurre un error. + */ + public static String getJsonFromObject(Object object) { + if (object == null) { + return "null"; + } + try { + return MAPPER.writeValueAsString(object); + } catch (JsonProcessingException e) { + logger.log(Level.SEVERE, "Error parsing objeto a JSON: {0}", e.getMessage()); + return null; + } + } + + /** + * Convierte una cadena JSON en un objeto Java de la clase especificada. + * + * @param json La cadena JSON a convertir. + * @param className La clase del objeto Java resultante. + * @param El tipo del objeto resultante. + * @return El objeto Java resultante, o null si ocurre un error o la cadena + * JSON está vacía. + */ + public static T getObjectFromJson(String json, Class className) { + if (json == null || json.isEmpty()) { + return null; + } + try { + return MAPPER.readValue(json, className); + } catch (JsonProcessingException | IllegalArgumentException e) { + logger.log(Level.WARNING, "Error parsing JSON a objeto: {0}", e.getMessage()); + return null; + } + } + + public static List getListFromJson(String json, Class className) { + if (json == null || json.isEmpty()) { + return new ArrayList<>(); + } + try { + return MAPPER.readValue(json, + MAPPER.getTypeFactory().constructCollectionType(List.class, className) + ); + } catch (JsonProcessingException | IllegalArgumentException e) { + logger.log(Level.WARNING, "Error parsing JSON a List Object: {0}", e.getMessage()); + } + + return new ArrayList<>(); + } + + public static List getListFromInputStream(InputStream inputStream, Class className) throws IOException { + if (inputStream == null) { + return new ArrayList<>(); + } + try { + return MAPPER.readValue(inputStream, + MAPPER.getTypeFactory().constructCollectionType(List.class, className) + ); + } catch (JsonProcessingException | IllegalArgumentException e) { + logger.log(Level.WARNING, "Error parsing JSON a List Object: {0}", e.getMessage()); + } + + return new ArrayList<>(); + } +} diff --git a/commons-bian/src/main/java/com/banesco/common/domain/dto/bian/device/LoggerHelper.java b/commons-bian/src/main/java/com/banesco/common/domain/dto/bian/device/LoggerHelper.java new file mode 100644 index 0000000..cb85dc6 --- /dev/null +++ b/commons-bian/src/main/java/com/banesco/common/domain/dto/bian/device/LoggerHelper.java @@ -0,0 +1,118 @@ +package com.banesco.common.domain.dto.bian.device; + +/** + * Clase utilitaria para la generación de mensajes de registro (logging). + * Facilita la creación de cadenas formateadas para registrar información de + * solicitudes y respuestas, tanto públicas como privadas, así como mensajes de + * error. Utiliza un formato estandarizado para mejorar la legibilidad y + * facilitar el análisis de los registros del sistema. + */ +public class LoggerHelper { + + /** + * Construye una cadena de información para una solicitud pública. + * + * @param requestId El ID de la solicitud. + * @param request El objeto de solicitud. + * @param El tipo del objeto de solicitud. + * @return Una cadena de información formateada. + */ + public static String buildInfoRequest(String requestId, T request) { + return String.format("[PUB RQ: %s] [%s]", requestId, JsonHelper.getJsonFromObject(request)); + } + + /** + * Construye una cadena de información para una solicitud pública. + * + * @param requestId El ID de la solicitud. + * @param request El request en cadena de la solicitud. + * @return Una cadena de información formateada. + */ + public static String buildInfoRequest(String requestId, String request) { + return String.format("[PUB RQ: %s] [%s]", requestId, request); + } + + /** + * Construye una cadena de información para una respuesta pública. + * + * @param requestId El ID de la solicitud. + * @param response El objeto de respuesta. + * @param El tipo del objeto de respuesta. + * @return Una cadena de información formateada. + */ + public static String buildInfoResponse(String requestId, T response) { + return String.format("[PUB RS: %s] [%s]", requestId, JsonHelper.getJsonFromObject(response)); + } + + /** + * Construye una cadena de información para una respuesta pública. + * + * @param requestId El ID de la solicitud. + * @param response El objeto en cadena de respuesta. + * @return Una cadena de información formateada. + */ + public static String buildInfoResponse(String requestId, String response) { + return String.format("[PUB RS: %s] [%s]", requestId, response); + } + + /** + * Construye una cadena de información para una solicitud privada. + * + * @param requestId El ID de la solicitud. + * @param name El nombre de la solicitud privada. + * @param request El objeto de solicitud. + * @param El tipo del objeto de solicitud. + * @return Una cadena de información formateada. + */ + public static String buildInfoPrivateRequest(String requestId, String name, T request) { + return String.format("[PRV RQ %s: %s] [%s]", name, requestId, JsonHelper.getJsonFromObject(request)); + } + + /** + * Construye una cadena de información para una solicitud privada. + * + * @param requestId El ID de la solicitud. + * @param name El nombre de la solicitud privada. + * @param request El objeto en cadena de la solicitud. + * @return Una cadena de información formateada. + */ + public static String buildInfoPrivateRequest(String requestId, String name, String request) { + return String.format("[PRV RQ %s: %s] [%s]", name, requestId, request); + } + + /** + * Construye una cadena de información para una respuesta privada. + * + * @param requestId El ID de la solicitud. + * @param name El nombre de la respuesta privada. + * @param response El objeto de respuesta. + * @param El tipo del objeto de respuesta. + * @return Una cadena de información formateada. + */ + public static String buildInfoPrivateResponse(String requestId, String name, T response) { + return String.format("[PRV RS %s: %s] [%s]", name, requestId, JsonHelper.getJsonFromObject(response)); + } + + /** + * Construye una cadena de información para una respuesta privada. + * + * @param requestId El ID de la solicitud. + * @param name El nombre de la respuesta privada. + * @param response El objeto en cadena de la respuesta. + * @return Una cadena de información formateada. + */ + public static String buildInfoPrivateResponse(String requestId, String name, String response) { + return String.format("[PRV RS %s: %s] [%s]", name, requestId, response); + } + + /** + * Construye una cadena de error. + * + * @param requestId El ID de la solicitud asociada al error. + * @param out El mensaje de error. + * @return Una cadena de error formateada. + */ + public static String buildError(String requestId, String out) { + return String.format("[ERROR %s] [%s]", requestId, out); + } +} diff --git a/commons-bian/src/main/java/com/banesco/common/domain/dto/bian/device/RequestHelper.java b/commons-bian/src/main/java/com/banesco/common/domain/dto/bian/device/RequestHelper.java new file mode 100644 index 0000000..e20550e --- /dev/null +++ b/commons-bian/src/main/java/com/banesco/common/domain/dto/bian/device/RequestHelper.java @@ -0,0 +1,81 @@ +package com.banesco.common.domain.dto.bian.device; + +import java.util.concurrent.ThreadLocalRandom; + +/** + * Clase utilitaria para operaciones relacionadas con solicitudes HTTP y + * generación de identificadores. Proporciona métodos para generar IDs únicos, + * obtener información del cliente y gestionar información del dispositivo. + */ +public class RequestHelper { + + private final String ALPHANUMERIC_CHARACTERS = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; + private final int baseCharacterLen = ALPHANUMERIC_CHARACTERS.length(); + + + /** + * Permite tener una cadena aleatoria de caracteres numericos + * + * @param len longitud de la cadena numerica a retornar + * @return + */ + public String randomNumeric(int len) { + char[] chars = new char[len]; + for (int i = 0; i < len; i++) { + chars[i] = (char) ThreadLocalRandom.current().nextInt(48, 58); // ascii index number + } + + return new String(chars); + } + + /** + * Permite tener una cadena aleatoria de caracteres alfa-numericos + * + * @param len longitud de la cadena alfa-numerica a retornar + * @return + */ + public String randomAlphanumeric(int len) { + char[] chars = new char[len]; + for (int i = 0; i < len; i++) { + chars[i] = ALPHANUMERIC_CHARACTERS.charAt(ThreadLocalRandom.current().nextInt(baseCharacterLen)); + } + + return new String(chars); + } + + + /** + * Retorna Identificador de la Instancia del Request, usando como prefijo un valor predefinido + * ejemplos: P2P, REM, + * Facilita identificar el origen de los Requests + * Deberia obtenerse una vez al inicia el Request + * + * @param apiSourceId + * @return + */ + public String getInstanceId(String apiSourceId) { + return (apiSourceId == null ? "INST" : apiSourceId).concat(randomAlphanumeric(10)); + } + + /** + * Retorna un Identificador del Request, se sugiere usar el getInstanceId creada como prefijo. + * Usar uno para Cada Request que implique afectacion financiera + * + * @param instanceId + * @return + */ + public String getRequestId(String instanceId) { + return instanceId.concat("REQ").concat(randomAlphanumeric(20)); + } + + + /** + * Permite Obtener un valor Numerico de Identificador de Transaccion + * + * @param len + * @return + */ + public String getTransactionId(int len) { + return randomNumeric(len); + } +} diff --git a/commons-bian/src/main/java/com/banesco/common/domain/dto/bian/device/StringHelper.java b/commons-bian/src/main/java/com/banesco/common/domain/dto/bian/device/StringHelper.java new file mode 100644 index 0000000..1a02374 --- /dev/null +++ b/commons-bian/src/main/java/com/banesco/common/domain/dto/bian/device/StringHelper.java @@ -0,0 +1,106 @@ +package com.banesco.common.domain.dto.bian.device; + +/** + * Clase utilitaria para operaciones con cadenas de texto (strings). Proporciona + * métodos para validar, manipular y formatear cadenas de texto. Incluye + * funcionalidades como verificación de tipos numéricos, validación de cadenas + * no vacías y funciones de formato como relleno de caracteres. + */ +public class StringHelper { + + /** + * Verifica si una cadena de texto representa un número entero. + * + * @param value La cadena de texto a verificar. + * @return true si la cadena es un número entero válido, false en caso + * contrario. + * @throws NumberFormatException Si el string no tiene el formato adeacuado + */ + public static boolean isNumeric(String value) { + if (value == null || value.isEmpty()) { + return false; + } + try { + Integer.parseInt(value); + return true; + } catch (NumberFormatException e) { + return false; + } + } + + /** + * Verifica si una cadena de texto es nula o está vacía después de + * eliminar espacios en blanco. + * + * @param value La cadena de texto a verificar. + * @return true si la cadena está vacía, false en caso contrario. + */ + public static boolean isEmpty(String value) { + return value == null || value.trim().isEmpty(); + } + + + /** + * Rellena una cadena de texto con un carácter específico a la izquierda + * hasta alcanzar la longitud deseada. + * + * @param inputStr La cadena de texto a rellenar. + * @param strLenOut La longitud deseada de la cadena resultante. + * @param padChar El carácter de relleno. + * @return La cadena rellenada con el carácter especificado a la izquierda. + */ + public static String leftPad(String inputStr, int strLenOut, char padChar) { + if (inputStr == null) { + inputStr = ""; // Handle null input + } + int padLength = strLenOut - inputStr.length(); + if (padLength <= 0) { + return inputStr; // No padding needed + } + + char[] paddedString = new char[padLength]; + for (int i = 0; i < padLength; i++) { + paddedString[i] = padChar; + } + + return new String(paddedString).concat(inputStr); + } + + /** + * Permite convertir nombre de propiedad separada con (,-) to CamelCase + * + * @param inputStr Cadena de texto a convertir + * @param firstUpper Flag que indica si la primera letra es Mayuscula + * @return + */ + public static String convertToCamelCase(String inputStr, boolean firstUpper) { + + StringBuilder result = new StringBuilder(); + boolean capitalizeNext = firstUpper; + + for (char ch : inputStr.toCharArray()) { + if (ch == '.' || ch == '-') { + capitalizeNext = true; // Next character should be capitalized + } else { + if (capitalizeNext) { + result.append(Character.toUpperCase(ch)); // Capitalize current character + capitalizeNext = false; // Reset flag + } else { + result.append(Character.toLowerCase(ch)); // Append in lowercase + } + } + } + + return result.toString(); + + } + + /** + * @param inputStr Cadena de texto a convertir en UpperCamelCase + * @return + */ + public static String convertToUpperCamelCase(String inputStr) { + return convertToCamelCase(inputStr, true); + } + +} diff --git a/commons-bian/src/main/java/com/banesco/common/domain/dto/bian/paymentCard/CardTypeValues.java b/commons-bian/src/main/java/com/banesco/common/domain/dto/bian/paymentCard/CardTypeValues.java new file mode 100644 index 0000000..6f06423 --- /dev/null +++ b/commons-bian/src/main/java/com/banesco/common/domain/dto/bian/paymentCard/CardTypeValues.java @@ -0,0 +1,6 @@ +package com.banesco.common.domain.dto.bian.paymentCard; + +public enum CardTypeValues { + DebitCard, + CreditCard +} diff --git a/commons-bian/src/main/java/com/banesco/common/domain/dto/bian/response/BaseResponse.java b/commons-bian/src/main/java/com/banesco/common/domain/dto/bian/response/BaseResponse.java new file mode 100644 index 0000000..35b8527 --- /dev/null +++ b/commons-bian/src/main/java/com/banesco/common/domain/dto/bian/response/BaseResponse.java @@ -0,0 +1,20 @@ +package com.banesco.common.domain.dto.bian.response; + +public class BaseResponse { + protected StatusResponse statusResponse; + + public BaseResponse() { + } + + public BaseResponse(StatusResponse statusResponse) { + this.statusResponse = statusResponse; + } + + public StatusResponse getStatusResponse() { + return statusResponse; + } + + public void setStatusResponse(StatusResponse statusResponse) { + this.statusResponse = statusResponse; + } +} diff --git a/commons-bian/src/main/java/com/banesco/common/domain/dto/bian/response/MetadataResponse.java b/commons-bian/src/main/java/com/banesco/common/domain/dto/bian/response/MetadataResponse.java new file mode 100644 index 0000000..4f13ff4 --- /dev/null +++ b/commons-bian/src/main/java/com/banesco/common/domain/dto/bian/response/MetadataResponse.java @@ -0,0 +1,10 @@ +package com.banesco.common.domain.dto.bian.response; + +public record MetadataResponse(String timestamp, String operationId) { + + @Override + public String toString() { + return "{\"timestamp\":\"%s\",\"operationId\":\"%s\"}".formatted(timestamp, operationId); + } + +} diff --git a/commons-bian/src/main/java/com/banesco/common/domain/dto/bian/response/StatusResponse.java b/commons-bian/src/main/java/com/banesco/common/domain/dto/bian/response/StatusResponse.java new file mode 100644 index 0000000..ef001f9 --- /dev/null +++ b/commons-bian/src/main/java/com/banesco/common/domain/dto/bian/response/StatusResponse.java @@ -0,0 +1,10 @@ +package com.banesco.common.domain.dto.bian.response; + +public record StatusResponse(String status,String statusCode, String message, String traceId) { + + @Override + public String toString() { + return "{\"status\":\"%s\",\"statusCode\":\"%s\",\"message\":\"%s\",\"traceId\":\"%s\"}".formatted(status, statusCode, message, traceId); + } + +} diff --git a/commons-bian/src/main/java/com/banesco/common/domain/interfaces/BaseStatusCodesEnum.java b/commons-bian/src/main/java/com/banesco/common/domain/interfaces/BaseStatusCodesEnum.java new file mode 100644 index 0000000..da70b01 --- /dev/null +++ b/commons-bian/src/main/java/com/banesco/common/domain/interfaces/BaseStatusCodesEnum.java @@ -0,0 +1,6 @@ +package com.banesco.common.domain.interfaces; + +public interface BaseStatusCodesEnum { + String getStatusCode(); + String getStatusDesc(); +} diff --git a/commons-bian/src/main/java/com/banesco/common/domain/model/ApiConfig.java b/commons-bian/src/main/java/com/banesco/common/domain/model/ApiConfig.java new file mode 100644 index 0000000..b15eaba --- /dev/null +++ b/commons-bian/src/main/java/com/banesco/common/domain/model/ApiConfig.java @@ -0,0 +1,54 @@ +package com.banesco.common.domain.model; + +import java.util.Map; + +/** + * Clase de configuración para APIs. Almacena la información necesaria para + * conectarse a un servicio API externo, incluyendo URL, configuración de + * timeout y parámetros adicionales. Diseñada para ser utilizada como objeto de + * configuración en clientes de API y servicios de integración. + */ +public class ApiConfig { + + String url; + ApiTimeout timeout; + Map config; + + public ApiConfig(){ + + } + + public ApiConfig(String url, + ApiTimeout timeout, + Map config) { + + this.url = url; + this.timeout = timeout; + this.config = config; + } + + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url; + } + + public ApiTimeout getTimeout() { + return timeout; + } + + public void setTimeout(ApiTimeout timeout) { + this.timeout = timeout; + } + + public Map getConfig() { + return config; + } + + public void setConfig(Map config) { + this.config = config; + } + +} diff --git a/commons-bian/src/main/java/com/banesco/common/domain/model/ApiTimeout.java b/commons-bian/src/main/java/com/banesco/common/domain/model/ApiTimeout.java new file mode 100644 index 0000000..e7f6ab2 --- /dev/null +++ b/commons-bian/src/main/java/com/banesco/common/domain/model/ApiTimeout.java @@ -0,0 +1,37 @@ +package com.banesco.common.domain.model; + +/** + * Clase interna que representa la configuración de tiempos de espera + * (timeout) para conexiones a APIs. Define los tiempos máximos de espera + * para establecer la conexión y para recibir una respuesta, especificados + * en milisegundos. + */ +public class ApiTimeout{ + private int connect; + private int response; + + public ApiTimeout() { + + } + public ApiTimeout(int connect, int response) { + this.connect = connect; + this.response = response; + } + + public int getConnect() { + return connect; + } + + public void setConnect(int connect) { + this.connect = connect; + } + + public int getResponse() { + return response; + } + + public void setResponse(int response) { + this.response = response; + } + +} diff --git a/commons-bian/src/main/java/com/banesco/common/domain/model/BackResponse.java b/commons-bian/src/main/java/com/banesco/common/domain/model/BackResponse.java new file mode 100644 index 0000000..1ab89e4 --- /dev/null +++ b/commons-bian/src/main/java/com/banesco/common/domain/model/BackResponse.java @@ -0,0 +1,63 @@ +package com.banesco.common.domain.model; + +/** + * Clase para obtener los codigos y mensajes de salida + */ +public class BackResponse { + + private String backendCode; + private int httpCode; + private String statusCode; + private String description; + + public BackResponse() { + } + + public BackResponse(String backendCode, + int httpCode, + String statusCode, + String description) { + this.backendCode = backendCode; + this.httpCode = httpCode; + this.statusCode = statusCode; + this.description = backendCode; + } + + public String getBackendCode() { + return backendCode; + } + + public int getHttpCode() { + return httpCode; + } + + public String getStatusCode() { + return statusCode; + } + + public String getDescription() { + return description; + } + + public void setBackendCode(String backendCode) { + this.backendCode = backendCode; + } + + public void setHttpCode(int httpCode) { + this.httpCode = httpCode; + } + + public void setStatusCode(String statusCode) { + this.statusCode = statusCode; + } + + public void setDescription(String description) { + this.description = description; + } + + @Override + public String toString() { + return "{\"backendCode\":\"%s\",\"httpCode\":%d,\"statusCode\":\"%s\",\"description\":\"%s\"}" + .formatted(backendCode, httpCode, statusCode, description); + } +} \ No newline at end of file diff --git a/commons-bian/src/main/java/com/banesco/common/domain/model/RedisParam.java b/commons-bian/src/main/java/com/banesco/common/domain/model/RedisParam.java new file mode 100644 index 0000000..aef3541 --- /dev/null +++ b/commons-bian/src/main/java/com/banesco/common/domain/model/RedisParam.java @@ -0,0 +1,31 @@ +package com.banesco.common.domain.model; + + +public class RedisParam { + private String prefix; + private long expiration; + + public RedisParam() { + } + + public RedisParam(String prefix, long expiration) { + this.prefix = prefix; + this.expiration = expiration; + } + + public String getPrefix() { + return prefix; + } + + public void setPrefix(String prefix) { + this.prefix = prefix; + } + + public long getExpiration() { + return expiration; + } + + public void setExpiration(long expiration) { + this.expiration = expiration; + } +} diff --git a/commons-bian/src/main/java/com/banesco/common/infraestructure/repository/MessageRepository.java b/commons-bian/src/main/java/com/banesco/common/infraestructure/repository/MessageRepository.java new file mode 100644 index 0000000..4a59712 --- /dev/null +++ b/commons-bian/src/main/java/com/banesco/common/infraestructure/repository/MessageRepository.java @@ -0,0 +1,111 @@ +package com.banesco.common.infraestructure.repository; + +import com.banesco.common.domain.model.BackResponse; +import com.banesco.common.domain.dto.bian.device.JsonHelper; +import com.banesco.common.domain.dto.bian.device.StringHelper; + +import java.io.FileInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import java.util.logging.Level; +import java.util.logging.Logger; + +public class MessageRepository { + + private static final Logger logger = Logger.getLogger(MessageRepository.class.getName()); + + /** + * Respuesta de error por defecto que se utiliza cuando no se encuentra un + * error específico. + */ + + /** + * Mapa que almacena múltiples mapas de códigos de error, donde la clave + * principal es el nombre del archivo de mensajes. + */ + public final Map> mapErrorsMultiple = new HashMap<>(); + + /** + * Carga los mensajes de error desde un InputStream y los almacena en un + * mapa. + * + * @param inputStream El InputStream que contiene los datos JSON de los + * mensajes de error. + * @param messageFileKey La clave del archivo de mensajes, utilizada para + * almacenar el mapa en mapErrorsMultiple. + * @return Un mapa que contiene los códigos de error como claves y los + * objetos BackResponse como valores. + * @throws IOException Si ocurre un error de entrada/salida al leer el + * InputStream. + */ + private Map loadFile(InputStream inputStream, String messageFileKey) throws IOException { + Map mapStatusCodes = new HashMap<>(); + Arrays.stream(JsonHelper.MAPPER.readValue(inputStream, BackResponse[].class)).forEach(o -> { + mapStatusCodes.put(o.getBackendCode(), o); + }); + mapErrorsMultiple.put(messageFileKey, mapStatusCodes); + return mapStatusCodes; + } + + /** + * Carga los mensajes de error desde una cadena JSON y los almacena en un + * mapa. + * + * @param messageFileKey La clave del archivo de mensajes, utilizada para + * almacenar el mapa en mapErrorsMultiple. + * @param jsonString La cadena JSON que contiene los datos de los mensajes + * de error. + * @throws IOException Si ocurre un error al procesar la cadena JSON. + */ + public void loadMessagesFromString(String messageFileKey, String jsonString) throws IOException { + Map mapStatusCodes = new HashMap<>(); + Arrays.stream(JsonHelper.MAPPER.readValue(jsonString, BackResponse[].class)).forEach(o -> { + mapStatusCodes.put(o.getBackendCode(), o); + }); + mapErrorsMultiple.put(messageFileKey, mapStatusCodes); + } + + /** + * Obtiene el mapa de códigos de error para un archivo de respuesta + * específico. + * + * @param responseFile El nombre del archivo de respuesta para el cual se + * desea obtener el mapa de errores. + * @return Un mapa que contiene los códigos de error como claves y los + * objetos BackResponse como valores, o null si no se encuentra el mapa. + */ + public Map getErrorMap(String responseFile, boolean insideProperties) { + Map errorMap = mapErrorsMultiple.get(responseFile); + if (insideProperties || (errorMap != null && !errorMap.isEmpty())) { + return errorMap; + } + + String fileName = (StringHelper.isNumeric(responseFile) ? "vb".concat(responseFile) : responseFile).concat(".json"); + + try { + try { + // Intenta cargar el archivo desde el directorio /config/. + return loadFile(new FileInputStream("/config/".concat(fileName)), responseFile); + } catch (IOException e) { + // Si no se encuentra el archivo en /config/, intenta cargarlo desde el classpath. + logger.log(Level.WARNING, "Path /config/" + fileName + " not found. Loading local from errors-mapping/" + fileName); + ClassLoader classLoader = getClass().getClassLoader(); + InputStream inputStream = classLoader.getResourceAsStream("errors-mapping/" + fileName); + if (inputStream == null) { + // Si no se encuentra el archivo en el classpath, registra un error y devuelve null. + logger.log(Level.SEVERE, "Resource errors-mapping/" + fileName + " not found."); + return null; + } + return loadFile(inputStream, responseFile); + } + } catch (IOException e) { + // Si ocurre un error al cargar el archivo desde cualquier ubicación, registra un error y devuelve null. + logger.log(Level.SEVERE, "Error getting Service Messages to /config/".concat(fileName) + ": " + e.getMessage()); + + return null; + } + } +} diff --git a/commons-bian/src/main/java/com/banesco/common/infraestructure/repository/RegisterSecurityRepository.java b/commons-bian/src/main/java/com/banesco/common/infraestructure/repository/RegisterSecurityRepository.java new file mode 100644 index 0000000..d9ca2ef --- /dev/null +++ b/commons-bian/src/main/java/com/banesco/common/infraestructure/repository/RegisterSecurityRepository.java @@ -0,0 +1,90 @@ +package com.banesco.common.infraestructure.repository; + +import com.banesco.common.domain.model.ApiConfig; +import com.banesco.common.domain.dto.bian.device.JsonHelper; +import com.banesco.common.domain.dto.bian.device.LoggerHelper; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStreamReader; +import java.io.OutputStream; +import java.net.HttpURLConnection; +import java.net.URL; +import java.nio.charset.StandardCharsets; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.logging.Level; +import java.util.logging.Logger; + +public class RegisterSecurityRepository { + + private static final Logger logger = Logger.getLogger(RegisterSecurityRepository.class.getName()); + private final LoggerHelper loggerHelper; + private final ApiConfig registerSecurityAPI; + private final ExecutorService executor = Executors.newCachedThreadPool(); + + public RegisterSecurityRepository(LoggerHelper loggerHelper, ApiConfig registerSecurityAPI) { + this.loggerHelper = loggerHelper; + this.registerSecurityAPI = registerSecurityAPI; + } + + public void writeTrice(String requestId, T registerSecurityRq) { + logger.info(loggerHelper.buildInfoPrivateRequest(requestId, "RegisterSecurityRq", registerSecurityRq)); + + CompletableFuture.runAsync(() -> { + try { + URL url = new URL(registerSecurityAPI.getUrl()); + HttpURLConnection connection = (HttpURLConnection) url.openConnection(); + connection.setRequestMethod("POST"); + connection.setRequestProperty("Content-Type", "application/json"); + connection.setConnectTimeout(registerSecurityAPI.getTimeout().getConnect()); + connection.setReadTimeout(registerSecurityAPI.getTimeout().getResponse()); + connection.setDoOutput(true); + + String jsonInputString = JsonHelper.getJsonFromObject(registerSecurityRq); + + try (OutputStream os = connection.getOutputStream()) { + byte[] input = jsonInputString.getBytes(StandardCharsets.UTF_8); + os.write(input, 0, input.length); + } + + int responseCode = connection.getResponseCode(); + if (responseCode == HttpURLConnection.HTTP_OK) { + try (BufferedReader br = new BufferedReader(new InputStreamReader(connection.getInputStream(), StandardCharsets.UTF_8))) { + StringBuilder response = new StringBuilder(); + String responseLine; + while ((responseLine = br.readLine()) != null) { + response.append(responseLine.trim()); + } + logger.info(loggerHelper.buildInfoPrivateResponse(requestId, "RegisterSecurityRs", response.toString())); + } + } else { + try (BufferedReader br = new BufferedReader(new InputStreamReader(connection.getErrorStream(), StandardCharsets.UTF_8))) { + StringBuilder response = new StringBuilder(); + String responseLine; + while ((responseLine = br.readLine()) != null) { + response.append(responseLine.trim()); + } + logger.info(loggerHelper.buildInfoPrivateResponse(requestId, "RegisterSecurityRs", response.toString())); + } + } + + connection.disconnect(); + + } catch (IOException e) { + logger.log(Level.SEVERE, String.format("Error interno writeTrice: %s", e.getMessage())); + logger.info(loggerHelper.buildInfoPrivateResponse(requestId, "RegisterSecurityRs", e.getMessage())); + } + }, executor).exceptionally(ex -> { + logger.log(Level.SEVERE, String.format("Async Error interno writeTrice: %s", ex.getMessage())); + logger.info(loggerHelper.buildInfoPrivateResponse(requestId, "RegisterSecurityRs", ex.getMessage())); + return null; + }); + + } + + public void shutdown() { + executor.shutdown(); + } +} diff --git a/commons-bian/src/main/java/com/banesco/common/infraestructure/service/MessageService.java b/commons-bian/src/main/java/com/banesco/common/infraestructure/service/MessageService.java new file mode 100644 index 0000000..fab6eb3 --- /dev/null +++ b/commons-bian/src/main/java/com/banesco/common/infraestructure/service/MessageService.java @@ -0,0 +1,104 @@ +package com.banesco.common.infraestructure.service; + +import com.banesco.common.domain.model.BackResponse; +import com.banesco.common.domain.dto.bian.response.StatusResponse; +import com.banesco.common.infraestructure.repository.MessageRepository; + +import java.util.Map; +import java.util.logging.Level; +import java.util.logging.Logger; + +public class MessageService { + + private static final Logger logger = Logger.getLogger(MessageService.class.getName()); + private final MessageRepository messageRepository; + + private final String CONFLICT = "CONFLICT"; + private final BackResponse DEFAULT_ERROR = new BackResponse( + CONFLICT, + 409, + CONFLICT, + CONFLICT + ); + + private boolean messagesInsideProperties = false; + + /** + * Constructor de MessageService. + * + * @param messageRepository El repositorio de mensajes que se utilizará para + * cargar y obtener mensajes de error. + */ + public MessageService(MessageRepository messageRepository) { + this.messageRepository = messageRepository; + } + + + /** + * Carga mensajes desde una cadena JSON en el repositorio de mensajes. + * + * @param responseFileName El nombre del archivo de respuesta asociado con + * los mensajes. + * @param jsonResponse La cadena JSON que contiene los mensajes. + */ + public void loadMessageFromJson(String responseFileName, String jsonResponse) { + messagesInsideProperties = true; + try { + messageRepository.loadMessagesFromString(responseFileName, jsonResponse); + } catch (Exception ex) { + logger.log(Level.SEVERE, "Error loading messages from JSON: %s".formatted(ex.getMessage()), ex); + } + } + + /** + * Obtiene una respuesta de estado (BackResponse) basada en el código de + * backend y el nombre del archivo de respuesta. + * + * @param responseFileName El nombre del archivo de respuesta. + * @param backendCode El código de backend para buscar la respuesta. + * @return La respuesta de estado (BackResponse) correspondiente al código + * de backend, la respuesta por defecto si no se encuentra, o null si hay un + * error. + */ + public BackResponse geStatusResponse(String responseFileName, String backendCode) { + logger.log(Level.INFO, "Finding backendCode: \"%s\" in File: \"%s\"".formatted(backendCode, responseFileName)); + Map errors = messageRepository.getErrorMap(responseFileName, messagesInsideProperties); + + if (errors == null || errors.isEmpty()) { + logger.log(Level.WARNING, "Error map for %s is empty or null.".formatted(responseFileName)); + return DEFAULT_ERROR; + } + + BackResponse backResponse = null; + try { + backResponse = errors.get(backendCode); + if (backResponse == null) { + backResponse = errors.get("default"); + } + } catch (Exception e) { + logger.log(Level.WARNING, "Error code: %s not found in %s. Using default.".formatted(backendCode, responseFileName), e); + try { + backResponse = errors.get("default"); + } catch (Exception e2) { + logger.log(Level.SEVERE, "Error getting default code.", e2); + } + } + + if (backResponse == null) { + logger.log(Level.WARNING, "Error code: %s and default not found in %s.".formatted(backendCode, responseFileName)); + return DEFAULT_ERROR; + } + return backResponse; + } + + public StatusResponse backToStatusResponse(String traceId, BackResponse backResponse, String target) { + return new StatusResponse( + backResponse.getHttpCode()>=200 && backResponse.getHttpCode()<300?"ok":"error", + backResponse.getStatusCode(), + target == null ? backResponse.getDescription() : + backResponse.getDescription().formatted(target), + traceId + + ); + } +} diff --git a/commons-bian/src/main/java/com/banesco/common/infraestructure/utils/DateValidator.java b/commons-bian/src/main/java/com/banesco/common/infraestructure/utils/DateValidator.java new file mode 100644 index 0000000..782f5db --- /dev/null +++ b/commons-bian/src/main/java/com/banesco/common/infraestructure/utils/DateValidator.java @@ -0,0 +1,90 @@ +package com.banesco.common.infraestructure.utils; + +import java.time.DateTimeException; +import java.time.LocalDate; +import java.time.format.DateTimeFormatter; + +/** + * Clase para validación de fechas con configuración flexible. Permite validar + * fechas en diferentes formatos, comprobar rangos de años y verificar la + * correcta formación de componentes de fecha (año, mes, día). Implementa el + * patrón Builder para facilitar la configuración personalizada de los + * parámetros de validación. + */ +public class DateValidator { + + private final DateTimeFormatter dateFormatter; + private final PatternValidator datePattern; + private final int minYear; + private final int maxYear; + + private DateValidator(Builder builder) { + this.dateFormatter = builder.dateFormatter; + this.datePattern = new PatternValidator(builder.dateFormatRegex); + this.minYear = builder.minYear; + this.maxYear = builder.maxYear; + } + + public static class Builder { + + private DateTimeFormatter dateFormatter = DateTimeFormatter.ofPattern("yyyy/MM/dd"); + private String dateFormatRegex = "(\\d{4})/(0[1-9]|1[0-2])/(0[1-9]|[12][0-9]|3[01])"; + private int minYear = 1900; + private int maxYear = 2100; + + public Builder withDateFormatter(String dateFormatterPattern) { + this.dateFormatter = DateTimeFormatter.ofPattern(dateFormatterPattern); + return this; + } + + public Builder withDateFormatRegex(String dateFormatRegex) { + this.dateFormatRegex = dateFormatRegex; + return this; + } + + public Builder withMinYear(int minYear) { + this.minYear = minYear; + return this; + } + + public Builder withMaxYear(int maxYear) { + this.maxYear = maxYear; + return this; + } + + public DateValidator build() { + return new DateValidator(this); + } + } + + public boolean isValidDateFormat(String date) { + return datePattern.isValid(date); + } + + public boolean isValidDate(String date) { + if (!isValidDateFormat(date)) { + return false; + } + + try { + LocalDate parsedDate = LocalDate.parse(date, dateFormatter); + String formattedDate = parsedDate.format(dateFormatter); + return date.equals(formattedDate); + } catch (DateTimeException e) { + return false; + } + } + + public boolean isValidDate(int year, int month, int day) { + return year >= minYear && year <= maxYear && month >= 1 && month <= 12 && isValidDayOfMonth(year, month, day); + } + + private boolean isValidDayOfMonth(int year, int month, int day) { + try { + LocalDate.of(year, month, day); + return true; + } catch (DateTimeException e) { + return false; + } + } +} diff --git a/commons-bian/src/main/java/com/banesco/common/infraestructure/utils/PatternValidator.java b/commons-bian/src/main/java/com/banesco/common/infraestructure/utils/PatternValidator.java new file mode 100644 index 0000000..205e980 --- /dev/null +++ b/commons-bian/src/main/java/com/banesco/common/infraestructure/utils/PatternValidator.java @@ -0,0 +1,32 @@ +package com.banesco.common.infraestructure.utils; + +import java.util.regex.Pattern; + +/** + * Clase para validar Expresion regulares + */ +public class PatternValidator { + + private final Pattern pattern; + + public PatternValidator(String patternStr) { + pattern = Pattern.compile(patternStr); + } + + public static PatternValidator withRegex(String patternStr) { + return new PatternValidator(patternStr); + } + + /** + * Validates is un valor tiene formato valido. + * + * @param value the value to check. + * @return true if the value has format valid, false otherwise. + */ + public boolean isValid(String value) { + if (value == null) { + return false; + } + return pattern.matcher(value).matches(); + } +} diff --git a/commons-bian/src/test/java/com/banesco/AppTest.java b/commons-bian/src/test/java/com/banesco/AppTest.java new file mode 100644 index 0000000..0cbda81 --- /dev/null +++ b/commons-bian/src/test/java/com/banesco/AppTest.java @@ -0,0 +1,19 @@ +package com.banesco; + + +/** + * Unit test for simple App. + */ +public class AppTest { + /** + * Create the test case + * + * @param testName name of the test case + */ + + public AppTest(String testName) { + + } + + +} diff --git a/rec-update-card-status/.dockerignore b/rec-update-card-status/.dockerignore new file mode 100644 index 0000000..e69de29 diff --git a/rec-update-card-status/.gitattributes b/rec-update-card-status/.gitattributes new file mode 100644 index 0000000..2125666 --- /dev/null +++ b/rec-update-card-status/.gitattributes @@ -0,0 +1 @@ +* text=auto \ No newline at end of file diff --git a/rec-update-card-status/.gitignore b/rec-update-card-status/.gitignore new file mode 100644 index 0000000..6ebc5dd --- /dev/null +++ b/rec-update-card-status/.gitignore @@ -0,0 +1,49 @@ +/target/ +!.mvn/wrapper/maven-wrapper.jar + +### STS ### +.apt_generated +.classpath +.factorypath +.project +.settings +.springBeans +.sts4-cache + +### IntelliJ IDEA ### +.idea +*.iws +*.iml +*.ipr + +### NetBeans ### +/nbproject/private/ +/build/ +/nbbuild/ +/dist/ +/nbdist/ +/.nb-gradle/ + +### Eclipse ### +.apt_generated +.classpath +.factorypath +.project +.settings +.springBeans +.sts4-cache + + +### VS Code ### +.vscode/ + +### Mac OS ### +.DS_Store + +### Config ### +.mvn/* +dependency-reduced-pom.xml +## no track +application-local.yaml +application-local.properties +*:Zone.Identifier \ No newline at end of file diff --git a/rec-update-card-status/.gitmodules b/rec-update-card-status/.gitmodules new file mode 100644 index 0000000..e69de29 diff --git a/rec-update-card-status/.pre-commit-config.yaml b/rec-update-card-status/.pre-commit-config.yaml new file mode 100644 index 0000000..e69de29 diff --git a/rec-update-card-status/CHANGES.md b/rec-update-card-status/CHANGES.md new file mode 100644 index 0000000..497a019 --- /dev/null +++ b/rec-update-card-status/CHANGES.md @@ -0,0 +1,9 @@ +boveda_express_ +======================= + +Here you can see the full list of changes between each Flask-RESTful release. + +Version 0.1 +------------- + +First public release diff --git a/rec-update-card-status/CONTRIBUTING.md b/rec-update-card-status/CONTRIBUTING.md new file mode 100644 index 0000000..e69de29 diff --git a/rec-update-card-status/Dockerfile b/rec-update-card-status/Dockerfile new file mode 100644 index 0000000..edc78b0 --- /dev/null +++ b/rec-update-card-status/Dockerfile @@ -0,0 +1,14 @@ +## Build stage ## +FROM default-route-openshift-image-registry.apps.desplakur3.desintra.banesco.com/runners-gitlab/openjdk-17:1.20-2.1721752931 AS build +COPY . /home/default/ +COPY pom.xml /home/default +COPY settings.xml /home/default +RUN mvn -s /home/default/settings.xml -f /home/default/pom.xml -Dmaven.wagon.http.ssl.insecure=true -Dmaven.wagon.http.ssl.allowall=true -Dmaven.wagon.http.ssl.ignore.validity.dates=true -DskipTests=true clean package +RUN ls -ltra /home/default/target/ + +### Package stage ### +FROM default-route-openshift-image-registry.apps.desplakur3.desintra.banesco.com/runners-gitlab/openjdk-17:1.20-2.1721752931 +WORKDIR /home/default +CMD ["ls"] +COPY --from=build /home/default/target/*.jar app.jar +CMD ["java","-jar","app.jar"] diff --git a/rec-update-card-status/HELP.md b/rec-update-card-status/HELP.md new file mode 100644 index 0000000..bcdd8ac --- /dev/null +++ b/rec-update-card-status/HELP.md @@ -0,0 +1,18 @@ +# Getting Started + +### Reference Documentation + +For further reference, please consider the following sections: + +* [Official Apache Maven documentation](https://maven.apache.org/guides/index.html) +* [Spring Boot Maven Plugin Reference Guide](https://docs.spring.io/spring-boot/3.3.2/maven-plugin) +* [Create an OCI image](https://docs.spring.io/spring-boot/3.3.2/maven-plugin/build-image.html) + +### Maven Parent overrides + +Due to Maven's design, elements are inherited from the parent POM to the project POM. +While most of the inheritance is fine, it also inherits unwanted elements like `` and `` from the +parent. +To prevent this, the project POM contains empty overrides for these elements. +If you manually switch to a different parent and actually want the inheritance, you need to remove those overrides. + diff --git a/rec-update-card-status/LICENSE b/rec-update-card-status/LICENSE new file mode 100644 index 0000000..1773f19 --- /dev/null +++ b/rec-update-card-status/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2024 Banesco Banco Universal, C.A. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/rec-update-card-status/README.md b/rec-update-card-status/README.md new file mode 100644 index 0000000..61fa9d9 --- /dev/null +++ b/rec-update-card-status/README.md @@ -0,0 +1,24 @@ +# Banesco + +> Application: + +## Distribution + +The project is composed or will be distributed under the following organisational scheme: + +1. apps (Folder containing all available applications and apis) +2. config (Folder containing initial system configuration) +3. config/main (Folder containing static files and media files) + 1. media (folder containing filed upload by user) + 2. private (folder containing css, images, js) + 3. static (folder that will contain all the collectstatic generated from the private folder for production display) + 4. templates +4. requirements (folder containter requirements necesaries for proyect) + +## How to install? + +You will need to fill in all the configuration necessary to build this project and how it is configured for use. + +Go, enjoy! + +### Banesco Banco Universal, C.A. \ No newline at end of file diff --git a/rec-update-card-status/docker-compose.yml b/rec-update-card-status/docker-compose.yml new file mode 100644 index 0000000..e69de29 diff --git a/rec-update-card-status/mvnw b/rec-update-card-status/mvnw new file mode 100644 index 0000000..d7c358e --- /dev/null +++ b/rec-update-card-status/mvnw @@ -0,0 +1,259 @@ +#!/bin/sh +# ---------------------------------------------------------------------------- +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# ---------------------------------------------------------------------------- + +# ---------------------------------------------------------------------------- +# Apache Maven Wrapper startup batch script, version 3.3.2 +# +# Optional ENV vars +# ----------------- +# JAVA_HOME - location of a JDK home dir, required when download maven via java source +# MVNW_REPOURL - repo url base for downloading maven distribution +# MVNW_USERNAME/MVNW_PASSWORD - user and password for downloading maven +# MVNW_VERBOSE - true: enable verbose log; debug: trace the mvnw script; others: silence the output +# ---------------------------------------------------------------------------- + +set -euf +[ "${MVNW_VERBOSE-}" != debug ] || set -x + +# OS specific support. +native_path() { printf %s\\n "$1"; } +case "$(uname)" in +CYGWIN* | MINGW*) + [ -z "${JAVA_HOME-}" ] || JAVA_HOME="$(cygpath --unix "$JAVA_HOME")" + native_path() { cygpath --path --windows "$1"; } + ;; +esac + +# set JAVACMD and JAVACCMD +set_java_home() { + # For Cygwin and MinGW, ensure paths are in Unix format before anything is touched + if [ -n "${JAVA_HOME-}" ]; then + if [ -x "$JAVA_HOME/jre/sh/java" ]; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + JAVACCMD="$JAVA_HOME/jre/sh/javac" + else + JAVACMD="$JAVA_HOME/bin/java" + JAVACCMD="$JAVA_HOME/bin/javac" + + if [ ! -x "$JAVACMD" ] || [ ! -x "$JAVACCMD" ]; then + echo "The JAVA_HOME environment variable is not defined correctly, so mvnw cannot run." >&2 + echo "JAVA_HOME is set to \"$JAVA_HOME\", but \"\$JAVA_HOME/bin/java\" or \"\$JAVA_HOME/bin/javac\" does not exist." >&2 + return 1 + fi + fi + else + JAVACMD="$( + 'set' +e + 'unset' -f command 2>/dev/null + 'command' -v java + )" || : + JAVACCMD="$( + 'set' +e + 'unset' -f command 2>/dev/null + 'command' -v javac + )" || : + + if [ ! -x "${JAVACMD-}" ] || [ ! -x "${JAVACCMD-}" ]; then + echo "The java/javac command does not exist in PATH nor is JAVA_HOME set, so mvnw cannot run." >&2 + return 1 + fi + fi +} + +# hash string like Java String::hashCode +hash_string() { + str="${1:-}" h=0 + while [ -n "$str" ]; do + char="${str%"${str#?}"}" + h=$(((h * 31 + $(LC_CTYPE=C printf %d "'$char")) % 4294967296)) + str="${str#?}" + done + printf %x\\n $h +} + +verbose() { :; } +[ "${MVNW_VERBOSE-}" != true ] || verbose() { printf %s\\n "${1-}"; } + +die() { + printf %s\\n "$1" >&2 + exit 1 +} + +trim() { + # MWRAPPER-139: + # Trims trailing and leading whitespace, carriage returns, tabs, and linefeeds. + # Needed for removing poorly interpreted newline sequences when running in more + # exotic environments such as mingw bash on Windows. + printf "%s" "${1}" | tr -d '[:space:]' +} + +# parse distributionUrl and optional distributionSha256Sum, requires .mvn/wrapper/maven-wrapper.properties +while IFS="=" read -r key value; do + case "${key-}" in + distributionUrl) distributionUrl=$(trim "${value-}") ;; + distributionSha256Sum) distributionSha256Sum=$(trim "${value-}") ;; + esac +done <"${0%/*}/.mvn/wrapper/maven-wrapper.properties" +[ -n "${distributionUrl-}" ] || die "cannot read distributionUrl property in ${0%/*}/.mvn/wrapper/maven-wrapper.properties" + +case "${distributionUrl##*/}" in +maven-mvnd-*bin.*) + MVN_CMD=mvnd.sh _MVNW_REPO_PATTERN=/maven/mvnd/ + case "${PROCESSOR_ARCHITECTURE-}${PROCESSOR_ARCHITEW6432-}:$(uname -a)" in + *AMD64:CYGWIN* | *AMD64:MINGW*) distributionPlatform=windows-amd64 ;; + :Darwin*x86_64) distributionPlatform=darwin-amd64 ;; + :Darwin*arm64) distributionPlatform=darwin-aarch64 ;; + :Linux*x86_64*) distributionPlatform=linux-amd64 ;; + *) + echo "Cannot detect native platform for mvnd on $(uname)-$(uname -m), use pure java version" >&2 + distributionPlatform=linux-amd64 + ;; + esac + distributionUrl="${distributionUrl%-bin.*}-$distributionPlatform.zip" + ;; +maven-mvnd-*) MVN_CMD=mvnd.sh _MVNW_REPO_PATTERN=/maven/mvnd/ ;; +*) MVN_CMD="mvn${0##*/mvnw}" _MVNW_REPO_PATTERN=/org/apache/maven/ ;; +esac + +# apply MVNW_REPOURL and calculate MAVEN_HOME +# maven home pattern: ~/.m2/wrapper/dists/{apache-maven-,maven-mvnd--}/ +[ -z "${MVNW_REPOURL-}" ] || distributionUrl="$MVNW_REPOURL$_MVNW_REPO_PATTERN${distributionUrl#*"$_MVNW_REPO_PATTERN"}" +distributionUrlName="${distributionUrl##*/}" +distributionUrlNameMain="${distributionUrlName%.*}" +distributionUrlNameMain="${distributionUrlNameMain%-bin}" +MAVEN_USER_HOME="${MAVEN_USER_HOME:-${HOME}/.m2}" +MAVEN_HOME="${MAVEN_USER_HOME}/wrapper/dists/${distributionUrlNameMain-}/$(hash_string "$distributionUrl")" + +exec_maven() { + unset MVNW_VERBOSE MVNW_USERNAME MVNW_PASSWORD MVNW_REPOURL || : + exec "$MAVEN_HOME/bin/$MVN_CMD" "$@" || die "cannot exec $MAVEN_HOME/bin/$MVN_CMD" +} + +if [ -d "$MAVEN_HOME" ]; then + verbose "found existing MAVEN_HOME at $MAVEN_HOME" + exec_maven "$@" +fi + +case "${distributionUrl-}" in +*?-bin.zip | *?maven-mvnd-?*-?*.zip) ;; +*) die "distributionUrl is not valid, must match *-bin.zip or maven-mvnd-*.zip, but found '${distributionUrl-}'" ;; +esac + +# prepare tmp dir +if TMP_DOWNLOAD_DIR="$(mktemp -d)" && [ -d "$TMP_DOWNLOAD_DIR" ]; then + clean() { rm -rf -- "$TMP_DOWNLOAD_DIR"; } + trap clean HUP INT TERM EXIT +else + die "cannot create temp dir" +fi + +mkdir -p -- "${MAVEN_HOME%/*}" + +# Download and Install Apache Maven +verbose "Couldn't find MAVEN_HOME, downloading and installing it ..." +verbose "Downloading from: $distributionUrl" +verbose "Downloading to: $TMP_DOWNLOAD_DIR/$distributionUrlName" + +# select .zip or .tar.gz +if ! command -v unzip >/dev/null; then + distributionUrl="${distributionUrl%.zip}.tar.gz" + distributionUrlName="${distributionUrl##*/}" +fi + +# verbose opt +__MVNW_QUIET_WGET=--quiet __MVNW_QUIET_CURL=--silent __MVNW_QUIET_UNZIP=-q __MVNW_QUIET_TAR='' +[ "${MVNW_VERBOSE-}" != true ] || __MVNW_QUIET_WGET='' __MVNW_QUIET_CURL='' __MVNW_QUIET_UNZIP='' __MVNW_QUIET_TAR=v + +# normalize http auth +case "${MVNW_PASSWORD:+has-password}" in +'') MVNW_USERNAME='' MVNW_PASSWORD='' ;; +has-password) [ -n "${MVNW_USERNAME-}" ] || MVNW_USERNAME='' MVNW_PASSWORD='' ;; +esac + +if [ -z "${MVNW_USERNAME-}" ] && command -v wget >/dev/null; then + verbose "Found wget ... using wget" + wget ${__MVNW_QUIET_WGET:+"$__MVNW_QUIET_WGET"} "$distributionUrl" -O "$TMP_DOWNLOAD_DIR/$distributionUrlName" || die "wget: Failed to fetch $distributionUrl" +elif [ -z "${MVNW_USERNAME-}" ] && command -v curl >/dev/null; then + verbose "Found curl ... using curl" + curl ${__MVNW_QUIET_CURL:+"$__MVNW_QUIET_CURL"} -f -L -o "$TMP_DOWNLOAD_DIR/$distributionUrlName" "$distributionUrl" || die "curl: Failed to fetch $distributionUrl" +elif set_java_home; then + verbose "Falling back to use Java to download" + javaSource="$TMP_DOWNLOAD_DIR/Downloader.java" + targetZip="$TMP_DOWNLOAD_DIR/$distributionUrlName" + cat >"$javaSource" <<-END + public class Downloader extends java.net.Authenticator + { + protected java.net.PasswordAuthentication getPasswordAuthentication() + { + return new java.net.PasswordAuthentication( System.getenv( "MVNW_USERNAME" ), System.getenv( "MVNW_PASSWORD" ).toCharArray() ); + } + public static void main( String[] args ) throws Exception + { + setDefault( new Downloader() ); + java.nio.file.Files.copy( java.net.URI.create( args[0] ).toURL().openStream(), java.nio.file.Paths.get( args[1] ).toAbsolutePath().normalize() ); + } + } + END + # For Cygwin/MinGW, switch paths to Windows format before running javac and java + verbose " - Compiling Downloader.java ..." + "$(native_path "$JAVACCMD")" "$(native_path "$javaSource")" || die "Failed to compile Downloader.java" + verbose " - Running Downloader.java ..." + "$(native_path "$JAVACMD")" -cp "$(native_path "$TMP_DOWNLOAD_DIR")" Downloader "$distributionUrl" "$(native_path "$targetZip")" +fi + +# If specified, validate the SHA-256 sum of the Maven distribution zip file +if [ -n "${distributionSha256Sum-}" ]; then + distributionSha256Result=false + if [ "$MVN_CMD" = mvnd.sh ]; then + echo "Checksum validation is not supported for maven-mvnd." >&2 + echo "Please disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties." >&2 + exit 1 + elif command -v sha256sum >/dev/null; then + if echo "$distributionSha256Sum $TMP_DOWNLOAD_DIR/$distributionUrlName" | sha256sum -c >/dev/null 2>&1; then + distributionSha256Result=true + fi + elif command -v shasum >/dev/null; then + if echo "$distributionSha256Sum $TMP_DOWNLOAD_DIR/$distributionUrlName" | shasum -a 256 -c >/dev/null 2>&1; then + distributionSha256Result=true + fi + else + echo "Checksum validation was requested but neither 'sha256sum' or 'shasum' are available." >&2 + echo "Please install either command, or disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties." >&2 + exit 1 + fi + if [ $distributionSha256Result = false ]; then + echo "Error: Failed to validate Maven distribution SHA-256, your Maven distribution might be compromised." >&2 + echo "If you updated your Maven version, you need to update the specified distributionSha256Sum property." >&2 + exit 1 + fi +fi + +# unzip and move +if command -v unzip >/dev/null; then + unzip ${__MVNW_QUIET_UNZIP:+"$__MVNW_QUIET_UNZIP"} "$TMP_DOWNLOAD_DIR/$distributionUrlName" -d "$TMP_DOWNLOAD_DIR" || die "failed to unzip" +else + tar xzf${__MVNW_QUIET_TAR:+"$__MVNW_QUIET_TAR"} "$TMP_DOWNLOAD_DIR/$distributionUrlName" -C "$TMP_DOWNLOAD_DIR" || die "failed to untar" +fi +printf %s\\n "$distributionUrl" >"$TMP_DOWNLOAD_DIR/$distributionUrlNameMain/mvnw.url" +mv -- "$TMP_DOWNLOAD_DIR/$distributionUrlNameMain" "$MAVEN_HOME" || [ -d "$MAVEN_HOME" ] || die "fail to move MAVEN_HOME" + +clean || : +exec_maven "$@" diff --git a/rec-update-card-status/mvnw.cmd b/rec-update-card-status/mvnw.cmd new file mode 100644 index 0000000..6f779cf --- /dev/null +++ b/rec-update-card-status/mvnw.cmd @@ -0,0 +1,149 @@ +<# : batch portion +@REM ---------------------------------------------------------------------------- +@REM Licensed to the Apache Software Foundation (ASF) under one +@REM or more contributor license agreements. See the NOTICE file +@REM distributed with this work for additional information +@REM regarding copyright ownership. The ASF licenses this file +@REM to you under the Apache License, Version 2.0 (the +@REM "License"); you may not use this file except in compliance +@REM with the License. You may obtain a copy of the License at +@REM +@REM https://www.apache.org/licenses/LICENSE-2.0 +@REM +@REM Unless required by applicable law or agreed to in writing, +@REM software distributed under the License is distributed on an +@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +@REM KIND, either express or implied. See the License for the +@REM specific language governing permissions and limitations +@REM under the License. +@REM ---------------------------------------------------------------------------- + +@REM ---------------------------------------------------------------------------- +@REM Apache Maven Wrapper startup batch script, version 3.3.2 +@REM +@REM Optional ENV vars +@REM MVNW_REPOURL - repo url base for downloading maven distribution +@REM MVNW_USERNAME/MVNW_PASSWORD - user and password for downloading maven +@REM MVNW_VERBOSE - true: enable verbose log; others: silence the output +@REM ---------------------------------------------------------------------------- + +@IF "%__MVNW_ARG0_NAME__%"=="" (SET __MVNW_ARG0_NAME__=%~nx0) +@SET __MVNW_CMD__= +@SET __MVNW_ERROR__= +@SET __MVNW_PSMODULEP_SAVE=%PSModulePath% +@SET PSModulePath= +@FOR /F "usebackq tokens=1* delims==" %%A IN (`powershell -noprofile "& {$scriptDir='%~dp0'; $script='%__MVNW_ARG0_NAME__%'; icm -ScriptBlock ([Scriptblock]::Create((Get-Content -Raw '%~f0'))) -NoNewScope}"`) DO @( + IF "%%A"=="MVN_CMD" (set __MVNW_CMD__=%%B) ELSE IF "%%B"=="" (echo %%A) ELSE (echo %%A=%%B) +) +@SET PSModulePath=%__MVNW_PSMODULEP_SAVE% +@SET __MVNW_PSMODULEP_SAVE= +@SET __MVNW_ARG0_NAME__= +@SET MVNW_USERNAME= +@SET MVNW_PASSWORD= +@IF NOT "%__MVNW_CMD__%"=="" (%__MVNW_CMD__% %*) +@echo Cannot start maven from wrapper >&2 && exit /b 1 +@GOTO :EOF +: end batch / begin powershell #> + +$ErrorActionPreference = "Stop" +if ($env:MVNW_VERBOSE -eq "true") { + $VerbosePreference = "Continue" +} + +# calculate distributionUrl, requires .mvn/wrapper/maven-wrapper.properties +$distributionUrl = (Get-Content -Raw "$scriptDir/.mvn/wrapper/maven-wrapper.properties" | ConvertFrom-StringData).distributionUrl +if (!$distributionUrl) { + Write-Error "cannot read distributionUrl property in $scriptDir/.mvn/wrapper/maven-wrapper.properties" +} + +switch -wildcard -casesensitive ( $($distributionUrl -replace '^.*/','') ) { + "maven-mvnd-*" { + $USE_MVND = $true + $distributionUrl = $distributionUrl -replace '-bin\.[^.]*$',"-windows-amd64.zip" + $MVN_CMD = "mvnd.cmd" + break + } + default { + $USE_MVND = $false + $MVN_CMD = $script -replace '^mvnw','mvn' + break + } +} + +# apply MVNW_REPOURL and calculate MAVEN_HOME +# maven home pattern: ~/.m2/wrapper/dists/{apache-maven-,maven-mvnd--}/ +if ($env:MVNW_REPOURL) { + $MVNW_REPO_PATTERN = if ($USE_MVND) { "/org/apache/maven/" } else { "/maven/mvnd/" } + $distributionUrl = "$env:MVNW_REPOURL$MVNW_REPO_PATTERN$($distributionUrl -replace '^.*'+$MVNW_REPO_PATTERN,'')" +} +$distributionUrlName = $distributionUrl -replace '^.*/','' +$distributionUrlNameMain = $distributionUrlName -replace '\.[^.]*$','' -replace '-bin$','' +$MAVEN_HOME_PARENT = "$HOME/.m2/wrapper/dists/$distributionUrlNameMain" +if ($env:MAVEN_USER_HOME) { + $MAVEN_HOME_PARENT = "$env:MAVEN_USER_HOME/wrapper/dists/$distributionUrlNameMain" +} +$MAVEN_HOME_NAME = ([System.Security.Cryptography.MD5]::Create().ComputeHash([byte[]][char[]]$distributionUrl) | ForEach-Object {$_.ToString("x2")}) -join '' +$MAVEN_HOME = "$MAVEN_HOME_PARENT/$MAVEN_HOME_NAME" + +if (Test-Path -Path "$MAVEN_HOME" -PathType Container) { + Write-Verbose "found existing MAVEN_HOME at $MAVEN_HOME" + Write-Output "MVN_CMD=$MAVEN_HOME/bin/$MVN_CMD" + exit $? +} + +if (! $distributionUrlNameMain -or ($distributionUrlName -eq $distributionUrlNameMain)) { + Write-Error "distributionUrl is not valid, must end with *-bin.zip, but found $distributionUrl" +} + +# prepare tmp dir +$TMP_DOWNLOAD_DIR_HOLDER = New-TemporaryFile +$TMP_DOWNLOAD_DIR = New-Item -Itemtype Directory -Path "$TMP_DOWNLOAD_DIR_HOLDER.dir" +$TMP_DOWNLOAD_DIR_HOLDER.Delete() | Out-Null +trap { + if ($TMP_DOWNLOAD_DIR.Exists) { + try { Remove-Item $TMP_DOWNLOAD_DIR -Recurse -Force | Out-Null } + catch { Write-Warning "Cannot remove $TMP_DOWNLOAD_DIR" } + } +} + +New-Item -Itemtype Directory -Path "$MAVEN_HOME_PARENT" -Force | Out-Null + +# Download and Install Apache Maven +Write-Verbose "Couldn't find MAVEN_HOME, downloading and installing it ..." +Write-Verbose "Downloading from: $distributionUrl" +Write-Verbose "Downloading to: $TMP_DOWNLOAD_DIR/$distributionUrlName" + +$webclient = New-Object System.Net.WebClient +if ($env:MVNW_USERNAME -and $env:MVNW_PASSWORD) { + $webclient.Credentials = New-Object System.Net.NetworkCredential($env:MVNW_USERNAME, $env:MVNW_PASSWORD) +} +[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 +$webclient.DownloadFile($distributionUrl, "$TMP_DOWNLOAD_DIR/$distributionUrlName") | Out-Null + +# If specified, validate the SHA-256 sum of the Maven distribution zip file +$distributionSha256Sum = (Get-Content -Raw "$scriptDir/.mvn/wrapper/maven-wrapper.properties" | ConvertFrom-StringData).distributionSha256Sum +if ($distributionSha256Sum) { + if ($USE_MVND) { + Write-Error "Checksum validation is not supported for maven-mvnd. `nPlease disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties." + } + Import-Module $PSHOME\Modules\Microsoft.PowerShell.Utility -Function Get-FileHash + if ((Get-FileHash "$TMP_DOWNLOAD_DIR/$distributionUrlName" -Algorithm SHA256).Hash.ToLower() -ne $distributionSha256Sum) { + Write-Error "Error: Failed to validate Maven distribution SHA-256, your Maven distribution might be compromised. If you updated your Maven version, you need to update the specified distributionSha256Sum property." + } +} + +# unzip and move +Expand-Archive "$TMP_DOWNLOAD_DIR/$distributionUrlName" -DestinationPath "$TMP_DOWNLOAD_DIR" | Out-Null +Rename-Item -Path "$TMP_DOWNLOAD_DIR/$distributionUrlNameMain" -NewName $MAVEN_HOME_NAME | Out-Null +try { + Move-Item -Path "$TMP_DOWNLOAD_DIR/$MAVEN_HOME_NAME" -Destination $MAVEN_HOME_PARENT | Out-Null +} catch { + if (! (Test-Path -Path "$MAVEN_HOME" -PathType Container)) { + Write-Error "fail to move MAVEN_HOME" + } +} finally { + try { Remove-Item $TMP_DOWNLOAD_DIR -Recurse -Force | Out-Null } + catch { Write-Warning "Cannot remove $TMP_DOWNLOAD_DIR" } +} + +Write-Output "MVN_CMD=$MAVEN_HOME/bin/$MVN_CMD" diff --git a/rec-update-card-status/pom.xml b/rec-update-card-status/pom.xml new file mode 100644 index 0000000..06b2947 --- /dev/null +++ b/rec-update-card-status/pom.xml @@ -0,0 +1,238 @@ + + + 4.0.0 + com.banesco + rec-update-card-status + 1.0-native-quarkus-jdk17 + rec-update-card-status + API Reception - Update card status + + 17 + 17 + 3.13.0 + 17 + UTF-8 + UTF-8 + quarkus-bom + io.quarkus.platform + 3.19.3 + true + 3.5.2 + com.banesco.RecUpdateCardStatusApplication + + + + + + ${quarkus.platform.group-id} + ${quarkus.platform.artifact-id} + ${quarkus.platform.version} + pom + import + + + ${quarkus.platform.group-id} + quarkus-camel-bom + ${quarkus.platform.version} + pom + import + + + + + + + com.banesco + commons-bian + 1.0 + + + io.quarkus + quarkus-core + + + io.quarkus + quarkus-rest + + + io.quarkus + quarkus-rest-client + + + io.quarkus + quarkus-rest-client-jackson + + + io.quarkus + quarkus-config-yaml + + + io.quarkus + quarkus-rest-jsonb + + + io.quarkus + quarkus-smallrye-openapi + + + io.quarkus + quarkus-swagger-ui + + + io.quarkus + quarkus-smallrye-health + + + io.quarkus + quarkus-arc + + + + io.quarkus + quarkus-junit5 + test + + + io.quarkus + quarkus-junit5-mockito + test + + + com.fasterxml.jackson.datatype + jackson-datatype-jsr310 + 2.17.2 + + + + io.rest-assured + rest-assured + test + + + org.projectlombok + lombok + 1.18.34 + provided + + + org.jboss.logmanager + jboss-logmanager + 3.0.6.Final + + + org.jboss.logging + jboss-logging + 3.6.0.Final + + + org.slf4j + slf4j-api + 2.0.13 + + + + + + + + org.eclipse.jkube + openshift-maven-plugin + 1.0.0 + + + + + maven-volumen + /root/.m2 + + + + + + + ${quarkus.platform.group-id} + quarkus-maven-plugin + ${quarkus.platform.version} + true + + + + build + generate-code + generate-code-tests + native-image-agent + + + + + + + maven-compiler-plugin + ${compiler-plugin.version} + + true + + + + org.apache.maven.plugins + maven-surefire-plugin + 3.1.2 + + + org.jboss.logmanager.LogManager + ${maven.home} + + + + + maven-failsafe-plugin + 3.0.0-M5 + + + + integration-test + verify + + + + + + ${project.build.directory}/${project.build.finalName}-runner + + org.jboss.logmanager.LogManager + ${maven.home} + + + + + + + + + native + + + native + + + + false + native + true + + + + + src/main/resources + + application-dev.yaml + application-local.yaml + + + + + + + diff --git a/rec-update-card-status/scripts/native/Dockerfile b/rec-update-card-status/scripts/native/Dockerfile new file mode 100644 index 0000000..b445f86 --- /dev/null +++ b/rec-update-card-status/scripts/native/Dockerfile @@ -0,0 +1,31 @@ +#### +# This Dockerfile is used in order to build a container that runs the Quarkus application in native (no JVM) mode. +# It uses a micro base image, tuned for Quarkus native executables. +# It reduces the size of the resulting container image. +# Check https://quarkus.io/guides/quarkus-runtime-base-image for further information about this image. +# +# Before building the container image run: +# +# ./mvnw package -Dnative +# +# Then, build the image with: +# +# docker build -f src/main/docker/Dockerfile.native-micro -t quarkus/rec-update-card-status . +# +# Then run the container using: +# +# docker run -i --rm -p 8080:8080 quarkus/rec-update-card-transaction-switch +# +### +FROM quay.io/quarkus/quarkus-micro-image:2.0 +RUN mkdir -p /work +ENV TZ="America/Caracas" +ENV LANGUAGE='en_US:en' +VOLUME /tmp +COPY /file/*-runner /work/recUpdateCardStatus +RUN chmod -R 775 /work +RUN ls -ltra /work/ +EXPOSE 8080 +WORKDIR /work/ + +ENTRYPOINT ["./recUpdateCardStatus", "-Dquarkus.http.host=0.0.0.0"] \ No newline at end of file diff --git a/rec-update-card-status/scripts/native/file/rec-update-card-status-switch-1.0-native-quarkus-jdk17-runner b/rec-update-card-status/scripts/native/file/rec-update-card-status-switch-1.0-native-quarkus-jdk17-runner new file mode 100644 index 0000000..c8f76df Binary files /dev/null and b/rec-update-card-status/scripts/native/file/rec-update-card-status-switch-1.0-native-quarkus-jdk17-runner differ diff --git a/rec-update-card-status/src/main/docker/Dockerfile.jvm b/rec-update-card-status/src/main/docker/Dockerfile.jvm new file mode 100644 index 0000000..f75486c --- /dev/null +++ b/rec-update-card-status/src/main/docker/Dockerfile.jvm @@ -0,0 +1,97 @@ +#### +# This Dockerfile_mvn is used in order to build a container that runs the Quarkus application in JVM mode +# +# Before building the container image run: +# +# ./mvnw package +# +# Then, build the image with: +# +# docker build -f src/main/docker/Dockerfile_mvn.jvm -t quarkus/prv-send-mail-jvm . +# +# Then run the container using: +# +# docker run -i --rm -p 8080:8080 quarkus/prv-send-mail-jvm +# +# If you want to include the debug port into your docker image +# you will have to expose the debug port (default 5005 being the default) like this : EXPOSE 8080 5005. +# Additionally you will have to set -e JAVA_DEBUG=true and -e JAVA_DEBUG_PORT=*:5005 +# when running the container +# +# Then run the container using : +# +# docker run -i --rm -p 8080:8080 quarkus/prv-send-mail-jvm +# +# This image uses the `run-java.sh` script to run the application. +# This scripts computes the command line to execute your Java application, and +# includes memory/GC tuning. +# You can configure the behavior using the following environment properties: +# - JAVA_OPTS: JVM options passed to the `java` command (example: "-verbose:class") +# - JAVA_OPTS_APPEND: User specified Java options to be appended to generated options +# in JAVA_OPTS (example: "-Dsome.property=foo") +# - JAVA_MAX_MEM_RATIO: Is used when no `-Xmx` option is given in JAVA_OPTS. This is +# used to calculate a default maximal heap memory based on a containers restriction. +# If used in a container without any memory constraints for the container then this +# option has no effect. If there is a memory constraint then `-Xmx` is set to a ratio +# of the container available memory as set here. The default is `50` which means 50% +# of the available memory is used as an upper boundary. You can skip this mechanism by +# setting this value to `0` in which case no `-Xmx` option is added. +# - JAVA_INITIAL_MEM_RATIO: Is used when no `-Xms` option is given in JAVA_OPTS. This +# is used to calculate a default initial heap memory based on the maximum heap memory. +# If used in a container without any memory constraints for the container then this +# option has no effect. If there is a memory constraint then `-Xms` is set to a ratio +# of the `-Xmx` memory as set here. The default is `25` which means 25% of the `-Xmx` +# is used as the initial heap size. You can skip this mechanism by setting this value +# to `0` in which case no `-Xms` option is added (example: "25") +# - JAVA_MAX_INITIAL_MEM: Is used when no `-Xms` option is given in JAVA_OPTS. +# This is used to calculate the maximum value of the initial heap memory. If used in +# a container without any memory constraints for the container then this option has +# no effect. If there is a memory constraint then `-Xms` is limited to the value set +# here. The default is 4096MB which means the calculated value of `-Xms` never will +# be greater than 4096MB. The value of this variable is expressed in MB (example: "4096") +# - JAVA_DIAGNOSTICS: Set this to get some diagnostics information to standard output +# when things are happening. This option, if set to true, will set +# `-XX:+UnlockDiagnosticVMOptions`. Disabled by default (example: "true"). +# - JAVA_DEBUG: If set remote debugging will be switched on. Disabled by default (example: +# true"). +# - JAVA_DEBUG_PORT: Port used for remote debugging. Defaults to 5005 (example: "8787"). +# - CONTAINER_CORE_LIMIT: A calculated core limit as described in +# https://www.kernel.org/doc/Documentation/scheduler/sched-bwc.txt. (example: "2") +# - CONTAINER_MAX_MEMORY: Memory limit given to the container (example: "1024"). +# - GC_MIN_HEAP_FREE_RATIO: Minimum percentage of heap free after GC to avoid expansion. +# (example: "20") +# - GC_MAX_HEAP_FREE_RATIO: Maximum percentage of heap free after GC to avoid shrinking. +# (example: "40") +# - GC_TIME_RATIO: Specifies the ratio of the time spent outside the garbage collection. +# (example: "4") +# - GC_ADAPTIVE_SIZE_POLICY_WEIGHT: The weighting given to the current GC time versus +# previous GC times. (example: "90") +# - GC_METASPACE_SIZE: The initial metaspace size. (example: "20") +# - GC_MAX_METASPACE_SIZE: The maximum metaspace size. (example: "100") +# - GC_CONTAINER_OPTIONS: Specify Java GC to use. The value of this variable should +# contain the necessary JRE command-line options to specify the required GC, which +# will override the default of `-XX:+UseParallelGC` (example: -XX:+UseG1GC). +# - HTTPS_PROXY: The location of the https proxy. (example: "myuser@127.0.0.1:8080") +# - HTTP_PROXY: The location of the http proxy. (example: "myuser@127.0.0.1:8080") +# - NO_PROXY: A comma separated lists of hosts, IP addresses or domains that can be +# accessed directly. (example: "foo.example.com,bar.example.com") +# +### +FROM registry.access.redhat.com/ubi8/openjdk-17:1.20 + +ENV LANGUAGE='en_US:en' + + +# We make four distinct layers so if there are application changes the library layers can be re-used +COPY --chown=185 target/quarkus-app/lib/ /deployments/lib/ +COPY --chown=185 target/quarkus-app/*.jar /deployments/ +COPY --chown=185 target/quarkus-app/app/ /deployments/app/ +COPY --chown=185 target/quarkus-app/quarkus/ /deployments/quarkus/ + +EXPOSE 8080 +USER 185 +ENV JAVA_OPTS_APPEND="-Dquarkus.http.host=0.0.0.0 -Djava.util.logging.manager=org.jboss.logmanager.LogManager" +ENV JAVA_APP_JAR="/deployments/quarkus-run.jar" + +ENTRYPOINT [ "/opt/jboss/container/java/run/run-java.sh" ] + diff --git a/rec-update-card-status/src/main/docker/Dockerfile.legacy-jar b/rec-update-card-status/src/main/docker/Dockerfile.legacy-jar new file mode 100644 index 0000000..21bfb9e --- /dev/null +++ b/rec-update-card-status/src/main/docker/Dockerfile.legacy-jar @@ -0,0 +1,93 @@ +#### +# This Dockerfile_mvn is used in order to build a container that runs the Quarkus application in JVM mode +# +# Before building the container image run: +# +# ./mvnw package -Dquarkus.package.jar.type=legacy-jar +# +# Then, build the image with: +# +# docker build -f src/main/docker/Dockerfile_mvn.legacy-jar -t quarkus/prv-send-mail-legacy-jar . +# +# Then run the container using: +# +# docker run -i --rm -p 8080:8080 quarkus/prv-send-mail-legacy-jar +# +# If you want to include the debug port into your docker image +# you will have to expose the debug port (default 5005 being the default) like this : EXPOSE 8080 5005. +# Additionally you will have to set -e JAVA_DEBUG=true and -e JAVA_DEBUG_PORT=*:5005 +# when running the container +# +# Then run the container using : +# +# docker run -i --rm -p 8080:8080 quarkus/prv-send-mail-legacy-jar +# +# This image uses the `run-java.sh` script to run the application. +# This scripts computes the command line to execute your Java application, and +# includes memory/GC tuning. +# You can configure the behavior using the following environment properties: +# - JAVA_OPTS: JVM options passed to the `java` command (example: "-verbose:class") +# - JAVA_OPTS_APPEND: User specified Java options to be appended to generated options +# in JAVA_OPTS (example: "-Dsome.property=foo") +# - JAVA_MAX_MEM_RATIO: Is used when no `-Xmx` option is given in JAVA_OPTS. This is +# used to calculate a default maximal heap memory based on a containers restriction. +# If used in a container without any memory constraints for the container then this +# option has no effect. If there is a memory constraint then `-Xmx` is set to a ratio +# of the container available memory as set here. The default is `50` which means 50% +# of the available memory is used as an upper boundary. You can skip this mechanism by +# setting this value to `0` in which case no `-Xmx` option is added. +# - JAVA_INITIAL_MEM_RATIO: Is used when no `-Xms` option is given in JAVA_OPTS. This +# is used to calculate a default initial heap memory based on the maximum heap memory. +# If used in a container without any memory constraints for the container then this +# option has no effect. If there is a memory constraint then `-Xms` is set to a ratio +# of the `-Xmx` memory as set here. The default is `25` which means 25% of the `-Xmx` +# is used as the initial heap size. You can skip this mechanism by setting this value +# to `0` in which case no `-Xms` option is added (example: "25") +# - JAVA_MAX_INITIAL_MEM: Is used when no `-Xms` option is given in JAVA_OPTS. +# This is used to calculate the maximum value of the initial heap memory. If used in +# a container without any memory constraints for the container then this option has +# no effect. If there is a memory constraint then `-Xms` is limited to the value set +# here. The default is 4096MB which means the calculated value of `-Xms` never will +# be greater than 4096MB. The value of this variable is expressed in MB (example: "4096") +# - JAVA_DIAGNOSTICS: Set this to get some diagnostics information to standard output +# when things are happening. This option, if set to true, will set +# `-XX:+UnlockDiagnosticVMOptions`. Disabled by default (example: "true"). +# - JAVA_DEBUG: If set remote debugging will be switched on. Disabled by default (example: +# true"). +# - JAVA_DEBUG_PORT: Port used for remote debugging. Defaults to 5005 (example: "8787"). +# - CONTAINER_CORE_LIMIT: A calculated core limit as described in +# https://www.kernel.org/doc/Documentation/scheduler/sched-bwc.txt. (example: "2") +# - CONTAINER_MAX_MEMORY: Memory limit given to the container (example: "1024"). +# - GC_MIN_HEAP_FREE_RATIO: Minimum percentage of heap free after GC to avoid expansion. +# (example: "20") +# - GC_MAX_HEAP_FREE_RATIO: Maximum percentage of heap free after GC to avoid shrinking. +# (example: "40") +# - GC_TIME_RATIO: Specifies the ratio of the time spent outside the garbage collection. +# (example: "4") +# - GC_ADAPTIVE_SIZE_POLICY_WEIGHT: The weighting given to the current GC time versus +# previous GC times. (example: "90") +# - GC_METASPACE_SIZE: The initial metaspace size. (example: "20") +# - GC_MAX_METASPACE_SIZE: The maximum metaspace size. (example: "100") +# - GC_CONTAINER_OPTIONS: Specify Java GC to use. The value of this variable should +# contain the necessary JRE command-line options to specify the required GC, which +# will override the default of `-XX:+UseParallelGC` (example: -XX:+UseG1GC). +# - HTTPS_PROXY: The location of the https proxy. (example: "myuser@127.0.0.1:8080") +# - HTTP_PROXY: The location of the http proxy. (example: "myuser@127.0.0.1:8080") +# - NO_PROXY: A comma separated lists of hosts, IP addresses or domains that can be +# accessed directly. (example: "foo.example.com,bar.example.com") +# +### +FROM registry.access.redhat.com/ubi8/openjdk-17:1.20 + +ENV LANGUAGE='en_US:en' + + +COPY target/lib/* /deployments/lib/ +COPY target/*-runner.jar /deployments/quarkus-run.jar + +EXPOSE 8080 +USER 185 +ENV JAVA_OPTS_APPEND="-Dquarkus.http.host=0.0.0.0 -Djava.util.logging.manager=org.jboss.logmanager.LogManager" +ENV JAVA_APP_JAR="/deployments/quarkus-run.jar" + +ENTRYPOINT [ "/opt/jboss/container/java/run/run-java.sh" ] diff --git a/rec-update-card-status/src/main/docker/Dockerfile.native b/rec-update-card-status/src/main/docker/Dockerfile.native new file mode 100644 index 0000000..b698d4e --- /dev/null +++ b/rec-update-card-status/src/main/docker/Dockerfile.native @@ -0,0 +1,29 @@ +#### +# This Dockerfile_mvn is used in order to build a container that runs the Quarkus application in native (no JVM) mode. +# +# Before building the container image run: +# +# ./mvnw package -Dnative +# +# Then, build the image with: +# +# docker build -f src/main/docker/Dockerfile_mvn.native -t quarkus/prv-send-mail . +# +# Then run the container using: +# +# docker run -i --rm -p 8080:8080 quarkus/prv-send-mail +# +### +FROM registry.access.redhat.com/ubi8/ubi-minimal:8.10 +WORKDIR /work/ +RUN ls -ltra /work +RUN ls -ltra target/ +RUN chown 1001 /work \ + && chmod "g+rwX" /work \ + && chown 1001:root /work +COPY --chown=1001:root target/*-runner /work/application + +EXPOSE 8080 +USER 1001 + +ENTRYPOINT ["./application", "-Dquarkus.http.host=0.0.0.0"] diff --git a/rec-update-card-status/src/main/docker/Dockerfile.native-micro b/rec-update-card-status/src/main/docker/Dockerfile.native-micro new file mode 100644 index 0000000..3ca02d3 --- /dev/null +++ b/rec-update-card-status/src/main/docker/Dockerfile.native-micro @@ -0,0 +1,30 @@ +#### +# This Dockerfile_mvn is used in order to build a container that runs the Quarkus application in native (no JVM) mode. +# It uses a micro base image, tuned for Quarkus native executables. +# It reduces the size of the resulting container image. +# Check https://quarkus.io/guides/quarkus-runtime-base-image for further information about this image. +# +# Before building the container image run: +# +# ./mvnw package -Dnative +# +# Then, build the image with: +# +# docker build -f src/main/docker/Dockerfile_mvn.native-micro -t quarkus/prv-send-mail . +# +# Then run the container using: +# +# docker run -i --rm -p 8080:8080 quarkus/prv-send-mail +# +### +FROM quay.io/quarkus/quarkus-micro-image:2.0 +WORKDIR /work/ +RUN chown 1001 /work \ + && chmod "g+rwX" /work \ + && chown 1001:root /work +COPY --chown=1001:root target/*-runner /work/application + +EXPOSE 8080 +USER 1001 + +ENTRYPOINT ["./application", "-Dquarkus.http.host=0.0.0.0"] diff --git a/rec-update-card-status/src/main/java/com/banesco/RecUpdateCardStatusApplication.java b/rec-update-card-status/src/main/java/com/banesco/RecUpdateCardStatusApplication.java new file mode 100644 index 0000000..1fc6dd7 --- /dev/null +++ b/rec-update-card-status/src/main/java/com/banesco/RecUpdateCardStatusApplication.java @@ -0,0 +1,13 @@ +package com.banesco; + +import io.quarkus.runtime.Quarkus; +import io.quarkus.runtime.annotations.QuarkusMain; + +@QuarkusMain +public class RecUpdateCardStatusApplication { + + public static void main(String[] args) { + System.out.println("Starting Reception Update Card Status ..........."); + Quarkus.run(); + } +} \ No newline at end of file diff --git a/rec-update-card-status/src/main/java/com/banesco/application/UpdateConfigResponse.java b/rec-update-card-status/src/main/java/com/banesco/application/UpdateConfigResponse.java new file mode 100644 index 0000000..c54e00a --- /dev/null +++ b/rec-update-card-status/src/main/java/com/banesco/application/UpdateConfigResponse.java @@ -0,0 +1,42 @@ +package com.banesco.application; + +import io.quarkus.runtime.annotations.RegisterForReflection; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.List; + + +@Data +@RegisterForReflection +public class UpdateConfigResponse { + + private String result; + private List configMapList; + private String error; + + + @Data + @AllArgsConstructor + @NoArgsConstructor + public static class ConfigModel { + private String namespace; + private String configMapName; + private List properties; + + + @Data + @AllArgsConstructor + @NoArgsConstructor + public static class PropertyChange { + private String name; + private String oldValue; + private String newValue; + private String withError; + } + + } + + +} diff --git a/rec-update-card-status/src/main/java/com/banesco/application/helper/UpdateCardStatusRequestValidator.java b/rec-update-card-status/src/main/java/com/banesco/application/helper/UpdateCardStatusRequestValidator.java new file mode 100644 index 0000000..f15d62f --- /dev/null +++ b/rec-update-card-status/src/main/java/com/banesco/application/helper/UpdateCardStatusRequestValidator.java @@ -0,0 +1,166 @@ +package com.banesco.application.helper; + + +import com.banesco.common.application.exception.BanRuntimeException; +import com.banesco.common.application.helper.DeviceHelper; +import com.banesco.common.domain.dto.bian.device.StringHelper; +import com.banesco.common.infraestructure.utils.PatternValidator; +import com.banesco.commons.config.StatusCodes; +import com.banesco.domain.bian.request.RecUpdateCardStatusRequest; +import jakarta.enterprise.context.ApplicationScoped; +import org.eclipse.microprofile.config.Config; +import org.eclipse.microprofile.config.ConfigProvider; +import org.eclipse.microprofile.config.inject.ConfigProperty; + +import java.util.List; + +@ApplicationScoped +public class UpdateCardStatusRequestValidator { + + private final PatternValidator CUSTOMER_NUMBER_PATTERN; + private final PatternValidator CARD_NUMBER_PATTERN; + + private final PatternValidator CARD_STATUS_CODE_PATTERN; + private final PatternValidator CARD_STATUS_ACTION_PATTERN; + private final PatternValidator CARD_STATUS_REASON_PATTERN; + + @ConfigProperty(name = "api.allowed.customer.types") + List CUSTOMER_TYPES; + @ConfigProperty(name = "api.allowed.card.types") + List CARD_TYPES; + + public UpdateCardStatusRequestValidator() { + Config configEnv = ConfigProvider.getConfig(); + + CUSTOMER_NUMBER_PATTERN = PatternValidator.withRegex(configEnv.getValue("api.allowed.customer.number-pattern", String.class)); + CARD_NUMBER_PATTERN = PatternValidator.withRegex(configEnv.getValue("api.allowed.card.number-pattern", String.class)); + CARD_STATUS_CODE_PATTERN = PatternValidator.withRegex(configEnv.getValue("api.allowed.card.status-code-pattern", String.class)); + CARD_STATUS_ACTION_PATTERN = PatternValidator.withRegex(configEnv.getValue("api.allowed.card.status-action-pattern", String.class)); + CARD_STATUS_REASON_PATTERN = PatternValidator.withRegex(configEnv.getValue("api.allowed.card.status-reason-pattern", String.class)); + + } + + + // Function to check invalid fields + public void validatedRequest( + String customerReferenceFintechId, + String appId, + RecUpdateCardStatusRequest request + ) { + //check header + if (StringHelper.isEmpty(customerReferenceFintechId)) { + throw new BanRuntimeException(StatusCodes.INVALID_HEADER, "customerReferenceFintechId"); + } + + if (StringHelper.isEmpty(appId)) { + throw new BanRuntimeException(StatusCodes.INVALID_HEADER, "appId"); + } + + + if (request == null) { + throw new BanRuntimeException(StatusCodes.FIELD_REQUIRED, "body"); + } + + // VLI Device + if (request.getDevice() == null) { + throw new BanRuntimeException(StatusCodes.FIELD_REQUIRED, "device"); + } + + if (StringHelper.isEmpty(request.getDevice().getDeviceType())) { + throw new BanRuntimeException(StatusCodes.FIELD_REQUIRED, "device.deviceType"); + } + + boolean isValidDevice = DeviceHelper.isValidDeviceType(request.getDevice().getDeviceType()); + if (!isValidDevice) { + throw new BanRuntimeException(StatusCodes.INVALID_FORMAT, "device.deviceType"); + } + + if (StringHelper.isEmpty(request.getDevice().getDeviceDescription())) { + throw new BanRuntimeException(StatusCodes.FIELD_REQUIRED, "device.deviceDescription"); + } + + if (request.getDevice().getDeviceDescription().length() > 255) { + throw new BanRuntimeException(StatusCodes.INVALID_FORMAT, "device.deviceDescription"); + } + + if (StringHelper.isEmpty(request.getDevice().getDeviceSessionReference())) { + throw new BanRuntimeException(StatusCodes.FIELD_REQUIRED, "device.deviceSessionReference"); + } + if (request.getDevice().getDeviceSessionReference().length() > 255) { + throw new BanRuntimeException(StatusCodes.INVALID_FORMAT, "device.deviceSessionReference"); + } + + // Customer + + var customerReference = request.getCustomerReference(); + if (customerReference == null) { + throw new BanRuntimeException(StatusCodes.FIELD_REQUIRED, "customerReference"); + } + + if (StringHelper.isEmpty(customerReference.getCustomerIdType())) { + throw new BanRuntimeException(StatusCodes.FIELD_REQUIRED, "customerReference.customerIdType"); + } + + if (!CUSTOMER_TYPES.contains(customerReference.getCustomerIdType())) { + throw new BanRuntimeException(StatusCodes.INVALID_FORMAT, "customerReference.customerIdType"); + } + + if (StringHelper.isEmpty(customerReference.getCustomerId())) { + throw new BanRuntimeException(StatusCodes.FIELD_REQUIRED, "customerReference.customerId"); + } + + if (!CUSTOMER_NUMBER_PATTERN.isValid(customerReference.getCustomerId())) { + throw new BanRuntimeException(StatusCodes.INVALID_FORMAT, "customerReference.customerId"); + } + + // Card + + + var paymentCard = request.getCardReference(); + if (paymentCard == null) { + throw new BanRuntimeException(StatusCodes.FIELD_REQUIRED, "cardReference.paymentCard"); + } + + if (StringHelper.isEmpty(paymentCard.getCardType())) { + throw new BanRuntimeException(StatusCodes.FIELD_REQUIRED, "cardReference.cardType"); + } + + if (!CARD_TYPES.contains(paymentCard.getCardType())) { + throw new BanRuntimeException(StatusCodes.INVALID_FORMAT, "cardReference.cardType"); + } + + if (StringHelper.isEmpty(paymentCard.getCardNumber())) { + throw new BanRuntimeException(StatusCodes.FIELD_REQUIRED, "cardReference.cardNumber"); + } + + if (!CARD_NUMBER_PATTERN.isValid(paymentCard.getCardNumber())) { + throw new BanRuntimeException(StatusCodes.INVALID_FORMAT, "cardReference.cardNumber"); + } + + if (StringHelper.isEmpty(paymentCard.getCardStatusCode())) { + throw new BanRuntimeException(StatusCodes.FIELD_REQUIRED, "cardReference.cardStatusCode"); + } + + if (!CARD_STATUS_CODE_PATTERN.isValid(paymentCard.getCardStatusCode())) { + throw new BanRuntimeException(StatusCodes.INVALID_FORMAT, "cardReference.cardStatusCode"); + } + + if (StringHelper.isEmpty(paymentCard.getCardStatusAction())) { + throw new BanRuntimeException(StatusCodes.FIELD_REQUIRED, "cardReference.cardStatusAction"); + } + + if (!CARD_STATUS_ACTION_PATTERN.isValid(paymentCard.getCardStatusAction())) { + throw new BanRuntimeException(StatusCodes.INVALID_FORMAT, "cardReference.cardStatusAction"); + } + + if (StringHelper.isEmpty(paymentCard.getCardStatusReason())) { + throw new BanRuntimeException(StatusCodes.FIELD_REQUIRED, "cardReference.cardStatusReason"); + } + + if (!CARD_STATUS_REASON_PATTERN.isValid(paymentCard.getCardStatusReason())) { + throw new BanRuntimeException(StatusCodes.INVALID_FORMAT, "cardReference.cardStatusReason"); + } + + } + +} diff --git a/rec-update-card-status/src/main/java/com/banesco/application/rest/controllers/UpdateCardStatusController.java b/rec-update-card-status/src/main/java/com/banesco/application/rest/controllers/UpdateCardStatusController.java new file mode 100644 index 0000000..6304e54 --- /dev/null +++ b/rec-update-card-status/src/main/java/com/banesco/application/rest/controllers/UpdateCardStatusController.java @@ -0,0 +1,265 @@ +package com.banesco.application.rest.controllers; + +import com.banesco.application.helper.UpdateCardStatusRequestValidator; +import com.banesco.common.application.exception.BanBackendException; +import com.banesco.common.application.exception.BanRuntimeException; +import com.banesco.common.domain.dto.bian.device.JsonHelper; +import com.banesco.common.domain.dto.bian.device.LoggerHelper; +import com.banesco.common.domain.model.BackResponse; +import com.banesco.commons.config.AppConf; +import com.banesco.domain.bian.request.RecUpdateCardStatusRequest; +import com.banesco.domain.bian.response.RecUpdateCardStatusResponse; +import com.banesco.domain.models.CurrentState; +import com.banesco.domain.ports.inbound.RegisterSecurityUseCase; +import com.banesco.domain.ports.inbound.UpdateCardStatusUseCase; +import com.banesco.infrastructure.dtos.RegisterSecurityRq; +import jakarta.inject.Inject; +import jakarta.ws.rs.*; +import jakarta.ws.rs.core.MediaType; +import jakarta.ws.rs.core.Response; +import lombok.extern.slf4j.Slf4j; +import org.eclipse.microprofile.openapi.annotations.OpenAPIDefinition; +import org.eclipse.microprofile.openapi.annotations.Operation; +import org.eclipse.microprofile.openapi.annotations.info.Info; +import org.eclipse.microprofile.openapi.annotations.media.Content; +import org.eclipse.microprofile.openapi.annotations.media.ExampleObject; +import org.eclipse.microprofile.openapi.annotations.media.Schema; +import org.eclipse.microprofile.openapi.annotations.parameters.Parameter; +import org.eclipse.microprofile.openapi.annotations.parameters.RequestBody; +import org.eclipse.microprofile.openapi.annotations.responses.APIResponse; +import org.eclipse.microprofile.openapi.annotations.responses.APIResponses; + +@OpenAPIDefinition(info = @Info( + title = "rec-update-card-status", + version = "1.0", + description = "API Recepcion - Cancelación de TDD") +) +@Path("/card/status/update") +@Consumes(MediaType.APPLICATION_JSON) +@Produces(MediaType.APPLICATION_JSON) +@Slf4j +public class UpdateCardStatusController { + + + private final UpdateCardStatusRequestValidator updateCardStatusRequestValidator; + private final UpdateCardStatusUseCase updateCardStatusUseCase; + private final RegisterSecurityUseCase registerSecurityUseCase; + + @Inject + AppConf appConf; + + @Inject + public UpdateCardStatusController( + UpdateCardStatusRequestValidator updateCardStatusRequestValidator, + UpdateCardStatusUseCase updateCardStatusUseCase, + RegisterSecurityUseCase registerSecurityUseCase + + ) { + + this.updateCardStatusRequestValidator = updateCardStatusRequestValidator; + this.updateCardStatusUseCase = updateCardStatusUseCase; + this.registerSecurityUseCase = registerSecurityUseCase; + } + + @PUT + @Operation( + summary = "updateCardStatus", + description = "Permite cambiar el estatus de las tarjetas de los clientes." + ) + @Parameter( + name = "customerReferenceFintechId", + description = "ID de la fintech", + example = "pranical-test" + ) + @Parameter( + name = "appId", + description = "ID de la aplicación", + example = "DANIAPP" + ) + @RequestBody( + description = "Datos de la solicitud para actualizar el estatus de la tarjeta", + required = true, + content = @Content( + mediaType = MediaType.APPLICATION_JSON, + schema = @Schema(implementation = RecUpdateCardStatusRequest.class), + examples = { + @ExampleObject( + name = "Ejemplo exitoso", + summary = "Petición con datos válidos", + value = "{\n" + + " \"customerReference\": {\n" + + " \"customerIdType\": \"J\",\n" + + " \"customerId\": \"500634269\"\n" + + " },\n" + + " \"device\": {\n" + + " \"deviceType\": \"Mobile\",\n" + + " \"deviceDescription\": \"Xiaomi Note 11 PRO\",\n" + + " \"deviceIp\": \"127.0.0.1\",\n" + + " \"deviceSessionReference\": \"12345678901304\"\n" + + " },\n" + + " \"cardReference\": {\n" + + " \"cardType\": \"DebitCard\",\n" + + " \"cardNumber\": \"6012-8862-0791-7605\",\n" + + " \"cardStatusCode\": \"52\",\n" + + " \"cardStatusAction\": \"CV\",\n" + + " \"cardStatusReason\": \"Bloqueo Temporal\"\n" + + " }\n" + + "}" + ), + @ExampleObject( + name = "Ejemplo Error de validación", + summary = "Petición con formato inválido", + value = "{\n" + + " \"customerReference\": {\n" + + " \"customerIdType\": \"V\",\n" + + " \"customerId\": \"500634269\"\n" + + " },\n" + + " \"device\": {\n" + + " \"deviceType\": \"Mobile\",\n" + + " \"deviceDescription\": \"Xiaomi Note 11 PRO\",\n" + + " \"deviceIp\": \"127.0.0.1\",\n" + + " \"deviceSessionReference\": \"12345678901304\"\n" + + " },\n" + + " \"cardReference\": {\n" + + " \"cardType\": \"DebitCard\",\n" + + " \"cardNumber\": \"6012886207917605\",\n" + + " \"cardStatusCode\": \"52\",\n" + + " \"cardStatusAction\": \"CV\",\n" + + " \"cardStatusReason\": \"Bloqueo Temporal\"\n" + + " }\n" + + "}" + ) + } + ) + ) + @APIResponses(value = { + @APIResponse( + responseCode = "200", + description = "Operación exitosa", + + content = @Content( + mediaType = MediaType.APPLICATION_JSON, + schema = @Schema(implementation = RecUpdateCardStatusResponse.class), + examples = @ExampleObject( + name = "Ejemplo exitoso", + value = "{\"statusResponse\":{\"status\":\"ok\",\"statusCode\":\"200\",\"message\":\"Operacion exitosa\",\"requestId\":\"UCSS123456789\"}}" + ) + ) + ), + @APIResponse( + responseCode = "400", + description = "Error en formato o campo requerido", + content = @Content( + mediaType = MediaType.APPLICATION_JSON, + schema = @Schema(implementation = RecUpdateCardStatusResponse.class), + examples = @ExampleObject( + name = "Ejemplo Error de validación", + value = "{\"statusResponse\":{\"status\":\"error\",\"statusCode\":\"VDE02\",\"message\":\"VDE02 - Error en formato del campo: cardReference.cardNumber\",\"requestId\":\"UCSS123456789\"}}" + ) + ) + ) + }) + public Response updateCardStatus( + @HeaderParam("customerReferenceFintechId") String customerReferenceFintechId, + @HeaderParam("appId") String appId, + RecUpdateCardStatusRequest request) { + + long startExecution = System.currentTimeMillis(); + CurrentState currentState = appConf.getCurrentState(appId, customerReferenceFintechId); + RecUpdateCardStatusResponse dataResponse = null; + log.info("INICIO =>"); + log.info("[HEADERS {}: \ncustomerReferenceFintechId: {}\nappId: {}]", + currentState.requestId(), customerReferenceFintechId, appId); + + log.info(LoggerHelper.buildInfoRequest(currentState.requestId(), JsonHelper.getJsonFromObject(request))); + boolean mustWriteTrace = false; + String backendCode = "500"; + String target = null; + + try { + // Validate Request + updateCardStatusRequestValidator.validatedRequest( + customerReferenceFintechId, + appId, + request + ); + + + mustWriteTrace = true; + + updateCardStatusUseCase.execute( + currentState, + request + ); + + backendCode = "200"; + } catch (BanRuntimeException e) { + backendCode = e.getStatusCode().getStatusCode(); + log.error(LoggerHelper.buildError(currentState.requestId(), backendCode + " - " + e.getMessage())); + if (e.getTarget() != null) { + target = e.getTarget(); + } + + } catch (BanBackendException e) { + backendCode = e.getBackendCode(); + log.error(LoggerHelper.buildError(currentState.requestId(), backendCode + " - " + e.getMessage())); + if (e.getTarget() != null) { + target = e.getTarget(); + } + + } catch (Exception e) { + log.error(LoggerHelper.buildError(currentState.requestId(), backendCode + " - " + e.getMessage())); + } + + BackResponse backResponse = appConf.responsesMap.get(backendCode); + + if (backResponse == null) { + backResponse = appConf.messageService.geStatusResponse( + appConf.getRecUpdateCardMessageKey(), + backendCode); + appConf.responsesMap.put(backendCode, backResponse); + } + + RecUpdateCardStatusResponse response = new RecUpdateCardStatusResponse(); + response.setStatusResponse(appConf.messageService.backToStatusResponse(currentState.requestId(), backResponse, target)); + + String outputJson = response.toString(); + + log.info(LoggerHelper.buildInfoResponse(currentState.requestId(), outputJson)); + + if (mustWriteTrace) { // writeTrace + + /* + registerSecurityUseCase.writeTrace(currentState.requestId(), + getRegisterSecurityRq( + currentState.fintechId(), + request, + response, + outputJson, + System.currentTimeMillis() - startExecution, + backResponse.getHttpCode() + ));*/ + } + + return Response.status(backResponse.getHttpCode()) + .entity(outputJson) + .build(); + } + + + private RegisterSecurityRq getRegisterSecurityRq( + String fintechId, + RecUpdateCardStatusRequest request, + RecUpdateCardStatusResponse response, + String outputJson, + long timeExecution, + int httpCode + ) { + // Building Trace Data + RegisterSecurityRq registerSecurityRequest = new RegisterSecurityRq(); + + + return registerSecurityRequest; + + } +} diff --git a/rec-update-card-status/src/main/java/com/banesco/commons/config/AppConf.java b/rec-update-card-status/src/main/java/com/banesco/commons/config/AppConf.java new file mode 100644 index 0000000..d26cc85 --- /dev/null +++ b/rec-update-card-status/src/main/java/com/banesco/commons/config/AppConf.java @@ -0,0 +1,105 @@ +package com.banesco.commons.config; + +import com.banesco.common.application.exception.BanRuntimeException; +import com.banesco.common.domain.dto.bian.device.DateHelper; +import com.banesco.common.domain.dto.bian.device.JsonHelper; +import com.banesco.common.domain.dto.bian.device.RequestHelper; +import com.banesco.common.domain.model.ApiConfig; +import com.banesco.common.domain.model.BackResponse; +import com.banesco.common.infraestructure.repository.MessageRepository; +import com.banesco.common.infraestructure.service.MessageService; +import com.banesco.commons.exceptions.BanConfigException; +import com.banesco.domain.models.CurrentState; +import jakarta.inject.Singleton; +import lombok.Getter; +import lombok.extern.slf4j.Slf4j; +import org.eclipse.microprofile.config.Config; +import org.eclipse.microprofile.config.ConfigProvider; + +import java.util.HashMap; +import java.util.Map; +import java.util.NoSuchElementException; + + +@Singleton +@Getter +@Slf4j +public class AppConf { + + private static AppConf _INSTANCE; + + public final Map responsesMap = new HashMap<>(); + public final MessageService messageService; + private final String appSourceId; + private final String recUpdateCardMessageKey; + private final Config configEnv; + private final RequestHelper requestHelper; + + DateHelper dateHelper = DateHelper.getInstance(); + public static void getInstance() { + + synchronized (AppConf.class) { + if (_INSTANCE == null) { + log.info("AppConf getInstance-->"); + _INSTANCE = new AppConf(); + } + } + } + + public AppConf() { + + log.info("NEW INSTANCE AppConf**********************************"); + try { + + configEnv = ConfigProvider.getConfig(); + + requestHelper = new RequestHelper(); + + messageService = new MessageService(new MessageRepository()); + + appSourceId = configEnv.getValue("api.source-id", String.class); + + recUpdateCardMessageKey = configEnv.getValue("api.recUpdateCardStatus.messages.key", String.class); + boolean apiReadMessages = configEnv.getValue("api.read-messages.from-props", Boolean.class); + if (apiReadMessages) { + messageService.loadMessageFromJson(recUpdateCardMessageKey, configEnv.getValue("api.recUpdateCardStatus.messages.content", String.class)); + } + _INSTANCE = this; + } catch (NoSuchElementException e) { + String errorMessage = "[ERROR CONFIG]: [%s]".formatted(e.getMessage()); + log.error(errorMessage); + throw new BanConfigException(errorMessage); + } catch (Exception e) { + String errorMessage = "[ERROR CONFIG]: [%s]".formatted(e.getMessage()); + log.error(errorMessage); + throw new BanConfigException(errorMessage); + } + + } + + + public ApiConfig loadApiConfig(String apiName) { + + try { + + log.info("Loading APIConfig with key:{}", apiName); + String apiConfig = configEnv.getValue(apiName, String.class); + return JsonHelper.getObjectFromJson(apiConfig, ApiConfig.class); + } catch (Exception e) { + log.error("Error Loading API Config: {} -> {}", apiName, e.getMessage()); + throw new BanRuntimeException(StatusCodes.INTERNAL_ERROR); + } + + } + + public CurrentState getCurrentState(String fintechId, String appId) { + + return new CurrentState( + this.requestHelper.getRequestId(requestHelper.getInstanceId(appSourceId)), + fintechId, + appId + ); + } + + +} diff --git a/rec-update-card-status/src/main/java/com/banesco/commons/config/StatusCodes.java b/rec-update-card-status/src/main/java/com/banesco/commons/config/StatusCodes.java new file mode 100644 index 0000000..dc02724 --- /dev/null +++ b/rec-update-card-status/src/main/java/com/banesco/commons/config/StatusCodes.java @@ -0,0 +1,28 @@ +package com.banesco.commons.config; + + +import com.banesco.common.domain.interfaces.BaseStatusCodesEnum; +import lombok.Getter; + +/** + * Clase para definir Status de Respuesta. + */ +@Getter +public enum StatusCodes implements BaseStatusCodesEnum { + + SUCCESS_OPERATION("OK", "Operación exitosa"), + INVALID_HEADER("401", "INVALID HEADERS: NO AUTORIZADO"), + FIELD_REQUIRED("VDE01", "ERROR CAMPO REQUERIDO: %s"), + INVALID_FORMAT("VDE02", "ERROR EN FORMATO DEL CAMPO: %s"), + INTERNAL_ERROR("500", "ERROR INTERNO"), + FAILED_DEPENDENCY("424", "FALLA DE DEPENDENCIA"); + + private String statusCode; + private String statusDesc; + + StatusCodes(String statusCode, String statusDesc) { + this.statusCode = statusCode; + this.statusDesc = statusDesc; + } + +} diff --git a/rec-update-card-status/src/main/java/com/banesco/commons/exceptions/BanConfigException.java b/rec-update-card-status/src/main/java/com/banesco/commons/exceptions/BanConfigException.java new file mode 100644 index 0000000..cc9a486 --- /dev/null +++ b/rec-update-card-status/src/main/java/com/banesco/commons/exceptions/BanConfigException.java @@ -0,0 +1,9 @@ +package com.banesco.commons.exceptions; + +public class BanConfigException extends RuntimeException { + + public BanConfigException(String message) { + super(message); + } + +} diff --git a/rec-update-card-status/src/main/java/com/banesco/commons/exceptions/InternalExceptionMapper.java b/rec-update-card-status/src/main/java/com/banesco/commons/exceptions/InternalExceptionMapper.java new file mode 100644 index 0000000..02df14d --- /dev/null +++ b/rec-update-card-status/src/main/java/com/banesco/commons/exceptions/InternalExceptionMapper.java @@ -0,0 +1,55 @@ +package com.banesco.commons.exceptions; + +import com.banesco.common.domain.dto.bian.response.StatusResponse; +import com.banesco.domain.bian.response.RecUpdateCardStatusResponse; +import io.vertx.ext.web.RoutingContext; +import jakarta.inject.Inject; +import jakarta.ws.rs.core.Response; +import lombok.extern.slf4j.Slf4j; +import org.jboss.resteasy.reactive.server.ServerExceptionMapper; +import org.jboss.resteasy.reactive.server.UnwrapException; + +import java.util.HashMap; +import java.util.Map; +import java.util.concurrent.CompletionException; + +@UnwrapException({CompletionException.class, BanConfigException.class}) +@Slf4j +public class InternalExceptionMapper { + + @Inject + RoutingContext routingContext; // Injecting the RoutingContext + + @ServerExceptionMapper + public Response handleConfigException(Exception ex) { + String uri = routingContext.request().uri(); + + switch (uri) { + + case "/card/status/update": + RecUpdateCardStatusResponse response = new RecUpdateCardStatusResponse(); + response.setStatusResponse( + new StatusResponse( + "error", + "CONFLICT", + "Uso interno", + null + ) + ); + return Response.status(Response.Status.INTERNAL_SERVER_ERROR) + .entity(response.toString()) + .build(); + default: + + + } + + Map errorMap = new HashMap<>(); + errorMap.put("error", "USO INTERNO"); + + + return Response.status(Response.Status.INTERNAL_SERVER_ERROR) + .entity(errorMap).build(); + } + +} \ No newline at end of file diff --git a/rec-update-card-status/src/main/java/com/banesco/commons/exceptions/MalformedPayloadExceptionMapper.java b/rec-update-card-status/src/main/java/com/banesco/commons/exceptions/MalformedPayloadExceptionMapper.java new file mode 100644 index 0000000..8143e67 --- /dev/null +++ b/rec-update-card-status/src/main/java/com/banesco/commons/exceptions/MalformedPayloadExceptionMapper.java @@ -0,0 +1,46 @@ +package com.banesco.commons.exceptions; + +import com.banesco.common.domain.dto.bian.response.StatusResponse; +import com.banesco.commons.config.StatusCodes; +import com.banesco.domain.bian.response.RecUpdateCardStatusResponse; +import io.vertx.core.http.HttpServerRequest; +import io.vertx.ext.web.RoutingContext; +import jakarta.inject.Inject; +import jakarta.json.bind.JsonbException; +import jakarta.ws.rs.core.Response; +import jakarta.ws.rs.ext.ExceptionMapper; +import jakarta.ws.rs.ext.Provider; +import lombok.extern.slf4j.Slf4j; + +@Provider +@Slf4j +public class MalformedPayloadExceptionMapper implements ExceptionMapper { + + @Inject + RoutingContext routingContext; // Injecting the RoutingContext + + @Override + public Response toResponse(JsonbException exception) { + + HttpServerRequest headers = routingContext.request(); + log.error("INICIO ERROR => {}", exception.getMessage()); + log.error("[HEADERS {}]: [\nfintechId: {}\nappId: {}]", + headers.getHeader("fintechId"), + headers.getHeader("appId")); + + + String jsonResult = (new RecUpdateCardStatusResponse( new StatusResponse( + "error", + StatusCodes.INVALID_FORMAT.getStatusCode(), + StatusCodes.INVALID_FORMAT.getStatusDesc().formatted("body"), + null + ))).toString(); + + log.error("[RESPONSE]: [{}]", jsonResult); + return Response.status(Response.Status.BAD_REQUEST) + .entity( + jsonResult + ) + .build(); + } +} \ No newline at end of file diff --git a/rec-update-card-status/src/main/java/com/banesco/commons/utils/ResponseUtil.java b/rec-update-card-status/src/main/java/com/banesco/commons/utils/ResponseUtil.java new file mode 100644 index 0000000..ca387f5 --- /dev/null +++ b/rec-update-card-status/src/main/java/com/banesco/commons/utils/ResponseUtil.java @@ -0,0 +1,12 @@ +package com.banesco.commons.utils; + +import com.banesco.common.domain.dto.bian.response.StatusResponse; +import com.banesco.commons.config.StatusCodes; + + +public class ResponseUtil { + + public static StatusResponse mapErrorResponse(String requestId, StatusCodes statusCodes) { + return new StatusResponse("error", statusCodes.getStatusCode(), statusCodes.getStatusDesc(), requestId); + } +} diff --git a/rec-update-card-status/src/main/java/com/banesco/domain/bian/dto/CardReference.java b/rec-update-card-status/src/main/java/com/banesco/domain/bian/dto/CardReference.java new file mode 100644 index 0000000..d1f7878 --- /dev/null +++ b/rec-update-card-status/src/main/java/com/banesco/domain/bian/dto/CardReference.java @@ -0,0 +1,18 @@ +package com.banesco.domain.bian.dto; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + + +@Data +@NoArgsConstructor +@AllArgsConstructor +public class CardReference { + + String cardType; + String cardNumber; + String cardStatusCode; + String cardStatusAction; + String cardStatusReason; +} diff --git a/rec-update-card-status/src/main/java/com/banesco/domain/bian/request/RecUpdateCardStatusRequest.java b/rec-update-card-status/src/main/java/com/banesco/domain/bian/request/RecUpdateCardStatusRequest.java new file mode 100644 index 0000000..b1899a1 --- /dev/null +++ b/rec-update-card-status/src/main/java/com/banesco/domain/bian/request/RecUpdateCardStatusRequest.java @@ -0,0 +1,18 @@ +package com.banesco.domain.bian.request; + +import com.banesco.common.domain.dto.bian.customer.CustomerReference; +import com.banesco.common.domain.dto.bian.device.Device; +import com.banesco.domain.bian.dto.CardReference; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + + +@Data +@AllArgsConstructor +@NoArgsConstructor +public class RecUpdateCardStatusRequest { + CustomerReference customerReference; + Device device; + CardReference cardReference; +} diff --git a/rec-update-card-status/src/main/java/com/banesco/domain/bian/response/RecUpdateCardStatusResponse.java b/rec-update-card-status/src/main/java/com/banesco/domain/bian/response/RecUpdateCardStatusResponse.java new file mode 100644 index 0000000..88c0825 --- /dev/null +++ b/rec-update-card-status/src/main/java/com/banesco/domain/bian/response/RecUpdateCardStatusResponse.java @@ -0,0 +1,28 @@ +package com.banesco.domain.bian.response; + + +import com.banesco.common.domain.dto.bian.response.BaseResponse; +import com.banesco.common.domain.dto.bian.response.StatusResponse; +import io.quarkus.runtime.annotations.RegisterForReflection; +import lombok.EqualsAndHashCode; + + +@RegisterForReflection +@EqualsAndHashCode(callSuper = false) +public class RecUpdateCardStatusResponse extends BaseResponse { + + public RecUpdateCardStatusResponse() { + super(); + } + + public RecUpdateCardStatusResponse(StatusResponse statusResponse) { + super(statusResponse); + } + + @Override + public String toString() { + + return "{\"statusResponse\":%s}".formatted(statusResponse.toString()); + } + +} diff --git a/rec-update-card-status/src/main/java/com/banesco/domain/models/CurrentState.java b/rec-update-card-status/src/main/java/com/banesco/domain/models/CurrentState.java new file mode 100644 index 0000000..0477dc7 --- /dev/null +++ b/rec-update-card-status/src/main/java/com/banesco/domain/models/CurrentState.java @@ -0,0 +1,8 @@ +package com.banesco.domain.models; + +import io.quarkus.runtime.annotations.RegisterForReflection; + +@RegisterForReflection +public record CurrentState(String requestId, String fintechId, String appId) { + +} diff --git a/rec-update-card-status/src/main/java/com/banesco/domain/ports/inbound/RegisterSecurityUseCase.java b/rec-update-card-status/src/main/java/com/banesco/domain/ports/inbound/RegisterSecurityUseCase.java new file mode 100644 index 0000000..ca2312d --- /dev/null +++ b/rec-update-card-status/src/main/java/com/banesco/domain/ports/inbound/RegisterSecurityUseCase.java @@ -0,0 +1,8 @@ +package com.banesco.domain.ports.inbound; + +import com.banesco.infrastructure.dtos.RegisterSecurityRq; + +public interface RegisterSecurityUseCase { + + void writeTrace(String requestId, RegisterSecurityRq securityRq); +} diff --git a/rec-update-card-status/src/main/java/com/banesco/domain/ports/inbound/UpdateCardStatusUseCase.java b/rec-update-card-status/src/main/java/com/banesco/domain/ports/inbound/UpdateCardStatusUseCase.java new file mode 100644 index 0000000..0da3b76 --- /dev/null +++ b/rec-update-card-status/src/main/java/com/banesco/domain/ports/inbound/UpdateCardStatusUseCase.java @@ -0,0 +1,12 @@ +package com.banesco.domain.ports.inbound; + +import com.banesco.domain.bian.request.RecUpdateCardStatusRequest; +import com.banesco.domain.models.CurrentState; + +public interface UpdateCardStatusUseCase { + + void execute( + CurrentState currentState, + RecUpdateCardStatusRequest request + ); +} diff --git a/rec-update-card-status/src/main/java/com/banesco/domain/ports/outbound/PaymentCardPort.java b/rec-update-card-status/src/main/java/com/banesco/domain/ports/outbound/PaymentCardPort.java new file mode 100644 index 0000000..9473d32 --- /dev/null +++ b/rec-update-card-status/src/main/java/com/banesco/domain/ports/outbound/PaymentCardPort.java @@ -0,0 +1,10 @@ +package com.banesco.domain.ports.outbound; + +import com.banesco.common.domain.dto.bian.response.StatusResponse; +import com.banesco.domain.bian.request.RecUpdateCardStatusRequest; +import com.banesco.domain.models.CurrentState; + +public interface PaymentCardPort { + + StatusResponse updateCardStatus(CurrentState currentState, RecUpdateCardStatusRequest request); +} diff --git a/rec-update-card-status/src/main/java/com/banesco/domain/ports/outbound/RegisterSecurityPort.java b/rec-update-card-status/src/main/java/com/banesco/domain/ports/outbound/RegisterSecurityPort.java new file mode 100644 index 0000000..1c0f82e --- /dev/null +++ b/rec-update-card-status/src/main/java/com/banesco/domain/ports/outbound/RegisterSecurityPort.java @@ -0,0 +1,8 @@ +package com.banesco.domain.ports.outbound; + +import com.banesco.infrastructure.dtos.RegisterSecurityRq; + +public interface RegisterSecurityPort { + + void writeTrace(String requestId, RegisterSecurityRq request); +} diff --git a/rec-update-card-status/src/main/java/com/banesco/domain/services/RegisterSecurityService.java b/rec-update-card-status/src/main/java/com/banesco/domain/services/RegisterSecurityService.java new file mode 100644 index 0000000..73e91fe --- /dev/null +++ b/rec-update-card-status/src/main/java/com/banesco/domain/services/RegisterSecurityService.java @@ -0,0 +1,30 @@ +package com.banesco.domain.services; + +import com.banesco.domain.ports.inbound.RegisterSecurityUseCase; +import com.banesco.domain.ports.outbound.RegisterSecurityPort; +import com.banesco.infrastructure.dtos.RegisterSecurityRq; +import jakarta.enterprise.context.ApplicationScoped; +import lombok.extern.slf4j.Slf4j; + +@ApplicationScoped +@Slf4j +public class RegisterSecurityService implements RegisterSecurityUseCase { + + + private final RegisterSecurityPort registerSecurityPort; + + public RegisterSecurityService(RegisterSecurityPort registerSecurityPort) { + this.registerSecurityPort = registerSecurityPort; + } + + + @Override + public void writeTrace(String requestId, RegisterSecurityRq request) { + try { + registerSecurityPort.writeTrace(requestId, request); + } catch (Exception e) { + log.error("Error writing trace: {}", e.getMessage()); + } + + } +} diff --git a/rec-update-card-status/src/main/java/com/banesco/domain/services/UpdateCardStatusService.java b/rec-update-card-status/src/main/java/com/banesco/domain/services/UpdateCardStatusService.java new file mode 100644 index 0000000..d7ae500 --- /dev/null +++ b/rec-update-card-status/src/main/java/com/banesco/domain/services/UpdateCardStatusService.java @@ -0,0 +1,40 @@ +package com.banesco.domain.services; + +import com.banesco.common.application.exception.BanBackendException; +import com.banesco.common.domain.dto.bian.response.StatusResponse; +import com.banesco.commons.config.StatusCodes; +import com.banesco.domain.bian.request.RecUpdateCardStatusRequest; +import com.banesco.domain.models.CurrentState; +import com.banesco.domain.ports.inbound.UpdateCardStatusUseCase; +import com.banesco.domain.ports.outbound.PaymentCardPort; +import jakarta.enterprise.context.ApplicationScoped; +import jakarta.inject.Inject; + +@ApplicationScoped +public class UpdateCardStatusService implements UpdateCardStatusUseCase { + + + private final PaymentCardPort paymentCardPort; + private final String RESULT_OK = StatusCodes.SUCCESS_OPERATION.getStatusCode(); + + @Inject + public UpdateCardStatusService(PaymentCardPort paymentCardPort) { + this.paymentCardPort = paymentCardPort; + + } + + + @Override + public void execute(CurrentState currentState, + RecUpdateCardStatusRequest request) { + + StatusResponse statusResponse = paymentCardPort.updateCardStatus(currentState, request); + + if (!statusResponse.statusCode().equals(RESULT_OK)) { + throw new BanBackendException(statusResponse.statusCode(), statusResponse.message()); + } + + } + + +} diff --git a/rec-update-card-status/src/main/java/com/banesco/infrastructure/dtos/RegisterSecurityRq.java b/rec-update-card-status/src/main/java/com/banesco/infrastructure/dtos/RegisterSecurityRq.java new file mode 100644 index 0000000..f7b1367 --- /dev/null +++ b/rec-update-card-status/src/main/java/com/banesco/infrastructure/dtos/RegisterSecurityRq.java @@ -0,0 +1,43 @@ +package com.banesco.infrastructure.dtos; + + +import io.quarkus.runtime.annotations.RegisterForReflection; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Date; + +@Data +@AllArgsConstructor +@NoArgsConstructor +@RegisterForReflection +public class RegisterSecurityRq { + + private String codBan; + private String codMon; + private String codEve; + private String codEve2;//new + private String login; + private Date fecHor; + private String nacCli; + private Integer cedRifCli; + private String productoCli; + + private String objeto; //new + private Integer tipoRespuesta; + private String msgRespuesta; + private Integer tiempoRespuesta; + private String codFintech; + + private String cedRifFintech; //new + + private String tipoDispositivo; + private String desDispositivo; + private String ipCli; + + + private String sp; + + +} diff --git a/rec-update-card-status/src/main/java/com/banesco/infrastructure/dtos/card/BusUpdateCardStatusRequest.java b/rec-update-card-status/src/main/java/com/banesco/infrastructure/dtos/card/BusUpdateCardStatusRequest.java new file mode 100644 index 0000000..f50e83f --- /dev/null +++ b/rec-update-card-status/src/main/java/com/banesco/infrastructure/dtos/card/BusUpdateCardStatusRequest.java @@ -0,0 +1,22 @@ +package com.banesco.infrastructure.dtos.card; + + +import com.banesco.common.domain.dto.bian.customer.CustomerReference; +import com.banesco.common.domain.dto.bian.device.Device; +import com.banesco.domain.bian.dto.CardReference; +import io.quarkus.runtime.annotations.RegisterForReflection; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +@RegisterForReflection +@Data +@AllArgsConstructor +@NoArgsConstructor +public class BusUpdateCardStatusRequest { + String requestId; + String customerReferenceFintechId; + CustomerReference customerReference; + Device device; + CardReference cardReference; +} diff --git a/rec-update-card-status/src/main/java/com/banesco/infrastructure/dtos/card/BusUpdateCardStatusResponse.java b/rec-update-card-status/src/main/java/com/banesco/infrastructure/dtos/card/BusUpdateCardStatusResponse.java new file mode 100644 index 0000000..620b1ad --- /dev/null +++ b/rec-update-card-status/src/main/java/com/banesco/infrastructure/dtos/card/BusUpdateCardStatusResponse.java @@ -0,0 +1,22 @@ +package com.banesco.infrastructure.dtos.card; + + +import com.banesco.common.domain.dto.bian.response.BaseResponse; +import com.banesco.common.domain.dto.bian.response.StatusResponse; +import io.quarkus.runtime.annotations.RegisterForReflection; +import lombok.Data; +import lombok.EqualsAndHashCode; + +@RegisterForReflection +@Data +@EqualsAndHashCode(callSuper = false) +public class BusUpdateCardStatusResponse extends BaseResponse { + public BusUpdateCardStatusResponse() { + super(); + } + + public BusUpdateCardStatusResponse(StatusResponse statusResponse) { + super(statusResponse); + } + +} diff --git a/rec-update-card-status/src/main/java/com/banesco/infrastructure/healthcheck/ApplicationLivenessCheck.java b/rec-update-card-status/src/main/java/com/banesco/infrastructure/healthcheck/ApplicationLivenessCheck.java new file mode 100644 index 0000000..22b940e --- /dev/null +++ b/rec-update-card-status/src/main/java/com/banesco/infrastructure/healthcheck/ApplicationLivenessCheck.java @@ -0,0 +1,38 @@ +package com.banesco.infrastructure.healthcheck; + +import jakarta.enterprise.context.ApplicationScoped; +import lombok.extern.slf4j.Slf4j; +import org.eclipse.microprofile.config.inject.ConfigProperty; +import org.eclipse.microprofile.health.HealthCheck; +import org.eclipse.microprofile.health.HealthCheckResponse; +import org.eclipse.microprofile.health.Liveness; + +@Liveness +@ApplicationScoped +@Slf4j +public class ApplicationLivenessCheck implements HealthCheck { + + private final String applicationName; + private final String applicationVersion; + + + public ApplicationLivenessCheck( + @ConfigProperty(name = "quarkus.application.name", defaultValue = "api-application") String applicationName, + @ConfigProperty(name = "quarkus.application.version", defaultValue = "unknown") String applicationVersion) { + this.applicationName = applicationName; + this.applicationVersion = applicationVersion; + } + + @Override + public HealthCheckResponse call() { + log.debug("Ejecutando liveness health check: {}", System.currentTimeMillis()); + // Simplemente reportamos que la aplicación está activa + // Si este código se ejecuta, significa que la JVM está funcionando + return HealthCheckResponse.named("API") + .up() + .withData("application", applicationName) + .withData("version", applicationVersion) + .withData("timestamp", System.currentTimeMillis()) + .build(); + } +} \ No newline at end of file diff --git a/rec-update-card-status/src/main/java/com/banesco/infrastructure/healthcheck/ConfigHealthCheck.java b/rec-update-card-status/src/main/java/com/banesco/infrastructure/healthcheck/ConfigHealthCheck.java new file mode 100644 index 0000000..dabe00e --- /dev/null +++ b/rec-update-card-status/src/main/java/com/banesco/infrastructure/healthcheck/ConfigHealthCheck.java @@ -0,0 +1,69 @@ +package com.banesco.infrastructure.healthcheck; + +import com.banesco.commons.config.AppConf; +import jakarta.enterprise.context.ApplicationScoped; +import jakarta.inject.Inject; +import lombok.extern.slf4j.Slf4j; +import org.eclipse.microprofile.health.HealthCheck; +import org.eclipse.microprofile.health.HealthCheckResponse; +import org.eclipse.microprofile.health.Readiness; + +import java.util.concurrent.Semaphore; + + +@SuppressWarnings("unused") +@Readiness +@Slf4j +@ApplicationScoped +public class ConfigHealthCheck implements HealthCheck { + + + // Semáforo para evitar múltiples health checks simultáneos + private final Semaphore healthCheckSemaphore = new Semaphore(1); + + @Inject + public ConfigHealthCheck() { + log.info("ConfigHealthCheck inicializado"); + } + + @Override + public HealthCheckResponse call() { + + if (!healthCheckSemaphore.tryAcquire()) { + log.debug("Health check en progreso, saltando esta invocación"); + return HealthCheckResponse.builder() + .name("ApiConfig") + .withData("AppConf", "progressing") + .withData("timestamp", System.currentTimeMillis()) + .build(); + } + + try { + AppConf.getInstance(); + return buildResponse(null); + } catch (Exception e) { + return buildResponse(e.getMessage()); + } finally { + healthCheckSemaphore.release(); + } + } + + private HealthCheckResponse buildResponse(String errorMessage) { + var responseBuilder = HealthCheckResponse.named("ApiConfig"); + + if (errorMessage == null) { + return responseBuilder.up() + .withData("AppConf", "configured") + .withData("timestamp", System.currentTimeMillis()) + .build(); + + } + + return responseBuilder.down() + .withData("AppConf", "wrong") + .withData("timestamp", System.currentTimeMillis()) + .withData("errorMessage", errorMessage) + .build(); + + } +} \ No newline at end of file diff --git a/rec-update-card-status/src/main/java/com/banesco/infrastructure/rest/PaymentCardAdapter.java b/rec-update-card-status/src/main/java/com/banesco/infrastructure/rest/PaymentCardAdapter.java new file mode 100644 index 0000000..154159d --- /dev/null +++ b/rec-update-card-status/src/main/java/com/banesco/infrastructure/rest/PaymentCardAdapter.java @@ -0,0 +1,75 @@ +package com.banesco.infrastructure.rest; + +import com.banesco.common.domain.dto.bian.response.StatusResponse; +import com.banesco.common.domain.model.ApiConfig; +import com.banesco.commons.config.AppConf; +import com.banesco.commons.config.StatusCodes; +import com.banesco.domain.bian.request.RecUpdateCardStatusRequest; +import com.banesco.domain.models.CurrentState; +import com.banesco.domain.ports.outbound.PaymentCardPort; +import com.banesco.infrastructure.rest.mappers.PaymentCardMapper; +import com.banesco.infrastructure.rest.repositories.PaymentCardRepository; +import jakarta.enterprise.context.ApplicationScoped; +import jakarta.inject.Inject; +import lombok.extern.slf4j.Slf4j; + + +@ApplicationScoped +@Slf4j +public class PaymentCardAdapter implements PaymentCardPort { + + + private final PaymentCardRepository paymentRepository; + private final PaymentCardMapper paymentCardMapper; + + private final String OPERATION_NAME = "bus-update-card-status"; + AppConf appConf; + + @Inject + public PaymentCardAdapter(AppConf appConf, + PaymentCardMapper paymentCardMapper) { + + this.appConf = appConf; + this.paymentCardMapper = paymentCardMapper; + ApiConfig apiConfig = appConf.loadApiConfig("api.rest-client." + OPERATION_NAME); + paymentRepository = new PaymentCardRepository(apiConfig); + + } + + + public StatusResponse updateCardStatus(CurrentState currentState, RecUpdateCardStatusRequest request) { + + /* + StatusResponse statusResponse = paymentRepository.updateCardStatus( + this.paymentCardMapper.toBusinessRequest( + currentState, + request + ) + );*/ + + StatusResponse statusResponse; + + if (request.getCustomerReference().getCustomerIdType().equals("J")) { + statusResponse = new StatusResponse( + "ok", + StatusCodes.SUCCESS_OPERATION.getStatusCode(), + + "Operacion realizada con exito", + currentState.requestId() + ); + } else { + statusResponse = new StatusResponse( + "error", + StatusCodes.FAILED_DEPENDENCY.getStatusCode(), + "Error al procesar la solicitud", + currentState.requestId() + ); + } + + + return statusResponse; + + } + + +} diff --git a/rec-update-card-status/src/main/java/com/banesco/infrastructure/rest/RegisterSecurityAdapter.java b/rec-update-card-status/src/main/java/com/banesco/infrastructure/rest/RegisterSecurityAdapter.java new file mode 100644 index 0000000..353b92f --- /dev/null +++ b/rec-update-card-status/src/main/java/com/banesco/infrastructure/rest/RegisterSecurityAdapter.java @@ -0,0 +1,76 @@ +package com.banesco.infrastructure.rest; + +import com.banesco.common.domain.dto.bian.device.LoggerHelper; +import com.banesco.common.domain.model.ApiConfig; +import com.banesco.commons.config.AppConf; +import com.banesco.domain.ports.outbound.RegisterSecurityPort; +import com.banesco.infrastructure.dtos.RegisterSecurityRq; +import com.banesco.infrastructure.rest.clients.RegisterSecurityRestClient; +import jakarta.enterprise.context.ApplicationScoped; +import jakarta.inject.Inject; +import jakarta.ws.rs.core.Response; +import lombok.extern.slf4j.Slf4j; +import org.eclipse.microprofile.rest.client.RestClientBuilder; + +import java.net.URI; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.TimeUnit; + + +@ApplicationScoped +@Slf4j +public class RegisterSecurityAdapter implements RegisterSecurityPort { + + private final RegisterSecurityRestClient restClient; + + private final String registerSecuritySP; + private final String registerSecurityEventCod; + private final String registerSecurityBankCod; + private final String registerSecurityCurCOd; + + + @Inject + public RegisterSecurityAdapter(AppConf appConf) { + + ApiConfig apiConfig = appConf.loadApiConfig("api.rest-client.register-security"); + + restClient = RestClientBuilder.newBuilder().baseUri( + URI.create(apiConfig.getUrl()) + ). + connectTimeout(apiConfig.getTimeout().getConnect(), TimeUnit.MILLISECONDS) + .readTimeout(apiConfig.getTimeout().getResponse(), TimeUnit.MILLISECONDS) + .build(RegisterSecurityRestClient.class); + + registerSecuritySP = apiConfig.getConfig().get("sp"); + registerSecurityEventCod = apiConfig.getConfig().get("eventCod"); + registerSecurityBankCod = apiConfig.getConfig().get("bankCod"); + registerSecurityCurCOd = apiConfig.getConfig().get("curCod"); + } + + + public void writeTrace(String requestId, RegisterSecurityRq request) { + + request.setSp(registerSecuritySP); + request.setCodEve(registerSecurityEventCod); + request.setCodEve2(registerSecurityEventCod); + request.setCodBan(registerSecurityBankCod); + request.setCodMon(registerSecurityCurCOd); + log.info(LoggerHelper.buildInfoPrivateRequest(requestId, "REGISTER_SECURITY", request)); + + CompletableFuture.supplyAsync(() -> { + // Simulate some processing + try { + Response responseHttp = restClient.invoke(request); + Object response = responseHttp.readEntity(Object.class); + log.info(LoggerHelper.buildInfoPrivateResponse(requestId, "REGISTER_SECURITY", response != null ? response.toString() : "null")); + } catch (Exception e) { + log.error(LoggerHelper.buildError("REGISTER_SECURITY - " + requestId, "Error calling API: " + e.getMessage())); + log.error("Error writing trace: {}", e.getMessage()); + } + return null; + }); + + } + + +} diff --git a/rec-update-card-status/src/main/java/com/banesco/infrastructure/rest/clients/BusUpdateCardStatusRestClient.java b/rec-update-card-status/src/main/java/com/banesco/infrastructure/rest/clients/BusUpdateCardStatusRestClient.java new file mode 100644 index 0000000..628ca5d --- /dev/null +++ b/rec-update-card-status/src/main/java/com/banesco/infrastructure/rest/clients/BusUpdateCardStatusRestClient.java @@ -0,0 +1,22 @@ +package com.banesco.infrastructure.rest.clients; + +import com.banesco.infrastructure.dtos.card.BusUpdateCardStatusRequest; +import io.quarkus.runtime.annotations.RegisterForReflection; +import jakarta.ws.rs.Consumes; +import jakarta.ws.rs.POST; +import jakarta.ws.rs.Produces; +import jakarta.ws.rs.core.MediaType; +import jakarta.ws.rs.core.Response; +import org.eclipse.microprofile.rest.client.inject.RegisterRestClient; + +@RegisterForReflection +@RegisterRestClient +public interface BusUpdateCardStatusRestClient { + + + @POST + @Consumes(MediaType.APPLICATION_JSON) + @Produces(MediaType.APPLICATION_JSON) + Response invoke(BusUpdateCardStatusRequest request); + +} diff --git a/rec-update-card-status/src/main/java/com/banesco/infrastructure/rest/clients/RegisterSecurityRestClient.java b/rec-update-card-status/src/main/java/com/banesco/infrastructure/rest/clients/RegisterSecurityRestClient.java new file mode 100644 index 0000000..d6350d3 --- /dev/null +++ b/rec-update-card-status/src/main/java/com/banesco/infrastructure/rest/clients/RegisterSecurityRestClient.java @@ -0,0 +1,22 @@ +package com.banesco.infrastructure.rest.clients; + +import com.banesco.infrastructure.dtos.RegisterSecurityRq; +import io.quarkus.runtime.annotations.RegisterForReflection; +import jakarta.ws.rs.Consumes; +import jakarta.ws.rs.POST; +import jakarta.ws.rs.Produces; +import jakarta.ws.rs.core.MediaType; +import jakarta.ws.rs.core.Response; +import org.eclipse.microprofile.rest.client.inject.RegisterRestClient; + +@RegisterForReflection +@RegisterRestClient +public interface RegisterSecurityRestClient { + + + @POST + @Consumes(MediaType.APPLICATION_JSON) + @Produces(MediaType.APPLICATION_JSON) + Response invoke(RegisterSecurityRq request); + +} diff --git a/rec-update-card-status/src/main/java/com/banesco/infrastructure/rest/mappers/PaymentCardMapper.java b/rec-update-card-status/src/main/java/com/banesco/infrastructure/rest/mappers/PaymentCardMapper.java new file mode 100644 index 0000000..0d8f84e --- /dev/null +++ b/rec-update-card-status/src/main/java/com/banesco/infrastructure/rest/mappers/PaymentCardMapper.java @@ -0,0 +1,30 @@ +package com.banesco.infrastructure.rest.mappers; + +import com.banesco.domain.bian.request.RecUpdateCardStatusRequest; +import com.banesco.domain.models.CurrentState; +import com.banesco.infrastructure.dtos.card.BusUpdateCardStatusRequest; +import jakarta.enterprise.context.ApplicationScoped; + +@ApplicationScoped +public class PaymentCardMapper { + + + public BusUpdateCardStatusRequest toBusinessRequest( + CurrentState currentState, + RecUpdateCardStatusRequest receptionRequest + ) { + + BusUpdateCardStatusRequest request = new BusUpdateCardStatusRequest( + currentState.requestId(), + currentState.fintechId(), + receptionRequest.getCustomerReference(), + receptionRequest.getDevice(), + receptionRequest.getCardReference() + + ); + + + return request; + + } +} diff --git a/rec-update-card-status/src/main/java/com/banesco/infrastructure/rest/repositories/PaymentCardRepository.java b/rec-update-card-status/src/main/java/com/banesco/infrastructure/rest/repositories/PaymentCardRepository.java new file mode 100644 index 0000000..5b972db --- /dev/null +++ b/rec-update-card-status/src/main/java/com/banesco/infrastructure/rest/repositories/PaymentCardRepository.java @@ -0,0 +1,69 @@ +package com.banesco.infrastructure.rest.repositories; + +import com.banesco.common.domain.dto.bian.device.JsonHelper; +import com.banesco.common.domain.dto.bian.device.LoggerHelper; +import com.banesco.common.domain.dto.bian.response.StatusResponse; +import com.banesco.common.domain.model.ApiConfig; +import com.banesco.commons.config.StatusCodes; +import com.banesco.commons.utils.ResponseUtil; +import com.banesco.infrastructure.dtos.card.BusUpdateCardStatusRequest; +import com.banesco.infrastructure.dtos.card.BusUpdateCardStatusResponse; +import com.banesco.infrastructure.rest.clients.BusUpdateCardStatusRestClient; +import io.quarkus.runtime.annotations.RegisterForReflection; +import jakarta.ws.rs.ClientErrorException; +import jakarta.ws.rs.core.Response; +import lombok.extern.slf4j.Slf4j; +import org.eclipse.microprofile.rest.client.RestClientBuilder; + +import java.net.URI; +import java.util.concurrent.TimeUnit; + + +@RegisterForReflection +@Slf4j +public class PaymentCardRepository { + + + private final BusUpdateCardStatusRestClient restClient; + + private final String OPERATION_NAME = "BUS_UPDATE_CARD_STATUS"; + + + public PaymentCardRepository(ApiConfig apiConfig) { + + restClient = RestClientBuilder.newBuilder().baseUri( + URI.create(apiConfig.getUrl()) + ). + connectTimeout(apiConfig.getTimeout().getConnect(), TimeUnit.MILLISECONDS) + .readTimeout(apiConfig.getTimeout().getResponse(), TimeUnit.MILLISECONDS) + .build(BusUpdateCardStatusRestClient.class); + + } + + + public StatusResponse updateCardStatus(BusUpdateCardStatusRequest request) { + + try { + + + log.info(LoggerHelper.buildInfoPrivateRequest(request.getRequestId(), OPERATION_NAME, JsonHelper.getJsonFromObject(request))); + + Response responseHttp = restClient.invoke(request); + + BusUpdateCardStatusResponse response = responseHttp.readEntity(BusUpdateCardStatusResponse.class); + log.info(LoggerHelper.buildInfoPrivateResponse(request.getRequestId(), OPERATION_NAME, JsonHelper.getJsonFromObject(response))); + + + return response.getStatusResponse(); + + + } catch (ClientErrorException e) { + log.error(LoggerHelper.buildError(OPERATION_NAME + " - " + request.getRequestId(), "Error calling API: " + e.getMessage())); + return ResponseUtil.mapErrorResponse(request.getRequestId(), StatusCodes.FAILED_DEPENDENCY); + } catch (Exception e) { + log.error(LoggerHelper.buildError(OPERATION_NAME + " - " + request.getRequestId(), "Error interno callig API: " + e.getMessage())); + return ResponseUtil.mapErrorResponse(request.getRequestId(), StatusCodes.INTERNAL_ERROR); + } + + } +} diff --git a/rec-update-card-status/src/main/resources/application-dev.yaml b/rec-update-card-status/src/main/resources/application-dev.yaml new file mode 100644 index 0000000..ed54574 --- /dev/null +++ b/rec-update-card-status/src/main/resources/application-dev.yaml @@ -0,0 +1,30 @@ +quarkus: + http: + port: 8080 + idle-timeout: 30s + thread-pool: + max-threads: 100 + core-threads: 1 +api: + source-id: UCSS + allowed: + customer: + types: J,V + number-pattern: '^\d{1,9}$' + card: + types: DebitCard,CreditCard + number-pattern: '^(\*|\d){4}-(\*|\d){4}-(\*|\d){4}-(\d){4}$' + status-code-pattern: '^\d{1,3}$' + status-action-pattern: '^([A-Z0-9]){1,3}$' + status-reason-pattern: '^([a-zA-Z0-9 ]){1,40}$' + read-messages: + from-props: true + recUpdateCardStatus: + messages: + key: 'recUpdateCardStatus' + content: '[{"backendCode":"200","httpCode":200,"statusCode":"200","description":"Operacion exitosa"},{"backendCode":"503","httpCode":503,"statusCode":"503","description":"Uso interno"},{"backendCode":"422","httpCode":422,"statusCode":"422","description":"Uso interno"},{"backendCode":"SERVICE_UNAVAILABLE","httpCode":500,"statusCode":"500","description":"Uso interno"},{"backendCode":"100","httpCode":503,"statusCode":"503","description":"VDR13 - OSB Disponible"},{"backendCode":"OSB-382505","httpCode":503,"statusCode":"503","description":"VDR13 - OSB Disponible"},{"backendCode":"OSB-380002","httpCode":503,"statusCode":"503","description":"VDR13 - OSB Disponible"},{"backendCode":"ERROR","httpCode":400,"statusCode":"400","description":"Uso interno"},{"backendCode":"400","httpCode":400,"statusCode":"400","description":"Uso interno"},{"backendCode":"401","httpCode":401,"statusCode":"401","description":"Uso interno"},{"backendCode":"403","httpCode":403,"statusCode":"403","description":"Uso interno"},{"backendCode":"404","httpCode":404,"statusCode":"404","description":"Uso interno"},{"backendCode":"default","httpCode":409,"statusCode":"409","description":"Conflicto"},{"backendCode":"424","httpCode":424,"statusCode":"424","description":"Error de dependencia"},{"backendCode":"VDE01","httpCode":400,"statusCode":"VDE01","description":"VDE01 - Error en dato de entrada obligatorio: %s"},{"backendCode":"VDE02","httpCode":400,"statusCode":"VDE02","description":"VDE02 - Error en valor permitido para campo: %s"}]' + rest-client: + bus-update-card-status: '{"url":"http://localhost:8081/card/status/update","timeout":{"connect":20000,"response":20000},"config":{}}' + register-security: '{"url":"http://api-register-security-route-apis-banesco-dev.apps.desplakur3.desintra.banesco.com/register-security/save","timeout":{"connect":20000,"response":20000},"config":{"sp":"spAPI_Traza","eventCod":"CANCTARJ","bankCod":"01","curCod":"BS"}}' + + diff --git a/rec-update-card-status/src/main/resources/application.yaml b/rec-update-card-status/src/main/resources/application.yaml new file mode 100644 index 0000000..be6aba3 --- /dev/null +++ b/rec-update-card-status/src/main/resources/application.yaml @@ -0,0 +1,33 @@ +quarkus: + http: + non-application-root-path: actuator + log: + level: INFO + console: + enable: true + profile: dev + debug: + print-startup-times: true + reflection: false + native: + file-encoding: UTF-8 + container-build: true + builder-image: quay.io/quarkus/ubi-quarkus-mandrel-builder-image:23.0.5.0-Final-java17 + container-runtime: docker + additional-build-args: + - -H:InitialCollectionPolicy=com.oracle.svm.core.genscavenge.CollectionPolicy\$BySpaceAndTime + - -H:ReflectionConfigurationFiles=reflect-config.json + native-image-xmx: 6G + resources: + excludes: resources/*.yaml + # Enable OpenAPI + smallrye-openapi: + path: /openapi + enable: 'true' + swagger-ui: + path: /swagger-ui + always-include: 'true' + application: + name: rec-update-card-status + version: 1.0.0 + #remove to compile \ No newline at end of file diff --git a/rec-update-card-status/src/main/resources/errors-mapping/recUpdateCardStatusSwitch.json b/rec-update-card-status/src/main/resources/errors-mapping/recUpdateCardStatusSwitch.json new file mode 100644 index 0000000..68e0b72 --- /dev/null +++ b/rec-update-card-status/src/main/resources/errors-mapping/recUpdateCardStatusSwitch.json @@ -0,0 +1,98 @@ +[ + { + "backendCode": "200", + "httpCode": 200, + "statusCode": "200", + "description": "Operacion exitosa" + }, + { + "backendCode": "503", + "httpCode": 503, + "statusCode": "503", + "description": "Uso interno" + }, + { + "backendCode": "422", + "httpCode": 422, + "statusCode": "422", + "description": "Uso interno" + }, + { + "backendCode": "SERVICE_UNAVAILABLE", + "httpCode": 500, + "statusCode": "500", + "description": "Uso interno" + }, + { + "backendCode": "100", + "httpCode": 503, + "statusCode": "503", + "description": "VDR13 - OSB Disponible" + }, + { + "backendCode": "OSB-382505", + "httpCode": 503, + "statusCode": "503", + "description": "VDR13 - OSB Disponible" + }, + { + "backendCode": "OSB-380002", + "httpCode": 503, + "statusCode": "503", + "description": "VDR13 - OSB Disponible" + }, + { + "backendCode": "ERROR", + "httpCode": 400, + "statusCode": "400", + "description": "Uso interno" + }, + { + "backendCode": "400", + "httpCode": 400, + "statusCode": "400", + "description": "Uso interno" + }, + { + "backendCode": "401", + "httpCode": 401, + "statusCode": "401", + "description": "Uso interno" + }, + { + "backendCode": "403", + "httpCode": 403, + "statusCode": "403", + "description": "Uso interno" + }, + { + "backendCode": "404", + "httpCode": 404, + "statusCode": "404", + "description": "Uso interno" + }, + { + "backendCode": "default", + "httpCode": 409, + "statusCode": "409", + "description": "Conflicto" + }, + { + "backendCode": "424", + "httpCode": 424, + "statusCode": "424", + "description": "Error de dependencia" + }, + { + "backendCode": "VDE01", + "httpCode": 400, + "statusCode": "VDE01", + "description": "VDE01 - Error en dato de entrada obligatorio: %s" + }, + { + "backendCode": "VDE02", + "httpCode": 400, + "statusCode": "VDE02", + "description": "VDE02 - Error en valor permitido para campo: %s" + } +] \ No newline at end of file diff --git a/rec-update-card-status/src/main/resources/examples/requestError.json b/rec-update-card-status/src/main/resources/examples/requestError.json new file mode 100644 index 0000000..514d2f7 --- /dev/null +++ b/rec-update-card-status/src/main/resources/examples/requestError.json @@ -0,0 +1,21 @@ + + +{ + "customerReference": { + "customerIdType": "V", + "customerId": "500634269" + }, + "device": { + "deviceType": "Mobile", + "deviceDescription": "Xiaomi Note 11 PRO", + "deviceIp": "127.0.0.1", + "deviceSessionReference": "12345678901304" + }, + "cardReference": { + "cardType": "DebitCard", + "cardNumber": "6012-8862-0791-7605", + "cardStatusCode": "52", + "cardStatusAction": "CV", + "cardStatusReason": "Bloqueo Temporal" + } +} \ No newline at end of file diff --git a/rec-update-card-status/src/main/resources/examples/requestSuccess.json b/rec-update-card-status/src/main/resources/examples/requestSuccess.json new file mode 100644 index 0000000..f068061 --- /dev/null +++ b/rec-update-card-status/src/main/resources/examples/requestSuccess.json @@ -0,0 +1,21 @@ + + +{ + "customerReference": { + "customerIdType": "J", + "customerId": "500634269" + }, + "device": { + "deviceType": "Mobile", + "deviceDescription": "Xiaomi Note 11 PRO", + "deviceIp": "127.0.0.1", + "deviceSessionReference": "12345678901304" + }, + "cardReference": { + "cardType": "DebitCard", + "cardNumber": "6012-8862-0791-7605", + "cardStatusCode": "52", + "cardStatusAction": "CV", + "cardStatusReason": "Bloqueo Temporal" + } +} \ No newline at end of file diff --git a/rec-update-card-status/src/main/resources/reflect-config.json b/rec-update-card-status/src/main/resources/reflect-config.json new file mode 100644 index 0000000..cc2aaa6 --- /dev/null +++ b/rec-update-card-status/src/main/resources/reflect-config.json @@ -0,0 +1,50 @@ +[ + { + "name": "com.banesco.commons.config.AppConf", + "allDeclaredConstructors": true, + "allDeclaredMethods": true, + "allDeclaredFields": true + }, + { + "name": "com.banesco.common.domain.model.BackResponse", + "allDeclaredConstructors": true, + "allDeclaredMethods": true, + "allDeclaredFields": true + }, + { + "name": "com.banesco.common.domain.dto.bian.device.Device", + "allDeclaredConstructors": true, + "allDeclaredMethods": true, + "allDeclaredFields": true + }, + { + "name": "com.banesco.common.domain.model.ApiConfig", + "allDeclaredConstructors": true, + "allDeclaredMethods": true, + "allDeclaredFields": true + }, + { + "name": "com.banesco.common.domain.model.ApiTimeout", + "allDeclaredConstructors": true, + "allDeclaredMethods": true, + "allDeclaredFields": true + }, + { + "name": "com.banesco.common.domain.dto.bian.response.StatusResponse", + "allDeclaredConstructors": true, + "allDeclaredMethods": true, + "allDeclaredFields": true + }, + { + "name": "com.banesco.common.domain.dto.bian.response.MetadataResponse", + "allDeclaredConstructors": true, + "allDeclaredMethods": true, + "allDeclaredFields": true + }, + { + "name": "com.banesco.common.domain.dto.bian.customer.CustomerReference", + "allDeclaredConstructors": true, + "allDeclaredMethods": true, + "allDeclaredFields": true + } +] diff --git a/rec-update-card-status/src/test/java/com/banesco/tests/BanTestWatcher.java b/rec-update-card-status/src/test/java/com/banesco/tests/BanTestWatcher.java new file mode 100644 index 0000000..0e72b16 --- /dev/null +++ b/rec-update-card-status/src/test/java/com/banesco/tests/BanTestWatcher.java @@ -0,0 +1,27 @@ +package com.banesco.tests; + +import org.junit.jupiter.api.extension.ExtensionContext; +import org.junit.jupiter.api.extension.TestWatcher; + +import java.util.Optional; + +public class BanTestWatcher implements TestWatcher { + private static final String ANSI_GREEN = "\u001B[32m"; + private static final String ANSI_RED = "\u001B[31m"; + private static final String ANSI_RESET = "\u001B[0m"; + + @Override + public void testSuccessful(ExtensionContext context) { + System.out.println(ANSI_GREEN + "Test successful: " + context.getDisplayName() + ANSI_RESET); + } + + @Override + public void testFailed(ExtensionContext context, Throwable cause) { + System.out.println(ANSI_RED + "Test failed: " + context.getDisplayName() + " - " + cause.getMessage() + ANSI_RESET); + } + + @Override + public void testDisabled(ExtensionContext context, Optional reason) { + System.out.println("Test disabled: " + context.getDisplayName() + " - " + reason.orElse("No reason given")); + } +} \ No newline at end of file diff --git a/update-card-status/.dockerignore b/update-card-status/.dockerignore new file mode 100644 index 0000000..23347a3 --- /dev/null +++ b/update-card-status/.dockerignore @@ -0,0 +1,4 @@ +!target/*-runner +!target/*-runner.jar +!target/lib/* +!target/quarkus-app/* \ No newline at end of file diff --git a/update-card-status/.gitattributes b/update-card-status/.gitattributes new file mode 100644 index 0000000..2125666 --- /dev/null +++ b/update-card-status/.gitattributes @@ -0,0 +1 @@ +* text=auto \ No newline at end of file diff --git a/update-card-status/.gitignore b/update-card-status/.gitignore new file mode 100644 index 0000000..974780a --- /dev/null +++ b/update-card-status/.gitignore @@ -0,0 +1,49 @@ +#Maven +target/ +pom.xml.tag +pom.xml.releaseBackup +pom.xml.versionsBackup +release.properties +.flattened-pom.xml + +# Eclipse +.project +.classpath +.settings/ +bin/ + +# IntelliJ +.idea +*.ipr +*.iml +*.iws + +# NetBeans +nb-configuration.xml + +# Visual Studio Code +.vscode +.factorypath + +# OSX +.DS_Store + +# Vim +*.swp +*.swo + +# patch +*.orig +*.rej + +# Local environment +.env + +# Plugin directory +/.quarkus/cli/plugins/ +# TLS Certificates +.certs/ +dependency-reduced-pom.xml +## no track +application-local.yaml +application-local.properties \ No newline at end of file diff --git a/update-card-status/.gitmodules b/update-card-status/.gitmodules new file mode 100644 index 0000000..e69de29 diff --git a/update-card-status/.mvn/wrapper/.gitignore b/update-card-status/.mvn/wrapper/.gitignore new file mode 100644 index 0000000..e72f5e8 --- /dev/null +++ b/update-card-status/.mvn/wrapper/.gitignore @@ -0,0 +1 @@ +maven-wrapper.jar diff --git a/update-card-status/.mvn/wrapper/MavenWrapperDownloader.java b/update-card-status/.mvn/wrapper/MavenWrapperDownloader.java new file mode 100644 index 0000000..fe7d037 --- /dev/null +++ b/update-card-status/.mvn/wrapper/MavenWrapperDownloader.java @@ -0,0 +1,93 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import java.io.IOException; +import java.io.InputStream; +import java.net.Authenticator; +import java.net.PasswordAuthentication; +import java.net.URI; +import java.net.URL; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.nio.file.StandardCopyOption; +import java.util.concurrent.ThreadLocalRandom; + +public final class MavenWrapperDownloader { + private static final String WRAPPER_VERSION = "3.3.2"; + + private static final boolean VERBOSE = Boolean.parseBoolean(System.getenv("MVNW_VERBOSE")); + + public static void main(String[] args) { + log("Apache Maven Wrapper Downloader " + WRAPPER_VERSION); + + if (args.length != 2) { + System.err.println(" - ERROR wrapperUrl or wrapperJarPath parameter missing"); + System.exit(1); + } + + try { + log(" - Downloader started"); + final URL wrapperUrl = URI.create(args[0]).toURL(); + final String jarPath = args[1].replace("..", ""); // Sanitize path + final Path wrapperJarPath = Paths.get(jarPath).toAbsolutePath().normalize(); + downloadFileFromURL(wrapperUrl, wrapperJarPath); + log("Done"); + } catch (IOException e) { + System.err.println("- Error downloading: " + e.getMessage()); + if (VERBOSE) { + e.printStackTrace(); + } + System.exit(1); + } + } + + private static void downloadFileFromURL(URL wrapperUrl, Path wrapperJarPath) + throws IOException { + log(" - Downloading to: " + wrapperJarPath); + if (System.getenv("MVNW_USERNAME") != null && System.getenv("MVNW_PASSWORD") != null) { + final String username = System.getenv("MVNW_USERNAME"); + final char[] password = System.getenv("MVNW_PASSWORD").toCharArray(); + Authenticator.setDefault(new Authenticator() { + @Override + protected PasswordAuthentication getPasswordAuthentication() { + return new PasswordAuthentication(username, password); + } + }); + } + Path temp = wrapperJarPath + .getParent() + .resolve(wrapperJarPath.getFileName() + "." + + Long.toUnsignedString(ThreadLocalRandom.current().nextLong()) + ".tmp"); + try (InputStream inStream = wrapperUrl.openStream()) { + Files.copy(inStream, temp, StandardCopyOption.REPLACE_EXISTING); + Files.move(temp, wrapperJarPath, StandardCopyOption.REPLACE_EXISTING); + } finally { + Files.deleteIfExists(temp); + } + log(" - Downloader complete"); + } + + private static void log(String msg) { + if (VERBOSE) { + System.out.println(msg); + } + } + +} diff --git a/update-card-status/.mvn/wrapper/maven-wrapper.properties b/update-card-status/.mvn/wrapper/maven-wrapper.properties new file mode 100644 index 0000000..1a580be --- /dev/null +++ b/update-card-status/.mvn/wrapper/maven-wrapper.properties @@ -0,0 +1,20 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +wrapperVersion=3.3.2 +distributionType=source +distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.9/apache-maven-3.9.9-bin.zip +wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.3.2/maven-wrapper-3.3.2.jar \ No newline at end of file diff --git a/update-card-status/.pre-commit-config.yaml b/update-card-status/.pre-commit-config.yaml new file mode 100644 index 0000000..e69de29 diff --git a/update-card-status/CHANGES.md b/update-card-status/CHANGES.md new file mode 100644 index 0000000..461df95 --- /dev/null +++ b/update-card-status/CHANGES.md @@ -0,0 +1,12 @@ +boveda_express_ +======================= + +Here you can see the full list of changes between each Flask-RESTful release. + +Version 0.1 +------------- +2025-03-20 + - Nueva version Quarkus + + +First public release diff --git a/update-card-status/CONTRIBUTING.md b/update-card-status/CONTRIBUTING.md new file mode 100644 index 0000000..e69de29 diff --git a/update-card-status/HELP.md b/update-card-status/HELP.md new file mode 100644 index 0000000..7c2b9d7 --- /dev/null +++ b/update-card-status/HELP.md @@ -0,0 +1,16 @@ +# Getting Started + +### Reference Documentation +For further reference, please consider the following sections: + +* [Official Apache Maven documentation](https://maven.apache.org/guides/index.html) +* [Spring Boot Maven Plugin Reference Guide](https://docs.spring.io/spring-boot/3.3.2/maven-plugin) +* [Create an OCI image](https://docs.spring.io/spring-boot/3.3.2/maven-plugin/build-image.html) + +### Maven Parent overrides + +Due to Maven's design, elements are inherited from the parent POM to the project POM. +While most of the inheritance is fine, it also inherits unwanted elements like `` and `` from the parent. +To prevent this, the project POM contains empty overrides for these elements. +If you manually switch to a different parent and actually want the inheritance, you need to remove those overrides. + diff --git a/update-card-status/LICENSE b/update-card-status/LICENSE new file mode 100644 index 0000000..1773f19 --- /dev/null +++ b/update-card-status/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2024 Banesco Banco Universal, C.A. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/update-card-status/README.md b/update-card-status/README.md new file mode 100644 index 0000000..e63d589 --- /dev/null +++ b/update-card-status/README.md @@ -0,0 +1,76 @@ +# api-p2p-payment + +This project uses Quarkus, the Supersonic Subatomic Java Framework. + +If you want to learn more about Quarkus, please visit its website: . + +## Deploy Openshift +./mvnw clean package -Pnative -Dquarkus.kubernetes.deploy=true + +## Running the application in dev mode + +You can run your application in dev mode that enables live coding using: + +```shell script +./mvnw compile quarkus:dev +``` + +> **_NOTE:_** Quarkus now ships with a Dev UI, which is available in dev mode only at . + +## Packaging and running the application + +The application can be packaged using: + +```shell script +./mvnw package +``` + +It produces the `quarkus-run.jar` file in the `target/quarkus-app/` directory. +Be aware that it’s not an _über-jar_ as the dependencies are copied into the `target/quarkus-app/lib/` directory. + +The application is now runnable using `java -jar target/quarkus-app/quarkus-run.jar`. + +If you want to build an _über-jar_, execute the following command: + +```shell script +./mvnw package -Dquarkus.package.jar.type=uber-jar +``` + +The application, packaged as an _über-jar_, is now runnable using `java -jar target/*-runner.jar`. + +## Creating a native executable + +You can create a native executable using: + +```shell script +./mvnw package -Dnative +``` + +Or, if you don't have GraalVM installed, you can run the native executable build in a container using: + +```shell script +./mvnw package -Dnative -Dquarkus.native.container-build=true +``` + +You can then execute your native executable with: `./target/api-p2p-payment-1.0-SNAPSHOT-runner` + +If you want to learn more about building native executables, please consult . + +## Related Guides + +- REST ([guide](https://quarkus.io/guides/rest)): A Jakarta REST implementation utilizing build time processing and + Vert.x. This extension is not compatible with the quarkus-resteasy extension, or any of the extensions that depend on + it. +- SmallRye OpenAPI ([guide](https://quarkus.io/guides/openapi-swaggerui)): Document your REST APIs with OpenAPI - comes + with Swagger UI +- Camel MicroProfile + Health ([guide](https://camel.apache.org/camel-quarkus/latest/reference/extensions/microprofile-health.html)): Expose + Camel health checks via MicroProfile Health + +## Provided Code + +### REST + +Easily start your REST Web Services + +[Related guide section...](https://quarkus.io/guides/getting-started-reactive#reactive-jax-rs-resources) diff --git a/update-card-status/docker-compose.yml b/update-card-status/docker-compose.yml new file mode 100644 index 0000000..e69de29 diff --git a/update-card-status/docs/.gitkeep b/update-card-status/docs/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/update-card-status/mvnw b/update-card-status/mvnw new file mode 100644 index 0000000..d7c358e --- /dev/null +++ b/update-card-status/mvnw @@ -0,0 +1,259 @@ +#!/bin/sh +# ---------------------------------------------------------------------------- +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# ---------------------------------------------------------------------------- + +# ---------------------------------------------------------------------------- +# Apache Maven Wrapper startup batch script, version 3.3.2 +# +# Optional ENV vars +# ----------------- +# JAVA_HOME - location of a JDK home dir, required when download maven via java source +# MVNW_REPOURL - repo url base for downloading maven distribution +# MVNW_USERNAME/MVNW_PASSWORD - user and password for downloading maven +# MVNW_VERBOSE - true: enable verbose log; debug: trace the mvnw script; others: silence the output +# ---------------------------------------------------------------------------- + +set -euf +[ "${MVNW_VERBOSE-}" != debug ] || set -x + +# OS specific support. +native_path() { printf %s\\n "$1"; } +case "$(uname)" in +CYGWIN* | MINGW*) + [ -z "${JAVA_HOME-}" ] || JAVA_HOME="$(cygpath --unix "$JAVA_HOME")" + native_path() { cygpath --path --windows "$1"; } + ;; +esac + +# set JAVACMD and JAVACCMD +set_java_home() { + # For Cygwin and MinGW, ensure paths are in Unix format before anything is touched + if [ -n "${JAVA_HOME-}" ]; then + if [ -x "$JAVA_HOME/jre/sh/java" ]; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + JAVACCMD="$JAVA_HOME/jre/sh/javac" + else + JAVACMD="$JAVA_HOME/bin/java" + JAVACCMD="$JAVA_HOME/bin/javac" + + if [ ! -x "$JAVACMD" ] || [ ! -x "$JAVACCMD" ]; then + echo "The JAVA_HOME environment variable is not defined correctly, so mvnw cannot run." >&2 + echo "JAVA_HOME is set to \"$JAVA_HOME\", but \"\$JAVA_HOME/bin/java\" or \"\$JAVA_HOME/bin/javac\" does not exist." >&2 + return 1 + fi + fi + else + JAVACMD="$( + 'set' +e + 'unset' -f command 2>/dev/null + 'command' -v java + )" || : + JAVACCMD="$( + 'set' +e + 'unset' -f command 2>/dev/null + 'command' -v javac + )" || : + + if [ ! -x "${JAVACMD-}" ] || [ ! -x "${JAVACCMD-}" ]; then + echo "The java/javac command does not exist in PATH nor is JAVA_HOME set, so mvnw cannot run." >&2 + return 1 + fi + fi +} + +# hash string like Java String::hashCode +hash_string() { + str="${1:-}" h=0 + while [ -n "$str" ]; do + char="${str%"${str#?}"}" + h=$(((h * 31 + $(LC_CTYPE=C printf %d "'$char")) % 4294967296)) + str="${str#?}" + done + printf %x\\n $h +} + +verbose() { :; } +[ "${MVNW_VERBOSE-}" != true ] || verbose() { printf %s\\n "${1-}"; } + +die() { + printf %s\\n "$1" >&2 + exit 1 +} + +trim() { + # MWRAPPER-139: + # Trims trailing and leading whitespace, carriage returns, tabs, and linefeeds. + # Needed for removing poorly interpreted newline sequences when running in more + # exotic environments such as mingw bash on Windows. + printf "%s" "${1}" | tr -d '[:space:]' +} + +# parse distributionUrl and optional distributionSha256Sum, requires .mvn/wrapper/maven-wrapper.properties +while IFS="=" read -r key value; do + case "${key-}" in + distributionUrl) distributionUrl=$(trim "${value-}") ;; + distributionSha256Sum) distributionSha256Sum=$(trim "${value-}") ;; + esac +done <"${0%/*}/.mvn/wrapper/maven-wrapper.properties" +[ -n "${distributionUrl-}" ] || die "cannot read distributionUrl property in ${0%/*}/.mvn/wrapper/maven-wrapper.properties" + +case "${distributionUrl##*/}" in +maven-mvnd-*bin.*) + MVN_CMD=mvnd.sh _MVNW_REPO_PATTERN=/maven/mvnd/ + case "${PROCESSOR_ARCHITECTURE-}${PROCESSOR_ARCHITEW6432-}:$(uname -a)" in + *AMD64:CYGWIN* | *AMD64:MINGW*) distributionPlatform=windows-amd64 ;; + :Darwin*x86_64) distributionPlatform=darwin-amd64 ;; + :Darwin*arm64) distributionPlatform=darwin-aarch64 ;; + :Linux*x86_64*) distributionPlatform=linux-amd64 ;; + *) + echo "Cannot detect native platform for mvnd on $(uname)-$(uname -m), use pure java version" >&2 + distributionPlatform=linux-amd64 + ;; + esac + distributionUrl="${distributionUrl%-bin.*}-$distributionPlatform.zip" + ;; +maven-mvnd-*) MVN_CMD=mvnd.sh _MVNW_REPO_PATTERN=/maven/mvnd/ ;; +*) MVN_CMD="mvn${0##*/mvnw}" _MVNW_REPO_PATTERN=/org/apache/maven/ ;; +esac + +# apply MVNW_REPOURL and calculate MAVEN_HOME +# maven home pattern: ~/.m2/wrapper/dists/{apache-maven-,maven-mvnd--}/ +[ -z "${MVNW_REPOURL-}" ] || distributionUrl="$MVNW_REPOURL$_MVNW_REPO_PATTERN${distributionUrl#*"$_MVNW_REPO_PATTERN"}" +distributionUrlName="${distributionUrl##*/}" +distributionUrlNameMain="${distributionUrlName%.*}" +distributionUrlNameMain="${distributionUrlNameMain%-bin}" +MAVEN_USER_HOME="${MAVEN_USER_HOME:-${HOME}/.m2}" +MAVEN_HOME="${MAVEN_USER_HOME}/wrapper/dists/${distributionUrlNameMain-}/$(hash_string "$distributionUrl")" + +exec_maven() { + unset MVNW_VERBOSE MVNW_USERNAME MVNW_PASSWORD MVNW_REPOURL || : + exec "$MAVEN_HOME/bin/$MVN_CMD" "$@" || die "cannot exec $MAVEN_HOME/bin/$MVN_CMD" +} + +if [ -d "$MAVEN_HOME" ]; then + verbose "found existing MAVEN_HOME at $MAVEN_HOME" + exec_maven "$@" +fi + +case "${distributionUrl-}" in +*?-bin.zip | *?maven-mvnd-?*-?*.zip) ;; +*) die "distributionUrl is not valid, must match *-bin.zip or maven-mvnd-*.zip, but found '${distributionUrl-}'" ;; +esac + +# prepare tmp dir +if TMP_DOWNLOAD_DIR="$(mktemp -d)" && [ -d "$TMP_DOWNLOAD_DIR" ]; then + clean() { rm -rf -- "$TMP_DOWNLOAD_DIR"; } + trap clean HUP INT TERM EXIT +else + die "cannot create temp dir" +fi + +mkdir -p -- "${MAVEN_HOME%/*}" + +# Download and Install Apache Maven +verbose "Couldn't find MAVEN_HOME, downloading and installing it ..." +verbose "Downloading from: $distributionUrl" +verbose "Downloading to: $TMP_DOWNLOAD_DIR/$distributionUrlName" + +# select .zip or .tar.gz +if ! command -v unzip >/dev/null; then + distributionUrl="${distributionUrl%.zip}.tar.gz" + distributionUrlName="${distributionUrl##*/}" +fi + +# verbose opt +__MVNW_QUIET_WGET=--quiet __MVNW_QUIET_CURL=--silent __MVNW_QUIET_UNZIP=-q __MVNW_QUIET_TAR='' +[ "${MVNW_VERBOSE-}" != true ] || __MVNW_QUIET_WGET='' __MVNW_QUIET_CURL='' __MVNW_QUIET_UNZIP='' __MVNW_QUIET_TAR=v + +# normalize http auth +case "${MVNW_PASSWORD:+has-password}" in +'') MVNW_USERNAME='' MVNW_PASSWORD='' ;; +has-password) [ -n "${MVNW_USERNAME-}" ] || MVNW_USERNAME='' MVNW_PASSWORD='' ;; +esac + +if [ -z "${MVNW_USERNAME-}" ] && command -v wget >/dev/null; then + verbose "Found wget ... using wget" + wget ${__MVNW_QUIET_WGET:+"$__MVNW_QUIET_WGET"} "$distributionUrl" -O "$TMP_DOWNLOAD_DIR/$distributionUrlName" || die "wget: Failed to fetch $distributionUrl" +elif [ -z "${MVNW_USERNAME-}" ] && command -v curl >/dev/null; then + verbose "Found curl ... using curl" + curl ${__MVNW_QUIET_CURL:+"$__MVNW_QUIET_CURL"} -f -L -o "$TMP_DOWNLOAD_DIR/$distributionUrlName" "$distributionUrl" || die "curl: Failed to fetch $distributionUrl" +elif set_java_home; then + verbose "Falling back to use Java to download" + javaSource="$TMP_DOWNLOAD_DIR/Downloader.java" + targetZip="$TMP_DOWNLOAD_DIR/$distributionUrlName" + cat >"$javaSource" <<-END + public class Downloader extends java.net.Authenticator + { + protected java.net.PasswordAuthentication getPasswordAuthentication() + { + return new java.net.PasswordAuthentication( System.getenv( "MVNW_USERNAME" ), System.getenv( "MVNW_PASSWORD" ).toCharArray() ); + } + public static void main( String[] args ) throws Exception + { + setDefault( new Downloader() ); + java.nio.file.Files.copy( java.net.URI.create( args[0] ).toURL().openStream(), java.nio.file.Paths.get( args[1] ).toAbsolutePath().normalize() ); + } + } + END + # For Cygwin/MinGW, switch paths to Windows format before running javac and java + verbose " - Compiling Downloader.java ..." + "$(native_path "$JAVACCMD")" "$(native_path "$javaSource")" || die "Failed to compile Downloader.java" + verbose " - Running Downloader.java ..." + "$(native_path "$JAVACMD")" -cp "$(native_path "$TMP_DOWNLOAD_DIR")" Downloader "$distributionUrl" "$(native_path "$targetZip")" +fi + +# If specified, validate the SHA-256 sum of the Maven distribution zip file +if [ -n "${distributionSha256Sum-}" ]; then + distributionSha256Result=false + if [ "$MVN_CMD" = mvnd.sh ]; then + echo "Checksum validation is not supported for maven-mvnd." >&2 + echo "Please disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties." >&2 + exit 1 + elif command -v sha256sum >/dev/null; then + if echo "$distributionSha256Sum $TMP_DOWNLOAD_DIR/$distributionUrlName" | sha256sum -c >/dev/null 2>&1; then + distributionSha256Result=true + fi + elif command -v shasum >/dev/null; then + if echo "$distributionSha256Sum $TMP_DOWNLOAD_DIR/$distributionUrlName" | shasum -a 256 -c >/dev/null 2>&1; then + distributionSha256Result=true + fi + else + echo "Checksum validation was requested but neither 'sha256sum' or 'shasum' are available." >&2 + echo "Please install either command, or disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties." >&2 + exit 1 + fi + if [ $distributionSha256Result = false ]; then + echo "Error: Failed to validate Maven distribution SHA-256, your Maven distribution might be compromised." >&2 + echo "If you updated your Maven version, you need to update the specified distributionSha256Sum property." >&2 + exit 1 + fi +fi + +# unzip and move +if command -v unzip >/dev/null; then + unzip ${__MVNW_QUIET_UNZIP:+"$__MVNW_QUIET_UNZIP"} "$TMP_DOWNLOAD_DIR/$distributionUrlName" -d "$TMP_DOWNLOAD_DIR" || die "failed to unzip" +else + tar xzf${__MVNW_QUIET_TAR:+"$__MVNW_QUIET_TAR"} "$TMP_DOWNLOAD_DIR/$distributionUrlName" -C "$TMP_DOWNLOAD_DIR" || die "failed to untar" +fi +printf %s\\n "$distributionUrl" >"$TMP_DOWNLOAD_DIR/$distributionUrlNameMain/mvnw.url" +mv -- "$TMP_DOWNLOAD_DIR/$distributionUrlNameMain" "$MAVEN_HOME" || [ -d "$MAVEN_HOME" ] || die "fail to move MAVEN_HOME" + +clean || : +exec_maven "$@" diff --git a/update-card-status/mvnw.cmd b/update-card-status/mvnw.cmd new file mode 100644 index 0000000..6f779cf --- /dev/null +++ b/update-card-status/mvnw.cmd @@ -0,0 +1,149 @@ +<# : batch portion +@REM ---------------------------------------------------------------------------- +@REM Licensed to the Apache Software Foundation (ASF) under one +@REM or more contributor license agreements. See the NOTICE file +@REM distributed with this work for additional information +@REM regarding copyright ownership. The ASF licenses this file +@REM to you under the Apache License, Version 2.0 (the +@REM "License"); you may not use this file except in compliance +@REM with the License. You may obtain a copy of the License at +@REM +@REM https://www.apache.org/licenses/LICENSE-2.0 +@REM +@REM Unless required by applicable law or agreed to in writing, +@REM software distributed under the License is distributed on an +@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +@REM KIND, either express or implied. See the License for the +@REM specific language governing permissions and limitations +@REM under the License. +@REM ---------------------------------------------------------------------------- + +@REM ---------------------------------------------------------------------------- +@REM Apache Maven Wrapper startup batch script, version 3.3.2 +@REM +@REM Optional ENV vars +@REM MVNW_REPOURL - repo url base for downloading maven distribution +@REM MVNW_USERNAME/MVNW_PASSWORD - user and password for downloading maven +@REM MVNW_VERBOSE - true: enable verbose log; others: silence the output +@REM ---------------------------------------------------------------------------- + +@IF "%__MVNW_ARG0_NAME__%"=="" (SET __MVNW_ARG0_NAME__=%~nx0) +@SET __MVNW_CMD__= +@SET __MVNW_ERROR__= +@SET __MVNW_PSMODULEP_SAVE=%PSModulePath% +@SET PSModulePath= +@FOR /F "usebackq tokens=1* delims==" %%A IN (`powershell -noprofile "& {$scriptDir='%~dp0'; $script='%__MVNW_ARG0_NAME__%'; icm -ScriptBlock ([Scriptblock]::Create((Get-Content -Raw '%~f0'))) -NoNewScope}"`) DO @( + IF "%%A"=="MVN_CMD" (set __MVNW_CMD__=%%B) ELSE IF "%%B"=="" (echo %%A) ELSE (echo %%A=%%B) +) +@SET PSModulePath=%__MVNW_PSMODULEP_SAVE% +@SET __MVNW_PSMODULEP_SAVE= +@SET __MVNW_ARG0_NAME__= +@SET MVNW_USERNAME= +@SET MVNW_PASSWORD= +@IF NOT "%__MVNW_CMD__%"=="" (%__MVNW_CMD__% %*) +@echo Cannot start maven from wrapper >&2 && exit /b 1 +@GOTO :EOF +: end batch / begin powershell #> + +$ErrorActionPreference = "Stop" +if ($env:MVNW_VERBOSE -eq "true") { + $VerbosePreference = "Continue" +} + +# calculate distributionUrl, requires .mvn/wrapper/maven-wrapper.properties +$distributionUrl = (Get-Content -Raw "$scriptDir/.mvn/wrapper/maven-wrapper.properties" | ConvertFrom-StringData).distributionUrl +if (!$distributionUrl) { + Write-Error "cannot read distributionUrl property in $scriptDir/.mvn/wrapper/maven-wrapper.properties" +} + +switch -wildcard -casesensitive ( $($distributionUrl -replace '^.*/','') ) { + "maven-mvnd-*" { + $USE_MVND = $true + $distributionUrl = $distributionUrl -replace '-bin\.[^.]*$',"-windows-amd64.zip" + $MVN_CMD = "mvnd.cmd" + break + } + default { + $USE_MVND = $false + $MVN_CMD = $script -replace '^mvnw','mvn' + break + } +} + +# apply MVNW_REPOURL and calculate MAVEN_HOME +# maven home pattern: ~/.m2/wrapper/dists/{apache-maven-,maven-mvnd--}/ +if ($env:MVNW_REPOURL) { + $MVNW_REPO_PATTERN = if ($USE_MVND) { "/org/apache/maven/" } else { "/maven/mvnd/" } + $distributionUrl = "$env:MVNW_REPOURL$MVNW_REPO_PATTERN$($distributionUrl -replace '^.*'+$MVNW_REPO_PATTERN,'')" +} +$distributionUrlName = $distributionUrl -replace '^.*/','' +$distributionUrlNameMain = $distributionUrlName -replace '\.[^.]*$','' -replace '-bin$','' +$MAVEN_HOME_PARENT = "$HOME/.m2/wrapper/dists/$distributionUrlNameMain" +if ($env:MAVEN_USER_HOME) { + $MAVEN_HOME_PARENT = "$env:MAVEN_USER_HOME/wrapper/dists/$distributionUrlNameMain" +} +$MAVEN_HOME_NAME = ([System.Security.Cryptography.MD5]::Create().ComputeHash([byte[]][char[]]$distributionUrl) | ForEach-Object {$_.ToString("x2")}) -join '' +$MAVEN_HOME = "$MAVEN_HOME_PARENT/$MAVEN_HOME_NAME" + +if (Test-Path -Path "$MAVEN_HOME" -PathType Container) { + Write-Verbose "found existing MAVEN_HOME at $MAVEN_HOME" + Write-Output "MVN_CMD=$MAVEN_HOME/bin/$MVN_CMD" + exit $? +} + +if (! $distributionUrlNameMain -or ($distributionUrlName -eq $distributionUrlNameMain)) { + Write-Error "distributionUrl is not valid, must end with *-bin.zip, but found $distributionUrl" +} + +# prepare tmp dir +$TMP_DOWNLOAD_DIR_HOLDER = New-TemporaryFile +$TMP_DOWNLOAD_DIR = New-Item -Itemtype Directory -Path "$TMP_DOWNLOAD_DIR_HOLDER.dir" +$TMP_DOWNLOAD_DIR_HOLDER.Delete() | Out-Null +trap { + if ($TMP_DOWNLOAD_DIR.Exists) { + try { Remove-Item $TMP_DOWNLOAD_DIR -Recurse -Force | Out-Null } + catch { Write-Warning "Cannot remove $TMP_DOWNLOAD_DIR" } + } +} + +New-Item -Itemtype Directory -Path "$MAVEN_HOME_PARENT" -Force | Out-Null + +# Download and Install Apache Maven +Write-Verbose "Couldn't find MAVEN_HOME, downloading and installing it ..." +Write-Verbose "Downloading from: $distributionUrl" +Write-Verbose "Downloading to: $TMP_DOWNLOAD_DIR/$distributionUrlName" + +$webclient = New-Object System.Net.WebClient +if ($env:MVNW_USERNAME -and $env:MVNW_PASSWORD) { + $webclient.Credentials = New-Object System.Net.NetworkCredential($env:MVNW_USERNAME, $env:MVNW_PASSWORD) +} +[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 +$webclient.DownloadFile($distributionUrl, "$TMP_DOWNLOAD_DIR/$distributionUrlName") | Out-Null + +# If specified, validate the SHA-256 sum of the Maven distribution zip file +$distributionSha256Sum = (Get-Content -Raw "$scriptDir/.mvn/wrapper/maven-wrapper.properties" | ConvertFrom-StringData).distributionSha256Sum +if ($distributionSha256Sum) { + if ($USE_MVND) { + Write-Error "Checksum validation is not supported for maven-mvnd. `nPlease disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties." + } + Import-Module $PSHOME\Modules\Microsoft.PowerShell.Utility -Function Get-FileHash + if ((Get-FileHash "$TMP_DOWNLOAD_DIR/$distributionUrlName" -Algorithm SHA256).Hash.ToLower() -ne $distributionSha256Sum) { + Write-Error "Error: Failed to validate Maven distribution SHA-256, your Maven distribution might be compromised. If you updated your Maven version, you need to update the specified distributionSha256Sum property." + } +} + +# unzip and move +Expand-Archive "$TMP_DOWNLOAD_DIR/$distributionUrlName" -DestinationPath "$TMP_DOWNLOAD_DIR" | Out-Null +Rename-Item -Path "$TMP_DOWNLOAD_DIR/$distributionUrlNameMain" -NewName $MAVEN_HOME_NAME | Out-Null +try { + Move-Item -Path "$TMP_DOWNLOAD_DIR/$MAVEN_HOME_NAME" -Destination $MAVEN_HOME_PARENT | Out-Null +} catch { + if (! (Test-Path -Path "$MAVEN_HOME" -PathType Container)) { + Write-Error "fail to move MAVEN_HOME" + } +} finally { + try { Remove-Item $TMP_DOWNLOAD_DIR -Recurse -Force | Out-Null } + catch { Write-Warning "Cannot remove $TMP_DOWNLOAD_DIR" } +} + +Write-Output "MVN_CMD=$MAVEN_HOME/bin/$MVN_CMD" diff --git a/update-card-status/pom.xml b/update-card-status/pom.xml new file mode 100644 index 0000000..7f5f958 --- /dev/null +++ b/update-card-status/pom.xml @@ -0,0 +1,275 @@ + + + 4.0.0 + com.banesco + update-card-status + 1.0-native-quarkus-jdk17 + update-card-status + Api Dominio - Cambio de status de TDD + + 17 + 17 + 3.13.0 + 17 + UTF-8 + UTF-8 + quarkus-bom + io.quarkus.platform + 3.19.3 + true + 3.5.2 + com.banesco.UpdateCardStatusApplication + + + + + + ${quarkus.platform.group-id} + ${quarkus.platform.artifact-id} + ${quarkus.platform.version} + pom + import + + + + + + io.quarkus + quarkus-core + + + io.quarkus + quarkus-rest + + + io.quarkus + quarkus-rest-client + + + io.quarkus + quarkus-rest-client-jackson + + + + io.quarkus + quarkus-config-yaml + + + io.quarkus + quarkus-rest-jsonb + + + io.quarkus + quarkus-smallrye-openapi + + + io.quarkus + quarkus-swagger-ui + + + io.quarkus + quarkus-smallrye-health + + + io.quarkiverse.cxf + quarkus-cxf + 3.15.1 + + + jakarta.jws + jakarta.jws-api + 3.0.0 + + + org.apache.cxf + cxf-rt-frontend-jaxws + 4.0.5 + + + org.apache.cxf + cxf-rt-transports-http + 4.0.5 + + + io.quarkus + quarkus-arc + + + io.quarkus + quarkus-junit5 + test + + + io.rest-assured + rest-assured + test + + + + org.projectlombok + lombok + 1.18.34 + provided + + + org.jboss.logmanager + jboss-logmanager + 3.0.6.Final + + + org.jboss.logging + jboss-logging + 3.6.0.Final + + + org.slf4j + slf4j-api + 2.0.13 + + + + + + + + + + org.eclipse.jkube + openshift-maven-plugin + 1.0.0 + + + + + maven-volumen + /root/.m2 + + + + + + + ${quarkus.platform.group-id} + quarkus-maven-plugin + ${quarkus.platform.version} + true + + + + build + generate-code + generate-code-tests + native-image-agent + + + + + + + maven-compiler-plugin + ${compiler-plugin.version} + + true + + + + org.apache.maven.plugins + maven-surefire-plugin + 3.1.2 + + + org.jboss.logmanager.LogManager + ${maven.home} + + + + + maven-failsafe-plugin + 3.0.0-M5 + + + + integration-test + verify + + + + + + ${project.build.directory}/${project.build.finalName}-runner + + org.jboss.logmanager.LogManager + ${maven.home} + + + + + + + + + native + + + native + + + + false + native + true + + + + + src/main/resources + + application-local.yaml + application-dev.yaml + + + + + + + diff --git a/update-card-status/scripts/native/Dockerfile b/update-card-status/scripts/native/Dockerfile new file mode 100644 index 0000000..cca4288 --- /dev/null +++ b/update-card-status/scripts/native/Dockerfile @@ -0,0 +1,31 @@ +#### +# This Dockerfile is used in order to build a container that runs the Quarkus application in native (no JVM) mode. +# It uses a micro base image, tuned for Quarkus native executables. +# It reduces the size of the resulting container image. +# Check https://quarkus.io/guides/quarkus-runtime-base-image for further information about this image. +# +# Before building the container image run: +# +# ./mvnw package -Dnative +# +# Then, build the image with: +# +# docker build -f src/main/docker/Dockerfile.native-micro -t quarkus/api-send-mail . +# +# Then run the container using: +# +# docker run -i --rm -p 8080:8080 quarkus/api-send-mail +# +### +FROM quay.io/quarkus/quarkus-micro-image:2.0 +RUN mkdir -p /work +ENV TZ="America/Caracas" +ENV LANGUAGE='en_US:en' +VOLUME /tmp +COPY /file/*-runner /work/apiP2PPayment +RUN chmod -R 775 /work +RUN ls -ltra /work/ +EXPOSE 8080 +WORKDIR /work/ + +ENTRYPOINT ["./apiP2PPayment", "-Dquarkus.http.host=0.0.0.0"] \ No newline at end of file diff --git a/update-card-status/scripts/native/file/api-p2p-payment-1.0-native-quarkus-jdk17-runner b/update-card-status/scripts/native/file/api-p2p-payment-1.0-native-quarkus-jdk17-runner new file mode 100644 index 0000000..858fdb0 Binary files /dev/null and b/update-card-status/scripts/native/file/api-p2p-payment-1.0-native-quarkus-jdk17-runner differ diff --git a/update-card-status/src/main/docker/Dockerfile.jvm b/update-card-status/src/main/docker/Dockerfile.jvm new file mode 100644 index 0000000..66d3d9a --- /dev/null +++ b/update-card-status/src/main/docker/Dockerfile.jvm @@ -0,0 +1,97 @@ +#### +# This Dockerfile_mvn is used in order to build a container that runs the Quarkus application in JVM mode +# +# Before building the container image run: +# +# ./mvnw package +# +# Then, build the image with: +# +# docker build -f src/main/docker/Dockerfile_mvn.jvm -t quarkus/api-p2p-payment-jvm . +# +# Then run the container using: +# +# docker run -i --rm -p 8080:8080 quarkus/api-p2p-payment-jvm +# +# If you want to include the debug port into your docker image +# you will have to expose the debug port (default 5005 being the default) like this : EXPOSE 8080 5005. +# Additionally you will have to set -e JAVA_DEBUG=true and -e JAVA_DEBUG_PORT=*:5005 +# when running the container +# +# Then run the container using : +# +# docker run -i --rm -p 8080:8080 quarkus/api-p2p-payment-jvm +# +# This image uses the `run-java.sh` script to run the application. +# This scripts computes the command line to execute your Java application, and +# includes memory/GC tuning. +# You can configure the behavior using the following environment properties: +# - JAVA_OPTS: JVM options passed to the `java` command (example: "-verbose:class") +# - JAVA_OPTS_APPEND: User specified Java options to be appended to generated options +# in JAVA_OPTS (example: "-Dsome.property=foo") +# - JAVA_MAX_MEM_RATIO: Is used when no `-Xmx` option is given in JAVA_OPTS. This is +# used to calculate a default maximal heap memory based on a containers restriction. +# If used in a container without any memory constraints for the container then this +# option has no effect. If there is a memory constraint then `-Xmx` is set to a ratio +# of the container available memory as set here. The default is `50` which means 50% +# of the available memory is used as an upper boundary. You can skip this mechanism by +# setting this value to `0` in which case no `-Xmx` option is added. +# - JAVA_INITIAL_MEM_RATIO: Is used when no `-Xms` option is given in JAVA_OPTS. This +# is used to calculate a default initial heap memory based on the maximum heap memory. +# If used in a container without any memory constraints for the container then this +# option has no effect. If there is a memory constraint then `-Xms` is set to a ratio +# of the `-Xmx` memory as set here. The default is `25` which means 25% of the `-Xmx` +# is used as the initial heap size. You can skip this mechanism by setting this value +# to `0` in which case no `-Xms` option is added (example: "25") +# - JAVA_MAX_INITIAL_MEM: Is used when no `-Xms` option is given in JAVA_OPTS. +# This is used to calculate the maximum value of the initial heap memory. If used in +# a container without any memory constraints for the container then this option has +# no effect. If there is a memory constraint then `-Xms` is limited to the value set +# here. The default is 4096MB which means the calculated value of `-Xms` never will +# be greater than 4096MB. The value of this variable is expressed in MB (example: "4096") +# - JAVA_DIAGNOSTICS: Set this to get some diagnostics information to standard output +# when things are happening. This option, if set to true, will set +# `-XX:+UnlockDiagnosticVMOptions`. Disabled by default (example: "true"). +# - JAVA_DEBUG: If set remote debugging will be switched on. Disabled by default (example: +# true"). +# - JAVA_DEBUG_PORT: Port used for remote debugging. Defaults to 5005 (example: "8787"). +# - CONTAINER_CORE_LIMIT: A calculated core limit as described in +# https://www.kernel.org/doc/Documentation/scheduler/sched-bwc.txt. (example: "2") +# - CONTAINER_MAX_MEMORY: Memory limit given to the container (example: "1024"). +# - GC_MIN_HEAP_FREE_RATIO: Minimum percentage of heap free after GC to avoid expansion. +# (example: "20") +# - GC_MAX_HEAP_FREE_RATIO: Maximum percentage of heap free after GC to avoid shrinking. +# (example: "40") +# - GC_TIME_RATIO: Specifies the ratio of the time spent outside the garbage collection. +# (example: "4") +# - GC_ADAPTIVE_SIZE_POLICY_WEIGHT: The weighting given to the current GC time versus +# previous GC times. (example: "90") +# - GC_METASPACE_SIZE: The initial metaspace size. (example: "20") +# - GC_MAX_METASPACE_SIZE: The maximum metaspace size. (example: "100") +# - GC_CONTAINER_OPTIONS: Specify Java GC to use. The value of this variable should +# contain the necessary JRE command-line options to specify the required GC, which +# will override the default of `-XX:+UseParallelGC` (example: -XX:+UseG1GC). +# - HTTPS_PROXY: The location of the https proxy. (example: "myuser@127.0.0.1:8080") +# - HTTP_PROXY: The location of the http proxy. (example: "myuser@127.0.0.1:8080") +# - NO_PROXY: A comma separated lists of hosts, IP addresses or domains that can be +# accessed directly. (example: "foo.example.com,bar.example.com") +# +### +FROM registry.access.redhat.com/ubi8/openjdk-17:1.20 + +ENV LANGUAGE='en_US:en' + + +# We make four distinct layers so if there are application changes the library layers can be re-used +COPY --chown=185 target/quarkus-app/lib/ /deployments/lib/ +COPY --chown=185 target/quarkus-app/*.jar /deployments/ +COPY --chown=185 target/quarkus-app/app/ /deployments/app/ +COPY --chown=185 target/quarkus-app/quarkus/ /deployments/quarkus/ + +EXPOSE 8080 +USER 185 +ENV JAVA_OPTS_APPEND="-Dquarkus.http.host=0.0.0.0 -Djava.util.logging.manager=org.jboss.logmanager.LogManager" +ENV JAVA_APP_JAR="/deployments/quarkus-run.jar" + +ENTRYPOINT [ "/opt/jboss/container/java/run/run-java.sh" ] + diff --git a/update-card-status/src/main/docker/Dockerfile.legacy-jar b/update-card-status/src/main/docker/Dockerfile.legacy-jar new file mode 100644 index 0000000..c1b0498 --- /dev/null +++ b/update-card-status/src/main/docker/Dockerfile.legacy-jar @@ -0,0 +1,93 @@ +#### +# This Dockerfile_mvn is used in order to build a container that runs the Quarkus application in JVM mode +# +# Before building the container image run: +# +# ./mvnw package -Dquarkus.package.jar.type=legacy-jar +# +# Then, build the image with: +# +# docker build -f src/main/docker/Dockerfile_mvn.legacy-jar -t quarkus/api-p2p-payment-legacy-jar . +# +# Then run the container using: +# +# docker run -i --rm -p 8080:8080 quarkus/api-p2p-payment-legacy-jar +# +# If you want to include the debug port into your docker image +# you will have to expose the debug port (default 5005 being the default) like this : EXPOSE 8080 5005. +# Additionally you will have to set -e JAVA_DEBUG=true and -e JAVA_DEBUG_PORT=*:5005 +# when running the container +# +# Then run the container using : +# +# docker run -i --rm -p 8080:8080 quarkus/api-p2p-payment-legacy-jar +# +# This image uses the `run-java.sh` script to run the application. +# This scripts computes the command line to execute your Java application, and +# includes memory/GC tuning. +# You can configure the behavior using the following environment properties: +# - JAVA_OPTS: JVM options passed to the `java` command (example: "-verbose:class") +# - JAVA_OPTS_APPEND: User specified Java options to be appended to generated options +# in JAVA_OPTS (example: "-Dsome.property=foo") +# - JAVA_MAX_MEM_RATIO: Is used when no `-Xmx` option is given in JAVA_OPTS. This is +# used to calculate a default maximal heap memory based on a containers restriction. +# If used in a container without any memory constraints for the container then this +# option has no effect. If there is a memory constraint then `-Xmx` is set to a ratio +# of the container available memory as set here. The default is `50` which means 50% +# of the available memory is used as an upper boundary. You can skip this mechanism by +# setting this value to `0` in which case no `-Xmx` option is added. +# - JAVA_INITIAL_MEM_RATIO: Is used when no `-Xms` option is given in JAVA_OPTS. This +# is used to calculate a default initial heap memory based on the maximum heap memory. +# If used in a container without any memory constraints for the container then this +# option has no effect. If there is a memory constraint then `-Xms` is set to a ratio +# of the `-Xmx` memory as set here. The default is `25` which means 25% of the `-Xmx` +# is used as the initial heap size. You can skip this mechanism by setting this value +# to `0` in which case no `-Xms` option is added (example: "25") +# - JAVA_MAX_INITIAL_MEM: Is used when no `-Xms` option is given in JAVA_OPTS. +# This is used to calculate the maximum value of the initial heap memory. If used in +# a container without any memory constraints for the container then this option has +# no effect. If there is a memory constraint then `-Xms` is limited to the value set +# here. The default is 4096MB which means the calculated value of `-Xms` never will +# be greater than 4096MB. The value of this variable is expressed in MB (example: "4096") +# - JAVA_DIAGNOSTICS: Set this to get some diagnostics information to standard output +# when things are happening. This option, if set to true, will set +# `-XX:+UnlockDiagnosticVMOptions`. Disabled by default (example: "true"). +# - JAVA_DEBUG: If set remote debugging will be switched on. Disabled by default (example: +# true"). +# - JAVA_DEBUG_PORT: Port used for remote debugging. Defaults to 5005 (example: "8787"). +# - CONTAINER_CORE_LIMIT: A calculated core limit as described in +# https://www.kernel.org/doc/Documentation/scheduler/sched-bwc.txt. (example: "2") +# - CONTAINER_MAX_MEMORY: Memory limit given to the container (example: "1024"). +# - GC_MIN_HEAP_FREE_RATIO: Minimum percentage of heap free after GC to avoid expansion. +# (example: "20") +# - GC_MAX_HEAP_FREE_RATIO: Maximum percentage of heap free after GC to avoid shrinking. +# (example: "40") +# - GC_TIME_RATIO: Specifies the ratio of the time spent outside the garbage collection. +# (example: "4") +# - GC_ADAPTIVE_SIZE_POLICY_WEIGHT: The weighting given to the current GC time versus +# previous GC times. (example: "90") +# - GC_METASPACE_SIZE: The initial metaspace size. (example: "20") +# - GC_MAX_METASPACE_SIZE: The maximum metaspace size. (example: "100") +# - GC_CONTAINER_OPTIONS: Specify Java GC to use. The value of this variable should +# contain the necessary JRE command-line options to specify the required GC, which +# will override the default of `-XX:+UseParallelGC` (example: -XX:+UseG1GC). +# - HTTPS_PROXY: The location of the https proxy. (example: "myuser@127.0.0.1:8080") +# - HTTP_PROXY: The location of the http proxy. (example: "myuser@127.0.0.1:8080") +# - NO_PROXY: A comma separated lists of hosts, IP addresses or domains that can be +# accessed directly. (example: "foo.example.com,bar.example.com") +# +### +FROM registry.access.redhat.com/ubi8/openjdk-17:1.20 + +ENV LANGUAGE='en_US:en' + + +COPY target/lib/* /deployments/lib/ +COPY target/*-runner.jar /deployments/quarkus-run.jar + +EXPOSE 8080 +USER 185 +ENV JAVA_OPTS_APPEND="-Dquarkus.http.host=0.0.0.0 -Djava.util.logging.manager=org.jboss.logmanager.LogManager" +ENV JAVA_APP_JAR="/deployments/quarkus-run.jar" + +ENTRYPOINT [ "/opt/jboss/container/java/run/run-java.sh" ] diff --git a/update-card-status/src/main/docker/Dockerfile.native b/update-card-status/src/main/docker/Dockerfile.native new file mode 100644 index 0000000..0ef182b --- /dev/null +++ b/update-card-status/src/main/docker/Dockerfile.native @@ -0,0 +1,29 @@ +#### +# This Dockerfile_mvn is used in order to build a container that runs the Quarkus application in native (no JVM) mode. +# +# Before building the container image run: +# +# ./mvnw package -Dnative +# +# Then, build the image with: +# +# docker build -f src/main/docker/Dockerfile_mvn.native -t quarkus/api-p2p-payment . +# +# Then run the container using: +# +# docker run -i --rm -p 8080:8080 quarkus/api-p2p-payment +# +### +FROM registry.access.redhat.com/ubi8/ubi-minimal:8.10 +WORKDIR /work/ +RUN ls -ltra /work +RUN ls -ltra target/ +RUN chown 1001 /work \ + && chmod "g+rwX" /work \ + && chown 1001:root /work +COPY --chown=1001:root target/*-runner /work/application + +EXPOSE 8080 +USER 1001 + +ENTRYPOINT ["./application", "-Dquarkus.http.host=0.0.0.0"] diff --git a/update-card-status/src/main/docker/Dockerfile.native-micro b/update-card-status/src/main/docker/Dockerfile.native-micro new file mode 100644 index 0000000..e364359 --- /dev/null +++ b/update-card-status/src/main/docker/Dockerfile.native-micro @@ -0,0 +1,30 @@ +#### +# This Dockerfile_mvn is used in order to build a container that runs the Quarkus application in native (no JVM) mode. +# It uses a micro base image, tuned for Quarkus native executables. +# It reduces the size of the resulting container image. +# Check https://quarkus.io/guides/quarkus-runtime-base-image for further information about this image. +# +# Before building the container image run: +# +# ./mvnw package -Dnative +# +# Then, build the image with: +# +# docker build -f src/main/docker/Dockerfile_mvn.native-micro -t quarkus/api-p2p-payment . +# +# Then run the container using: +# +# docker run -i --rm -p 8080:8080 quarkus/api-p2p-payment +# +### +FROM quay.io/quarkus/quarkus-micro-image:2.0 +WORKDIR /work/ +RUN chown 1001 /work \ + && chmod "g+rwX" /work \ + && chown 1001:root /work +COPY --chown=1001:root target/*-runner /work/application + +EXPOSE 8080 +USER 1001 + +ENTRYPOINT ["./application", "-Dquarkus.http.host=0.0.0.0"] diff --git a/update-card-status/src/main/java/com/banesco/UpdateCardStatusApplication.java b/update-card-status/src/main/java/com/banesco/UpdateCardStatusApplication.java new file mode 100644 index 0000000..436deed --- /dev/null +++ b/update-card-status/src/main/java/com/banesco/UpdateCardStatusApplication.java @@ -0,0 +1,13 @@ +package com.banesco; + +import io.quarkus.runtime.Quarkus; +import io.quarkus.runtime.annotations.QuarkusMain; + +@QuarkusMain +public class UpdateCardStatusApplication { + + public static void main(String[] args){ + System.out.println("Starting Domain API update card status..........."); + Quarkus.run(); + } +} \ No newline at end of file diff --git a/update-card-status/src/main/java/com/banesco/application/UpdateCardStatusRequest.java b/update-card-status/src/main/java/com/banesco/application/UpdateCardStatusRequest.java new file mode 100644 index 0000000..9de382c --- /dev/null +++ b/update-card-status/src/main/java/com/banesco/application/UpdateCardStatusRequest.java @@ -0,0 +1,23 @@ +package com.banesco.application; + + +import com.banesco.commons.soap.client.apipaymentoutappsvc.MsgRqHdr; +import com.banesco.domain.models.CardReference; +import com.banesco.domain.models.CustomerReference; +import io.quarkus.runtime.annotations.RegisterForReflection; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +@RegisterForReflection +@Data +@AllArgsConstructor +@NoArgsConstructor +public class UpdateCardStatusRequest { + + private MsgRqHdr msgRqHdr; + private CustomerReference customerReference; + private CardReference cardReference; + private String domain; + +} diff --git a/update-card-status/src/main/java/com/banesco/application/rest/controllers/UpdateCardController.java b/update-card-status/src/main/java/com/banesco/application/rest/controllers/UpdateCardController.java new file mode 100644 index 0000000..650c8c6 --- /dev/null +++ b/update-card-status/src/main/java/com/banesco/application/rest/controllers/UpdateCardController.java @@ -0,0 +1,64 @@ +package com.banesco.application.rest.controllers; + +import com.banesco.application.UpdateCardStatusRequest; +import com.banesco.commons.config.AppConf; +import com.banesco.commons.soap.client.apipaymentoutappsvc.AdditionalStatus; +import com.banesco.commons.soap.client.apipaymentoutappsvc.PayGenerateRs; +import com.banesco.domain.ports.inbound.UpdateCardStatusUseCase; +import jakarta.inject.Inject; +import jakarta.ws.rs.Consumes; +import jakarta.ws.rs.PUT; +import jakarta.ws.rs.Path; +import jakarta.ws.rs.Produces; +import jakarta.ws.rs.core.MediaType; +import jakarta.ws.rs.core.Response; +import lombok.extern.slf4j.Slf4j; +import org.eclipse.microprofile.openapi.annotations.Operation; +import org.eclipse.microprofile.openapi.annotations.tags.Tag; + + +@Tag(name = "API Dominio - Actualización de Estatus de Tarjetas") +@Path("/card/status/update") +@Consumes(MediaType.APPLICATION_JSON) +@Produces(MediaType.APPLICATION_JSON) +@Slf4j +public class UpdateCardController { + + + private final UpdateCardStatusUseCase updateCardStatusUseCase; + + private final AppConf appConf; + + @Inject + public UpdateCardController(AppConf appConf, + UpdateCardStatusUseCase updateCardStatusUseCase) { + this.appConf = appConf; + this.updateCardStatusUseCase = updateCardStatusUseCase; + } + + + @PUT() + @Operation(summary = "updateStatus", description = "Cambio de estatus de tarjeta") + public Response updateStatus( + UpdateCardStatusRequest request + ) { + + log.info("[RQ]: {}", appConf.getJsonHelper().getJsonFromObject(request)); + PayGenerateRs response = updateCardStatusUseCase.executeUpdate(request); + + if (response != null && response.getStatus() != null && response.getStatus().getStatusCode() != null) { + if (!response.getStatus().getStatusCode().equals("000")) { + AdditionalStatus additionalStatus = new AdditionalStatus(); + additionalStatus.setStatusCode(response.getStatus().getStatusCode()); + additionalStatus.setStatusDesc(response.getStatus().getStatusDesc()); + response.getStatus().getAdditionalStatus().add(additionalStatus); + } + } + log.info("[RS]: {}", appConf.getJsonHelper().getJsonFromObject(response)); + return Response.ok().entity(response).build(); + } + + +} + + diff --git a/update-card-status/src/main/java/com/banesco/commons/config/AppConf.java b/update-card-status/src/main/java/com/banesco/commons/config/AppConf.java new file mode 100644 index 0000000..0aa8aac --- /dev/null +++ b/update-card-status/src/main/java/com/banesco/commons/config/AppConf.java @@ -0,0 +1,17 @@ +package com.banesco.commons.config; + + +import com.banesco.commons.helper.JsonHelper; +import jakarta.inject.Singleton; +import lombok.extern.slf4j.Slf4j; + +@Slf4j +@Singleton +public class AppConf extends BaseAppConfig { + + public AppConf() { + super(new JsonHelper()); + log.info("AppConf Constructor****"); + } + +} diff --git a/update-card-status/src/main/java/com/banesco/commons/config/BaseAppConfig.java b/update-card-status/src/main/java/com/banesco/commons/config/BaseAppConfig.java new file mode 100644 index 0000000..43bda2e --- /dev/null +++ b/update-card-status/src/main/java/com/banesco/commons/config/BaseAppConfig.java @@ -0,0 +1,71 @@ +package com.banesco.commons.config; + +import com.banesco.commons.exceptions.BanRuntimeException; +import com.banesco.commons.helper.JsonHelper; +import com.banesco.commons.model.SoapEndpoint; +import lombok.Getter; +import lombok.extern.slf4j.Slf4j; +import org.eclipse.microprofile.config.Config; +import org.eclipse.microprofile.config.ConfigProvider; +import org.eclipse.microprofile.config.inject.ConfigProperty; + +import java.util.HashMap; +import java.util.Map; + +/** + * Define Base Configurations to Load resources required to invoke Banesco Soap Service + */ +@Slf4j +public class BaseAppConfig { + + + public final Map SOAP_DOMAINS = new HashMap<>(); + + @ConfigProperty(name = "soap.domain.current") + public String SOAP_CURRENT_DOMAIN; + + @Getter + protected JsonHelper jsonHelper; + + @Getter + protected Config env; + + public BaseAppConfig(JsonHelper jsonHelper) { + this.jsonHelper = jsonHelper; + this.env = ConfigProvider.getConfig(); + } + + + public SoapEndpoint loadSoapClientConfig(String soapClientName) { + + String soapConfig = env.getValue(soapClientName, String.class); + log.info("Loading SoapConfig:{} -> {}", soapClientName, soapConfig); + if (soapConfig == null) { + throw new BanRuntimeException("SOAP01", "SoapConfig is empty"); + } + return jsonHelper.getObjectFromJson(soapConfig, SoapEndpoint.class); + } + + /** + * Allow to get Soap UrlBase to request domainKey + * Required: env property 'soap.domain.' defined as http:// + * + * @param domainKey String + * @return + */ + + public String getDomainConfig(String domainKey) { + + String domain = SOAP_DOMAINS.get(domainKey); + if (domain == null) { + domain = env.getValue("soap.domains.".concat(domainKey), String.class); + log.info("Loading Domain:{} -> {}", domainKey, domain); + if (domain == null) { + throw new BanRuntimeException("CONF01", "domain invalid or bad configured: %s".formatted(domainKey)); + } + SOAP_DOMAINS.put(domainKey, domain); + } + return domain; + } + +} diff --git a/update-card-status/src/main/java/com/banesco/commons/config/StatusCodes.java b/update-card-status/src/main/java/com/banesco/commons/config/StatusCodes.java new file mode 100644 index 0000000..db33164 --- /dev/null +++ b/update-card-status/src/main/java/com/banesco/commons/config/StatusCodes.java @@ -0,0 +1,26 @@ +package com.banesco.commons.config; + + +import lombok.Getter; + +/** + * Clase para definir Status de Respuesta. + */ +@Getter +public enum StatusCodes { + + SUCCESS_OPERATION("OK", "Operación exitosa"), + FIELD_REQUIRED("VDE01", "Error campo requerido: %s"), + FAILED_NOTIFICATION("401", "No se pudo enviar la notificacion"), + INTERNAL_ERROR("500", "Error Interno"), + FAILED_DEPENDENCY("424", "Falla de dependencia SOAP"); + + private String statusCode; + private String statusDesc; + + StatusCodes(String statusCode, String statusDesc) { + this.statusCode = statusCode; + this.statusDesc = statusDesc; + } + +} diff --git a/update-card-status/src/main/java/com/banesco/commons/exceptions/BanRuntimeException.java b/update-card-status/src/main/java/com/banesco/commons/exceptions/BanRuntimeException.java new file mode 100644 index 0000000..0899eec --- /dev/null +++ b/update-card-status/src/main/java/com/banesco/commons/exceptions/BanRuntimeException.java @@ -0,0 +1,24 @@ +package com.banesco.commons.exceptions; + + +import com.banesco.commons.config.StatusCodes; +import lombok.Getter; + +@Getter +public class BanRuntimeException extends RuntimeException { + + protected String backCode; + protected String backDesc; + + public BanRuntimeException(String backCode, String backDesc) { + super(backDesc); + this.backCode = backCode; + this.backDesc = backDesc; + } + + public BanRuntimeException(StatusCodes statusCodes, String target) { + super(statusCodes.getStatusDesc().formatted(target)); + this.backCode = statusCodes.getStatusCode(); + this.backDesc = statusCodes.getStatusDesc().formatted(target); + } +} diff --git a/update-card-status/src/main/java/com/banesco/commons/helper/JsonHelper.java b/update-card-status/src/main/java/com/banesco/commons/helper/JsonHelper.java new file mode 100644 index 0000000..794e88f --- /dev/null +++ b/update-card-status/src/main/java/com/banesco/commons/helper/JsonHelper.java @@ -0,0 +1,42 @@ +package com.banesco.commons.helper; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.DeserializationFeature; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.SerializationFeature; +import io.quarkus.runtime.util.StringUtil; +import jakarta.enterprise.context.ApplicationScoped; +import lombok.extern.slf4j.Slf4j; + +@Slf4j +@ApplicationScoped +public class JsonHelper { + public static final ObjectMapper MAPPER = new ObjectMapper(); + + public JsonHelper() { + MAPPER.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false); + MAPPER.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); + } + + + public String getJsonFromObject(Object object) { + try { + return MAPPER.writeValueAsString(object); + } catch (JsonProcessingException e) { + log.error("Object To Json Exception: {}", e.getMessage()); + } + return null; + } + + + public T getObjectFromJson(String json, Class className) { + if (!StringUtil.isNullOrEmpty(json)) { + try { + return MAPPER.readValue(json, className); + } catch (JsonProcessingException | IllegalArgumentException e) { + log.error("JSON to Object Exception: {}", e.getMessage()); + } + } + return null; + } +} diff --git a/update-card-status/src/main/java/com/banesco/commons/helper/XMLHelper.java b/update-card-status/src/main/java/com/banesco/commons/helper/XMLHelper.java new file mode 100644 index 0000000..8d608ec --- /dev/null +++ b/update-card-status/src/main/java/com/banesco/commons/helper/XMLHelper.java @@ -0,0 +1,47 @@ +package com.banesco.commons.helper; + +import io.quarkus.runtime.annotations.RegisterForReflection; +import jakarta.xml.bind.JAXBContext; +import jakarta.xml.bind.JAXBElement; +import jakarta.xml.bind.JAXBException; +import jakarta.xml.bind.Marshaller; +import lombok.extern.slf4j.Slf4j; + +import java.io.OutputStream; +import java.util.Objects; + + +@RegisterForReflection +@Slf4j +public class XMLHelper { + + public static String buildXml(JAXBElement element) { + try { + + + JAXBContext ctx = JAXBContext.newInstance(element.getDeclaredType()); + Marshaller marshaller = ctx.createMarshaller(); + marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE); + + OutputStream output = new OutputStream() { + private final StringBuilder string = new StringBuilder(); + + @Override + public void write(int b) { + this.string.append((char) b); + } + + public String toString() { + return this.string.toString(); + } + }; + + marshaller.marshal(element, output); + + return Objects.requireNonNull(output).toString(); + } catch (JAXBException e) { + log.warn(e.getMessage()); + } + return null; + } +} diff --git a/update-card-status/src/main/java/com/banesco/commons/model/SoapEndpoint.java b/update-card-status/src/main/java/com/banesco/commons/model/SoapEndpoint.java new file mode 100644 index 0000000..46b8884 --- /dev/null +++ b/update-card-status/src/main/java/com/banesco/commons/model/SoapEndpoint.java @@ -0,0 +1,31 @@ +package com.banesco.commons.model; + +import io.quarkus.runtime.annotations.RegisterForReflection; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@AllArgsConstructor +@NoArgsConstructor +@RegisterForReflection +public class SoapEndpoint { + + private String domain; + private String path; + private String soapAction; + + private Timeout timeout; + + @Data + @AllArgsConstructor + @NoArgsConstructor + public static class Timeout { + private int connect = 15000; + private int response = 15000; + } + + public String getUrl(String domain) { + return domain.concat(path); + } +} \ No newline at end of file diff --git a/update-card-status/src/main/java/com/banesco/commons/soap/client/apipaymentoutappsvc/APIPaymentOutAppSvc.java b/update-card-status/src/main/java/com/banesco/commons/soap/client/apipaymentoutappsvc/APIPaymentOutAppSvc.java new file mode 100644 index 0000000..6e954c8 --- /dev/null +++ b/update-card-status/src/main/java/com/banesco/commons/soap/client/apipaymentoutappsvc/APIPaymentOutAppSvc.java @@ -0,0 +1,36 @@ +package com.banesco.commons.soap.client.apipaymentoutappsvc; + +import jakarta.jws.WebMethod; +import jakarta.jws.WebParam; +import jakarta.jws.WebResult; +import jakarta.jws.WebService; +import jakarta.jws.soap.SOAPBinding; +import jakarta.xml.bind.annotation.XmlSeeAlso; + +/** + * This class was generated by Apache CXF 4.0.5 + * 2025-03-13T16:16:36.967-04:00 + * Generated source version: 4.0.5 + * + */ +@WebService(targetNamespace = "http://xmlns.banesco.com/ApplicationService/APIPaymentOutAppSvc", name = "APIPaymentOutAppSvc") +@XmlSeeAlso({ObjectFactory.class}) +@SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE) +public interface APIPaymentOutAppSvc { + + @WebMethod(action = "payGenerate") + @WebResult(name = "payGenerate_Rs", targetNamespace = "http://xmlns.banesco.com/ApplicationService/APIPaymentOutAppSvc", partName = "payGenerate_Rs") + public PayGenerateRs payGenerate( + + @WebParam(partName = "payGenerate_Rq", name = "payGenerate_Rq", targetNamespace = "http://xmlns.banesco.com/ApplicationService/APIPaymentOutAppSvc") + PayGenerateRq payGenerateRq + ); + + @WebMethod(action = "readPayment") + @WebResult(name = "readPayment_Rs", targetNamespace = "http://xmlns.banesco.com/ApplicationService/APIPaymentOutAppSvc", partName = "readPayment_Rs") + public ReadPaymentRs readPayment( + + @WebParam(partName = "readPayment_Rq", name = "readPayment_Rq", targetNamespace = "http://xmlns.banesco.com/ApplicationService/APIPaymentOutAppSvc") + ReadPaymentRq readPaymentRq + ); +} diff --git a/update-card-status/src/main/java/com/banesco/commons/soap/client/apipaymentoutappsvc/APIPaymentOutAppSvcSOAPQSService.java b/update-card-status/src/main/java/com/banesco/commons/soap/client/apipaymentoutappsvc/APIPaymentOutAppSvcSOAPQSService.java new file mode 100644 index 0000000..4eb7108 --- /dev/null +++ b/update-card-status/src/main/java/com/banesco/commons/soap/client/apipaymentoutappsvc/APIPaymentOutAppSvcSOAPQSService.java @@ -0,0 +1,91 @@ +package com.banesco.commons.soap.client.apipaymentoutappsvc; + +import jakarta.xml.ws.Service; +import jakarta.xml.ws.WebEndpoint; +import jakarta.xml.ws.WebServiceClient; +import jakarta.xml.ws.WebServiceFeature; + +import javax.xml.namespace.QName; +import java.net.MalformedURLException; +import java.net.URI; +import java.net.URL; + +/** + * OSB Service + * + * This class was generated by Apache CXF 4.0.5 + * 2025-03-13T16:16:36.994-04:00 + * Generated source version: 4.0.5 + * + */ +@WebServiceClient(name = "APIPaymentOutAppSvcSOAPQSService", + wsdlLocation = "http://10.135.5.29:8001/APIPaymentOutAppSvc/proxy/APIPaymentOutAppSvc?wsdl", + targetNamespace = "http://xmlns.banesco.com/ApplicationService/APIPaymentOutAppSvc") +public class APIPaymentOutAppSvcSOAPQSService extends Service { + + public static final URL WSDL_LOCATION; + + public static final QName SERVICE = new QName("http://xmlns.banesco.com/ApplicationService/APIPaymentOutAppSvc", "APIPaymentOutAppSvcSOAPQSService"); + public static final QName APIPaymentOutAppSvcSOAPQSPort = new QName("http://xmlns.banesco.com/ApplicationService/APIPaymentOutAppSvc", "APIPaymentOutAppSvcSOAPQSPort"); + static { + URL url = null; + try { + url = URI.create("http://10.135.5.29:8001/APIPaymentOutAppSvc/proxy/APIPaymentOutAppSvc?wsdl").toURL(); + } catch (MalformedURLException e) { + java.util.logging.Logger.getLogger(APIPaymentOutAppSvcSOAPQSService.class.getName()) + .log(java.util.logging.Level.INFO, + "Can not initialize the default wsdl from {0}", "http://10.135.5.29:8001/APIPaymentOutAppSvc/proxy/APIPaymentOutAppSvc?wsdl"); + } + WSDL_LOCATION = url; + } + + public APIPaymentOutAppSvcSOAPQSService(URL wsdlLocation) { + super(wsdlLocation, SERVICE); + } + + public APIPaymentOutAppSvcSOAPQSService(URL wsdlLocation, QName serviceName) { + super(wsdlLocation, serviceName); + } + + public APIPaymentOutAppSvcSOAPQSService() { + super(WSDL_LOCATION, SERVICE); + } + + public APIPaymentOutAppSvcSOAPQSService(WebServiceFeature ... features) { + super(WSDL_LOCATION, SERVICE, features); + } + + public APIPaymentOutAppSvcSOAPQSService(URL wsdlLocation, WebServiceFeature ... features) { + super(wsdlLocation, SERVICE, features); + } + + public APIPaymentOutAppSvcSOAPQSService(URL wsdlLocation, QName serviceName, WebServiceFeature ... features) { + super(wsdlLocation, serviceName, features); + } + + + + + /** + * + * @return + * returns APIPaymentOutAppSvc + */ + @WebEndpoint(name = "APIPaymentOutAppSvcSOAPQSPort") + public APIPaymentOutAppSvc getAPIPaymentOutAppSvcSOAPQSPort() { + return super.getPort(APIPaymentOutAppSvcSOAPQSPort, APIPaymentOutAppSvc.class); + } + + /** + * + * @param features + * A list of {@link jakarta.xml.ws.WebServiceFeature} to configure on the proxy. Supported features not in the features parameter will have their default values. + * @return + * returns APIPaymentOutAppSvc + */ + @WebEndpoint(name = "APIPaymentOutAppSvcSOAPQSPort") + public APIPaymentOutAppSvc getAPIPaymentOutAppSvcSOAPQSPort(WebServiceFeature... features) { + return super.getPort(APIPaymentOutAppSvcSOAPQSPort, APIPaymentOutAppSvc.class, features); + } + +} diff --git a/update-card-status/src/main/java/com/banesco/commons/soap/client/apipaymentoutappsvc/APIPaymentOutAppSvc_APIPaymentOutAppSvcSOAPQSPort_Client.java b/update-card-status/src/main/java/com/banesco/commons/soap/client/apipaymentoutappsvc/APIPaymentOutAppSvc_APIPaymentOutAppSvcSOAPQSPort_Client.java new file mode 100644 index 0000000..81fecb3 --- /dev/null +++ b/update-card-status/src/main/java/com/banesco/commons/soap/client/apipaymentoutappsvc/APIPaymentOutAppSvc_APIPaymentOutAppSvcSOAPQSPort_Client.java @@ -0,0 +1,65 @@ + +package com.banesco.commons.soap.client.apipaymentoutappsvc; + +/** + * Please modify this class to meet your needs + * This class is not complete + */ + +import javax.xml.namespace.QName; +import java.io.File; +import java.net.MalformedURLException; +import java.net.URL; + +/** + * This class was generated by Apache CXF 4.0.5 + * 2025-03-13T16:16:36.775-04:00 + * Generated source version: 4.0.5 + * + */ +public final class APIPaymentOutAppSvc_APIPaymentOutAppSvcSOAPQSPort_Client { + + private static final QName SERVICE_NAME = new QName("http://xmlns.banesco.com/ApplicationService/APIPaymentOutAppSvc", "APIPaymentOutAppSvcSOAPQSService"); + + private APIPaymentOutAppSvc_APIPaymentOutAppSvcSOAPQSPort_Client() { + } + + public static void main(String args[]) throws java.lang.Exception { + URL wsdlURL = APIPaymentOutAppSvcSOAPQSService.WSDL_LOCATION; + if (args.length > 0 && args[0] != null && !"".equals(args[0])) { + File wsdlFile = new File(args[0]); + try { + if (wsdlFile.exists()) { + wsdlURL = wsdlFile.toURI().toURL(); + } else { + wsdlURL = new URL(args[0]); + } + } catch (MalformedURLException e) { + e.printStackTrace(); + } + } + + APIPaymentOutAppSvcSOAPQSService ss = new APIPaymentOutAppSvcSOAPQSService(wsdlURL, SERVICE_NAME); + APIPaymentOutAppSvc port = ss.getAPIPaymentOutAppSvcSOAPQSPort(); + + { + System.out.println("Invoking payGenerate..."); + com.banesco.commons.soap.client.apipaymentoutappsvc.PayGenerateRq _payGenerate_payGenerateRq = null; + com.banesco.commons.soap.client.apipaymentoutappsvc.PayGenerateRs _payGenerate__return = port.payGenerate(_payGenerate_payGenerateRq); + System.out.println("payGenerate.result=" + _payGenerate__return); + + + } + { + System.out.println("Invoking readPayment..."); + com.banesco.commons.soap.client.apipaymentoutappsvc.ReadPaymentRq _readPayment_readPaymentRq = null; + com.banesco.commons.soap.client.apipaymentoutappsvc.ReadPaymentRs _readPayment__return = port.readPayment(_readPayment_readPaymentRq); + System.out.println("readPayment.result=" + _readPayment__return); + + + } + + System.exit(0); + } + +} diff --git a/update-card-status/src/main/java/com/banesco/commons/soap/client/apipaymentoutappsvc/AdditionalStatus.java b/update-card-status/src/main/java/com/banesco/commons/soap/client/apipaymentoutappsvc/AdditionalStatus.java new file mode 100644 index 0000000..4d9507e --- /dev/null +++ b/update-card-status/src/main/java/com/banesco/commons/soap/client/apipaymentoutappsvc/AdditionalStatus.java @@ -0,0 +1,202 @@ + +package com.banesco.commons.soap.client.apipaymentoutappsvc; + +import jakarta.xml.bind.annotation.XmlAccessType; +import jakarta.xml.bind.annotation.XmlAccessorType; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlType; + + +/** + *

Java class for AdditionalStatus complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="AdditionalStatus">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="StatusType" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="StatusCode" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="StatusDesc" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="ValidationType" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="Severity" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="LineNumber" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "AdditionalStatus", namespace = "http://xmlns.banesco.com/EnterpriseObjects/Status", propOrder = { + "statusType", + "statusCode", + "statusDesc", + "validationType", + "severity", + "lineNumber" +}) +public class AdditionalStatus { + + @XmlElement(name = "StatusType") + protected String statusType; + @XmlElement(name = "StatusCode") + protected String statusCode; + @XmlElement(name = "StatusDesc") + protected String statusDesc; + @XmlElement(name = "ValidationType") + protected String validationType; + @XmlElement(name = "Severity") + protected String severity; + @XmlElement(name = "LineNumber") + protected String lineNumber; + + /** + * Gets the value of the statusType property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getStatusType() { + return statusType; + } + + /** + * Sets the value of the statusType property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setStatusType(String value) { + this.statusType = value; + } + + /** + * Gets the value of the statusCode property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getStatusCode() { + return statusCode; + } + + /** + * Sets the value of the statusCode property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setStatusCode(String value) { + this.statusCode = value; + } + + /** + * Gets the value of the statusDesc property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getStatusDesc() { + return statusDesc; + } + + /** + * Sets the value of the statusDesc property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setStatusDesc(String value) { + this.statusDesc = value; + } + + /** + * Gets the value of the validationType property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getValidationType() { + return validationType; + } + + /** + * Sets the value of the validationType property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setValidationType(String value) { + this.validationType = value; + } + + /** + * Gets the value of the severity property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getSeverity() { + return severity; + } + + /** + * Sets the value of the severity property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setSeverity(String value) { + this.severity = value; + } + + /** + * Gets the value of the lineNumber property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getLineNumber() { + return lineNumber; + } + + /** + * Sets the value of the lineNumber property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setLineNumber(String value) { + this.lineNumber = value; + } + +} diff --git a/update-card-status/src/main/java/com/banesco/commons/soap/client/apipaymentoutappsvc/ApplicantData.java b/update-card-status/src/main/java/com/banesco/commons/soap/client/apipaymentoutappsvc/ApplicantData.java new file mode 100644 index 0000000..40defa6 --- /dev/null +++ b/update-card-status/src/main/java/com/banesco/commons/soap/client/apipaymentoutappsvc/ApplicantData.java @@ -0,0 +1,342 @@ + +package com.banesco.commons.soap.client.apipaymentoutappsvc; + +import jakarta.xml.bind.annotation.XmlAccessType; +import jakarta.xml.bind.annotation.XmlAccessorType; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlType; + + +/** + *

Java class for ApplicantData complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="ApplicantData">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="EnterpriseCode" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="PrivateChannelId" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="IpAddress" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="HostName" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="StadisticId" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="Application" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="Nationality" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="IdDocument" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="RolType" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="PlanCode" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="Channel" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "ApplicantData", propOrder = { + "enterpriseCode", + "privateChannelId", + "ipAddress", + "hostName", + "stadisticId", + "application", + "nationality", + "idDocument", + "rolType", + "planCode", + "channel" +}) +public class ApplicantData { + + @XmlElement(name = "EnterpriseCode") + protected String enterpriseCode; + @XmlElement(name = "PrivateChannelId") + protected String privateChannelId; + @XmlElement(name = "IpAddress") + protected String ipAddress; + @XmlElement(name = "HostName") + protected String hostName; + @XmlElement(name = "StadisticId") + protected String stadisticId; + @XmlElement(name = "Application") + protected String application; + @XmlElement(name = "Nationality") + protected String nationality; + @XmlElement(name = "IdDocument") + protected String idDocument; + @XmlElement(name = "RolType") + protected String rolType; + @XmlElement(name = "PlanCode") + protected String planCode; + @XmlElement(name = "Channel") + protected String channel; + + /** + * Gets the value of the enterpriseCode property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getEnterpriseCode() { + return enterpriseCode; + } + + /** + * Sets the value of the enterpriseCode property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setEnterpriseCode(String value) { + this.enterpriseCode = value; + } + + /** + * Gets the value of the privateChannelId property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getPrivateChannelId() { + return privateChannelId; + } + + /** + * Sets the value of the privateChannelId property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setPrivateChannelId(String value) { + this.privateChannelId = value; + } + + /** + * Gets the value of the ipAddress property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getIpAddress() { + return ipAddress; + } + + /** + * Sets the value of the ipAddress property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setIpAddress(String value) { + this.ipAddress = value; + } + + /** + * Gets the value of the hostName property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getHostName() { + return hostName; + } + + /** + * Sets the value of the hostName property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setHostName(String value) { + this.hostName = value; + } + + /** + * Gets the value of the stadisticId property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getStadisticId() { + return stadisticId; + } + + /** + * Sets the value of the stadisticId property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setStadisticId(String value) { + this.stadisticId = value; + } + + /** + * Gets the value of the application property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getApplication() { + return application; + } + + /** + * Sets the value of the application property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setApplication(String value) { + this.application = value; + } + + /** + * Gets the value of the nationality property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getNationality() { + return nationality; + } + + /** + * Sets the value of the nationality property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setNationality(String value) { + this.nationality = value; + } + + /** + * Gets the value of the idDocument property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getIdDocument() { + return idDocument; + } + + /** + * Sets the value of the idDocument property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setIdDocument(String value) { + this.idDocument = value; + } + + /** + * Gets the value of the rolType property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getRolType() { + return rolType; + } + + /** + * Sets the value of the rolType property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setRolType(String value) { + this.rolType = value; + } + + /** + * Gets the value of the planCode property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getPlanCode() { + return planCode; + } + + /** + * Sets the value of the planCode property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setPlanCode(String value) { + this.planCode = value; + } + + /** + * Gets the value of the channel property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getChannel() { + return channel; + } + + /** + * Sets the value of the channel property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setChannel(String value) { + this.channel = value; + } + +} diff --git a/update-card-status/src/main/java/com/banesco/commons/soap/client/apipaymentoutappsvc/MsgRqHdr.java b/update-card-status/src/main/java/com/banesco/commons/soap/client/apipaymentoutappsvc/MsgRqHdr.java new file mode 100644 index 0000000..e95b383 --- /dev/null +++ b/update-card-status/src/main/java/com/banesco/commons/soap/client/apipaymentoutappsvc/MsgRqHdr.java @@ -0,0 +1,590 @@ + +package com.banesco.commons.soap.client.apipaymentoutappsvc; + +import jakarta.xml.bind.annotation.XmlAccessType; +import jakarta.xml.bind.annotation.XmlAccessorType; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlType; + +import java.util.ArrayList; +import java.util.List; + + +/** + *

Java class for MsgRqHdr complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="MsgRqHdr">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="MessageDate" type="{http://xmlns.banesco.com/EnterpriseObjects/MsgRqHdr}datePattern" minOccurs="0"/>
+ *         <element name="MessageTime" type="{http://xmlns.banesco.com/EnterpriseObjects/MsgRqHdr}timePattern" minOccurs="0"/>
+ *         <element name="RequestId" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="LastStatusRequest" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="FinalStatusRequest" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="ResumeId" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="ReverseId" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="LineId" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="SourceChannelCode" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="SupervisorCode" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="OperatorCode" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="RequestedOperationType" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="NetworkTrnInfo" type="{http://xmlns.banesco.com/EnterpriseObjects/MsgRqHdr}NetworkTrnInfo" maxOccurs="unbounded" minOccurs="0"/>
+ *         <element name="ApplicantData" type="{http://xmlns.banesco.com/EnterpriseObjects/MsgRqHdr}ApplicantData" minOccurs="0"/>
+ *         <element name="RecCtrlIn" type="{http://xmlns.banesco.com/EnterpriseObjects/MsgRqHdr}RecCtrlIn" minOccurs="0"/>
+ *         <element name="ReturnValue" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="MessageId" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="Priority" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="VBProtocol" type="{http://xmlns.banesco.com/EnterpriseObjects/MsgRqHdr}VBProtocol" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "MsgRqHdr", propOrder = { + "messageDate", + "messageTime", + "requestId", + "lastStatusRequest", + "finalStatusRequest", + "resumeId", + "reverseId", + "lineId", + "sourceChannelCode", + "supervisorCode", + "operatorCode", + "requestedOperationType", + "networkTrnInfo", + "applicantData", + "recCtrlIn", + "returnValue", + "messageId", + "priority", + "vbProtocol" +}) +public class MsgRqHdr { + + @XmlElement(name = "MessageDate") + protected String messageDate; + @XmlElement(name = "MessageTime") + protected String messageTime; + @XmlElement(name = "RequestId") + protected String requestId; + @XmlElement(name = "LastStatusRequest") + protected String lastStatusRequest; + @XmlElement(name = "FinalStatusRequest") + protected String finalStatusRequest; + @XmlElement(name = "ResumeId") + protected String resumeId; + @XmlElement(name = "ReverseId") + protected String reverseId; + @XmlElement(name = "LineId") + protected String lineId; + @XmlElement(name = "SourceChannelCode") + protected String sourceChannelCode; + @XmlElement(name = "SupervisorCode") + protected String supervisorCode; + @XmlElement(name = "OperatorCode") + protected String operatorCode; + @XmlElement(name = "RequestedOperationType") + protected String requestedOperationType; + @XmlElement(name = "NetworkTrnInfo") + protected List networkTrnInfo; + @XmlElement(name = "ApplicantData") + protected ApplicantData applicantData; + @XmlElement(name = "RecCtrlIn") + protected RecCtrlIn recCtrlIn; + @XmlElement(name = "ReturnValue") + protected String returnValue; + @XmlElement(name = "MessageId") + protected String messageId; + @XmlElement(name = "Priority") + protected String priority; + @XmlElement(name = "VBProtocol") + protected VBProtocol vbProtocol; + + /** + * Gets the value of the messageDate property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getMessageDate() { + return messageDate; + } + + /** + * Sets the value of the messageDate property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setMessageDate(String value) { + this.messageDate = value; + } + + /** + * Gets the value of the messageTime property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getMessageTime() { + return messageTime; + } + + /** + * Sets the value of the messageTime property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setMessageTime(String value) { + this.messageTime = value; + } + + /** + * Gets the value of the requestId property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getRequestId() { + return requestId; + } + + /** + * Sets the value of the requestId property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setRequestId(String value) { + this.requestId = value; + } + + /** + * Gets the value of the lastStatusRequest property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getLastStatusRequest() { + return lastStatusRequest; + } + + /** + * Sets the value of the lastStatusRequest property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setLastStatusRequest(String value) { + this.lastStatusRequest = value; + } + + /** + * Gets the value of the finalStatusRequest property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getFinalStatusRequest() { + return finalStatusRequest; + } + + /** + * Sets the value of the finalStatusRequest property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setFinalStatusRequest(String value) { + this.finalStatusRequest = value; + } + + /** + * Gets the value of the resumeId property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getResumeId() { + return resumeId; + } + + /** + * Sets the value of the resumeId property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setResumeId(String value) { + this.resumeId = value; + } + + /** + * Gets the value of the reverseId property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getReverseId() { + return reverseId; + } + + /** + * Sets the value of the reverseId property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setReverseId(String value) { + this.reverseId = value; + } + + /** + * Gets the value of the lineId property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getLineId() { + return lineId; + } + + /** + * Sets the value of the lineId property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setLineId(String value) { + this.lineId = value; + } + + /** + * Gets the value of the sourceChannelCode property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getSourceChannelCode() { + return sourceChannelCode; + } + + /** + * Sets the value of the sourceChannelCode property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setSourceChannelCode(String value) { + this.sourceChannelCode = value; + } + + /** + * Gets the value of the supervisorCode property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getSupervisorCode() { + return supervisorCode; + } + + /** + * Sets the value of the supervisorCode property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setSupervisorCode(String value) { + this.supervisorCode = value; + } + + /** + * Gets the value of the operatorCode property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getOperatorCode() { + return operatorCode; + } + + /** + * Sets the value of the operatorCode property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setOperatorCode(String value) { + this.operatorCode = value; + } + + /** + * Gets the value of the requestedOperationType property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getRequestedOperationType() { + return requestedOperationType; + } + + /** + * Sets the value of the requestedOperationType property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setRequestedOperationType(String value) { + this.requestedOperationType = value; + } + + /** + * Gets the value of the networkTrnInfo property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the Jakarta XML Binding object. + * This is why there is not a set method for the networkTrnInfo property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getNetworkTrnInfo().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link NetworkTrnInfo } + * + * + */ + public List getNetworkTrnInfo() { + if (networkTrnInfo == null) { + networkTrnInfo = new ArrayList(); + } + return this.networkTrnInfo; + } + + /** + * Gets the value of the applicantData property. + * + * @return + * possible object is + * {@link ApplicantData } + * + */ + public ApplicantData getApplicantData() { + return applicantData; + } + + /** + * Sets the value of the applicantData property. + * + * @param value + * allowed object is + * {@link ApplicantData } + * + */ + public void setApplicantData(ApplicantData value) { + this.applicantData = value; + } + + /** + * Gets the value of the recCtrlIn property. + * + * @return + * possible object is + * {@link RecCtrlIn } + * + */ + public RecCtrlIn getRecCtrlIn() { + return recCtrlIn; + } + + /** + * Sets the value of the recCtrlIn property. + * + * @param value + * allowed object is + * {@link RecCtrlIn } + * + */ + public void setRecCtrlIn(RecCtrlIn value) { + this.recCtrlIn = value; + } + + /** + * Gets the value of the returnValue property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getReturnValue() { + return returnValue; + } + + /** + * Sets the value of the returnValue property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setReturnValue(String value) { + this.returnValue = value; + } + + /** + * Gets the value of the messageId property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getMessageId() { + return messageId; + } + + /** + * Sets the value of the messageId property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setMessageId(String value) { + this.messageId = value; + } + + /** + * Gets the value of the priority property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getPriority() { + return priority; + } + + /** + * Sets the value of the priority property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setPriority(String value) { + this.priority = value; + } + + /** + * Gets the value of the vbProtocol property. + * + * @return + * possible object is + * {@link VBProtocol } + * + */ + public VBProtocol getVBProtocol() { + return vbProtocol; + } + + /** + * Sets the value of the vbProtocol property. + * + * @param value + * allowed object is + * {@link VBProtocol } + * + */ + + public void setTransactionCode(String transactionCode) { + this.getNetworkTrnInfo().get(0).setTransactionCode(transactionCode); + } + + public void setNetworkTrnInfo(List networkTrnInfo) { + this.networkTrnInfo = networkTrnInfo; + } + public void setVBProtocol(VBProtocol value) { + this.vbProtocol = value; + } + + public void setVbprotocol(VBProtocol value) { + this.vbProtocol = value; + } + public void setVbProtocol(VBProtocol value) { + this.vbProtocol = value; + } + + +} diff --git a/update-card-status/src/main/java/com/banesco/commons/soap/client/apipaymentoutappsvc/MsgRsHdr.java b/update-card-status/src/main/java/com/banesco/commons/soap/client/apipaymentoutappsvc/MsgRsHdr.java new file mode 100644 index 0000000..0b0ddc3 --- /dev/null +++ b/update-card-status/src/main/java/com/banesco/commons/soap/client/apipaymentoutappsvc/MsgRsHdr.java @@ -0,0 +1,686 @@ + +package com.banesco.commons.soap.client.apipaymentoutappsvc; + +import jakarta.xml.bind.annotation.XmlAccessType; +import jakarta.xml.bind.annotation.XmlAccessorType; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlType; + +import java.util.ArrayList; +import java.util.List; + + +/** + *

Java class for MsgRsHdr complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="MsgRsHdr">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="PrivateChannelId" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="FinalStatusRequest" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="CountDataOut" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="HeaderTypeReg" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="DetailTypeReg" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="TransactionCode" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="SupervisorCode" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="OperationType" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="TransactionConsecutive" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="DetailReg" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="RegisterNumber" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded" minOccurs="0"/>
+ *         <element name="TransactionType" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="RequestId" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="RequestedOperationType" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="MessageDate" type="{http://xmlns.banesco.com/EnterpriseObjects/MsgRsHdr}datePattern" minOccurs="0"/>
+ *         <element name="TransactionTime" type="{http://xmlns.banesco.com/EnterpriseObjects/MsgRsHdr}timePattern" minOccurs="0"/>
+ *         <element name="LastStatusRequest" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="ReturnValue" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="RequestStatus" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="MessageTime" type="{http://xmlns.banesco.com/EnterpriseObjects/MsgRsHdr}timePattern" minOccurs="0"/>
+ *         <element name="TransacctionDate" type="{http://xmlns.banesco.com/EnterpriseObjects/MsgRsHdr}datePattern" minOccurs="0"/>
+ *         <element name="RequestNumber" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="AppName" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "MsgRsHdr", namespace = "http://xmlns.banesco.com/EnterpriseObjects/MsgRsHdr", propOrder = { + "privateChannelId", + "finalStatusRequest", + "countDataOut", + "headerTypeReg", + "detailTypeReg", + "transactionCode", + "supervisorCode", + "operationType", + "transactionConsecutive", + "detailReg", + "registerNumber", + "transactionType", + "requestId", + "requestedOperationType", + "messageDate", + "transactionTime", + "lastStatusRequest", + "returnValue", + "requestStatus", + "messageTime", + "transacctionDate", + "requestNumber", + "appName" +}) +public class MsgRsHdr { + + @XmlElement(name = "PrivateChannelId") + protected String privateChannelId; + @XmlElement(name = "FinalStatusRequest") + protected String finalStatusRequest; + @XmlElement(name = "CountDataOut") + protected String countDataOut; + @XmlElement(name = "HeaderTypeReg") + protected String headerTypeReg; + @XmlElement(name = "DetailTypeReg") + protected String detailTypeReg; + @XmlElement(name = "TransactionCode") + protected String transactionCode; + @XmlElement(name = "SupervisorCode") + protected String supervisorCode; + @XmlElement(name = "OperationType") + protected String operationType; + @XmlElement(name = "TransactionConsecutive") + protected String transactionConsecutive; + @XmlElement(name = "DetailReg") + protected String detailReg; + @XmlElement(name = "RegisterNumber") + protected List registerNumber; + @XmlElement(name = "TransactionType") + protected String transactionType; + @XmlElement(name = "RequestId") + protected String requestId; + @XmlElement(name = "RequestedOperationType") + protected String requestedOperationType; + @XmlElement(name = "MessageDate") + protected String messageDate; + @XmlElement(name = "TransactionTime") + protected String transactionTime; + @XmlElement(name = "LastStatusRequest") + protected String lastStatusRequest; + @XmlElement(name = "ReturnValue") + protected String returnValue; + @XmlElement(name = "RequestStatus") + protected String requestStatus; + @XmlElement(name = "MessageTime") + protected String messageTime; + @XmlElement(name = "TransacctionDate") + protected String transacctionDate; + @XmlElement(name = "RequestNumber") + protected String requestNumber; + @XmlElement(name = "AppName") + protected String appName; + + /** + * Gets the value of the privateChannelId property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getPrivateChannelId() { + return privateChannelId; + } + + /** + * Sets the value of the privateChannelId property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setPrivateChannelId(String value) { + this.privateChannelId = value; + } + + /** + * Gets the value of the finalStatusRequest property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getFinalStatusRequest() { + return finalStatusRequest; + } + + /** + * Sets the value of the finalStatusRequest property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setFinalStatusRequest(String value) { + this.finalStatusRequest = value; + } + + /** + * Gets the value of the countDataOut property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getCountDataOut() { + return countDataOut; + } + + /** + * Sets the value of the countDataOut property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setCountDataOut(String value) { + this.countDataOut = value; + } + + /** + * Gets the value of the headerTypeReg property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getHeaderTypeReg() { + return headerTypeReg; + } + + /** + * Sets the value of the headerTypeReg property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setHeaderTypeReg(String value) { + this.headerTypeReg = value; + } + + /** + * Gets the value of the detailTypeReg property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getDetailTypeReg() { + return detailTypeReg; + } + + /** + * Sets the value of the detailTypeReg property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setDetailTypeReg(String value) { + this.detailTypeReg = value; + } + + /** + * Gets the value of the transactionCode property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getTransactionCode() { + return transactionCode; + } + + /** + * Sets the value of the transactionCode property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setTransactionCode(String value) { + this.transactionCode = value; + } + + /** + * Gets the value of the supervisorCode property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getSupervisorCode() { + return supervisorCode; + } + + /** + * Sets the value of the supervisorCode property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setSupervisorCode(String value) { + this.supervisorCode = value; + } + + /** + * Gets the value of the operationType property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getOperationType() { + return operationType; + } + + /** + * Sets the value of the operationType property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setOperationType(String value) { + this.operationType = value; + } + + /** + * Gets the value of the transactionConsecutive property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getTransactionConsecutive() { + return transactionConsecutive; + } + + /** + * Sets the value of the transactionConsecutive property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setTransactionConsecutive(String value) { + this.transactionConsecutive = value; + } + + /** + * Gets the value of the detailReg property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getDetailReg() { + return detailReg; + } + + /** + * Sets the value of the detailReg property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setDetailReg(String value) { + this.detailReg = value; + } + + /** + * Gets the value of the registerNumber property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the Jakarta XML Binding object. + * This is why there is not a set method for the registerNumber property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getRegisterNumber().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link String } + * + * + */ + public List getRegisterNumber() { + if (registerNumber == null) { + registerNumber = new ArrayList(); + } + return this.registerNumber; + } + + /** + * Gets the value of the transactionType property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getTransactionType() { + return transactionType; + } + + /** + * Sets the value of the transactionType property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setTransactionType(String value) { + this.transactionType = value; + } + + /** + * Gets the value of the requestId property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getRequestId() { + return requestId; + } + + /** + * Sets the value of the requestId property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setRequestId(String value) { + this.requestId = value; + } + + /** + * Gets the value of the requestedOperationType property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getRequestedOperationType() { + return requestedOperationType; + } + + /** + * Sets the value of the requestedOperationType property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setRequestedOperationType(String value) { + this.requestedOperationType = value; + } + + /** + * Gets the value of the messageDate property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getMessageDate() { + return messageDate; + } + + /** + * Sets the value of the messageDate property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setMessageDate(String value) { + this.messageDate = value; + } + + /** + * Gets the value of the transactionTime property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getTransactionTime() { + return transactionTime; + } + + /** + * Sets the value of the transactionTime property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setTransactionTime(String value) { + this.transactionTime = value; + } + + /** + * Gets the value of the lastStatusRequest property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getLastStatusRequest() { + return lastStatusRequest; + } + + /** + * Sets the value of the lastStatusRequest property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setLastStatusRequest(String value) { + this.lastStatusRequest = value; + } + + /** + * Gets the value of the returnValue property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getReturnValue() { + return returnValue; + } + + /** + * Sets the value of the returnValue property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setReturnValue(String value) { + this.returnValue = value; + } + + /** + * Gets the value of the requestStatus property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getRequestStatus() { + return requestStatus; + } + + /** + * Sets the value of the requestStatus property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setRequestStatus(String value) { + this.requestStatus = value; + } + + /** + * Gets the value of the messageTime property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getMessageTime() { + return messageTime; + } + + /** + * Sets the value of the messageTime property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setMessageTime(String value) { + this.messageTime = value; + } + + /** + * Gets the value of the transacctionDate property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getTransacctionDate() { + return transacctionDate; + } + + /** + * Sets the value of the transacctionDate property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setTransacctionDate(String value) { + this.transacctionDate = value; + } + + /** + * Gets the value of the requestNumber property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getRequestNumber() { + return requestNumber; + } + + /** + * Sets the value of the requestNumber property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setRequestNumber(String value) { + this.requestNumber = value; + } + + /** + * Gets the value of the appName property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getAppName() { + return appName; + } + + /** + * Sets the value of the appName property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setAppName(String value) { + this.appName = value; + } + +} diff --git a/update-card-status/src/main/java/com/banesco/commons/soap/client/apipaymentoutappsvc/NetworkTrnInfo.java b/update-card-status/src/main/java/com/banesco/commons/soap/client/apipaymentoutappsvc/NetworkTrnInfo.java new file mode 100644 index 0000000..132b522 --- /dev/null +++ b/update-card-status/src/main/java/com/banesco/commons/soap/client/apipaymentoutappsvc/NetworkTrnInfo.java @@ -0,0 +1,510 @@ + +package com.banesco.commons.soap.client.apipaymentoutappsvc; + +import jakarta.xml.bind.annotation.XmlAccessType; +import jakarta.xml.bind.annotation.XmlAccessorType; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlType; + + +/** + *

Java class for NetworkTrnInfo complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="NetworkTrnInfo">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="TransactionConsecutive" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="RegisterNumber" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="OriginatorName" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="OperationType" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="TransactionType" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="TransactionCode" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="TransactionDate" type="{http://xmlns.banesco.com/EnterpriseObjects/MsgRqHdr}datePattern" minOccurs="0"/>
+ *         <element name="TransactionTime" type="{http://xmlns.banesco.com/EnterpriseObjects/MsgRqHdr}timePattern" minOccurs="0"/>
+ *         <element name="BankId" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="AgencyCode" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="ChannelId" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="ChannelUserId" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="OperationExecIndicator" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="ConfiguredTransactionCode" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="Desc" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="UserId" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="UserType" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "NetworkTrnInfo", propOrder = { + "transactionConsecutive", + "registerNumber", + "originatorName", + "operationType", + "transactionType", + "transactionCode", + "transactionDate", + "transactionTime", + "bankId", + "agencyCode", + "channelId", + "channelUserId", + "operationExecIndicator", + "configuredTransactionCode", + "desc", + "userId", + "userType" +}) +public class NetworkTrnInfo { + + @XmlElement(name = "TransactionConsecutive") + protected String transactionConsecutive; + @XmlElement(name = "RegisterNumber") + protected String registerNumber; + @XmlElement(name = "OriginatorName") + protected String originatorName; + @XmlElement(name = "OperationType") + protected String operationType; + @XmlElement(name = "TransactionType") + protected String transactionType; + @XmlElement(name = "TransactionCode") + protected String transactionCode; + @XmlElement(name = "TransactionDate") + protected String transactionDate; + @XmlElement(name = "TransactionTime") + protected String transactionTime; + @XmlElement(name = "BankId") + protected String bankId; + @XmlElement(name = "AgencyCode") + protected String agencyCode; + @XmlElement(name = "ChannelId") + protected String channelId; + @XmlElement(name = "ChannelUserId") + protected String channelUserId; + @XmlElement(name = "OperationExecIndicator") + protected String operationExecIndicator; + @XmlElement(name = "ConfiguredTransactionCode") + protected String configuredTransactionCode; + @XmlElement(name = "Desc") + protected String desc; + @XmlElement(name = "UserId") + protected String userId; + @XmlElement(name = "UserType") + protected String userType; + + /** + * Gets the value of the transactionConsecutive property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getTransactionConsecutive() { + return transactionConsecutive; + } + + /** + * Sets the value of the transactionConsecutive property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setTransactionConsecutive(String value) { + this.transactionConsecutive = value; + } + + /** + * Gets the value of the registerNumber property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getRegisterNumber() { + return registerNumber; + } + + /** + * Sets the value of the registerNumber property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setRegisterNumber(String value) { + this.registerNumber = value; + } + + /** + * Gets the value of the originatorName property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getOriginatorName() { + return originatorName; + } + + /** + * Sets the value of the originatorName property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setOriginatorName(String value) { + this.originatorName = value; + } + + /** + * Gets the value of the operationType property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getOperationType() { + return operationType; + } + + /** + * Sets the value of the operationType property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setOperationType(String value) { + this.operationType = value; + } + + /** + * Gets the value of the transactionType property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getTransactionType() { + return transactionType; + } + + /** + * Sets the value of the transactionType property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setTransactionType(String value) { + this.transactionType = value; + } + + /** + * Gets the value of the transactionCode property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getTransactionCode() { + return transactionCode; + } + + /** + * Sets the value of the transactionCode property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setTransactionCode(String value) { + this.transactionCode = value; + } + + /** + * Gets the value of the transactionDate property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getTransactionDate() { + return transactionDate; + } + + /** + * Sets the value of the transactionDate property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setTransactionDate(String value) { + this.transactionDate = value; + } + + /** + * Gets the value of the transactionTime property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getTransactionTime() { + return transactionTime; + } + + /** + * Sets the value of the transactionTime property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setTransactionTime(String value) { + this.transactionTime = value; + } + + /** + * Gets the value of the bankId property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getBankId() { + return bankId; + } + + /** + * Sets the value of the bankId property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setBankId(String value) { + this.bankId = value; + } + + /** + * Gets the value of the agencyCode property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getAgencyCode() { + return agencyCode; + } + + /** + * Sets the value of the agencyCode property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setAgencyCode(String value) { + this.agencyCode = value; + } + + /** + * Gets the value of the channelId property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getChannelId() { + return channelId; + } + + /** + * Sets the value of the channelId property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setChannelId(String value) { + this.channelId = value; + } + + /** + * Gets the value of the channelUserId property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getChannelUserId() { + return channelUserId; + } + + /** + * Sets the value of the channelUserId property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setChannelUserId(String value) { + this.channelUserId = value; + } + + /** + * Gets the value of the operationExecIndicator property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getOperationExecIndicator() { + return operationExecIndicator; + } + + /** + * Sets the value of the operationExecIndicator property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setOperationExecIndicator(String value) { + this.operationExecIndicator = value; + } + + /** + * Gets the value of the configuredTransactionCode property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getConfiguredTransactionCode() { + return configuredTransactionCode; + } + + /** + * Sets the value of the configuredTransactionCode property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setConfiguredTransactionCode(String value) { + this.configuredTransactionCode = value; + } + + /** + * Gets the value of the desc property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getDesc() { + return desc; + } + + /** + * Sets the value of the desc property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setDesc(String value) { + this.desc = value; + } + + /** + * Gets the value of the userId property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getUserId() { + return userId; + } + + /** + * Sets the value of the userId property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setUserId(String value) { + this.userId = value; + } + + /** + * Gets the value of the userType property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getUserType() { + return userType; + } + + /** + * Sets the value of the userType property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setUserType(String value) { + this.userType = value; + } + +} diff --git a/update-card-status/src/main/java/com/banesco/commons/soap/client/apipaymentoutappsvc/ObjectFactory.java b/update-card-status/src/main/java/com/banesco/commons/soap/client/apipaymentoutappsvc/ObjectFactory.java new file mode 100644 index 0000000..eae6020 --- /dev/null +++ b/update-card-status/src/main/java/com/banesco/commons/soap/client/apipaymentoutappsvc/ObjectFactory.java @@ -0,0 +1,512 @@ + +package com.banesco.commons.soap.client.apipaymentoutappsvc; + +import jakarta.xml.bind.JAXBElement; +import jakarta.xml.bind.annotation.XmlElementDecl; +import jakarta.xml.bind.annotation.XmlRegistry; + +import javax.xml.namespace.QName; + + +/** + * This object contains factory methods for each + * Java content interface and Java element interface + * generated in the com.banesco.commons.soap.client.apipaymentoutappsvc package. + *

An ObjectFactory allows you to programatically + * construct new instances of the Java representation + * for XML content. The Java representation of XML + * content can consist of schema derived interfaces + * and classes representing the binding of schema + * type definitions, element declarations and model + * groups. Factory methods for each of these are + * provided in this class. + * + */ +@XmlRegistry +public class ObjectFactory { + + private final static QName _PayGenerateRq_QNAME = new QName("http://xmlns.banesco.com/ApplicationService/APIPaymentOutAppSvc", "payGenerate_Rq"); + private final static QName _PayGenerateRs_QNAME = new QName("http://xmlns.banesco.com/ApplicationService/APIPaymentOutAppSvc", "payGenerate_Rs"); + + /** + * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: com.banesco.commons.soap.client.apipaymentoutappsvc + * + */ + public ObjectFactory() { + } + + /** + * Create an instance of {@link ReadPaymentRq } + * + */ + public ReadPaymentRq createReadPaymentRq() { + return new ReadPaymentRq(); + } + + /** + * Create an instance of {@link ReadPaymentRs } + * + */ + public ReadPaymentRs createReadPaymentRs() { + return new ReadPaymentRs(); + } + + /** + * Create an instance of {@link ReadPaymentRs.Payments } + * + */ + public ReadPaymentRs.Payments createReadPaymentRsPayments() { + return new ReadPaymentRs.Payments(); + } + + /** + * Create an instance of {@link ReadPaymentRs.Payments.Account } + * + */ + public ReadPaymentRs.Payments.Account createReadPaymentRsPaymentsAccount() { + return new ReadPaymentRs.Payments.Account(); + } + + /** + * Create an instance of {@link ReadPaymentRq.Payments } + * + */ + public ReadPaymentRq.Payments createReadPaymentRqPayments() { + return new ReadPaymentRq.Payments(); + } + + /** + * Create an instance of {@link ReadPaymentRq.Payments.Account } + * + */ + public ReadPaymentRq.Payments.Account createReadPaymentRqPaymentsAccount() { + return new ReadPaymentRq.Payments.Account(); + } + + /** + * Create an instance of {@link PayGenerateRs } + * + */ + public PayGenerateRs createPayGenerateRs() { + return new PayGenerateRs(); + } + + /** + * Create an instance of {@link PayGenerateRs.Payments } + * + */ + public PayGenerateRs.Payments createPayGenerateRsPayments() { + return new PayGenerateRs.Payments(); + } + + /** + * Create an instance of {@link PayGenerateRs.Payments.Account } + * + */ + public PayGenerateRs.Payments.Account createPayGenerateRsPaymentsAccount() { + return new PayGenerateRs.Payments.Account(); + } + + /** + * Create an instance of {@link PayGenerateRs.Payments.Account.Banking } + * + */ + public PayGenerateRs.Payments.Account.Banking createPayGenerateRsPaymentsAccountBanking() { + return new PayGenerateRs.Payments.Account.Banking(); + } + + /** + * Create an instance of {@link PayGenerateRs.Payments.Account.Customer } + * + */ + public PayGenerateRs.Payments.Account.Customer createPayGenerateRsPaymentsAccountCustomer() { + return new PayGenerateRs.Payments.Account.Customer(); + } + + /** + * Create an instance of {@link PayGenerateRq } + * + */ + public PayGenerateRq createPayGenerateRq() { + return new PayGenerateRq(); + } + + /** + * Create an instance of {@link PayGenerateRq.Banking } + * + */ + public PayGenerateRq.Banking createPayGenerateRqBanking() { + return new PayGenerateRq.Banking(); + } + + /** + * Create an instance of {@link PayGenerateRq.Payments } + * + */ + public PayGenerateRq.Payments createPayGenerateRqPayments() { + return new PayGenerateRq.Payments(); + } + + /** + * Create an instance of {@link PayGenerateRq.Payments.Account } + * + */ + public PayGenerateRq.Payments.Account createPayGenerateRqPaymentsAccount() { + return new PayGenerateRq.Payments.Account(); + } + + /** + * Create an instance of {@link PayGenerateRq.Payments.Account.Customer } + * + */ + public PayGenerateRq.Payments.Account.Customer createPayGenerateRqPaymentsAccountCustomer() { + return new PayGenerateRq.Payments.Account.Customer(); + } + + /** + * Create an instance of {@link PayGenerateRq.Payments.Account.Customer.ContactInfo } + * + */ + public PayGenerateRq.Payments.Account.Customer.ContactInfo createPayGenerateRqPaymentsAccountCustomerContactInfo() { + return new PayGenerateRq.Payments.Account.Customer.ContactInfo(); + } + + /** + * Create an instance of {@link PayGenerateRq.Payments.Account.Customer.ContactInfo.PhoneNum } + * + */ + public PayGenerateRq.Payments.Account.Customer.ContactInfo.PhoneNum createPayGenerateRqPaymentsAccountCustomerContactInfoPhoneNum() { + return new PayGenerateRq.Payments.Account.Customer.ContactInfo.PhoneNum(); + } + + /** + * Create an instance of {@link PayGenerateRq.Payments.Account.Customer.CustInfo } + * + */ + public PayGenerateRq.Payments.Account.Customer.CustInfo createPayGenerateRqPaymentsAccountCustomerCustInfo() { + return new PayGenerateRq.Payments.Account.Customer.CustInfo(); + } + + /** + * Create an instance of {@link PayGenerateRq.Payments.Account.Customer.PersonInfo } + * + */ + public PayGenerateRq.Payments.Account.Customer.PersonInfo createPayGenerateRqPaymentsAccountCustomerPersonInfo() { + return new PayGenerateRq.Payments.Account.Customer.PersonInfo(); + } + + /** + * Create an instance of {@link PayGenerateRq.Bill } + * + */ + public PayGenerateRq.Bill createPayGenerateRqBill() { + return new PayGenerateRq.Bill(); + } + + /** + * Create an instance of {@link PayGenerateRq.Bill.Account } + * + */ + public PayGenerateRq.Bill.Account createPayGenerateRqBillAccount() { + return new PayGenerateRq.Bill.Account(); + } + + /** + * Create an instance of {@link PayGenerateRq.Bill.Customer } + * + */ + public PayGenerateRq.Bill.Customer createPayGenerateRqBillCustomer() { + return new PayGenerateRq.Bill.Customer(); + } + + /** + * Create an instance of {@link PayGenerateRq.Bill.Customer.PersonInfo } + * + */ + public PayGenerateRq.Bill.Customer.PersonInfo createPayGenerateRqBillCustomerPersonInfo() { + return new PayGenerateRq.Bill.Customer.PersonInfo(); + } + + /** + * Create an instance of {@link MsgRqHdr } + * + */ + public MsgRqHdr createMsgRqHdr() { + return new MsgRqHdr(); + } + + /** + * Create an instance of {@link ReadPaymentRq.Receipt } + * + */ + public ReadPaymentRq.Receipt createReadPaymentRqReceipt() { + return new ReadPaymentRq.Receipt(); + } + + /** + * Create an instance of {@link MsgRsHdr } + * + */ + public MsgRsHdr createMsgRsHdr() { + return new MsgRsHdr(); + } + + /** + * Create an instance of {@link Status } + * + */ + public Status createStatus() { + return new Status(); + } + + /** + * Create an instance of {@link ReadPaymentRs.Receipt } + * + */ + public ReadPaymentRs.Receipt createReadPaymentRsReceipt() { + return new ReadPaymentRs.Receipt(); + } + + /** + * Create an instance of {@link NetworkTrnInfo } + * + */ + public NetworkTrnInfo createNetworkTrnInfo() { + return new NetworkTrnInfo(); + } + + /** + * Create an instance of {@link ApplicantData } + * + */ + public ApplicantData createApplicantData() { + return new ApplicantData(); + } + + /** + * Create an instance of {@link RecCtrlIn } + * + */ + public RecCtrlIn createRecCtrlIn() { + return new RecCtrlIn(); + } + + /** + * Create an instance of {@link VBProtocol } + * + */ + public VBProtocol createVBProtocol() { + return new VBProtocol(); + } + + /** + * Create an instance of {@link AdditionalStatus } + * + */ + public AdditionalStatus createAdditionalStatus() { + return new AdditionalStatus(); + } + + /** + * Create an instance of {@link ReadPaymentRs.Payments.CurAmt } + * + */ + public ReadPaymentRs.Payments.CurAmt createReadPaymentRsPaymentsCurAmt() { + return new ReadPaymentRs.Payments.CurAmt(); + } + + /** + * Create an instance of {@link ReadPaymentRs.Payments.Account.Service } + * + */ + public ReadPaymentRs.Payments.Account.Service createReadPaymentRsPaymentsAccountService() { + return new ReadPaymentRs.Payments.Account.Service(); + } + + /** + * Create an instance of {@link ReadPaymentRq.Payments.Account.Service } + * + */ + public ReadPaymentRq.Payments.Account.Service createReadPaymentRqPaymentsAccountService() { + return new ReadPaymentRq.Payments.Account.Service(); + } + + /** + * Create an instance of {@link PayGenerateRs.Payments.PmtInfo } + * + */ + public PayGenerateRs.Payments.PmtInfo createPayGenerateRsPaymentsPmtInfo() { + return new PayGenerateRs.Payments.PmtInfo(); + } + + /** + * Create an instance of {@link PayGenerateRs.Payments.Account.Banking.BankAcctTrnRec } + * + */ + public PayGenerateRs.Payments.Account.Banking.BankAcctTrnRec createPayGenerateRsPaymentsAccountBankingBankAcctTrnRec() { + return new PayGenerateRs.Payments.Account.Banking.BankAcctTrnRec(); + } + + /** + * Create an instance of {@link PayGenerateRs.Payments.Account.Customer.PersonInfo } + * + */ + public PayGenerateRs.Payments.Account.Customer.PersonInfo createPayGenerateRsPaymentsAccountCustomerPersonInfo() { + return new PayGenerateRs.Payments.Account.Customer.PersonInfo(); + } + + /** + * Create an instance of {@link PayGenerateRs.Payments.Account.Customer.OrgInfo } + * + */ + public PayGenerateRs.Payments.Account.Customer.OrgInfo createPayGenerateRsPaymentsAccountCustomerOrgInfo() { + return new PayGenerateRs.Payments.Account.Customer.OrgInfo(); + } + + /** + * Create an instance of {@link PayGenerateRq.Receipt } + * + */ + public PayGenerateRq.Receipt createPayGenerateRqReceipt() { + return new PayGenerateRq.Receipt(); + } + + /** + * Create an instance of {@link PayGenerateRq.Banking.BankAcctTrnRec } + * + */ + public PayGenerateRq.Banking.BankAcctTrnRec createPayGenerateRqBankingBankAcctTrnRec() { + return new PayGenerateRq.Banking.BankAcctTrnRec(); + } + + /** + * Create an instance of {@link PayGenerateRq.Payments.PmtInfo } + * + */ + public PayGenerateRq.Payments.PmtInfo createPayGenerateRqPaymentsPmtInfo() { + return new PayGenerateRq.Payments.PmtInfo(); + } + + /** + * Create an instance of {@link PayGenerateRq.Payments.CurAmt } + * + */ + public PayGenerateRq.Payments.CurAmt createPayGenerateRqPaymentsCurAmt() { + return new PayGenerateRq.Payments.CurAmt(); + } + + /** + * Create an instance of {@link PayGenerateRq.Payments.Account.Bankinfo } + * + */ + public PayGenerateRq.Payments.Account.Bankinfo createPayGenerateRqPaymentsAccountBankinfo() { + return new PayGenerateRq.Payments.Account.Bankinfo(); + } + + /** + * Create an instance of {@link PayGenerateRq.Payments.Account.Service } + * + */ + public PayGenerateRq.Payments.Account.Service createPayGenerateRqPaymentsAccountService() { + return new PayGenerateRq.Payments.Account.Service(); + } + + /** + * Create an instance of {@link PayGenerateRq.Payments.Account.Customer.CustId } + * + */ + public PayGenerateRq.Payments.Account.Customer.CustId createPayGenerateRqPaymentsAccountCustomerCustId() { + return new PayGenerateRq.Payments.Account.Customer.CustId(); + } + + /** + * Create an instance of {@link PayGenerateRq.Payments.Account.Customer.Product } + * + */ + public PayGenerateRq.Payments.Account.Customer.Product createPayGenerateRqPaymentsAccountCustomerProduct() { + return new PayGenerateRq.Payments.Account.Customer.Product(); + } + + /** + * Create an instance of {@link PayGenerateRq.Payments.Account.Customer.ContactInfo.PhoneNum.PhoneIden } + * + */ + public PayGenerateRq.Payments.Account.Customer.ContactInfo.PhoneNum.PhoneIden createPayGenerateRqPaymentsAccountCustomerContactInfoPhoneNumPhoneIden() { + return new PayGenerateRq.Payments.Account.Customer.ContactInfo.PhoneNum.PhoneIden(); + } + + /** + * Create an instance of {@link PayGenerateRq.Payments.Account.Customer.CustInfo.PhoneNum } + * + */ + public PayGenerateRq.Payments.Account.Customer.CustInfo.PhoneNum createPayGenerateRqPaymentsAccountCustomerCustInfoPhoneNum() { + return new PayGenerateRq.Payments.Account.Customer.CustInfo.PhoneNum(); + } + + /** + * Create an instance of {@link PayGenerateRq.Payments.Account.Customer.PersonInfo.OtherIdentDoc } + * + */ + public PayGenerateRq.Payments.Account.Customer.PersonInfo.OtherIdentDoc createPayGenerateRqPaymentsAccountCustomerPersonInfoOtherIdentDoc() { + return new PayGenerateRq.Payments.Account.Customer.PersonInfo.OtherIdentDoc(); + } + + /** + * Create an instance of {@link PayGenerateRq.Bill.GenericValue } + * + */ + public PayGenerateRq.Bill.GenericValue createPayGenerateRqBillGenericValue() { + return new PayGenerateRq.Bill.GenericValue(); + } + + /** + * Create an instance of {@link PayGenerateRq.Bill.Account.Service } + * + */ + public PayGenerateRq.Bill.Account.Service createPayGenerateRqBillAccountService() { + return new PayGenerateRq.Bill.Account.Service(); + } + + /** + * Create an instance of {@link PayGenerateRq.Bill.Customer.CustId } + * + */ + public PayGenerateRq.Bill.Customer.CustId createPayGenerateRqBillCustomerCustId() { + return new PayGenerateRq.Bill.Customer.CustId(); + } + + /** + * Create an instance of {@link PayGenerateRq.Bill.Customer.PersonInfo.OtherIdentDoc } + * + */ + public PayGenerateRq.Bill.Customer.PersonInfo.OtherIdentDoc createPayGenerateRqBillCustomerPersonInfoOtherIdentDoc() { + return new PayGenerateRq.Bill.Customer.PersonInfo.OtherIdentDoc(); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link PayGenerateRq }{@code >} + * + * @param value + * Java instance representing xml element's value. + * @return + * the new instance of {@link JAXBElement }{@code <}{@link PayGenerateRq }{@code >} + */ + @XmlElementDecl(namespace = "http://xmlns.banesco.com/ApplicationService/APIPaymentOutAppSvc", name = "payGenerate_Rq") + public JAXBElement createPayGenerateRq(PayGenerateRq value) { + return new JAXBElement(_PayGenerateRq_QNAME, PayGenerateRq.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link PayGenerateRs }{@code >} + * + * @param value + * Java instance representing xml element's value. + * @return + * the new instance of {@link JAXBElement }{@code <}{@link PayGenerateRs }{@code >} + */ + @XmlElementDecl(namespace = "http://xmlns.banesco.com/ApplicationService/APIPaymentOutAppSvc", name = "payGenerate_Rs") + public JAXBElement createPayGenerateRs(PayGenerateRs value) { + return new JAXBElement(_PayGenerateRs_QNAME, PayGenerateRs.class, null, value); + } + +} diff --git a/update-card-status/src/main/java/com/banesco/commons/soap/client/apipaymentoutappsvc/PayGenerateRq.java b/update-card-status/src/main/java/com/banesco/commons/soap/client/apipaymentoutappsvc/PayGenerateRq.java new file mode 100644 index 0000000..7337945 --- /dev/null +++ b/update-card-status/src/main/java/com/banesco/commons/soap/client/apipaymentoutappsvc/PayGenerateRq.java @@ -0,0 +1,3106 @@ + +package com.banesco.commons.soap.client.apipaymentoutappsvc; + +import jakarta.xml.bind.annotation.XmlAccessType; +import jakarta.xml.bind.annotation.XmlAccessorType; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlType; + +import java.util.ArrayList; +import java.util.List; + + +/** + *

Java class for payGenerate_Rq complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="payGenerate_Rq">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="MsgRqHdr" type="{http://xmlns.banesco.com/EnterpriseObjects/MsgRqHdr}MsgRqHdr" minOccurs="0"/>
+ *         <element name="Bill" maxOccurs="unbounded" minOccurs="0">
+ *           <complexType>
+ *             <complexContent>
+ *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                 <sequence>
+ *                   <element name="Customer" minOccurs="0">
+ *                     <complexType>
+ *                       <complexContent>
+ *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                           <sequence>
+ *                             <element name="PersonInfo" minOccurs="0">
+ *                               <complexType>
+ *                                 <complexContent>
+ *                                   <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                                     <sequence>
+ *                                       <element name="OtherIdentDoc" minOccurs="0">
+ *                                         <complexType>
+ *                                           <complexContent>
+ *                                             <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                                               <sequence>
+ *                                                 <element name="IdentSerialNum" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *                                                 <element name="Type" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *                                                 <element name="Desc" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *                                               </sequence>
+ *                                             </restriction>
+ *                                           </complexContent>
+ *                                         </complexType>
+ *                                       </element>
+ *                                     </sequence>
+ *                                   </restriction>
+ *                                 </complexContent>
+ *                               </complexType>
+ *                             </element>
+ *                             <element name="CustId">
+ *                               <complexType>
+ *                                 <complexContent>
+ *                                   <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                                     <sequence>
+ *                                       <element name="CustPermId" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *                                     </sequence>
+ *                                   </restriction>
+ *                                 </complexContent>
+ *                               </complexType>
+ *                             </element>
+ *                           </sequence>
+ *                         </restriction>
+ *                       </complexContent>
+ *                     </complexType>
+ *                   </element>
+ *                   <element name="GenericValue">
+ *                     <complexType>
+ *                       <complexContent>
+ *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                           <sequence>
+ *                             <element name="Value" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *                           </sequence>
+ *                         </restriction>
+ *                       </complexContent>
+ *                     </complexType>
+ *                   </element>
+ *                   <element name="Account" minOccurs="0">
+ *                     <complexType>
+ *                       <complexContent>
+ *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                           <sequence>
+ *                             <element name="AcctId" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *                             <element name="Service" minOccurs="0">
+ *                               <complexType>
+ *                                 <complexContent>
+ *                                   <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                                     <sequence>
+ *                                       <element name="SvcCode" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *                                     </sequence>
+ *                                   </restriction>
+ *                                 </complexContent>
+ *                               </complexType>
+ *                             </element>
+ *                           </sequence>
+ *                         </restriction>
+ *                       </complexContent>
+ *                     </complexType>
+ *                   </element>
+ *                 </sequence>
+ *               </restriction>
+ *             </complexContent>
+ *           </complexType>
+ *         </element>
+ *         <element name="Payments" minOccurs="0">
+ *           <complexType>
+ *             <complexContent>
+ *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                 <sequence>
+ *                   <element name="PmtInfo" minOccurs="0">
+ *                     <complexType>
+ *                       <complexContent>
+ *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                           <sequence>
+ *                             <element name="PmtRefId" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *                             <element name="Desc" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *                             <element name="Amt" type="{http://www.w3.org/2001/XMLSchema}double" minOccurs="0"/>
+ *                           </sequence>
+ *                         </restriction>
+ *                       </complexContent>
+ *                     </complexType>
+ *                   </element>
+ *                   <element name="CurAmt" minOccurs="0">
+ *                     <complexType>
+ *                       <complexContent>
+ *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                           <sequence>
+ *                             <element name="Amt" type="{http://www.w3.org/2001/XMLSchema}double" minOccurs="0"/>
+ *                           </sequence>
+ *                         </restriction>
+ *                       </complexContent>
+ *                     </complexType>
+ *                   </element>
+ *                   <element name="Account" maxOccurs="unbounded" minOccurs="0">
+ *                     <complexType>
+ *                       <complexContent>
+ *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                           <sequence>
+ *                             <element name="Customer" minOccurs="0">
+ *                               <complexType>
+ *                                 <complexContent>
+ *                                   <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                                     <sequence>
+ *                                       <element name="PersonInfo" minOccurs="0">
+ *                                         <complexType>
+ *                                           <complexContent>
+ *                                             <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                                               <sequence>
+ *                                                 <element name="OtherIdentDoc" minOccurs="0">
+ *                                                   <complexType>
+ *                                                     <complexContent>
+ *                                                       <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                                                         <sequence>
+ *                                                           <element name="IdentSerialNum" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *                                                           <element name="Type" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *                                                         </sequence>
+ *                                                       </restriction>
+ *                                                     </complexContent>
+ *                                                   </complexType>
+ *                                                 </element>
+ *                                               </sequence>
+ *                                             </restriction>
+ *                                           </complexContent>
+ *                                         </complexType>
+ *                                       </element>
+ *                                       <element name="CustId" minOccurs="0">
+ *                                         <complexType>
+ *                                           <complexContent>
+ *                                             <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                                               <sequence>
+ *                                                 <element name="CustPermId" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded" minOccurs="0"/>
+ *                                                 <element name="CustPermType" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *                                               </sequence>
+ *                                             </restriction>
+ *                                           </complexContent>
+ *                                         </complexType>
+ *                                       </element>
+ *                                       <element name="CustInfo" minOccurs="0">
+ *                                         <complexType>
+ *                                           <complexContent>
+ *                                             <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                                               <sequence>
+ *                                                 <element name="PhoneNum" maxOccurs="unbounded" minOccurs="0">
+ *                                                   <complexType>
+ *                                                     <complexContent>
+ *                                                       <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                                                         <sequence>
+ *                                                           <element name="Phone" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *                                                         </sequence>
+ *                                                       </restriction>
+ *                                                     </complexContent>
+ *                                                   </complexType>
+ *                                                 </element>
+ *                                               </sequence>
+ *                                             </restriction>
+ *                                           </complexContent>
+ *                                         </complexType>
+ *                                       </element>
+ *                                       <element name="ContactInfo" maxOccurs="unbounded" minOccurs="0">
+ *                                         <complexType>
+ *                                           <complexContent>
+ *                                             <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                                               <sequence>
+ *                                                 <element name="PhoneNum" maxOccurs="unbounded" minOccurs="0">
+ *                                                   <complexType>
+ *                                                     <complexContent>
+ *                                                       <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                                                         <sequence>
+ *                                                           <element name="PhoneIden" maxOccurs="unbounded" minOccurs="0">
+ *                                                             <complexType>
+ *                                                               <complexContent>
+ *                                                                 <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                                                                   <sequence>
+ *                                                                     <element name="PhoneId" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *                                                                   </sequence>
+ *                                                                 </restriction>
+ *                                                               </complexContent>
+ *                                                             </complexType>
+ *                                                           </element>
+ *                                                         </sequence>
+ *                                                       </restriction>
+ *                                                     </complexContent>
+ *                                                   </complexType>
+ *                                                 </element>
+ *                                               </sequence>
+ *                                             </restriction>
+ *                                           </complexContent>
+ *                                         </complexType>
+ *                                       </element>
+ *                                       <element name="Product" minOccurs="0">
+ *                                         <complexType>
+ *                                           <complexContent>
+ *                                             <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                                               <sequence>
+ *                                                 <element name="ProductId" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *                                               </sequence>
+ *                                             </restriction>
+ *                                           </complexContent>
+ *                                         </complexType>
+ *                                       </element>
+ *                                     </sequence>
+ *                                   </restriction>
+ *                                 </complexContent>
+ *                               </complexType>
+ *                             </element>
+ *                             <element name="Bankinfo" maxOccurs="unbounded" minOccurs="0">
+ *                               <complexType>
+ *                                 <complexContent>
+ *                                   <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                                     <sequence>
+ *                                       <element name="BankId" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded" minOccurs="0"/>
+ *                                     </sequence>
+ *                                   </restriction>
+ *                                 </complexContent>
+ *                               </complexType>
+ *                             </element>
+ *                             <element name="Service" minOccurs="0">
+ *                               <complexType>
+ *                                 <complexContent>
+ *                                   <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                                     <sequence>
+ *                                       <element name="SvcType" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *                                     </sequence>
+ *                                   </restriction>
+ *                                 </complexContent>
+ *                               </complexType>
+ *                             </element>
+ *                           </sequence>
+ *                         </restriction>
+ *                       </complexContent>
+ *                     </complexType>
+ *                   </element>
+ *                 </sequence>
+ *               </restriction>
+ *             </complexContent>
+ *           </complexType>
+ *         </element>
+ *         <element name="Receipt" minOccurs="0">
+ *           <complexType>
+ *             <complexContent>
+ *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                 <sequence>
+ *                   <element name="RefNum" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *                 </sequence>
+ *               </restriction>
+ *             </complexContent>
+ *           </complexType>
+ *         </element>
+ *         <element name="Banking" minOccurs="0">
+ *           <complexType>
+ *             <complexContent>
+ *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                 <sequence>
+ *                   <element name="BankAcctTrnRec" maxOccurs="unbounded" minOccurs="0">
+ *                     <complexType>
+ *                       <complexContent>
+ *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                           <sequence>
+ *                             <element name="TrnId" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *                             <element name="OrigDt" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded" minOccurs="0"/>
+ *                           </sequence>
+ *                         </restriction>
+ *                       </complexContent>
+ *                     </complexType>
+ *                   </element>
+ *                 </sequence>
+ *               </restriction>
+ *             </complexContent>
+ *           </complexType>
+ *         </element>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "payGenerate_Rq", namespace = "http://xmlns.banesco.com/ApplicationService/APIPaymentOutAppSvc", propOrder = { + "msgRqHdr", + "bill", + "payments", + "receipt", + "banking" +}) +public class PayGenerateRq { + + @XmlElement(name = "MsgRqHdr") + protected MsgRqHdr msgRqHdr; + @XmlElement(name = "Bill") + protected List bill; + @XmlElement(name = "Payments") + protected PayGenerateRq.Payments payments; + @XmlElement(name = "Receipt") + protected PayGenerateRq.Receipt receipt; + @XmlElement(name = "Banking") + protected PayGenerateRq.Banking banking; + + /** + * Gets the value of the msgRqHdr property. + * + * @return + * possible object is + * {@link MsgRqHdr } + * + */ + public MsgRqHdr getMsgRqHdr() { + return msgRqHdr; + } + + /** + * Sets the value of the msgRqHdr property. + * + * @param value + * allowed object is + * {@link MsgRqHdr } + * + */ + public void setMsgRqHdr(MsgRqHdr value) { + this.msgRqHdr = value; + } + + /** + * Gets the value of the bill property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the Jakarta XML Binding object. + * This is why there is not a set method for the bill property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getBill().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link PayGenerateRq.Bill } + * + * + */ + public List getBill() { + if (bill == null) { + bill = new ArrayList(); + } + return this.bill; + } + + /** + * Gets the value of the payments property. + * + * @return + * possible object is + * {@link PayGenerateRq.Payments } + * + */ + public PayGenerateRq.Payments getPayments() { + return payments; + } + + /** + * Sets the value of the payments property. + * + * @param value + * allowed object is + * {@link PayGenerateRq.Payments } + * + */ + public void setPayments(PayGenerateRq.Payments value) { + this.payments = value; + } + + /** + * Gets the value of the receipt property. + * + * @return + * possible object is + * {@link PayGenerateRq.Receipt } + * + */ + public PayGenerateRq.Receipt getReceipt() { + return receipt; + } + + /** + * Sets the value of the receipt property. + * + * @param value + * allowed object is + * {@link PayGenerateRq.Receipt } + * + */ + public void setReceipt(PayGenerateRq.Receipt value) { + this.receipt = value; + } + + /** + * Gets the value of the banking property. + * + * @return + * possible object is + * {@link PayGenerateRq.Banking } + * + */ + public PayGenerateRq.Banking getBanking() { + return banking; + } + + /** + * Sets the value of the banking property. + * + * @param value + * allowed object is + * {@link PayGenerateRq.Banking } + * + */ + public void setBanking(PayGenerateRq.Banking value) { + this.banking = value; + } + + + /** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+     * <complexType>
+     *   <complexContent>
+     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *       <sequence>
+     *         <element name="BankAcctTrnRec" maxOccurs="unbounded" minOccurs="0">
+     *           <complexType>
+     *             <complexContent>
+     *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *                 <sequence>
+     *                   <element name="TrnId" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+     *                   <element name="OrigDt" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded" minOccurs="0"/>
+     *                 </sequence>
+     *               </restriction>
+     *             </complexContent>
+     *           </complexType>
+     *         </element>
+     *       </sequence>
+     *     </restriction>
+     *   </complexContent>
+     * </complexType>
+     * 
+ * + * + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = { + "bankAcctTrnRec" + }) + public static class Banking { + + @XmlElement(name = "BankAcctTrnRec", namespace = "http://xmlns.banesco.com/ApplicationService/APIPaymentOutAppSvc") + protected List bankAcctTrnRec; + + /** + * Gets the value of the bankAcctTrnRec property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the Jakarta XML Binding object. + * This is why there is not a set method for the bankAcctTrnRec property. + * + *

+ * For example, to add a new item, do as follows: + *

+         *    getBankAcctTrnRec().add(newItem);
+         * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link PayGenerateRq.Banking.BankAcctTrnRec } + * + * + */ + public List getBankAcctTrnRec() { + if (bankAcctTrnRec == null) { + bankAcctTrnRec = new ArrayList(); + } + return this.bankAcctTrnRec; + } + + + /** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+         * <complexType>
+         *   <complexContent>
+         *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+         *       <sequence>
+         *         <element name="TrnId" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+         *         <element name="OrigDt" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded" minOccurs="0"/>
+         *       </sequence>
+         *     </restriction>
+         *   </complexContent>
+         * </complexType>
+         * 
+ * + * + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = { + "trnId", + "origDt" + }) + public static class BankAcctTrnRec { + + @XmlElement(name = "TrnId", namespace = "http://xmlns.banesco.com/ApplicationService/APIPaymentOutAppSvc") + protected String trnId; + @XmlElement(name = "OrigDt", namespace = "http://xmlns.banesco.com/ApplicationService/APIPaymentOutAppSvc") + protected List origDt; + + /** + * Gets the value of the trnId property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getTrnId() { + return trnId; + } + + /** + * Sets the value of the trnId property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setTrnId(String value) { + this.trnId = value; + } + + /** + * Gets the value of the origDt property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the Jakarta XML Binding object. + * This is why there is not a set method for the origDt property. + * + *

+ * For example, to add a new item, do as follows: + *

+             *    getOrigDt().add(newItem);
+             * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link String } + * + * + */ + public List getOrigDt() { + if (origDt == null) { + origDt = new ArrayList(); + } + return this.origDt; + } + + } + + } + + + /** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+     * <complexType>
+     *   <complexContent>
+     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *       <sequence>
+     *         <element name="Customer" minOccurs="0">
+     *           <complexType>
+     *             <complexContent>
+     *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *                 <sequence>
+     *                   <element name="PersonInfo" minOccurs="0">
+     *                     <complexType>
+     *                       <complexContent>
+     *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *                           <sequence>
+     *                             <element name="OtherIdentDoc" minOccurs="0">
+     *                               <complexType>
+     *                                 <complexContent>
+     *                                   <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *                                     <sequence>
+     *                                       <element name="IdentSerialNum" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+     *                                       <element name="Type" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+     *                                       <element name="Desc" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+     *                                     </sequence>
+     *                                   </restriction>
+     *                                 </complexContent>
+     *                               </complexType>
+     *                             </element>
+     *                           </sequence>
+     *                         </restriction>
+     *                       </complexContent>
+     *                     </complexType>
+     *                   </element>
+     *                   <element name="CustId">
+     *                     <complexType>
+     *                       <complexContent>
+     *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *                           <sequence>
+     *                             <element name="CustPermId" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+     *                           </sequence>
+     *                         </restriction>
+     *                       </complexContent>
+     *                     </complexType>
+     *                   </element>
+     *                 </sequence>
+     *               </restriction>
+     *             </complexContent>
+     *           </complexType>
+     *         </element>
+     *         <element name="GenericValue">
+     *           <complexType>
+     *             <complexContent>
+     *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *                 <sequence>
+     *                   <element name="Value" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+     *                 </sequence>
+     *               </restriction>
+     *             </complexContent>
+     *           </complexType>
+     *         </element>
+     *         <element name="Account" minOccurs="0">
+     *           <complexType>
+     *             <complexContent>
+     *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *                 <sequence>
+     *                   <element name="AcctId" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+     *                   <element name="Service" minOccurs="0">
+     *                     <complexType>
+     *                       <complexContent>
+     *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *                           <sequence>
+     *                             <element name="SvcCode" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+     *                           </sequence>
+     *                         </restriction>
+     *                       </complexContent>
+     *                     </complexType>
+     *                   </element>
+     *                 </sequence>
+     *               </restriction>
+     *             </complexContent>
+     *           </complexType>
+     *         </element>
+     *       </sequence>
+     *     </restriction>
+     *   </complexContent>
+     * </complexType>
+     * 
+ * + * + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = { + "customer", + "genericValue", + "account" + }) + public static class Bill { + + @XmlElement(name = "Customer", namespace = "http://xmlns.banesco.com/ApplicationService/APIPaymentOutAppSvc") + protected PayGenerateRq.Bill.Customer customer; + @XmlElement(name = "GenericValue", namespace = "http://xmlns.banesco.com/ApplicationService/APIPaymentOutAppSvc", required = true) + protected PayGenerateRq.Bill.GenericValue genericValue; + @XmlElement(name = "Account", namespace = "http://xmlns.banesco.com/ApplicationService/APIPaymentOutAppSvc") + protected PayGenerateRq.Bill.Account account; + + /** + * Gets the value of the customer property. + * + * @return + * possible object is + * {@link PayGenerateRq.Bill.Customer } + * + */ + public PayGenerateRq.Bill.Customer getCustomer() { + return customer; + } + + /** + * Sets the value of the customer property. + * + * @param value + * allowed object is + * {@link PayGenerateRq.Bill.Customer } + * + */ + public void setCustomer(PayGenerateRq.Bill.Customer value) { + this.customer = value; + } + + /** + * Gets the value of the genericValue property. + * + * @return + * possible object is + * {@link PayGenerateRq.Bill.GenericValue } + * + */ + public PayGenerateRq.Bill.GenericValue getGenericValue() { + return genericValue; + } + + /** + * Sets the value of the genericValue property. + * + * @param value + * allowed object is + * {@link PayGenerateRq.Bill.GenericValue } + * + */ + public void setGenericValue(PayGenerateRq.Bill.GenericValue value) { + this.genericValue = value; + } + + /** + * Gets the value of the account property. + * + * @return + * possible object is + * {@link PayGenerateRq.Bill.Account } + * + */ + public PayGenerateRq.Bill.Account getAccount() { + return account; + } + + /** + * Sets the value of the account property. + * + * @param value + * allowed object is + * {@link PayGenerateRq.Bill.Account } + * + */ + public void setAccount(PayGenerateRq.Bill.Account value) { + this.account = value; + } + + + /** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+         * <complexType>
+         *   <complexContent>
+         *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+         *       <sequence>
+         *         <element name="AcctId" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+         *         <element name="Service" minOccurs="0">
+         *           <complexType>
+         *             <complexContent>
+         *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+         *                 <sequence>
+         *                   <element name="SvcCode" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+         *                 </sequence>
+         *               </restriction>
+         *             </complexContent>
+         *           </complexType>
+         *         </element>
+         *       </sequence>
+         *     </restriction>
+         *   </complexContent>
+         * </complexType>
+         * 
+ * + * + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = { + "acctId", + "service" + }) + public static class Account { + + @XmlElement(name = "AcctId", namespace = "http://xmlns.banesco.com/ApplicationService/APIPaymentOutAppSvc") + protected String acctId; + @XmlElement(name = "Service", namespace = "http://xmlns.banesco.com/ApplicationService/APIPaymentOutAppSvc") + protected PayGenerateRq.Bill.Account.Service service; + + /** + * Gets the value of the acctId property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getAcctId() { + return acctId; + } + + /** + * Sets the value of the acctId property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setAcctId(String value) { + this.acctId = value; + } + + /** + * Gets the value of the service property. + * + * @return + * possible object is + * {@link PayGenerateRq.Bill.Account.Service } + * + */ + public PayGenerateRq.Bill.Account.Service getService() { + return service; + } + + /** + * Sets the value of the service property. + * + * @param value + * allowed object is + * {@link PayGenerateRq.Bill.Account.Service } + * + */ + public void setService(PayGenerateRq.Bill.Account.Service value) { + this.service = value; + } + + + /** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+             * <complexType>
+             *   <complexContent>
+             *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+             *       <sequence>
+             *         <element name="SvcCode" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+             *       </sequence>
+             *     </restriction>
+             *   </complexContent>
+             * </complexType>
+             * 
+ * + * + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = { + "svcCode" + }) + public static class Service { + + @XmlElement(name = "SvcCode", namespace = "http://xmlns.banesco.com/ApplicationService/APIPaymentOutAppSvc") + protected String svcCode; + + /** + * Gets the value of the svcCode property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getSvcCode() { + return svcCode; + } + + /** + * Sets the value of the svcCode property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setSvcCode(String value) { + this.svcCode = value; + } + + } + + } + + + /** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+         * <complexType>
+         *   <complexContent>
+         *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+         *       <sequence>
+         *         <element name="PersonInfo" minOccurs="0">
+         *           <complexType>
+         *             <complexContent>
+         *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+         *                 <sequence>
+         *                   <element name="OtherIdentDoc" minOccurs="0">
+         *                     <complexType>
+         *                       <complexContent>
+         *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+         *                           <sequence>
+         *                             <element name="IdentSerialNum" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+         *                             <element name="Type" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+         *                             <element name="Desc" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+         *                           </sequence>
+         *                         </restriction>
+         *                       </complexContent>
+         *                     </complexType>
+         *                   </element>
+         *                 </sequence>
+         *               </restriction>
+         *             </complexContent>
+         *           </complexType>
+         *         </element>
+         *         <element name="CustId">
+         *           <complexType>
+         *             <complexContent>
+         *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+         *                 <sequence>
+         *                   <element name="CustPermId" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+         *                 </sequence>
+         *               </restriction>
+         *             </complexContent>
+         *           </complexType>
+         *         </element>
+         *       </sequence>
+         *     </restriction>
+         *   </complexContent>
+         * </complexType>
+         * 
+ * + * + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = { + "personInfo", + "custId" + }) + public static class Customer { + + @XmlElement(name = "PersonInfo", namespace = "http://xmlns.banesco.com/ApplicationService/APIPaymentOutAppSvc") + protected PayGenerateRq.Bill.Customer.PersonInfo personInfo; + @XmlElement(name = "CustId", namespace = "http://xmlns.banesco.com/ApplicationService/APIPaymentOutAppSvc", required = true) + protected PayGenerateRq.Bill.Customer.CustId custId; + + /** + * Gets the value of the personInfo property. + * + * @return + * possible object is + * {@link PayGenerateRq.Bill.Customer.PersonInfo } + * + */ + public PayGenerateRq.Bill.Customer.PersonInfo getPersonInfo() { + return personInfo; + } + + /** + * Sets the value of the personInfo property. + * + * @param value + * allowed object is + * {@link PayGenerateRq.Bill.Customer.PersonInfo } + * + */ + public void setPersonInfo(PayGenerateRq.Bill.Customer.PersonInfo value) { + this.personInfo = value; + } + + /** + * Gets the value of the custId property. + * + * @return + * possible object is + * {@link PayGenerateRq.Bill.Customer.CustId } + * + */ + public PayGenerateRq.Bill.Customer.CustId getCustId() { + return custId; + } + + /** + * Sets the value of the custId property. + * + * @param value + * allowed object is + * {@link PayGenerateRq.Bill.Customer.CustId } + * + */ + public void setCustId(PayGenerateRq.Bill.Customer.CustId value) { + this.custId = value; + } + + + /** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+             * <complexType>
+             *   <complexContent>
+             *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+             *       <sequence>
+             *         <element name="CustPermId" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+             *       </sequence>
+             *     </restriction>
+             *   </complexContent>
+             * </complexType>
+             * 
+ * + * + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = { + "custPermId" + }) + public static class CustId { + + @XmlElement(name = "CustPermId", namespace = "http://xmlns.banesco.com/ApplicationService/APIPaymentOutAppSvc") + protected String custPermId; + + /** + * Gets the value of the custPermId property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getCustPermId() { + return custPermId; + } + + /** + * Sets the value of the custPermId property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setCustPermId(String value) { + this.custPermId = value; + } + + } + + + /** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+             * <complexType>
+             *   <complexContent>
+             *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+             *       <sequence>
+             *         <element name="OtherIdentDoc" minOccurs="0">
+             *           <complexType>
+             *             <complexContent>
+             *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+             *                 <sequence>
+             *                   <element name="IdentSerialNum" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+             *                   <element name="Type" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+             *                   <element name="Desc" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+             *                 </sequence>
+             *               </restriction>
+             *             </complexContent>
+             *           </complexType>
+             *         </element>
+             *       </sequence>
+             *     </restriction>
+             *   </complexContent>
+             * </complexType>
+             * 
+ * + * + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = { + "otherIdentDoc" + }) + public static class PersonInfo { + + @XmlElement(name = "OtherIdentDoc", namespace = "http://xmlns.banesco.com/ApplicationService/APIPaymentOutAppSvc") + protected PayGenerateRq.Bill.Customer.PersonInfo.OtherIdentDoc otherIdentDoc; + + /** + * Gets the value of the otherIdentDoc property. + * + * @return + * possible object is + * {@link PayGenerateRq.Bill.Customer.PersonInfo.OtherIdentDoc } + * + */ + public PayGenerateRq.Bill.Customer.PersonInfo.OtherIdentDoc getOtherIdentDoc() { + return otherIdentDoc; + } + + /** + * Sets the value of the otherIdentDoc property. + * + * @param value + * allowed object is + * {@link PayGenerateRq.Bill.Customer.PersonInfo.OtherIdentDoc } + * + */ + public void setOtherIdentDoc(PayGenerateRq.Bill.Customer.PersonInfo.OtherIdentDoc value) { + this.otherIdentDoc = value; + } + + + /** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+                 * <complexType>
+                 *   <complexContent>
+                 *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+                 *       <sequence>
+                 *         <element name="IdentSerialNum" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+                 *         <element name="Type" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+                 *         <element name="Desc" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+                 *       </sequence>
+                 *     </restriction>
+                 *   </complexContent>
+                 * </complexType>
+                 * 
+ * + * + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = { + "identSerialNum", + "type", + "desc" + }) + public static class OtherIdentDoc { + + @XmlElement(name = "IdentSerialNum", namespace = "http://xmlns.banesco.com/ApplicationService/APIPaymentOutAppSvc") + protected String identSerialNum; + @XmlElement(name = "Type", namespace = "http://xmlns.banesco.com/ApplicationService/APIPaymentOutAppSvc") + protected String type; + @XmlElement(name = "Desc", namespace = "http://xmlns.banesco.com/ApplicationService/APIPaymentOutAppSvc") + protected String desc; + + /** + * Gets the value of the identSerialNum property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getIdentSerialNum() { + return identSerialNum; + } + + /** + * Sets the value of the identSerialNum property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setIdentSerialNum(String value) { + this.identSerialNum = value; + } + + /** + * Gets the value of the type property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getType() { + return type; + } + + /** + * Sets the value of the type property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setType(String value) { + this.type = value; + } + + /** + * Gets the value of the desc property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getDesc() { + return desc; + } + + /** + * Sets the value of the desc property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setDesc(String value) { + this.desc = value; + } + + } + + } + + } + + + /** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+         * <complexType>
+         *   <complexContent>
+         *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+         *       <sequence>
+         *         <element name="Value" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+         *       </sequence>
+         *     </restriction>
+         *   </complexContent>
+         * </complexType>
+         * 
+ * + * + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = { + "value" + }) + public static class GenericValue { + + @XmlElement(name = "Value", namespace = "http://xmlns.banesco.com/ApplicationService/APIPaymentOutAppSvc") + protected String value; + + /** + * Gets the value of the value property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getValue() { + return value; + } + + /** + * Sets the value of the value property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setValue(String value) { + this.value = value; + } + + } + + } + + + /** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+     * <complexType>
+     *   <complexContent>
+     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *       <sequence>
+     *         <element name="PmtInfo" minOccurs="0">
+     *           <complexType>
+     *             <complexContent>
+     *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *                 <sequence>
+     *                   <element name="PmtRefId" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+     *                   <element name="Desc" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+     *                   <element name="Amt" type="{http://www.w3.org/2001/XMLSchema}double" minOccurs="0"/>
+     *                 </sequence>
+     *               </restriction>
+     *             </complexContent>
+     *           </complexType>
+     *         </element>
+     *         <element name="CurAmt" minOccurs="0">
+     *           <complexType>
+     *             <complexContent>
+     *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *                 <sequence>
+     *                   <element name="Amt" type="{http://www.w3.org/2001/XMLSchema}double" minOccurs="0"/>
+     *                 </sequence>
+     *               </restriction>
+     *             </complexContent>
+     *           </complexType>
+     *         </element>
+     *         <element name="Account" maxOccurs="unbounded" minOccurs="0">
+     *           <complexType>
+     *             <complexContent>
+     *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *                 <sequence>
+     *                   <element name="Customer" minOccurs="0">
+     *                     <complexType>
+     *                       <complexContent>
+     *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *                           <sequence>
+     *                             <element name="PersonInfo" minOccurs="0">
+     *                               <complexType>
+     *                                 <complexContent>
+     *                                   <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *                                     <sequence>
+     *                                       <element name="OtherIdentDoc" minOccurs="0">
+     *                                         <complexType>
+     *                                           <complexContent>
+     *                                             <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *                                               <sequence>
+     *                                                 <element name="IdentSerialNum" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+     *                                                 <element name="Type" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+     *                                               </sequence>
+     *                                             </restriction>
+     *                                           </complexContent>
+     *                                         </complexType>
+     *                                       </element>
+     *                                     </sequence>
+     *                                   </restriction>
+     *                                 </complexContent>
+     *                               </complexType>
+     *                             </element>
+     *                             <element name="CustId" minOccurs="0">
+     *                               <complexType>
+     *                                 <complexContent>
+     *                                   <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *                                     <sequence>
+     *                                       <element name="CustPermId" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded" minOccurs="0"/>
+     *                                       <element name="CustPermType" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+     *                                     </sequence>
+     *                                   </restriction>
+     *                                 </complexContent>
+     *                               </complexType>
+     *                             </element>
+     *                             <element name="CustInfo" minOccurs="0">
+     *                               <complexType>
+     *                                 <complexContent>
+     *                                   <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *                                     <sequence>
+     *                                       <element name="PhoneNum" maxOccurs="unbounded" minOccurs="0">
+     *                                         <complexType>
+     *                                           <complexContent>
+     *                                             <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *                                               <sequence>
+     *                                                 <element name="Phone" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+     *                                               </sequence>
+     *                                             </restriction>
+     *                                           </complexContent>
+     *                                         </complexType>
+     *                                       </element>
+     *                                     </sequence>
+     *                                   </restriction>
+     *                                 </complexContent>
+     *                               </complexType>
+     *                             </element>
+     *                             <element name="ContactInfo" maxOccurs="unbounded" minOccurs="0">
+     *                               <complexType>
+     *                                 <complexContent>
+     *                                   <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *                                     <sequence>
+     *                                       <element name="PhoneNum" maxOccurs="unbounded" minOccurs="0">
+     *                                         <complexType>
+     *                                           <complexContent>
+     *                                             <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *                                               <sequence>
+     *                                                 <element name="PhoneIden" maxOccurs="unbounded" minOccurs="0">
+     *                                                   <complexType>
+     *                                                     <complexContent>
+     *                                                       <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *                                                         <sequence>
+     *                                                           <element name="PhoneId" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+     *                                                         </sequence>
+     *                                                       </restriction>
+     *                                                     </complexContent>
+     *                                                   </complexType>
+     *                                                 </element>
+     *                                               </sequence>
+     *                                             </restriction>
+     *                                           </complexContent>
+     *                                         </complexType>
+     *                                       </element>
+     *                                     </sequence>
+     *                                   </restriction>
+     *                                 </complexContent>
+     *                               </complexType>
+     *                             </element>
+     *                             <element name="Product" minOccurs="0">
+     *                               <complexType>
+     *                                 <complexContent>
+     *                                   <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *                                     <sequence>
+     *                                       <element name="ProductId" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+     *                                     </sequence>
+     *                                   </restriction>
+     *                                 </complexContent>
+     *                               </complexType>
+     *                             </element>
+     *                           </sequence>
+     *                         </restriction>
+     *                       </complexContent>
+     *                     </complexType>
+     *                   </element>
+     *                   <element name="Bankinfo" maxOccurs="unbounded" minOccurs="0">
+     *                     <complexType>
+     *                       <complexContent>
+     *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *                           <sequence>
+     *                             <element name="BankId" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded" minOccurs="0"/>
+     *                           </sequence>
+     *                         </restriction>
+     *                       </complexContent>
+     *                     </complexType>
+     *                   </element>
+     *                   <element name="Service" minOccurs="0">
+     *                     <complexType>
+     *                       <complexContent>
+     *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *                           <sequence>
+     *                             <element name="SvcType" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+     *                           </sequence>
+     *                         </restriction>
+     *                       </complexContent>
+     *                     </complexType>
+     *                   </element>
+     *                 </sequence>
+     *               </restriction>
+     *             </complexContent>
+     *           </complexType>
+     *         </element>
+     *       </sequence>
+     *     </restriction>
+     *   </complexContent>
+     * </complexType>
+     * 
+ * + * + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = { + "pmtInfo", + "curAmt", + "account" + }) + public static class Payments { + + @XmlElement(name = "PmtInfo", namespace = "http://xmlns.banesco.com/ApplicationService/APIPaymentOutAppSvc") + protected PayGenerateRq.Payments.PmtInfo pmtInfo; + @XmlElement(name = "CurAmt", namespace = "http://xmlns.banesco.com/ApplicationService/APIPaymentOutAppSvc") + protected PayGenerateRq.Payments.CurAmt curAmt; + @XmlElement(name = "Account", namespace = "http://xmlns.banesco.com/ApplicationService/APIPaymentOutAppSvc") + protected List account; + + /** + * Gets the value of the pmtInfo property. + * + * @return + * possible object is + * {@link PayGenerateRq.Payments.PmtInfo } + * + */ + public PayGenerateRq.Payments.PmtInfo getPmtInfo() { + return pmtInfo; + } + + /** + * Sets the value of the pmtInfo property. + * + * @param value + * allowed object is + * {@link PayGenerateRq.Payments.PmtInfo } + * + */ + public void setPmtInfo(PayGenerateRq.Payments.PmtInfo value) { + this.pmtInfo = value; + } + + /** + * Gets the value of the curAmt property. + * + * @return + * possible object is + * {@link PayGenerateRq.Payments.CurAmt } + * + */ + public PayGenerateRq.Payments.CurAmt getCurAmt() { + return curAmt; + } + + /** + * Sets the value of the curAmt property. + * + * @param value + * allowed object is + * {@link PayGenerateRq.Payments.CurAmt } + * + */ + public void setCurAmt(PayGenerateRq.Payments.CurAmt value) { + this.curAmt = value; + } + + /** + * Gets the value of the account property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the Jakarta XML Binding object. + * This is why there is not a set method for the account property. + * + *

+ * For example, to add a new item, do as follows: + *

+         *    getAccount().add(newItem);
+         * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link PayGenerateRq.Payments.Account } + * + * + */ + public List getAccount() { + if (account == null) { + account = new ArrayList(); + } + return this.account; + } + + + /** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+         * <complexType>
+         *   <complexContent>
+         *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+         *       <sequence>
+         *         <element name="Customer" minOccurs="0">
+         *           <complexType>
+         *             <complexContent>
+         *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+         *                 <sequence>
+         *                   <element name="PersonInfo" minOccurs="0">
+         *                     <complexType>
+         *                       <complexContent>
+         *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+         *                           <sequence>
+         *                             <element name="OtherIdentDoc" minOccurs="0">
+         *                               <complexType>
+         *                                 <complexContent>
+         *                                   <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+         *                                     <sequence>
+         *                                       <element name="IdentSerialNum" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+         *                                       <element name="Type" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+         *                                     </sequence>
+         *                                   </restriction>
+         *                                 </complexContent>
+         *                               </complexType>
+         *                             </element>
+         *                           </sequence>
+         *                         </restriction>
+         *                       </complexContent>
+         *                     </complexType>
+         *                   </element>
+         *                   <element name="CustId" minOccurs="0">
+         *                     <complexType>
+         *                       <complexContent>
+         *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+         *                           <sequence>
+         *                             <element name="CustPermId" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded" minOccurs="0"/>
+         *                             <element name="CustPermType" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+         *                           </sequence>
+         *                         </restriction>
+         *                       </complexContent>
+         *                     </complexType>
+         *                   </element>
+         *                   <element name="CustInfo" minOccurs="0">
+         *                     <complexType>
+         *                       <complexContent>
+         *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+         *                           <sequence>
+         *                             <element name="PhoneNum" maxOccurs="unbounded" minOccurs="0">
+         *                               <complexType>
+         *                                 <complexContent>
+         *                                   <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+         *                                     <sequence>
+         *                                       <element name="Phone" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+         *                                     </sequence>
+         *                                   </restriction>
+         *                                 </complexContent>
+         *                               </complexType>
+         *                             </element>
+         *                           </sequence>
+         *                         </restriction>
+         *                       </complexContent>
+         *                     </complexType>
+         *                   </element>
+         *                   <element name="ContactInfo" maxOccurs="unbounded" minOccurs="0">
+         *                     <complexType>
+         *                       <complexContent>
+         *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+         *                           <sequence>
+         *                             <element name="PhoneNum" maxOccurs="unbounded" minOccurs="0">
+         *                               <complexType>
+         *                                 <complexContent>
+         *                                   <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+         *                                     <sequence>
+         *                                       <element name="PhoneIden" maxOccurs="unbounded" minOccurs="0">
+         *                                         <complexType>
+         *                                           <complexContent>
+         *                                             <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+         *                                               <sequence>
+         *                                                 <element name="PhoneId" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+         *                                               </sequence>
+         *                                             </restriction>
+         *                                           </complexContent>
+         *                                         </complexType>
+         *                                       </element>
+         *                                     </sequence>
+         *                                   </restriction>
+         *                                 </complexContent>
+         *                               </complexType>
+         *                             </element>
+         *                           </sequence>
+         *                         </restriction>
+         *                       </complexContent>
+         *                     </complexType>
+         *                   </element>
+         *                   <element name="Product" minOccurs="0">
+         *                     <complexType>
+         *                       <complexContent>
+         *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+         *                           <sequence>
+         *                             <element name="ProductId" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+         *                           </sequence>
+         *                         </restriction>
+         *                       </complexContent>
+         *                     </complexType>
+         *                   </element>
+         *                 </sequence>
+         *               </restriction>
+         *             </complexContent>
+         *           </complexType>
+         *         </element>
+         *         <element name="Bankinfo" maxOccurs="unbounded" minOccurs="0">
+         *           <complexType>
+         *             <complexContent>
+         *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+         *                 <sequence>
+         *                   <element name="BankId" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded" minOccurs="0"/>
+         *                 </sequence>
+         *               </restriction>
+         *             </complexContent>
+         *           </complexType>
+         *         </element>
+         *         <element name="Service" minOccurs="0">
+         *           <complexType>
+         *             <complexContent>
+         *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+         *                 <sequence>
+         *                   <element name="SvcType" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+         *                 </sequence>
+         *               </restriction>
+         *             </complexContent>
+         *           </complexType>
+         *         </element>
+         *       </sequence>
+         *     </restriction>
+         *   </complexContent>
+         * </complexType>
+         * 
+ * + * + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = { + "customer", + "bankinfo", + "service" + }) + public static class Account { + + @XmlElement(name = "Customer", namespace = "http://xmlns.banesco.com/ApplicationService/APIPaymentOutAppSvc") + protected PayGenerateRq.Payments.Account.Customer customer; + @XmlElement(name = "Bankinfo", namespace = "http://xmlns.banesco.com/ApplicationService/APIPaymentOutAppSvc") + protected List bankinfo; + @XmlElement(name = "Service", namespace = "http://xmlns.banesco.com/ApplicationService/APIPaymentOutAppSvc") + protected PayGenerateRq.Payments.Account.Service service; + + /** + * Gets the value of the customer property. + * + * @return + * possible object is + * {@link PayGenerateRq.Payments.Account.Customer } + * + */ + public PayGenerateRq.Payments.Account.Customer getCustomer() { + return customer; + } + + /** + * Sets the value of the customer property. + * + * @param value + * allowed object is + * {@link PayGenerateRq.Payments.Account.Customer } + * + */ + public void setCustomer(PayGenerateRq.Payments.Account.Customer value) { + this.customer = value; + } + + /** + * Gets the value of the bankinfo property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the Jakarta XML Binding object. + * This is why there is not a set method for the bankinfo property. + * + *

+ * For example, to add a new item, do as follows: + *

+             *    getBankinfo().add(newItem);
+             * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link PayGenerateRq.Payments.Account.Bankinfo } + * + * + */ + public List getBankinfo() { + if (bankinfo == null) { + bankinfo = new ArrayList(); + } + return this.bankinfo; + } + + /** + * Gets the value of the service property. + * + * @return + * possible object is + * {@link PayGenerateRq.Payments.Account.Service } + * + */ + public PayGenerateRq.Payments.Account.Service getService() { + return service; + } + + /** + * Sets the value of the service property. + * + * @param value + * allowed object is + * {@link PayGenerateRq.Payments.Account.Service } + * + */ + public void setService(PayGenerateRq.Payments.Account.Service value) { + this.service = value; + } + + + /** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+             * <complexType>
+             *   <complexContent>
+             *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+             *       <sequence>
+             *         <element name="BankId" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded" minOccurs="0"/>
+             *       </sequence>
+             *     </restriction>
+             *   </complexContent>
+             * </complexType>
+             * 
+ * + * + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = { + "bankId" + }) + public static class Bankinfo { + + @XmlElement(name = "BankId", namespace = "http://xmlns.banesco.com/ApplicationService/APIPaymentOutAppSvc") + protected List bankId; + + /** + * Gets the value of the bankId property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the Jakarta XML Binding object. + * This is why there is not a set method for the bankId property. + * + *

+ * For example, to add a new item, do as follows: + *

+                 *    getBankId().add(newItem);
+                 * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link String } + * + * + */ + public List getBankId() { + if (bankId == null) { + bankId = new ArrayList(); + } + return this.bankId; + } + + } + + + /** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+             * <complexType>
+             *   <complexContent>
+             *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+             *       <sequence>
+             *         <element name="PersonInfo" minOccurs="0">
+             *           <complexType>
+             *             <complexContent>
+             *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+             *                 <sequence>
+             *                   <element name="OtherIdentDoc" minOccurs="0">
+             *                     <complexType>
+             *                       <complexContent>
+             *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+             *                           <sequence>
+             *                             <element name="IdentSerialNum" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+             *                             <element name="Type" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+             *                           </sequence>
+             *                         </restriction>
+             *                       </complexContent>
+             *                     </complexType>
+             *                   </element>
+             *                 </sequence>
+             *               </restriction>
+             *             </complexContent>
+             *           </complexType>
+             *         </element>
+             *         <element name="CustId" minOccurs="0">
+             *           <complexType>
+             *             <complexContent>
+             *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+             *                 <sequence>
+             *                   <element name="CustPermId" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded" minOccurs="0"/>
+             *                   <element name="CustPermType" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+             *                 </sequence>
+             *               </restriction>
+             *             </complexContent>
+             *           </complexType>
+             *         </element>
+             *         <element name="CustInfo" minOccurs="0">
+             *           <complexType>
+             *             <complexContent>
+             *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+             *                 <sequence>
+             *                   <element name="PhoneNum" maxOccurs="unbounded" minOccurs="0">
+             *                     <complexType>
+             *                       <complexContent>
+             *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+             *                           <sequence>
+             *                             <element name="Phone" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+             *                           </sequence>
+             *                         </restriction>
+             *                       </complexContent>
+             *                     </complexType>
+             *                   </element>
+             *                 </sequence>
+             *               </restriction>
+             *             </complexContent>
+             *           </complexType>
+             *         </element>
+             *         <element name="ContactInfo" maxOccurs="unbounded" minOccurs="0">
+             *           <complexType>
+             *             <complexContent>
+             *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+             *                 <sequence>
+             *                   <element name="PhoneNum" maxOccurs="unbounded" minOccurs="0">
+             *                     <complexType>
+             *                       <complexContent>
+             *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+             *                           <sequence>
+             *                             <element name="PhoneIden" maxOccurs="unbounded" minOccurs="0">
+             *                               <complexType>
+             *                                 <complexContent>
+             *                                   <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+             *                                     <sequence>
+             *                                       <element name="PhoneId" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+             *                                     </sequence>
+             *                                   </restriction>
+             *                                 </complexContent>
+             *                               </complexType>
+             *                             </element>
+             *                           </sequence>
+             *                         </restriction>
+             *                       </complexContent>
+             *                     </complexType>
+             *                   </element>
+             *                 </sequence>
+             *               </restriction>
+             *             </complexContent>
+             *           </complexType>
+             *         </element>
+             *         <element name="Product" minOccurs="0">
+             *           <complexType>
+             *             <complexContent>
+             *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+             *                 <sequence>
+             *                   <element name="ProductId" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+             *                 </sequence>
+             *               </restriction>
+             *             </complexContent>
+             *           </complexType>
+             *         </element>
+             *       </sequence>
+             *     </restriction>
+             *   </complexContent>
+             * </complexType>
+             * 
+ * + * + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = { + "personInfo", + "custId", + "custInfo", + "contactInfo", + "product" + }) + public static class Customer { + + @XmlElement(name = "PersonInfo", namespace = "http://xmlns.banesco.com/ApplicationService/APIPaymentOutAppSvc") + protected PayGenerateRq.Payments.Account.Customer.PersonInfo personInfo; + @XmlElement(name = "CustId", namespace = "http://xmlns.banesco.com/ApplicationService/APIPaymentOutAppSvc") + protected PayGenerateRq.Payments.Account.Customer.CustId custId; + @XmlElement(name = "CustInfo", namespace = "http://xmlns.banesco.com/ApplicationService/APIPaymentOutAppSvc") + protected PayGenerateRq.Payments.Account.Customer.CustInfo custInfo; + @XmlElement(name = "ContactInfo", namespace = "http://xmlns.banesco.com/ApplicationService/APIPaymentOutAppSvc") + protected List contactInfo; + @XmlElement(name = "Product", namespace = "http://xmlns.banesco.com/ApplicationService/APIPaymentOutAppSvc") + protected PayGenerateRq.Payments.Account.Customer.Product product; + + /** + * Gets the value of the personInfo property. + * + * @return + * possible object is + * {@link PayGenerateRq.Payments.Account.Customer.PersonInfo } + * + */ + public PayGenerateRq.Payments.Account.Customer.PersonInfo getPersonInfo() { + return personInfo; + } + + /** + * Sets the value of the personInfo property. + * + * @param value + * allowed object is + * {@link PayGenerateRq.Payments.Account.Customer.PersonInfo } + * + */ + public void setPersonInfo(PayGenerateRq.Payments.Account.Customer.PersonInfo value) { + this.personInfo = value; + } + + /** + * Gets the value of the custId property. + * + * @return + * possible object is + * {@link PayGenerateRq.Payments.Account.Customer.CustId } + * + */ + public PayGenerateRq.Payments.Account.Customer.CustId getCustId() { + return custId; + } + + /** + * Sets the value of the custId property. + * + * @param value + * allowed object is + * {@link PayGenerateRq.Payments.Account.Customer.CustId } + * + */ + public void setCustId(PayGenerateRq.Payments.Account.Customer.CustId value) { + this.custId = value; + } + + /** + * Gets the value of the custInfo property. + * + * @return + * possible object is + * {@link PayGenerateRq.Payments.Account.Customer.CustInfo } + * + */ + public PayGenerateRq.Payments.Account.Customer.CustInfo getCustInfo() { + return custInfo; + } + + /** + * Sets the value of the custInfo property. + * + * @param value + * allowed object is + * {@link PayGenerateRq.Payments.Account.Customer.CustInfo } + * + */ + public void setCustInfo(PayGenerateRq.Payments.Account.Customer.CustInfo value) { + this.custInfo = value; + } + + /** + * Gets the value of the contactInfo property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the Jakarta XML Binding object. + * This is why there is not a set method for the contactInfo property. + * + *

+ * For example, to add a new item, do as follows: + *

+                 *    getContactInfo().add(newItem);
+                 * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link PayGenerateRq.Payments.Account.Customer.ContactInfo } + * + * + */ + public List getContactInfo() { + if (contactInfo == null) { + contactInfo = new ArrayList(); + } + return this.contactInfo; + } + + /** + * Gets the value of the product property. + * + * @return + * possible object is + * {@link PayGenerateRq.Payments.Account.Customer.Product } + * + */ + public PayGenerateRq.Payments.Account.Customer.Product getProduct() { + return product; + } + + /** + * Sets the value of the product property. + * + * @param value + * allowed object is + * {@link PayGenerateRq.Payments.Account.Customer.Product } + * + */ + public void setProduct(PayGenerateRq.Payments.Account.Customer.Product value) { + this.product = value; + } + + + /** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+                 * <complexType>
+                 *   <complexContent>
+                 *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+                 *       <sequence>
+                 *         <element name="PhoneNum" maxOccurs="unbounded" minOccurs="0">
+                 *           <complexType>
+                 *             <complexContent>
+                 *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+                 *                 <sequence>
+                 *                   <element name="PhoneIden" maxOccurs="unbounded" minOccurs="0">
+                 *                     <complexType>
+                 *                       <complexContent>
+                 *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+                 *                           <sequence>
+                 *                             <element name="PhoneId" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+                 *                           </sequence>
+                 *                         </restriction>
+                 *                       </complexContent>
+                 *                     </complexType>
+                 *                   </element>
+                 *                 </sequence>
+                 *               </restriction>
+                 *             </complexContent>
+                 *           </complexType>
+                 *         </element>
+                 *       </sequence>
+                 *     </restriction>
+                 *   </complexContent>
+                 * </complexType>
+                 * 
+ * + * + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = { + "phoneNum" + }) + public static class ContactInfo { + + @XmlElement(name = "PhoneNum", namespace = "http://xmlns.banesco.com/ApplicationService/APIPaymentOutAppSvc") + protected List phoneNum; + + /** + * Gets the value of the phoneNum property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the Jakarta XML Binding object. + * This is why there is not a set method for the phoneNum property. + * + *

+ * For example, to add a new item, do as follows: + *

+                     *    getPhoneNum().add(newItem);
+                     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link PayGenerateRq.Payments.Account.Customer.ContactInfo.PhoneNum } + * + * + */ + public List getPhoneNum() { + if (phoneNum == null) { + phoneNum = new ArrayList(); + } + return this.phoneNum; + } + + + /** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+                     * <complexType>
+                     *   <complexContent>
+                     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+                     *       <sequence>
+                     *         <element name="PhoneIden" maxOccurs="unbounded" minOccurs="0">
+                     *           <complexType>
+                     *             <complexContent>
+                     *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+                     *                 <sequence>
+                     *                   <element name="PhoneId" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+                     *                 </sequence>
+                     *               </restriction>
+                     *             </complexContent>
+                     *           </complexType>
+                     *         </element>
+                     *       </sequence>
+                     *     </restriction>
+                     *   </complexContent>
+                     * </complexType>
+                     * 
+ * + * + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = { + "phoneIden" + }) + public static class PhoneNum { + + @XmlElement(name = "PhoneIden", namespace = "http://xmlns.banesco.com/ApplicationService/APIPaymentOutAppSvc") + protected List phoneIden; + + /** + * Gets the value of the phoneIden property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the Jakarta XML Binding object. + * This is why there is not a set method for the phoneIden property. + * + *

+ * For example, to add a new item, do as follows: + *

+                         *    getPhoneIden().add(newItem);
+                         * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link PayGenerateRq.Payments.Account.Customer.ContactInfo.PhoneNum.PhoneIden } + * + * + */ + public List getPhoneIden() { + if (phoneIden == null) { + phoneIden = new ArrayList(); + } + return this.phoneIden; + } + + + /** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+                         * <complexType>
+                         *   <complexContent>
+                         *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+                         *       <sequence>
+                         *         <element name="PhoneId" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+                         *       </sequence>
+                         *     </restriction>
+                         *   </complexContent>
+                         * </complexType>
+                         * 
+ * + * + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = { + "phoneId" + }) + public static class PhoneIden { + + @XmlElement(name = "PhoneId", namespace = "http://xmlns.banesco.com/ApplicationService/APIPaymentOutAppSvc") + protected String phoneId; + + /** + * Gets the value of the phoneId property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getPhoneId() { + return phoneId; + } + + /** + * Sets the value of the phoneId property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setPhoneId(String value) { + this.phoneId = value; + } + + } + + } + + } + + + /** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+                 * <complexType>
+                 *   <complexContent>
+                 *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+                 *       <sequence>
+                 *         <element name="CustPermId" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded" minOccurs="0"/>
+                 *         <element name="CustPermType" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+                 *       </sequence>
+                 *     </restriction>
+                 *   </complexContent>
+                 * </complexType>
+                 * 
+ * + * + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = { + "custPermId", + "custPermType" + }) + public static class CustId { + + @XmlElement(name = "CustPermId", namespace = "http://xmlns.banesco.com/ApplicationService/APIPaymentOutAppSvc") + protected List custPermId; + @XmlElement(name = "CustPermType", namespace = "http://xmlns.banesco.com/ApplicationService/APIPaymentOutAppSvc") + protected String custPermType; + + /** + * Gets the value of the custPermId property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the Jakarta XML Binding object. + * This is why there is not a set method for the custPermId property. + * + *

+ * For example, to add a new item, do as follows: + *

+                     *    getCustPermId().add(newItem);
+                     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link String } + * + * + */ + public List getCustPermId() { + if (custPermId == null) { + custPermId = new ArrayList(); + } + return this.custPermId; + } + + /** + * Gets the value of the custPermType property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getCustPermType() { + return custPermType; + } + + /** + * Sets the value of the custPermType property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setCustPermType(String value) { + this.custPermType = value; + } + + } + + + /** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+                 * <complexType>
+                 *   <complexContent>
+                 *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+                 *       <sequence>
+                 *         <element name="PhoneNum" maxOccurs="unbounded" minOccurs="0">
+                 *           <complexType>
+                 *             <complexContent>
+                 *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+                 *                 <sequence>
+                 *                   <element name="Phone" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+                 *                 </sequence>
+                 *               </restriction>
+                 *             </complexContent>
+                 *           </complexType>
+                 *         </element>
+                 *       </sequence>
+                 *     </restriction>
+                 *   </complexContent>
+                 * </complexType>
+                 * 
+ * + * + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = { + "phoneNum" + }) + public static class CustInfo { + + @XmlElement(name = "PhoneNum", namespace = "http://xmlns.banesco.com/ApplicationService/APIPaymentOutAppSvc") + protected List phoneNum; + + /** + * Gets the value of the phoneNum property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the Jakarta XML Binding object. + * This is why there is not a set method for the phoneNum property. + * + *

+ * For example, to add a new item, do as follows: + *

+                     *    getPhoneNum().add(newItem);
+                     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link PayGenerateRq.Payments.Account.Customer.CustInfo.PhoneNum } + * + * + */ + public List getPhoneNum() { + if (phoneNum == null) { + phoneNum = new ArrayList(); + } + return this.phoneNum; + } + + + /** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+                     * <complexType>
+                     *   <complexContent>
+                     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+                     *       <sequence>
+                     *         <element name="Phone" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+                     *       </sequence>
+                     *     </restriction>
+                     *   </complexContent>
+                     * </complexType>
+                     * 
+ * + * + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = { + "phone" + }) + public static class PhoneNum { + + @XmlElement(name = "Phone", namespace = "http://xmlns.banesco.com/ApplicationService/APIPaymentOutAppSvc") + protected String phone; + + /** + * Gets the value of the phone property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getPhone() { + return phone; + } + + /** + * Sets the value of the phone property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setPhone(String value) { + this.phone = value; + } + + } + + } + + + /** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+                 * <complexType>
+                 *   <complexContent>
+                 *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+                 *       <sequence>
+                 *         <element name="OtherIdentDoc" minOccurs="0">
+                 *           <complexType>
+                 *             <complexContent>
+                 *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+                 *                 <sequence>
+                 *                   <element name="IdentSerialNum" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+                 *                   <element name="Type" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+                 *                 </sequence>
+                 *               </restriction>
+                 *             </complexContent>
+                 *           </complexType>
+                 *         </element>
+                 *       </sequence>
+                 *     </restriction>
+                 *   </complexContent>
+                 * </complexType>
+                 * 
+ * + * + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = { + "otherIdentDoc" + }) + public static class PersonInfo { + + @XmlElement(name = "OtherIdentDoc", namespace = "http://xmlns.banesco.com/ApplicationService/APIPaymentOutAppSvc") + protected PayGenerateRq.Payments.Account.Customer.PersonInfo.OtherIdentDoc otherIdentDoc; + + /** + * Gets the value of the otherIdentDoc property. + * + * @return + * possible object is + * {@link PayGenerateRq.Payments.Account.Customer.PersonInfo.OtherIdentDoc } + * + */ + public PayGenerateRq.Payments.Account.Customer.PersonInfo.OtherIdentDoc getOtherIdentDoc() { + return otherIdentDoc; + } + + /** + * Sets the value of the otherIdentDoc property. + * + * @param value + * allowed object is + * {@link PayGenerateRq.Payments.Account.Customer.PersonInfo.OtherIdentDoc } + * + */ + public void setOtherIdentDoc(PayGenerateRq.Payments.Account.Customer.PersonInfo.OtherIdentDoc value) { + this.otherIdentDoc = value; + } + + + /** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+                     * <complexType>
+                     *   <complexContent>
+                     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+                     *       <sequence>
+                     *         <element name="IdentSerialNum" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+                     *         <element name="Type" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+                     *       </sequence>
+                     *     </restriction>
+                     *   </complexContent>
+                     * </complexType>
+                     * 
+ * + * + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = { + "identSerialNum", + "type" + }) + public static class OtherIdentDoc { + + @XmlElement(name = "IdentSerialNum", namespace = "http://xmlns.banesco.com/ApplicationService/APIPaymentOutAppSvc") + protected String identSerialNum; + @XmlElement(name = "Type", namespace = "http://xmlns.banesco.com/ApplicationService/APIPaymentOutAppSvc") + protected String type; + + /** + * Gets the value of the identSerialNum property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getIdentSerialNum() { + return identSerialNum; + } + + /** + * Sets the value of the identSerialNum property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setIdentSerialNum(String value) { + this.identSerialNum = value; + } + + /** + * Gets the value of the type property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getType() { + return type; + } + + /** + * Sets the value of the type property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setType(String value) { + this.type = value; + } + + } + + } + + + /** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+                 * <complexType>
+                 *   <complexContent>
+                 *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+                 *       <sequence>
+                 *         <element name="ProductId" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+                 *       </sequence>
+                 *     </restriction>
+                 *   </complexContent>
+                 * </complexType>
+                 * 
+ * + * + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = { + "productId" + }) + public static class Product { + + @XmlElement(name = "ProductId", namespace = "http://xmlns.banesco.com/ApplicationService/APIPaymentOutAppSvc") + protected String productId; + + /** + * Gets the value of the productId property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getProductId() { + return productId; + } + + /** + * Sets the value of the productId property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setProductId(String value) { + this.productId = value; + } + + } + + } + + + /** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+             * <complexType>
+             *   <complexContent>
+             *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+             *       <sequence>
+             *         <element name="SvcType" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+             *       </sequence>
+             *     </restriction>
+             *   </complexContent>
+             * </complexType>
+             * 
+ * + * + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = { + "svcType" + }) + public static class Service { + + @XmlElement(name = "SvcType", namespace = "http://xmlns.banesco.com/ApplicationService/APIPaymentOutAppSvc") + protected String svcType; + + /** + * Gets the value of the svcType property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getSvcType() { + return svcType; + } + + /** + * Sets the value of the svcType property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setSvcType(String value) { + this.svcType = value; + } + + } + + } + + + /** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+         * <complexType>
+         *   <complexContent>
+         *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+         *       <sequence>
+         *         <element name="Amt" type="{http://www.w3.org/2001/XMLSchema}double" minOccurs="0"/>
+         *       </sequence>
+         *     </restriction>
+         *   </complexContent>
+         * </complexType>
+         * 
+ * + * + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = { + "amt" + }) + public static class CurAmt { + + @XmlElement(name = "Amt", namespace = "http://xmlns.banesco.com/ApplicationService/APIPaymentOutAppSvc") + protected Double amt; + + /** + * Gets the value of the amt property. + * + * @return + * possible object is + * {@link Double } + * + */ + public Double getAmt() { + return amt; + } + + /** + * Sets the value of the amt property. + * + * @param value + * allowed object is + * {@link Double } + * + */ + public void setAmt(Double value) { + this.amt = value; + } + + } + + + /** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+         * <complexType>
+         *   <complexContent>
+         *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+         *       <sequence>
+         *         <element name="PmtRefId" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+         *         <element name="Desc" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+         *         <element name="Amt" type="{http://www.w3.org/2001/XMLSchema}double" minOccurs="0"/>
+         *       </sequence>
+         *     </restriction>
+         *   </complexContent>
+         * </complexType>
+         * 
+ * + * + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = { + "pmtRefId", + "desc", + "amt" + }) + public static class PmtInfo { + + @XmlElement(name = "PmtRefId", namespace = "http://xmlns.banesco.com/ApplicationService/APIPaymentOutAppSvc") + protected String pmtRefId; + @XmlElement(name = "Desc", namespace = "http://xmlns.banesco.com/ApplicationService/APIPaymentOutAppSvc") + protected String desc; + @XmlElement(name = "Amt", namespace = "http://xmlns.banesco.com/ApplicationService/APIPaymentOutAppSvc") + protected Double amt; + + /** + * Gets the value of the pmtRefId property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getPmtRefId() { + return pmtRefId; + } + + /** + * Sets the value of the pmtRefId property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setPmtRefId(String value) { + this.pmtRefId = value; + } + + /** + * Gets the value of the desc property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getDesc() { + return desc; + } + + /** + * Sets the value of the desc property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setDesc(String value) { + this.desc = value; + } + + /** + * Gets the value of the amt property. + * + * @return + * possible object is + * {@link Double } + * + */ + public Double getAmt() { + return amt; + } + + /** + * Sets the value of the amt property. + * + * @param value + * allowed object is + * {@link Double } + * + */ + public void setAmt(Double value) { + this.amt = value; + } + + } + + } + + + /** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+     * <complexType>
+     *   <complexContent>
+     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *       <sequence>
+     *         <element name="RefNum" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+     *       </sequence>
+     *     </restriction>
+     *   </complexContent>
+     * </complexType>
+     * 
+ * + * + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = { + "refNum" + }) + public static class Receipt { + + @XmlElement(name = "RefNum", namespace = "http://xmlns.banesco.com/ApplicationService/APIPaymentOutAppSvc") + protected String refNum; + + /** + * Gets the value of the refNum property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getRefNum() { + return refNum; + } + + /** + * Sets the value of the refNum property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setRefNum(String value) { + this.refNum = value; + } + + } + +} diff --git a/update-card-status/src/main/java/com/banesco/commons/soap/client/apipaymentoutappsvc/PayGenerateRs.java b/update-card-status/src/main/java/com/banesco/commons/soap/client/apipaymentoutappsvc/PayGenerateRs.java new file mode 100644 index 0000000..822cbfe --- /dev/null +++ b/update-card-status/src/main/java/com/banesco/commons/soap/client/apipaymentoutappsvc/PayGenerateRs.java @@ -0,0 +1,953 @@ + +package com.banesco.commons.soap.client.apipaymentoutappsvc; + +import jakarta.xml.bind.annotation.XmlAccessType; +import jakarta.xml.bind.annotation.XmlAccessorType; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlType; + +import java.util.ArrayList; +import java.util.List; + + +/** + *

Java class for payGenerate_Rs complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="payGenerate_Rs">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="MsgRsHdr" type="{http://xmlns.banesco.com/EnterpriseObjects/MsgRsHdr}MsgRsHdr" minOccurs="0"/>
+ *         <element name="Status" type="{http://xmlns.banesco.com/EnterpriseObjects/Status}Status" minOccurs="0"/>
+ *         <element name="Payments" maxOccurs="unbounded" minOccurs="0">
+ *           <complexType>
+ *             <complexContent>
+ *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                 <sequence>
+ *                   <element name="PmtInfo" minOccurs="0">
+ *                     <complexType>
+ *                       <complexContent>
+ *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                           <sequence>
+ *                             <element name="Desc" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *                           </sequence>
+ *                         </restriction>
+ *                       </complexContent>
+ *                     </complexType>
+ *                   </element>
+ *                   <element name="Account" maxOccurs="unbounded" minOccurs="0">
+ *                     <complexType>
+ *                       <complexContent>
+ *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                           <sequence>
+ *                             <element name="AcctId" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *                             <element name="Customer" minOccurs="0">
+ *                               <complexType>
+ *                                 <complexContent>
+ *                                   <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                                     <sequence>
+ *                                       <element name="PersonInfo" minOccurs="0">
+ *                                         <complexType>
+ *                                           <complexContent>
+ *                                             <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                                               <sequence>
+ *                                                 <element name="FullName" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *                                               </sequence>
+ *                                             </restriction>
+ *                                           </complexContent>
+ *                                         </complexType>
+ *                                       </element>
+ *                                       <element name="OrgInfo" minOccurs="0">
+ *                                         <complexType>
+ *                                           <complexContent>
+ *                                             <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                                               <sequence>
+ *                                                 <element name="OrgId" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *                                                 <element name="Name" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *                                               </sequence>
+ *                                             </restriction>
+ *                                           </complexContent>
+ *                                         </complexType>
+ *                                       </element>
+ *                                     </sequence>
+ *                                   </restriction>
+ *                                 </complexContent>
+ *                               </complexType>
+ *                             </element>
+ *                             <element name="Banking" minOccurs="0">
+ *                               <complexType>
+ *                                 <complexContent>
+ *                                   <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                                     <sequence>
+ *                                       <element name="BankAcctTrnRec" minOccurs="0">
+ *                                         <complexType>
+ *                                           <complexContent>
+ *                                             <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                                               <sequence>
+ *                                                 <element name="TrnId" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *                                               </sequence>
+ *                                             </restriction>
+ *                                           </complexContent>
+ *                                         </complexType>
+ *                                       </element>
+ *                                     </sequence>
+ *                                   </restriction>
+ *                                 </complexContent>
+ *                               </complexType>
+ *                             </element>
+ *                           </sequence>
+ *                         </restriction>
+ *                       </complexContent>
+ *                     </complexType>
+ *                   </element>
+ *                 </sequence>
+ *               </restriction>
+ *             </complexContent>
+ *           </complexType>
+ *         </element>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "payGenerate_Rs", namespace = "http://xmlns.banesco.com/ApplicationService/APIPaymentOutAppSvc", propOrder = { + "msgRsHdr", + "status", + "payments" +}) +public class PayGenerateRs { + + @XmlElement(name = "MsgRsHdr") + protected MsgRsHdr msgRsHdr; + @XmlElement(name = "Status") + protected Status status; + @XmlElement(name = "Payments") + protected List payments; + + /** + * Gets the value of the msgRsHdr property. + * + * @return + * possible object is + * {@link MsgRsHdr } + * + */ + public MsgRsHdr getMsgRsHdr() { + return msgRsHdr; + } + + /** + * Sets the value of the msgRsHdr property. + * + * @param value + * allowed object is + * {@link MsgRsHdr } + * + */ + public void setMsgRsHdr(MsgRsHdr value) { + this.msgRsHdr = value; + } + + /** + * Gets the value of the status property. + * + * @return + * possible object is + * {@link Status } + * + */ + public Status getStatus() { + return status; + } + + /** + * Sets the value of the status property. + * + * @param value + * allowed object is + * {@link Status } + * + */ + public void setStatus(Status value) { + this.status = value; + } + + /** + * Gets the value of the payments property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the Jakarta XML Binding object. + * This is why there is not a set method for the payments property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getPayments().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link PayGenerateRs.Payments } + * + * + */ + public List getPayments() { + if (payments == null) { + payments = new ArrayList(); + } + return this.payments; + } + + + /** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+     * <complexType>
+     *   <complexContent>
+     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *       <sequence>
+     *         <element name="PmtInfo" minOccurs="0">
+     *           <complexType>
+     *             <complexContent>
+     *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *                 <sequence>
+     *                   <element name="Desc" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+     *                 </sequence>
+     *               </restriction>
+     *             </complexContent>
+     *           </complexType>
+     *         </element>
+     *         <element name="Account" maxOccurs="unbounded" minOccurs="0">
+     *           <complexType>
+     *             <complexContent>
+     *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *                 <sequence>
+     *                   <element name="AcctId" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+     *                   <element name="Customer" minOccurs="0">
+     *                     <complexType>
+     *                       <complexContent>
+     *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *                           <sequence>
+     *                             <element name="PersonInfo" minOccurs="0">
+     *                               <complexType>
+     *                                 <complexContent>
+     *                                   <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *                                     <sequence>
+     *                                       <element name="FullName" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+     *                                     </sequence>
+     *                                   </restriction>
+     *                                 </complexContent>
+     *                               </complexType>
+     *                             </element>
+     *                             <element name="OrgInfo" minOccurs="0">
+     *                               <complexType>
+     *                                 <complexContent>
+     *                                   <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *                                     <sequence>
+     *                                       <element name="OrgId" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+     *                                       <element name="Name" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+     *                                     </sequence>
+     *                                   </restriction>
+     *                                 </complexContent>
+     *                               </complexType>
+     *                             </element>
+     *                           </sequence>
+     *                         </restriction>
+     *                       </complexContent>
+     *                     </complexType>
+     *                   </element>
+     *                   <element name="Banking" minOccurs="0">
+     *                     <complexType>
+     *                       <complexContent>
+     *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *                           <sequence>
+     *                             <element name="BankAcctTrnRec" minOccurs="0">
+     *                               <complexType>
+     *                                 <complexContent>
+     *                                   <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *                                     <sequence>
+     *                                       <element name="TrnId" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+     *                                     </sequence>
+     *                                   </restriction>
+     *                                 </complexContent>
+     *                               </complexType>
+     *                             </element>
+     *                           </sequence>
+     *                         </restriction>
+     *                       </complexContent>
+     *                     </complexType>
+     *                   </element>
+     *                 </sequence>
+     *               </restriction>
+     *             </complexContent>
+     *           </complexType>
+     *         </element>
+     *       </sequence>
+     *     </restriction>
+     *   </complexContent>
+     * </complexType>
+     * 
+ * + * + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = { + "pmtInfo", + "account" + }) + public static class Payments { + + @XmlElement(name = "PmtInfo", namespace = "http://xmlns.banesco.com/ApplicationService/APIPaymentOutAppSvc") + protected PayGenerateRs.Payments.PmtInfo pmtInfo; + @XmlElement(name = "Account", namespace = "http://xmlns.banesco.com/ApplicationService/APIPaymentOutAppSvc") + protected List account; + + /** + * Gets the value of the pmtInfo property. + * + * @return + * possible object is + * {@link PayGenerateRs.Payments.PmtInfo } + * + */ + public PayGenerateRs.Payments.PmtInfo getPmtInfo() { + return pmtInfo; + } + + /** + * Sets the value of the pmtInfo property. + * + * @param value + * allowed object is + * {@link PayGenerateRs.Payments.PmtInfo } + * + */ + public void setPmtInfo(PayGenerateRs.Payments.PmtInfo value) { + this.pmtInfo = value; + } + + /** + * Gets the value of the account property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the Jakarta XML Binding object. + * This is why there is not a set method for the account property. + * + *

+ * For example, to add a new item, do as follows: + *

+         *    getAccount().add(newItem);
+         * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link PayGenerateRs.Payments.Account } + * + * + */ + public List getAccount() { + if (account == null) { + account = new ArrayList(); + } + return this.account; + } + + + /** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+         * <complexType>
+         *   <complexContent>
+         *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+         *       <sequence>
+         *         <element name="AcctId" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+         *         <element name="Customer" minOccurs="0">
+         *           <complexType>
+         *             <complexContent>
+         *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+         *                 <sequence>
+         *                   <element name="PersonInfo" minOccurs="0">
+         *                     <complexType>
+         *                       <complexContent>
+         *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+         *                           <sequence>
+         *                             <element name="FullName" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+         *                           </sequence>
+         *                         </restriction>
+         *                       </complexContent>
+         *                     </complexType>
+         *                   </element>
+         *                   <element name="OrgInfo" minOccurs="0">
+         *                     <complexType>
+         *                       <complexContent>
+         *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+         *                           <sequence>
+         *                             <element name="OrgId" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+         *                             <element name="Name" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+         *                           </sequence>
+         *                         </restriction>
+         *                       </complexContent>
+         *                     </complexType>
+         *                   </element>
+         *                 </sequence>
+         *               </restriction>
+         *             </complexContent>
+         *           </complexType>
+         *         </element>
+         *         <element name="Banking" minOccurs="0">
+         *           <complexType>
+         *             <complexContent>
+         *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+         *                 <sequence>
+         *                   <element name="BankAcctTrnRec" minOccurs="0">
+         *                     <complexType>
+         *                       <complexContent>
+         *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+         *                           <sequence>
+         *                             <element name="TrnId" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+         *                           </sequence>
+         *                         </restriction>
+         *                       </complexContent>
+         *                     </complexType>
+         *                   </element>
+         *                 </sequence>
+         *               </restriction>
+         *             </complexContent>
+         *           </complexType>
+         *         </element>
+         *       </sequence>
+         *     </restriction>
+         *   </complexContent>
+         * </complexType>
+         * 
+ * + * + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = { + "acctId", + "customer", + "banking" + }) + public static class Account { + + @XmlElement(name = "AcctId", namespace = "http://xmlns.banesco.com/ApplicationService/APIPaymentOutAppSvc") + protected String acctId; + @XmlElement(name = "Customer", namespace = "http://xmlns.banesco.com/ApplicationService/APIPaymentOutAppSvc") + protected PayGenerateRs.Payments.Account.Customer customer; + @XmlElement(name = "Banking", namespace = "http://xmlns.banesco.com/ApplicationService/APIPaymentOutAppSvc") + protected PayGenerateRs.Payments.Account.Banking banking; + + /** + * Gets the value of the acctId property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getAcctId() { + return acctId; + } + + /** + * Sets the value of the acctId property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setAcctId(String value) { + this.acctId = value; + } + + /** + * Gets the value of the customer property. + * + * @return + * possible object is + * {@link PayGenerateRs.Payments.Account.Customer } + * + */ + public PayGenerateRs.Payments.Account.Customer getCustomer() { + return customer; + } + + /** + * Sets the value of the customer property. + * + * @param value + * allowed object is + * {@link PayGenerateRs.Payments.Account.Customer } + * + */ + public void setCustomer(PayGenerateRs.Payments.Account.Customer value) { + this.customer = value; + } + + /** + * Gets the value of the banking property. + * + * @return + * possible object is + * {@link PayGenerateRs.Payments.Account.Banking } + * + */ + public PayGenerateRs.Payments.Account.Banking getBanking() { + return banking; + } + + /** + * Sets the value of the banking property. + * + * @param value + * allowed object is + * {@link PayGenerateRs.Payments.Account.Banking } + * + */ + public void setBanking(PayGenerateRs.Payments.Account.Banking value) { + this.banking = value; + } + + + /** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+             * <complexType>
+             *   <complexContent>
+             *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+             *       <sequence>
+             *         <element name="BankAcctTrnRec" minOccurs="0">
+             *           <complexType>
+             *             <complexContent>
+             *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+             *                 <sequence>
+             *                   <element name="TrnId" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+             *                 </sequence>
+             *               </restriction>
+             *             </complexContent>
+             *           </complexType>
+             *         </element>
+             *       </sequence>
+             *     </restriction>
+             *   </complexContent>
+             * </complexType>
+             * 
+ * + * + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = { + "bankAcctTrnRec" + }) + public static class Banking { + + @XmlElement(name = "BankAcctTrnRec", namespace = "http://xmlns.banesco.com/ApplicationService/APIPaymentOutAppSvc") + protected PayGenerateRs.Payments.Account.Banking.BankAcctTrnRec bankAcctTrnRec; + + /** + * Gets the value of the bankAcctTrnRec property. + * + * @return + * possible object is + * {@link PayGenerateRs.Payments.Account.Banking.BankAcctTrnRec } + * + */ + public PayGenerateRs.Payments.Account.Banking.BankAcctTrnRec getBankAcctTrnRec() { + return bankAcctTrnRec; + } + + /** + * Sets the value of the bankAcctTrnRec property. + * + * @param value + * allowed object is + * {@link PayGenerateRs.Payments.Account.Banking.BankAcctTrnRec } + * + */ + public void setBankAcctTrnRec(PayGenerateRs.Payments.Account.Banking.BankAcctTrnRec value) { + this.bankAcctTrnRec = value; + } + + + /** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+                 * <complexType>
+                 *   <complexContent>
+                 *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+                 *       <sequence>
+                 *         <element name="TrnId" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+                 *       </sequence>
+                 *     </restriction>
+                 *   </complexContent>
+                 * </complexType>
+                 * 
+ * + * + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = { + "trnId" + }) + public static class BankAcctTrnRec { + + @XmlElement(name = "TrnId", namespace = "http://xmlns.banesco.com/ApplicationService/APIPaymentOutAppSvc") + protected String trnId; + + /** + * Gets the value of the trnId property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getTrnId() { + return trnId; + } + + /** + * Sets the value of the trnId property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setTrnId(String value) { + this.trnId = value; + } + + } + + } + + + /** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+             * <complexType>
+             *   <complexContent>
+             *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+             *       <sequence>
+             *         <element name="PersonInfo" minOccurs="0">
+             *           <complexType>
+             *             <complexContent>
+             *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+             *                 <sequence>
+             *                   <element name="FullName" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+             *                 </sequence>
+             *               </restriction>
+             *             </complexContent>
+             *           </complexType>
+             *         </element>
+             *         <element name="OrgInfo" minOccurs="0">
+             *           <complexType>
+             *             <complexContent>
+             *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+             *                 <sequence>
+             *                   <element name="OrgId" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+             *                   <element name="Name" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+             *                 </sequence>
+             *               </restriction>
+             *             </complexContent>
+             *           </complexType>
+             *         </element>
+             *       </sequence>
+             *     </restriction>
+             *   </complexContent>
+             * </complexType>
+             * 
+ * + * + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = { + "personInfo", + "orgInfo" + }) + public static class Customer { + + @XmlElement(name = "PersonInfo", namespace = "http://xmlns.banesco.com/ApplicationService/APIPaymentOutAppSvc") + protected PayGenerateRs.Payments.Account.Customer.PersonInfo personInfo; + @XmlElement(name = "OrgInfo", namespace = "http://xmlns.banesco.com/ApplicationService/APIPaymentOutAppSvc") + protected PayGenerateRs.Payments.Account.Customer.OrgInfo orgInfo; + + /** + * Gets the value of the personInfo property. + * + * @return + * possible object is + * {@link PayGenerateRs.Payments.Account.Customer.PersonInfo } + * + */ + public PayGenerateRs.Payments.Account.Customer.PersonInfo getPersonInfo() { + return personInfo; + } + + /** + * Sets the value of the personInfo property. + * + * @param value + * allowed object is + * {@link PayGenerateRs.Payments.Account.Customer.PersonInfo } + * + */ + public void setPersonInfo(PayGenerateRs.Payments.Account.Customer.PersonInfo value) { + this.personInfo = value; + } + + /** + * Gets the value of the orgInfo property. + * + * @return + * possible object is + * {@link PayGenerateRs.Payments.Account.Customer.OrgInfo } + * + */ + public PayGenerateRs.Payments.Account.Customer.OrgInfo getOrgInfo() { + return orgInfo; + } + + /** + * Sets the value of the orgInfo property. + * + * @param value + * allowed object is + * {@link PayGenerateRs.Payments.Account.Customer.OrgInfo } + * + */ + public void setOrgInfo(PayGenerateRs.Payments.Account.Customer.OrgInfo value) { + this.orgInfo = value; + } + + + /** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+                 * <complexType>
+                 *   <complexContent>
+                 *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+                 *       <sequence>
+                 *         <element name="OrgId" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+                 *         <element name="Name" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+                 *       </sequence>
+                 *     </restriction>
+                 *   </complexContent>
+                 * </complexType>
+                 * 
+ * + * + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = { + "orgId", + "name" + }) + public static class OrgInfo { + + @XmlElement(name = "OrgId", namespace = "http://xmlns.banesco.com/ApplicationService/APIPaymentOutAppSvc") + protected String orgId; + @XmlElement(name = "Name", namespace = "http://xmlns.banesco.com/ApplicationService/APIPaymentOutAppSvc") + protected String name; + + /** + * Gets the value of the orgId property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getOrgId() { + return orgId; + } + + /** + * Sets the value of the orgId property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setOrgId(String value) { + this.orgId = value; + } + + /** + * Gets the value of the name property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getName() { + return name; + } + + /** + * Sets the value of the name property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setName(String value) { + this.name = value; + } + + } + + + /** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+                 * <complexType>
+                 *   <complexContent>
+                 *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+                 *       <sequence>
+                 *         <element name="FullName" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+                 *       </sequence>
+                 *     </restriction>
+                 *   </complexContent>
+                 * </complexType>
+                 * 
+ * + * + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = { + "fullName" + }) + public static class PersonInfo { + + @XmlElement(name = "FullName", namespace = "http://xmlns.banesco.com/ApplicationService/APIPaymentOutAppSvc") + protected String fullName; + + /** + * Gets the value of the fullName property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getFullName() { + return fullName; + } + + /** + * Sets the value of the fullName property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setFullName(String value) { + this.fullName = value; + } + + } + + } + + } + + + /** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+         * <complexType>
+         *   <complexContent>
+         *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+         *       <sequence>
+         *         <element name="Desc" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+         *       </sequence>
+         *     </restriction>
+         *   </complexContent>
+         * </complexType>
+         * 
+ * + * + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = { + "desc" + }) + public static class PmtInfo { + + @XmlElement(name = "Desc", namespace = "http://xmlns.banesco.com/ApplicationService/APIPaymentOutAppSvc") + protected String desc; + + /** + * Gets the value of the desc property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getDesc() { + return desc; + } + + /** + * Sets the value of the desc property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setDesc(String value) { + this.desc = value; + } + + } + + } + +} diff --git a/update-card-status/src/main/java/com/banesco/commons/soap/client/apipaymentoutappsvc/ReadPaymentRq.java b/update-card-status/src/main/java/com/banesco/commons/soap/client/apipaymentoutappsvc/ReadPaymentRq.java new file mode 100644 index 0000000..d752e31 --- /dev/null +++ b/update-card-status/src/main/java/com/banesco/commons/soap/client/apipaymentoutappsvc/ReadPaymentRq.java @@ -0,0 +1,419 @@ + +package com.banesco.commons.soap.client.apipaymentoutappsvc; + +import jakarta.xml.bind.annotation.*; + +import java.util.ArrayList; +import java.util.List; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="MsgRqHdr" type="{http://xmlns.banesco.com/EnterpriseObjects/MsgRqHdr}MsgRqHdr" minOccurs="0"/>
+ *         <element name="Payments" maxOccurs="unbounded" minOccurs="0">
+ *           <complexType>
+ *             <complexContent>
+ *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                 <sequence>
+ *                   <element name="Account" maxOccurs="unbounded" minOccurs="0">
+ *                     <complexType>
+ *                       <complexContent>
+ *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                           <sequence>
+ *                             <element name="Service" minOccurs="0">
+ *                               <complexType>
+ *                                 <complexContent>
+ *                                   <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                                     <sequence>
+ *                                       <element name="SvcCode" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *                                     </sequence>
+ *                                   </restriction>
+ *                                 </complexContent>
+ *                               </complexType>
+ *                             </element>
+ *                           </sequence>
+ *                         </restriction>
+ *                       </complexContent>
+ *                     </complexType>
+ *                   </element>
+ *                 </sequence>
+ *               </restriction>
+ *             </complexContent>
+ *           </complexType>
+ *         </element>
+ *         <element name="Receipt" minOccurs="0">
+ *           <complexType>
+ *             <complexContent>
+ *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                 <sequence>
+ *                   <element name="RefNum" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *                 </sequence>
+ *               </restriction>
+ *             </complexContent>
+ *           </complexType>
+ *         </element>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "", propOrder = { + "msgRqHdr", + "payments", + "receipt" +}) +@XmlRootElement(name = "readPayment_Rq", namespace = "http://xmlns.banesco.com/ApplicationService/APIPaymentOutAppSvc") +public class ReadPaymentRq { + + @XmlElement(name = "MsgRqHdr", namespace = "http://xmlns.banesco.com/ApplicationService/APIPaymentOutAppSvc") + protected MsgRqHdr msgRqHdr; + @XmlElement(name = "Payments", namespace = "http://xmlns.banesco.com/ApplicationService/APIPaymentOutAppSvc") + protected List payments; + @XmlElement(name = "Receipt", namespace = "http://xmlns.banesco.com/ApplicationService/APIPaymentOutAppSvc") + protected ReadPaymentRq.Receipt receipt; + + /** + * Gets the value of the msgRqHdr property. + * + * @return + * possible object is + * {@link MsgRqHdr } + * + */ + public MsgRqHdr getMsgRqHdr() { + return msgRqHdr; + } + + /** + * Sets the value of the msgRqHdr property. + * + * @param value + * allowed object is + * {@link MsgRqHdr } + * + */ + public void setMsgRqHdr(MsgRqHdr value) { + this.msgRqHdr = value; + } + + /** + * Gets the value of the payments property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the Jakarta XML Binding object. + * This is why there is not a set method for the payments property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getPayments().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link ReadPaymentRq.Payments } + * + * + */ + public List getPayments() { + if (payments == null) { + payments = new ArrayList(); + } + return this.payments; + } + + /** + * Gets the value of the receipt property. + * + * @return + * possible object is + * {@link ReadPaymentRq.Receipt } + * + */ + public ReadPaymentRq.Receipt getReceipt() { + return receipt; + } + + /** + * Sets the value of the receipt property. + * + * @param value + * allowed object is + * {@link ReadPaymentRq.Receipt } + * + */ + public void setReceipt(ReadPaymentRq.Receipt value) { + this.receipt = value; + } + + + /** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+     * <complexType>
+     *   <complexContent>
+     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *       <sequence>
+     *         <element name="Account" maxOccurs="unbounded" minOccurs="0">
+     *           <complexType>
+     *             <complexContent>
+     *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *                 <sequence>
+     *                   <element name="Service" minOccurs="0">
+     *                     <complexType>
+     *                       <complexContent>
+     *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *                           <sequence>
+     *                             <element name="SvcCode" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+     *                           </sequence>
+     *                         </restriction>
+     *                       </complexContent>
+     *                     </complexType>
+     *                   </element>
+     *                 </sequence>
+     *               </restriction>
+     *             </complexContent>
+     *           </complexType>
+     *         </element>
+     *       </sequence>
+     *     </restriction>
+     *   </complexContent>
+     * </complexType>
+     * 
+ * + * + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = { + "account" + }) + public static class Payments { + + @XmlElement(name = "Account", namespace = "http://xmlns.banesco.com/ApplicationService/APIPaymentOutAppSvc") + protected List account; + + /** + * Gets the value of the account property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the Jakarta XML Binding object. + * This is why there is not a set method for the account property. + * + *

+ * For example, to add a new item, do as follows: + *

+         *    getAccount().add(newItem);
+         * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link ReadPaymentRq.Payments.Account } + * + * + */ + public List getAccount() { + if (account == null) { + account = new ArrayList(); + } + return this.account; + } + + + /** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+         * <complexType>
+         *   <complexContent>
+         *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+         *       <sequence>
+         *         <element name="Service" minOccurs="0">
+         *           <complexType>
+         *             <complexContent>
+         *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+         *                 <sequence>
+         *                   <element name="SvcCode" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+         *                 </sequence>
+         *               </restriction>
+         *             </complexContent>
+         *           </complexType>
+         *         </element>
+         *       </sequence>
+         *     </restriction>
+         *   </complexContent>
+         * </complexType>
+         * 
+ * + * + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = { + "service" + }) + public static class Account { + + @XmlElement(name = "Service", namespace = "http://xmlns.banesco.com/ApplicationService/APIPaymentOutAppSvc") + protected ReadPaymentRq.Payments.Account.Service service; + + /** + * Gets the value of the service property. + * + * @return + * possible object is + * {@link ReadPaymentRq.Payments.Account.Service } + * + */ + public ReadPaymentRq.Payments.Account.Service getService() { + return service; + } + + /** + * Sets the value of the service property. + * + * @param value + * allowed object is + * {@link ReadPaymentRq.Payments.Account.Service } + * + */ + public void setService(ReadPaymentRq.Payments.Account.Service value) { + this.service = value; + } + + + /** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+             * <complexType>
+             *   <complexContent>
+             *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+             *       <sequence>
+             *         <element name="SvcCode" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+             *       </sequence>
+             *     </restriction>
+             *   </complexContent>
+             * </complexType>
+             * 
+ * + * + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = { + "svcCode" + }) + public static class Service { + + @XmlElement(name = "SvcCode", namespace = "http://xmlns.banesco.com/ApplicationService/APIPaymentOutAppSvc") + protected String svcCode; + + /** + * Gets the value of the svcCode property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getSvcCode() { + return svcCode; + } + + /** + * Sets the value of the svcCode property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setSvcCode(String value) { + this.svcCode = value; + } + + } + + } + + } + + + /** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+     * <complexType>
+     *   <complexContent>
+     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *       <sequence>
+     *         <element name="RefNum" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+     *       </sequence>
+     *     </restriction>
+     *   </complexContent>
+     * </complexType>
+     * 
+ * + * + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = { + "refNum" + }) + public static class Receipt { + + @XmlElement(name = "RefNum", namespace = "http://xmlns.banesco.com/ApplicationService/APIPaymentOutAppSvc") + protected String refNum; + + /** + * Gets the value of the refNum property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getRefNum() { + return refNum; + } + + /** + * Sets the value of the refNum property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setRefNum(String value) { + this.refNum = value; + } + + } + +} diff --git a/update-card-status/src/main/java/com/banesco/commons/soap/client/apipaymentoutappsvc/ReadPaymentRs.java b/update-card-status/src/main/java/com/banesco/commons/soap/client/apipaymentoutappsvc/ReadPaymentRs.java new file mode 100644 index 0000000..d1d1d56 --- /dev/null +++ b/update-card-status/src/main/java/com/banesco/commons/soap/client/apipaymentoutappsvc/ReadPaymentRs.java @@ -0,0 +1,578 @@ + +package com.banesco.commons.soap.client.apipaymentoutappsvc; + +import jakarta.xml.bind.annotation.*; + +import java.util.ArrayList; +import java.util.List; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="MsgRsHdr" type="{http://xmlns.banesco.com/EnterpriseObjects/MsgRsHdr}MsgRsHdr" minOccurs="0"/>
+ *         <element name="Status" type="{http://xmlns.banesco.com/EnterpriseObjects/Status}Status" minOccurs="0"/>
+ *         <element name="Payments" maxOccurs="unbounded" minOccurs="0">
+ *           <complexType>
+ *             <complexContent>
+ *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                 <sequence>
+ *                   <element name="CurAmt" minOccurs="0">
+ *                     <complexType>
+ *                       <complexContent>
+ *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                           <sequence>
+ *                             <element name="Amt" type="{http://www.w3.org/2001/XMLSchema}double"/>
+ *                           </sequence>
+ *                         </restriction>
+ *                       </complexContent>
+ *                     </complexType>
+ *                   </element>
+ *                   <element name="Account" maxOccurs="unbounded" minOccurs="0">
+ *                     <complexType>
+ *                       <complexContent>
+ *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                           <sequence>
+ *                             <element name="AcctId" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded" minOccurs="0"/>
+ *                             <element name="Service" minOccurs="0">
+ *                               <complexType>
+ *                                 <complexContent>
+ *                                   <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                                     <sequence>
+ *                                       <element name="SvcCode" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *                                     </sequence>
+ *                                   </restriction>
+ *                                 </complexContent>
+ *                               </complexType>
+ *                             </element>
+ *                           </sequence>
+ *                         </restriction>
+ *                       </complexContent>
+ *                     </complexType>
+ *                   </element>
+ *                 </sequence>
+ *               </restriction>
+ *             </complexContent>
+ *           </complexType>
+ *         </element>
+ *         <element name="Receipt" minOccurs="0">
+ *           <complexType>
+ *             <complexContent>
+ *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                 <sequence>
+ *                   <element name="RefNum" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *                 </sequence>
+ *               </restriction>
+ *             </complexContent>
+ *           </complexType>
+ *         </element>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "", propOrder = { + "msgRsHdr", + "status", + "payments", + "receipt" +}) +@XmlRootElement(name = "readPayment_Rs", namespace = "http://xmlns.banesco.com/ApplicationService/APIPaymentOutAppSvc") +public class ReadPaymentRs { + + @XmlElement(name = "MsgRsHdr", namespace = "http://xmlns.banesco.com/ApplicationService/APIPaymentOutAppSvc") + protected MsgRsHdr msgRsHdr; + @XmlElement(name = "Status", namespace = "http://xmlns.banesco.com/ApplicationService/APIPaymentOutAppSvc") + protected Status status; + @XmlElement(name = "Payments", namespace = "http://xmlns.banesco.com/ApplicationService/APIPaymentOutAppSvc") + protected List payments; + @XmlElement(name = "Receipt", namespace = "http://xmlns.banesco.com/ApplicationService/APIPaymentOutAppSvc") + protected ReadPaymentRs.Receipt receipt; + + /** + * Gets the value of the msgRsHdr property. + * + * @return + * possible object is + * {@link MsgRsHdr } + * + */ + public MsgRsHdr getMsgRsHdr() { + return msgRsHdr; + } + + /** + * Sets the value of the msgRsHdr property. + * + * @param value + * allowed object is + * {@link MsgRsHdr } + * + */ + public void setMsgRsHdr(MsgRsHdr value) { + this.msgRsHdr = value; + } + + /** + * Gets the value of the status property. + * + * @return + * possible object is + * {@link Status } + * + */ + public Status getStatus() { + return status; + } + + /** + * Sets the value of the status property. + * + * @param value + * allowed object is + * {@link Status } + * + */ + public void setStatus(Status value) { + this.status = value; + } + + /** + * Gets the value of the payments property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the Jakarta XML Binding object. + * This is why there is not a set method for the payments property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getPayments().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link ReadPaymentRs.Payments } + * + * + */ + public List getPayments() { + if (payments == null) { + payments = new ArrayList(); + } + return this.payments; + } + + /** + * Gets the value of the receipt property. + * + * @return + * possible object is + * {@link ReadPaymentRs.Receipt } + * + */ + public ReadPaymentRs.Receipt getReceipt() { + return receipt; + } + + /** + * Sets the value of the receipt property. + * + * @param value + * allowed object is + * {@link ReadPaymentRs.Receipt } + * + */ + public void setReceipt(ReadPaymentRs.Receipt value) { + this.receipt = value; + } + + + /** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+     * <complexType>
+     *   <complexContent>
+     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *       <sequence>
+     *         <element name="CurAmt" minOccurs="0">
+     *           <complexType>
+     *             <complexContent>
+     *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *                 <sequence>
+     *                   <element name="Amt" type="{http://www.w3.org/2001/XMLSchema}double"/>
+     *                 </sequence>
+     *               </restriction>
+     *             </complexContent>
+     *           </complexType>
+     *         </element>
+     *         <element name="Account" maxOccurs="unbounded" minOccurs="0">
+     *           <complexType>
+     *             <complexContent>
+     *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *                 <sequence>
+     *                   <element name="AcctId" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded" minOccurs="0"/>
+     *                   <element name="Service" minOccurs="0">
+     *                     <complexType>
+     *                       <complexContent>
+     *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *                           <sequence>
+     *                             <element name="SvcCode" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+     *                           </sequence>
+     *                         </restriction>
+     *                       </complexContent>
+     *                     </complexType>
+     *                   </element>
+     *                 </sequence>
+     *               </restriction>
+     *             </complexContent>
+     *           </complexType>
+     *         </element>
+     *       </sequence>
+     *     </restriction>
+     *   </complexContent>
+     * </complexType>
+     * 
+ * + * + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = { + "curAmt", + "account" + }) + public static class Payments { + + @XmlElement(name = "CurAmt", namespace = "http://xmlns.banesco.com/ApplicationService/APIPaymentOutAppSvc") + protected ReadPaymentRs.Payments.CurAmt curAmt; + @XmlElement(name = "Account", namespace = "http://xmlns.banesco.com/ApplicationService/APIPaymentOutAppSvc") + protected List account; + + /** + * Gets the value of the curAmt property. + * + * @return + * possible object is + * {@link ReadPaymentRs.Payments.CurAmt } + * + */ + public ReadPaymentRs.Payments.CurAmt getCurAmt() { + return curAmt; + } + + /** + * Sets the value of the curAmt property. + * + * @param value + * allowed object is + * {@link ReadPaymentRs.Payments.CurAmt } + * + */ + public void setCurAmt(ReadPaymentRs.Payments.CurAmt value) { + this.curAmt = value; + } + + /** + * Gets the value of the account property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the Jakarta XML Binding object. + * This is why there is not a set method for the account property. + * + *

+ * For example, to add a new item, do as follows: + *

+         *    getAccount().add(newItem);
+         * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link ReadPaymentRs.Payments.Account } + * + * + */ + public List getAccount() { + if (account == null) { + account = new ArrayList(); + } + return this.account; + } + + + /** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+         * <complexType>
+         *   <complexContent>
+         *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+         *       <sequence>
+         *         <element name="AcctId" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded" minOccurs="0"/>
+         *         <element name="Service" minOccurs="0">
+         *           <complexType>
+         *             <complexContent>
+         *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+         *                 <sequence>
+         *                   <element name="SvcCode" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+         *                 </sequence>
+         *               </restriction>
+         *             </complexContent>
+         *           </complexType>
+         *         </element>
+         *       </sequence>
+         *     </restriction>
+         *   </complexContent>
+         * </complexType>
+         * 
+ * + * + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = { + "acctId", + "service" + }) + public static class Account { + + @XmlElement(name = "AcctId", namespace = "http://xmlns.banesco.com/ApplicationService/APIPaymentOutAppSvc") + protected List acctId; + @XmlElement(name = "Service", namespace = "http://xmlns.banesco.com/ApplicationService/APIPaymentOutAppSvc") + protected ReadPaymentRs.Payments.Account.Service service; + + /** + * Gets the value of the acctId property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the Jakarta XML Binding object. + * This is why there is not a set method for the acctId property. + * + *

+ * For example, to add a new item, do as follows: + *

+             *    getAcctId().add(newItem);
+             * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link String } + * + * + */ + public List getAcctId() { + if (acctId == null) { + acctId = new ArrayList(); + } + return this.acctId; + } + + /** + * Gets the value of the service property. + * + * @return + * possible object is + * {@link ReadPaymentRs.Payments.Account.Service } + * + */ + public ReadPaymentRs.Payments.Account.Service getService() { + return service; + } + + /** + * Sets the value of the service property. + * + * @param value + * allowed object is + * {@link ReadPaymentRs.Payments.Account.Service } + * + */ + public void setService(ReadPaymentRs.Payments.Account.Service value) { + this.service = value; + } + + + /** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+             * <complexType>
+             *   <complexContent>
+             *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+             *       <sequence>
+             *         <element name="SvcCode" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+             *       </sequence>
+             *     </restriction>
+             *   </complexContent>
+             * </complexType>
+             * 
+ * + * + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = { + "svcCode" + }) + public static class Service { + + @XmlElement(name = "SvcCode", namespace = "http://xmlns.banesco.com/ApplicationService/APIPaymentOutAppSvc") + protected String svcCode; + + /** + * Gets the value of the svcCode property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getSvcCode() { + return svcCode; + } + + /** + * Sets the value of the svcCode property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setSvcCode(String value) { + this.svcCode = value; + } + + } + + } + + + /** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+         * <complexType>
+         *   <complexContent>
+         *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+         *       <sequence>
+         *         <element name="Amt" type="{http://www.w3.org/2001/XMLSchema}double"/>
+         *       </sequence>
+         *     </restriction>
+         *   </complexContent>
+         * </complexType>
+         * 
+ * + * + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = { + "amt" + }) + public static class CurAmt { + + @XmlElement(name = "Amt", namespace = "http://xmlns.banesco.com/ApplicationService/APIPaymentOutAppSvc") + protected double amt; + + /** + * Gets the value of the amt property. + * + */ + public double getAmt() { + return amt; + } + + /** + * Sets the value of the amt property. + * + */ + public void setAmt(double value) { + this.amt = value; + } + + } + + } + + + /** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+     * <complexType>
+     *   <complexContent>
+     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *       <sequence>
+     *         <element name="RefNum" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+     *       </sequence>
+     *     </restriction>
+     *   </complexContent>
+     * </complexType>
+     * 
+ * + * + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = { + "refNum" + }) + public static class Receipt { + + @XmlElement(name = "RefNum", namespace = "http://xmlns.banesco.com/ApplicationService/APIPaymentOutAppSvc") + protected String refNum; + + /** + * Gets the value of the refNum property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getRefNum() { + return refNum; + } + + /** + * Sets the value of the refNum property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setRefNum(String value) { + this.refNum = value; + } + + } + +} diff --git a/update-card-status/src/main/java/com/banesco/commons/soap/client/apipaymentoutappsvc/RecCtrlIn.java b/update-card-status/src/main/java/com/banesco/commons/soap/client/apipaymentoutappsvc/RecCtrlIn.java new file mode 100644 index 0000000..e6f734f --- /dev/null +++ b/update-card-status/src/main/java/com/banesco/commons/soap/client/apipaymentoutappsvc/RecCtrlIn.java @@ -0,0 +1,62 @@ + +package com.banesco.commons.soap.client.apipaymentoutappsvc; + +import jakarta.xml.bind.annotation.XmlAccessType; +import jakarta.xml.bind.annotation.XmlAccessorType; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlType; + + +/** + *

Java class for RecCtrlIn complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="RecCtrlIn">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="MaxRec" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "RecCtrlIn", propOrder = { + "maxRec" +}) +public class RecCtrlIn { + + @XmlElement(name = "MaxRec") + protected String maxRec; + + /** + * Gets the value of the maxRec property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getMaxRec() { + return maxRec; + } + + /** + * Sets the value of the maxRec property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setMaxRec(String value) { + this.maxRec = value; + } + +} diff --git a/update-card-status/src/main/java/com/banesco/commons/soap/client/apipaymentoutappsvc/Status.java b/update-card-status/src/main/java/com/banesco/commons/soap/client/apipaymentoutappsvc/Status.java new file mode 100644 index 0000000..8d66381 --- /dev/null +++ b/update-card-status/src/main/java/com/banesco/commons/soap/client/apipaymentoutappsvc/Status.java @@ -0,0 +1,295 @@ + +package com.banesco.commons.soap.client.apipaymentoutappsvc; + +import jakarta.xml.bind.annotation.XmlAccessType; +import jakarta.xml.bind.annotation.XmlAccessorType; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlType; + +import java.math.BigInteger; +import java.util.ArrayList; +import java.util.List; + + +/** + *

Java class for Status complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="Status">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="StatusType" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="StatusCode" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="StatusDesc" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="ApplicationName" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="LineNumber" type="{http://www.w3.org/2001/XMLSchema}integer" minOccurs="0"/>
+ *         <element name="AdditionalStatus" type="{http://xmlns.banesco.com/EnterpriseObjects/Status}AdditionalStatus" maxOccurs="unbounded" minOccurs="0"/>
+ *         <element name="Severity" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="StatusInd" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="LogId" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "Status", namespace = "http://xmlns.banesco.com/EnterpriseObjects/Status", propOrder = { + "statusType", + "statusCode", + "statusDesc", + "applicationName", + "lineNumber", + "additionalStatus", + "severity", + "statusInd", + "logId" +}) +public class Status { + + @XmlElement(name = "StatusType") + protected String statusType; + @XmlElement(name = "StatusCode") + protected String statusCode; + @XmlElement(name = "StatusDesc") + protected String statusDesc; + @XmlElement(name = "ApplicationName") + protected String applicationName; + @XmlElement(name = "LineNumber") + protected BigInteger lineNumber; + @XmlElement(name = "AdditionalStatus") + protected List additionalStatus; + @XmlElement(name = "Severity") + protected String severity; + @XmlElement(name = "StatusInd") + protected String statusInd; + @XmlElement(name = "LogId") + protected String logId; + + /** + * Gets the value of the statusType property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getStatusType() { + return statusType; + } + + /** + * Sets the value of the statusType property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setStatusType(String value) { + this.statusType = value; + } + + /** + * Gets the value of the statusCode property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getStatusCode() { + return statusCode; + } + + /** + * Sets the value of the statusCode property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setStatusCode(String value) { + this.statusCode = value; + } + + /** + * Gets the value of the statusDesc property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getStatusDesc() { + return statusDesc; + } + + /** + * Sets the value of the statusDesc property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setStatusDesc(String value) { + this.statusDesc = value; + } + + /** + * Gets the value of the applicationName property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getApplicationName() { + return applicationName; + } + + /** + * Sets the value of the applicationName property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setApplicationName(String value) { + this.applicationName = value; + } + + /** + * Gets the value of the lineNumber property. + * + * @return + * possible object is + * {@link BigInteger } + * + */ + public BigInteger getLineNumber() { + return lineNumber; + } + + /** + * Sets the value of the lineNumber property. + * + * @param value + * allowed object is + * {@link BigInteger } + * + */ + public void setLineNumber(BigInteger value) { + this.lineNumber = value; + } + + /** + * Gets the value of the additionalStatus property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the Jakarta XML Binding object. + * This is why there is not a set method for the additionalStatus property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getAdditionalStatus().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link AdditionalStatus } + * + * + */ + public List getAdditionalStatus() { + if (additionalStatus == null) { + additionalStatus = new ArrayList(); + } + return this.additionalStatus; + } + + /** + * Gets the value of the severity property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getSeverity() { + return severity; + } + + /** + * Sets the value of the severity property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setSeverity(String value) { + this.severity = value; + } + + /** + * Gets the value of the statusInd property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getStatusInd() { + return statusInd; + } + + /** + * Sets the value of the statusInd property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setStatusInd(String value) { + this.statusInd = value; + } + + /** + * Gets the value of the logId property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getLogId() { + return logId; + } + + /** + * Sets the value of the logId property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setLogId(String value) { + this.logId = value; + } + +} diff --git a/update-card-status/src/main/java/com/banesco/commons/soap/client/apipaymentoutappsvc/VBProtocol.java b/update-card-status/src/main/java/com/banesco/commons/soap/client/apipaymentoutappsvc/VBProtocol.java new file mode 100644 index 0000000..d5a389a --- /dev/null +++ b/update-card-status/src/main/java/com/banesco/commons/soap/client/apipaymentoutappsvc/VBProtocol.java @@ -0,0 +1,98 @@ + +package com.banesco.commons.soap.client.apipaymentoutappsvc; + +import jakarta.xml.bind.annotation.XmlAccessType; +import jakarta.xml.bind.annotation.XmlAccessorType; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlType; + + +/** + *

Java class for VBProtocol complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="VBProtocol">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="VBProtocolInd" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/>
+ *         <element name="TransactionInd" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "VBProtocol", propOrder = { + "vbProtocolInd", + "transactionInd" +}) +public class VBProtocol { + + @XmlElement(name = "VBProtocolInd", defaultValue = "false") + protected Boolean vbProtocolInd; + @XmlElement(name = "TransactionInd", defaultValue = "false") + protected Boolean transactionInd; + + /** + * Gets the value of the vbProtocolInd property. + * + * @return + * possible object is + * {@link Boolean } + * + */ + public Boolean isVBProtocolInd() { + return vbProtocolInd; + } + + /** + * Sets the value of the vbProtocolInd property. + * + * @param value + * allowed object is + * {@link Boolean } + * + */ + public void setVBProtocolInd(Boolean value) { + this.vbProtocolInd = value; + } + + public void setVbprotocolInd(Boolean vbprotocolInd) { + this.vbProtocolInd = vbprotocolInd; + } + + public void setVbProtocolInd(Boolean vbprotocolInd) { + this.vbProtocolInd = vbprotocolInd; + } + + /** + * Gets the value of the transactionInd property. + * + * @return + * possible object is + * {@link Boolean } + * + */ + public Boolean isTransactionInd() { + return transactionInd; + } + + /** + * Sets the value of the transactionInd property. + * + * @param value + * allowed object is + * {@link Boolean } + * + */ + public void setTransactionInd(Boolean value) { + this.transactionInd = value; + } + +} diff --git a/update-card-status/src/main/java/com/banesco/commons/soap/client/apipaymentoutappsvc/package-info.java b/update-card-status/src/main/java/com/banesco/commons/soap/client/apipaymentoutappsvc/package-info.java new file mode 100644 index 0000000..39921de --- /dev/null +++ b/update-card-status/src/main/java/com/banesco/commons/soap/client/apipaymentoutappsvc/package-info.java @@ -0,0 +1,2 @@ +@jakarta.xml.bind.annotation.XmlSchema(namespace = "http://xmlns.banesco.com/EnterpriseObjects/MsgRqHdr", elementFormDefault = jakarta.xml.bind.annotation.XmlNsForm.QUALIFIED) +package com.banesco.commons.soap.client.apipaymentoutappsvc; diff --git a/update-card-status/src/main/java/com/banesco/domain/models/CardReference.java b/update-card-status/src/main/java/com/banesco/domain/models/CardReference.java new file mode 100644 index 0000000..75bd2de --- /dev/null +++ b/update-card-status/src/main/java/com/banesco/domain/models/CardReference.java @@ -0,0 +1,18 @@ +package com.banesco.domain.models; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + + +@Data +@NoArgsConstructor +@AllArgsConstructor +public class CardReference { + + String cardType; + String cardNumber; + String cardStatusCode; + String cardStatusAction; + String cardStatusReason; +} diff --git a/update-card-status/src/main/java/com/banesco/domain/models/CustomerReference.java b/update-card-status/src/main/java/com/banesco/domain/models/CustomerReference.java new file mode 100644 index 0000000..4002c14 --- /dev/null +++ b/update-card-status/src/main/java/com/banesco/domain/models/CustomerReference.java @@ -0,0 +1,36 @@ +package com.banesco.domain.models; + +public class CustomerReference { + String customerIdType; + String customerId; + + public CustomerReference() { + } + + public CustomerReference(String customerIdType, String customerId) { + this.customerIdType = customerIdType; + this.customerId = customerId; + } + + public String getCustomerIdType() { + return customerIdType; + } + + public void setCustomerIdType(String customerIdType) { + this.customerIdType = customerIdType; + } + + public String getCustomerId() { + return customerId; + } + + public void setCustomerId(String customerId) { + this.customerId = customerId; + } + + @Override + public String toString() { + return "{\"customerIdType\":\"%s\",\"customerId\":\"%s\"}" + .formatted(customerIdType, customerId); + } +} diff --git a/update-card-status/src/main/java/com/banesco/domain/models/Payment.java b/update-card-status/src/main/java/com/banesco/domain/models/Payment.java new file mode 100644 index 0000000..767e3bf --- /dev/null +++ b/update-card-status/src/main/java/com/banesco/domain/models/Payment.java @@ -0,0 +1,79 @@ +package com.banesco.domain.models; + +import io.quarkus.runtime.annotations.RegisterForReflection; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + + +@RegisterForReflection +@Data +@AllArgsConstructor +@NoArgsConstructor +public class Payment { + + private String referenceId; + private String referenceDesc; + private Double amount; + private String transactionDate; + private Sender sender; + private Receiver receiver; + + + @Data + public static class Sender { + private String accountId; + private String documentType; + private String documentId; + private String personType; + private String phoneNumber; + private String bankId; + private String svcType; + + public String toString() { + return "{\"accountId\":\"%s\",\"documentType\":\"%s\",\"documentId\":\"%s\",\"personType\":\"%s\",\"phoneNumber\":\"%s\",\"bankId\":\"%s\",\"svcType\":\"%s\"}" + .formatted(accountId, + documentType, + documentId, + personType, + phoneNumber, + bankId, + svcType + ); + } + + } + + @Data + public static class Receiver { + + private String documentType; + private String documentId; + private String personType; + private String phoneNumber; + private String bankId; + + public String toString() { + return "{\"documentType\":\"%s\",\"documentId\":\"%s\",\"personType\":\"%s\",\"phoneNumber\":\"%s\",\"bankId\":\"%s\"}" + .formatted(documentType, + documentId, + personType, + phoneNumber, + bankId + ); + } + + } + + + public String toString() { + return "{\"referenceId\":\"%s\",\"referenceDesc\":\"%s\",\"amount\":%s,\"transactionDate\":\"%s\",\"sender\":%s,\"receiver\":%s}" + .formatted(referenceId, + referenceDesc, + amount, + transactionDate, + sender, + receiver); + } + +} diff --git a/update-card-status/src/main/java/com/banesco/domain/models/StatusResponse.java b/update-card-status/src/main/java/com/banesco/domain/models/StatusResponse.java new file mode 100644 index 0000000..d6c6f00 --- /dev/null +++ b/update-card-status/src/main/java/com/banesco/domain/models/StatusResponse.java @@ -0,0 +1,26 @@ +package com.banesco.domain.models; + +import com.banesco.commons.config.StatusCodes; +import io.quarkus.runtime.annotations.RegisterForReflection; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import org.eclipse.microprofile.openapi.annotations.media.Schema; + +@RegisterForReflection +@Data +@AllArgsConstructor +@NoArgsConstructor +@Schema +public class StatusResponse { + private String statusCode; + private String statusDesc; + + public static StatusResponse mapResponse(StatusCodes statusCode) { + return new StatusResponse(statusCode.getStatusCode(), statusCode.getStatusDesc()); + } + + public String toString() { + return "{\"statusCode\":\"%s\",\"statusDesc\":\"%s\"}".formatted(statusCode, statusDesc); + } +} diff --git a/update-card-status/src/main/java/com/banesco/domain/ports/inbound/UpdateCardStatusUseCase.java b/update-card-status/src/main/java/com/banesco/domain/ports/inbound/UpdateCardStatusUseCase.java new file mode 100644 index 0000000..cda9aab --- /dev/null +++ b/update-card-status/src/main/java/com/banesco/domain/ports/inbound/UpdateCardStatusUseCase.java @@ -0,0 +1,9 @@ +package com.banesco.domain.ports.inbound; + +import com.banesco.application.UpdateCardStatusRequest; +import com.banesco.commons.soap.client.apipaymentoutappsvc.PayGenerateRs; + +public interface UpdateCardStatusUseCase { + PayGenerateRs executeUpdate(UpdateCardStatusRequest updateCardStatusRequest); + +} diff --git a/update-card-status/src/main/java/com/banesco/domain/ports/outbound/CardPort.java b/update-card-status/src/main/java/com/banesco/domain/ports/outbound/CardPort.java new file mode 100644 index 0000000..c55ce0b --- /dev/null +++ b/update-card-status/src/main/java/com/banesco/domain/ports/outbound/CardPort.java @@ -0,0 +1,10 @@ +package com.banesco.domain.ports.outbound; + +import com.banesco.application.UpdateCardStatusRequest; +import com.banesco.commons.soap.client.apipaymentoutappsvc.PayGenerateRs; + +public interface CardPort { + + PayGenerateRs updateCardStatus(UpdateCardStatusRequest request); + +} diff --git a/update-card-status/src/main/java/com/banesco/domain/services/UpdateCardStatusService.java b/update-card-status/src/main/java/com/banesco/domain/services/UpdateCardStatusService.java new file mode 100644 index 0000000..07ce173 --- /dev/null +++ b/update-card-status/src/main/java/com/banesco/domain/services/UpdateCardStatusService.java @@ -0,0 +1,28 @@ +package com.banesco.domain.services; + +import com.banesco.application.UpdateCardStatusRequest; +import com.banesco.commons.soap.client.apipaymentoutappsvc.PayGenerateRs; +import com.banesco.domain.ports.inbound.UpdateCardStatusUseCase; +import com.banesco.domain.ports.outbound.CardPort; +import jakarta.enterprise.context.ApplicationScoped; +import lombok.extern.slf4j.Slf4j; + + +@ApplicationScoped +@Slf4j +public class UpdateCardStatusService implements UpdateCardStatusUseCase { + + CardPort cardPort; + + public UpdateCardStatusService(CardPort cardPort) { + this.cardPort = cardPort; + } + + + @Override + public PayGenerateRs executeUpdate(UpdateCardStatusRequest request) { + return cardPort.updateCardStatus(request); + + + } +} diff --git a/update-card-status/src/main/java/com/banesco/infrastructure/healthcheck/ApplicationLivenessCheck.java b/update-card-status/src/main/java/com/banesco/infrastructure/healthcheck/ApplicationLivenessCheck.java new file mode 100644 index 0000000..fe43889 --- /dev/null +++ b/update-card-status/src/main/java/com/banesco/infrastructure/healthcheck/ApplicationLivenessCheck.java @@ -0,0 +1,38 @@ +package com.banesco.infrastructure.healthcheck; + +import jakarta.enterprise.context.ApplicationScoped; +import lombok.extern.slf4j.Slf4j; +import org.eclipse.microprofile.config.inject.ConfigProperty; +import org.eclipse.microprofile.health.HealthCheck; +import org.eclipse.microprofile.health.HealthCheckResponse; +import org.eclipse.microprofile.health.Liveness; + +@Liveness +@ApplicationScoped +@Slf4j +public class ApplicationLivenessCheck implements HealthCheck { + + private final String applicationName; + private final String applicationVersion; + + public ApplicationLivenessCheck( + @ConfigProperty(name = "quarkus.application.name", defaultValue = "api-application") String applicationName, + @ConfigProperty(name = "quarkus.application.version", defaultValue = "unknown") String applicationVersion) { + this.applicationName = applicationName; + this.applicationVersion = applicationVersion; + } + + @Override + public HealthCheckResponse call() { + log.debug("Ejecutando liveness health check: {}", System.currentTimeMillis()); + + // Simplemente reportamos que la aplicación está activa + // Si este código se ejecuta, significa que la JVM está funcionando + return HealthCheckResponse.named("API") + .up() + .withData("application", applicationName) + .withData("version", applicationVersion) + .withData("timestamp", System.currentTimeMillis()) + .build(); + } +} \ No newline at end of file diff --git a/update-card-status/src/main/java/com/banesco/infrastructure/healthcheck/SoapHealthCheck.java b/update-card-status/src/main/java/com/banesco/infrastructure/healthcheck/SoapHealthCheck.java new file mode 100644 index 0000000..521bcdf --- /dev/null +++ b/update-card-status/src/main/java/com/banesco/infrastructure/healthcheck/SoapHealthCheck.java @@ -0,0 +1,193 @@ +package com.banesco.infrastructure.healthcheck; + +import com.banesco.commons.config.AppConf; +import com.banesco.commons.model.SoapEndpoint; +import jakarta.enterprise.context.ApplicationScoped; +import jakarta.inject.Inject; +import jakarta.xml.soap.MessageFactory; +import jakarta.xml.soap.SOAPConnection; +import jakarta.xml.soap.SOAPConnectionFactory; +import jakarta.xml.soap.SOAPMessage; +import lombok.extern.slf4j.Slf4j; +import org.eclipse.microprofile.config.inject.ConfigProperty; +import org.eclipse.microprofile.health.HealthCheck; +import org.eclipse.microprofile.health.HealthCheckResponse; +import org.eclipse.microprofile.health.HealthCheckResponseBuilder; +import org.eclipse.microprofile.health.Readiness; + +import java.util.ArrayList; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.Semaphore; + +/** + * Verifica connexion a SOAP + * Readiness + */ +@SuppressWarnings("unused") +@Readiness +@Slf4j +@ApplicationScoped +public class SoapHealthCheck implements HealthCheck { + + private final SoapEndpoint soapConfig; + + // Semáforo para evitar múltiples health checks simultáneos + private final Semaphore healthCheckSemaphore = new Semaphore(1); + + + private final String HEALTHCHECK_NAME = "SOAP"; + + private final String CHECK_OK = "OK"; + + + private final SOAPMessage soapMessage; + + private final AppConf appConf; + + + @ConfigProperty(name = "soap.health-check.enabled", defaultValue = "true") + boolean enabled; + + List domainsToValidate; + + @Inject + public SoapHealthCheck(AppConf appConf) throws Exception { + soapConfig = appConf.loadSoapClientConfig("soap.service.pay-generate"); + this.appConf = appConf; + Optional> domains = appConf.getEnv().getOptionalValues("soap.health-check.validation.domains", String.class); + + if (domains.isEmpty()) { + domainsToValidate = new ArrayList<>(); + } else { + domainsToValidate = domains.get(); + } + + log.info("SoapHealthCheck inicializado"); + MessageFactory messageFactory = MessageFactory.newInstance(); + soapMessage = messageFactory.createMessage(); + } + + + @Override + public HealthCheckResponse call() { + + if (!enabled) { + return HealthCheckResponse.up("Validacion indicada por soap.health-check.enabled esta inactiva"); + } + + HealthCheckResponseBuilder responseBuilder = HealthCheckResponse.named(HEALTHCHECK_NAME); + // Evitar múltiples health checks concurrentes + if (!healthCheckSemaphore.tryAcquire()) { + log.debug("Health check en progreso, saltando esta invocación"); + return responseBuilder + .withData("soap", "progressing") + .withData("timestamp", System.currentTimeMillis()) + .build(); + } + + + // check Current Domain + + try { + responseBuilder.withData("TYPE", "OSB"); + responseBuilder.withData("DOMAINS", "STATUS"); + if (!domainsToValidate.isEmpty()) { + + log.debug("Checking ALL"); + boolean allEndpointsUp = true; + + + String checkResponseSoap; + for (String domainKey : domainsToValidate) { + + checkResponseSoap = getEndpointAvailable(domainKey); + responseBuilder.withData(domainKey, checkResponseSoap); + if (!checkResponseSoap.equals(CHECK_OK)) { + allEndpointsUp = false; + } + + + } + + return buildResponse(responseBuilder, allEndpointsUp ? CHECK_OK : "Al menos un SoapEndpoint con Error"); + + + } else { + return responseBuilder + .up() + .withData("*", "ningun Dominio para chequeo") + .withData("timestamp", System.currentTimeMillis()) + .build(); + } + + } catch (Exception e) { + log.error("Error checking SoapEndpoint: {}", e.getMessage()); + return buildResponse(responseBuilder, "Error checking SoapEndpoint"); + + } finally { + healthCheckSemaphore.release(); + } + + + } + + private String getEndpointAvailable(String domainKey) { + SOAPConnection soapConnection = null; + try { + soapConnection = SOAPConnectionFactory.newInstance().createConnection(); + + // Populate the SOAP message with your request here + // For example, you can add a body, headers, etc. + + // Send the request and get the response + SOAPMessage soapResponse = soapConnection.call(soapMessage, soapConfig.getUrl(appConf.getDomainConfig(domainKey))); + + // Process the response (you can check for specific elements or status) + // For simplicity, we assume the service is up if we receive a response + + if (soapResponse == null) { + return "Error de conexion SOAP"; + } + // Close the connection + log.debug("Health check exitoso: conexión SOAP"); + return CHECK_OK; + + + + } catch (Exception e) { + log.error("Health check detectó error de conexión: {}", e.getMessage()); + return "Error de conexión: " + e.getMessage(); + + } finally { + if (soapConnection != null) { + try { + soapConnection.close(); + } catch (Exception e) { + log.warn("Error soapConnection.close()"); + } + } + } + + } + + + private HealthCheckResponse buildResponse(HealthCheckResponseBuilder responseBuilder, String errorMessage) { + + + if (errorMessage.equals(CHECK_OK)) { + return responseBuilder + .status(true) + .withData("timestamp", System.currentTimeMillis()) + .build(); + + } + + return responseBuilder + .status(false) + .withData("timestamp", System.currentTimeMillis()) + .withData("errorMessage", errorMessage) + .build(); + + } +} \ No newline at end of file diff --git a/update-card-status/src/main/java/com/banesco/infrastructure/mapper/PaymentMapper.java b/update-card-status/src/main/java/com/banesco/infrastructure/mapper/PaymentMapper.java new file mode 100644 index 0000000..c220ccf --- /dev/null +++ b/update-card-status/src/main/java/com/banesco/infrastructure/mapper/PaymentMapper.java @@ -0,0 +1,24 @@ +package com.banesco.infrastructure.mapper; + +import com.banesco.application.UpdateCardStatusRequest; +import com.banesco.commons.soap.client.apipaymentoutappsvc.ObjectFactory; +import com.banesco.commons.soap.client.apipaymentoutappsvc.PayGenerateRq; +import jakarta.enterprise.context.ApplicationScoped; + + +@ApplicationScoped +public class PaymentMapper { + public final ObjectFactory objectFactory; + + public PaymentMapper() { + this.objectFactory = new ObjectFactory(); + } + + public PayGenerateRq toPayGenerateRequest(UpdateCardStatusRequest paymentData) { + + + + return null; + + } +} diff --git a/update-card-status/src/main/java/com/banesco/infrastructure/soap/CardAdapter.java b/update-card-status/src/main/java/com/banesco/infrastructure/soap/CardAdapter.java new file mode 100644 index 0000000..6854b95 --- /dev/null +++ b/update-card-status/src/main/java/com/banesco/infrastructure/soap/CardAdapter.java @@ -0,0 +1,83 @@ +package com.banesco.infrastructure.soap; + +import com.banesco.application.UpdateCardStatusRequest; +import com.banesco.commons.config.AppConf; +import com.banesco.commons.helper.XMLHelper; +import com.banesco.commons.model.SoapEndpoint; +import com.banesco.commons.soap.client.apipaymentoutappsvc.APIPaymentOutAppSvc; +import com.banesco.commons.soap.client.apipaymentoutappsvc.PayGenerateRq; +import com.banesco.commons.soap.client.apipaymentoutappsvc.PayGenerateRs; +import com.banesco.domain.ports.outbound.CardPort; +import com.banesco.infrastructure.mapper.PaymentMapper; +import jakarta.enterprise.context.ApplicationScoped; +import jakarta.xml.bind.JAXBElement; +import lombok.extern.slf4j.Slf4j; +import org.apache.cxf.frontend.ClientProxy; +import org.apache.cxf.jaxws.JaxWsProxyFactoryBean; +import org.apache.cxf.transport.http.HTTPConduit; +import org.apache.cxf.transports.http.configuration.HTTPClientPolicy; +import org.eclipse.microprofile.config.inject.ConfigProperty; + +import java.util.HashMap; +import java.util.Map; + + +@ApplicationScoped +@Slf4j +public class CardAdapter implements CardPort { + + private Map SOAP_CLIENTS = new HashMap<>(); + private final AppConf appConf; + private final PaymentMapper paymentMapper; + private final SoapEndpoint paymentGenerateSOAP; + + @ConfigProperty(name = "soap.print-xml", defaultValue = "false") + boolean mustPrintXML; + + public CardAdapter(AppConf appConf, PaymentMapper paymentMapper) { + this.appConf = appConf; + this.paymentMapper = paymentMapper; + paymentGenerateSOAP = appConf.loadSoapClientConfig("soap.service.block-unblock-debit-card"); + } + + + public APIPaymentOutAppSvc getSoapClient(String domainKey) { + if (domainKey == null) { + domainKey = appConf.SOAP_CURRENT_DOMAIN; + } + APIPaymentOutAppSvc client = SOAP_CLIENTS.get(domainKey); + if (client == null) { + log.info("loading domainKey: {}", domainKey); + JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean(); + factory.setServiceClass(APIPaymentOutAppSvc.class); + factory.setAddress(paymentGenerateSOAP.getUrl(appConf.getDomainConfig(domainKey))); + + client = (APIPaymentOutAppSvc) factory.create(); + + HTTPConduit conduit = (HTTPConduit) ClientProxy.getClient(client).getConduit(); + HTTPClientPolicy httpClientPolicy = new HTTPClientPolicy(); + httpClientPolicy.setConnectionTimeout(paymentGenerateSOAP.getTimeout().getConnect()); // Connection timeout in milliseconds + httpClientPolicy.setReceiveTimeout(paymentGenerateSOAP.getTimeout().getResponse()); // Receive timeout in milliseconds + conduit.setClient(httpClientPolicy); + SOAP_CLIENTS.put(domainKey, client); + } + + return client; + } + + public PayGenerateRs updateCardStatus(UpdateCardStatusRequest requestData) { + + PayGenerateRq request = paymentMapper.toPayGenerateRequest(requestData); + + if (mustPrintXML) { + JAXBElement createReadAffiliationRq = paymentMapper.objectFactory.createPayGenerateRq(request); + log.info("[SOAP blockUnblockDebitCardRq]: [{}]", XMLHelper.buildXml(createReadAffiliationRq)); + } + + return getSoapClient(requestData.getDomain()).payGenerate(request); + + } + + +} + diff --git a/update-card-status/src/main/resources/application-dev.yaml b/update-card-status/src/main/resources/application-dev.yaml new file mode 100644 index 0000000..3ed64da --- /dev/null +++ b/update-card-status/src/main/resources/application-dev.yaml @@ -0,0 +1,19 @@ +quarkus: + http: + port: 8083 + idle-timeout: 30s +soap: + print-xml: false + health-check: + enabled: false + validation: + domains: osbc,osbp2p + service: + block-unblock-debit-card: '{"path":"/APIDebitCardOutAppSvc/proxy/APIDebitCardOutAppSvc","soapAction":"","timeout":{ "connect": 20000, "response": 20000}}' + domain: + current: osbc + domains: + osbc: http://10.135.5.32:8001 + osbttk: http://10.135.5.32:8001 + osbp2p: http://10.135.5.32:8001 + osbo: http://10.135.5.32:8001 diff --git a/update-card-status/src/main/resources/application.yaml b/update-card-status/src/main/resources/application.yaml new file mode 100644 index 0000000..1a7117e --- /dev/null +++ b/update-card-status/src/main/resources/application.yaml @@ -0,0 +1,32 @@ +quarkus: + log: + level: INFO + console: + enable: true + http: + non-application-root-path: actuator + profile: local + debug: + print-startup-times: true + reflection: false + native: + file-encoding: UTF-8 + container-build: true + builder-image: quay.io/quarkus/ubi-quarkus-mandrel-builder-image:23.0.5.0-Final-java17 + container-runtime: docker + additional-build-args: + - -H:InitialCollectionPolicy=com.oracle.svm.core.genscavenge.CollectionPolicy\$BySpaceAndTime + - -H:DynamicProxyConfigurationFiles=proxy-config.json + native-image-xmx: 4G + resources: + excludes: resources/*.yaml + smallrye-openapi: + path: /openapi + enable: 'true' + swagger-ui: + path: /swagger-ui + always-include: 'true' + application: + name: update-card-status + version: 1.0.0 + diff --git a/update-card-status/src/main/resources/examples/postValidateRequest.json b/update-card-status/src/main/resources/examples/postValidateRequest.json new file mode 100644 index 0000000..e69de29 diff --git a/update-card-status/src/main/resources/proxy-config.json b/update-card-status/src/main/resources/proxy-config.json new file mode 100644 index 0000000..a19fc0f --- /dev/null +++ b/update-card-status/src/main/resources/proxy-config.json @@ -0,0 +1,10 @@ +[ + { + "interfaces": [ + "com.banesco.commons.soap.client.apipaymentoutappsvc.APIPaymentOutAppSvc", + "jakarta.xml.ws.BindingProvider", + "java.io.Closeable", + "org.apache.cxf.endpoint.Client" + ] + } +] \ No newline at end of file