Compare commits
27 Commits
main
...
dev-pendin
| Author | SHA1 | Date |
|---|---|---|
|
|
3905f27015 | 4 weeks ago |
|
|
d6f656cda5 | 4 weeks ago |
|
|
1639058e20 | 4 weeks ago |
|
|
44707f34c2 | 4 weeks ago |
|
|
5e85a32f61 | 4 weeks ago |
|
|
a1f993bfd4 | 4 weeks ago |
|
|
8507141d9e | 4 weeks ago |
|
|
ea9abc99c8 | 4 weeks ago |
|
|
6225454d51 | 4 weeks ago |
|
|
cf224e3f85 | 4 weeks ago |
|
|
5bd79acda5 | 4 weeks ago |
|
|
493b1564c8 | 4 weeks ago |
|
|
29a5e2f5e1 | 4 weeks ago |
|
|
10084bbd48 | 4 weeks ago |
|
|
63f10ef2fc | 4 weeks ago |
|
|
2426fb7c7e | 1 month ago |
|
|
1e375887e5 | 1 month ago |
|
|
9c7f195e98 | 1 month ago |
|
|
a0529f9b34 | 1 month ago |
|
|
162678d8d9 | 1 month ago |
|
|
16ef541e30 | 1 month ago |
|
|
3a475a595d | 1 month ago |
|
|
e54acd9a61 | 1 month ago |
|
|
40cc1f1597 | 1 month ago |
|
|
01d3c23103 | 2 months ago |
|
|
173663d935 | 2 months ago |
|
|
fc07a8e88f | 2 months ago |
@ -0,0 +1,33 @@
|
|||||||
|
HELP.md
|
||||||
|
target/
|
||||||
|
.mvn/wrapper/maven-wrapper.jar
|
||||||
|
!**/src/main/**/target/
|
||||||
|
!**/src/test/**/target/
|
||||||
|
|
||||||
|
### STS ###
|
||||||
|
.apt_generated
|
||||||
|
.classpath
|
||||||
|
.factorypath
|
||||||
|
.project
|
||||||
|
.settings
|
||||||
|
.springBeans
|
||||||
|
.sts4-cache
|
||||||
|
|
||||||
|
### IntelliJ IDEA ###
|
||||||
|
.idea
|
||||||
|
*.iws
|
||||||
|
*.iml
|
||||||
|
*.ipr
|
||||||
|
|
||||||
|
### NetBeans ###
|
||||||
|
/nbproject/private/
|
||||||
|
/nbbuild/
|
||||||
|
/dist/
|
||||||
|
/nbdist/
|
||||||
|
/.nb-gradle/
|
||||||
|
build/
|
||||||
|
!**/src/main/**/build/
|
||||||
|
!**/src/test/**/build/
|
||||||
|
|
||||||
|
### VS Code ###
|
||||||
|
.vscode/
|
||||||
@ -0,0 +1,2 @@
|
|||||||
|
/mvnw text eol=lf
|
||||||
|
*.cmd text eol=crlf
|
||||||
@ -0,0 +1,33 @@
|
|||||||
|
HELP.md
|
||||||
|
target/
|
||||||
|
.mvn/wrapper/maven-wrapper.jar
|
||||||
|
!**/src/main/**/target/
|
||||||
|
!**/src/test/**/target/
|
||||||
|
|
||||||
|
### STS ###
|
||||||
|
.apt_generated
|
||||||
|
.classpath
|
||||||
|
.factorypath
|
||||||
|
.project
|
||||||
|
.settings
|
||||||
|
.springBeans
|
||||||
|
.sts4-cache
|
||||||
|
|
||||||
|
### IntelliJ IDEA ###
|
||||||
|
.idea
|
||||||
|
*.iws
|
||||||
|
*.iml
|
||||||
|
*.ipr
|
||||||
|
|
||||||
|
### NetBeans ###
|
||||||
|
/nbproject/private/
|
||||||
|
/nbbuild/
|
||||||
|
/dist/
|
||||||
|
/nbdist/
|
||||||
|
/.nb-gradle/
|
||||||
|
build/
|
||||||
|
!**/src/main/**/build/
|
||||||
|
!**/src/test/**/build/
|
||||||
|
|
||||||
|
### VS Code ###
|
||||||
|
.vscode/
|
||||||
@ -0,0 +1,2 @@
|
|||||||
|
distributionType=only-script
|
||||||
|
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.11/apache-maven-3.9.11-bin.zip
|
||||||
@ -0,0 +1,295 @@
|
|||||||
|
#!/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
|
||||||
|
#
|
||||||
|
# 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.
|
||||||
|
# ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
# ----------------------------------------------------------------------------
|
||||||
|
# Apache Maven Wrapper startup batch script, version 3.3.3
|
||||||
|
#
|
||||||
|
# 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:]'
|
||||||
|
}
|
||||||
|
|
||||||
|
scriptDir="$(dirname "$0")"
|
||||||
|
scriptName="$(basename "$0")"
|
||||||
|
|
||||||
|
# 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 <"$scriptDir/.mvn/wrapper/maven-wrapper.properties"
|
||||||
|
[ -n "${distributionUrl-}" ] || die "cannot read distributionUrl property in $scriptDir/.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${scriptName#mvnw}" _MVNW_REPO_PATTERN=/org/apache/maven/ ;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
# apply MVNW_REPOURL and calculate MAVEN_HOME
|
||||||
|
# maven home pattern: ~/.m2/wrapper/dists/{apache-maven-<version>,maven-mvnd-<version>-<platform>}/<hash>
|
||||||
|
[ -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
|
||||||
|
|
||||||
|
# Find the actual extracted directory name (handles snapshots where filename != directory name)
|
||||||
|
actualDistributionDir=""
|
||||||
|
|
||||||
|
# First try the expected directory name (for regular distributions)
|
||||||
|
if [ -d "$TMP_DOWNLOAD_DIR/$distributionUrlNameMain" ]; then
|
||||||
|
if [ -f "$TMP_DOWNLOAD_DIR/$distributionUrlNameMain/bin/$MVN_CMD" ]; then
|
||||||
|
actualDistributionDir="$distributionUrlNameMain"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
# If not found, search for any directory with the Maven executable (for snapshots)
|
||||||
|
if [ -z "$actualDistributionDir" ]; then
|
||||||
|
# enable globbing to iterate over items
|
||||||
|
set +f
|
||||||
|
for dir in "$TMP_DOWNLOAD_DIR"/*; do
|
||||||
|
if [ -d "$dir" ]; then
|
||||||
|
if [ -f "$dir/bin/$MVN_CMD" ]; then
|
||||||
|
actualDistributionDir="$(basename "$dir")"
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
set -f
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -z "$actualDistributionDir" ]; then
|
||||||
|
verbose "Contents of $TMP_DOWNLOAD_DIR:"
|
||||||
|
verbose "$(ls -la "$TMP_DOWNLOAD_DIR")"
|
||||||
|
die "Could not find Maven distribution directory in extracted archive"
|
||||||
|
fi
|
||||||
|
|
||||||
|
verbose "Found extracted Maven distribution directory: $actualDistributionDir"
|
||||||
|
printf %s\\n "$distributionUrl" >"$TMP_DOWNLOAD_DIR/$actualDistributionDir/mvnw.url"
|
||||||
|
mv -- "$TMP_DOWNLOAD_DIR/$actualDistributionDir" "$MAVEN_HOME" || [ -d "$MAVEN_HOME" ] || die "fail to move MAVEN_HOME"
|
||||||
|
|
||||||
|
clean || :
|
||||||
|
exec_maven "$@"
|
||||||
@ -0,0 +1,189 @@
|
|||||||
|
<# : 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 http://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.3
|
||||||
|
@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-<version>,maven-mvnd-<version>-<platform>}/<hash>
|
||||||
|
if ($env:MVNW_REPOURL) {
|
||||||
|
$MVNW_REPO_PATTERN = if ($USE_MVND -eq $False) { "/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_M2_PATH = "$HOME/.m2"
|
||||||
|
if ($env:MAVEN_USER_HOME) {
|
||||||
|
$MAVEN_M2_PATH = "$env:MAVEN_USER_HOME"
|
||||||
|
}
|
||||||
|
|
||||||
|
if (-not (Test-Path -Path $MAVEN_M2_PATH)) {
|
||||||
|
New-Item -Path $MAVEN_M2_PATH -ItemType Directory | Out-Null
|
||||||
|
}
|
||||||
|
|
||||||
|
$MAVEN_WRAPPER_DISTS = $null
|
||||||
|
if ((Get-Item $MAVEN_M2_PATH).Target[0] -eq $null) {
|
||||||
|
$MAVEN_WRAPPER_DISTS = "$MAVEN_M2_PATH/wrapper/dists"
|
||||||
|
} else {
|
||||||
|
$MAVEN_WRAPPER_DISTS = (Get-Item $MAVEN_M2_PATH).Target[0] + "/wrapper/dists"
|
||||||
|
}
|
||||||
|
|
||||||
|
$MAVEN_HOME_PARENT = "$MAVEN_WRAPPER_DISTS/$distributionUrlNameMain"
|
||||||
|
$MAVEN_HOME_NAME = ([System.Security.Cryptography.SHA256]::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
|
||||||
|
|
||||||
|
# Find the actual extracted directory name (handles snapshots where filename != directory name)
|
||||||
|
$actualDistributionDir = ""
|
||||||
|
|
||||||
|
# First try the expected directory name (for regular distributions)
|
||||||
|
$expectedPath = Join-Path "$TMP_DOWNLOAD_DIR" "$distributionUrlNameMain"
|
||||||
|
$expectedMvnPath = Join-Path "$expectedPath" "bin/$MVN_CMD"
|
||||||
|
if ((Test-Path -Path $expectedPath -PathType Container) -and (Test-Path -Path $expectedMvnPath -PathType Leaf)) {
|
||||||
|
$actualDistributionDir = $distributionUrlNameMain
|
||||||
|
}
|
||||||
|
|
||||||
|
# If not found, search for any directory with the Maven executable (for snapshots)
|
||||||
|
if (!$actualDistributionDir) {
|
||||||
|
Get-ChildItem -Path "$TMP_DOWNLOAD_DIR" -Directory | ForEach-Object {
|
||||||
|
$testPath = Join-Path $_.FullName "bin/$MVN_CMD"
|
||||||
|
if (Test-Path -Path $testPath -PathType Leaf) {
|
||||||
|
$actualDistributionDir = $_.Name
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!$actualDistributionDir) {
|
||||||
|
Write-Error "Could not find Maven distribution directory in extracted archive"
|
||||||
|
}
|
||||||
|
|
||||||
|
Write-Verbose "Found extracted Maven distribution directory: $actualDistributionDir"
|
||||||
|
Rename-Item -Path "$TMP_DOWNLOAD_DIR/$actualDistributionDir" -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"
|
||||||
@ -0,0 +1,212 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
<parent>
|
||||||
|
<groupId>com.mfsys</groupId>
|
||||||
|
<artifactId>parent</artifactId>
|
||||||
|
<version>0.0.1</version>
|
||||||
|
<relativePath>../parent/pom.xml</relativePath>
|
||||||
|
</parent>
|
||||||
|
|
||||||
|
<groupId>com.mfsys</groupId>
|
||||||
|
<artifactId>aconnect</artifactId>
|
||||||
|
<version>0.0.1</version>
|
||||||
|
<packaging>war</packaging>
|
||||||
|
<name>aconnect</name>
|
||||||
|
<description>Middleware Application</description>
|
||||||
|
|
||||||
|
<properties>
|
||||||
|
<java.version>21</java.version>
|
||||||
|
</properties>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
<!-- Spring Boot Starters -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-amqp</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-batch</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-data-jpa</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-web</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-webflux</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-security</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-validation</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-mail</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-data-redis</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- Database -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.mysql</groupId>
|
||||||
|
<artifactId>mysql-connector-j</artifactId>
|
||||||
|
<scope>runtime</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- Lombok -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.projectlombok</groupId>
|
||||||
|
<artifactId>lombok</artifactId>
|
||||||
|
<optional>true</optional>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- Tomcat (external deployment) -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-tomcat</artifactId>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- JWT -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>io.jsonwebtoken</groupId>
|
||||||
|
<artifactId>jjwt-api</artifactId>
|
||||||
|
<version>0.12.6</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>io.jsonwebtoken</groupId>
|
||||||
|
<artifactId>jjwt-impl</artifactId>
|
||||||
|
<version>0.12.6</version>
|
||||||
|
<scope>runtime</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>io.jsonwebtoken</groupId>
|
||||||
|
<artifactId>jjwt-jackson</artifactId>
|
||||||
|
<version>0.12.6</version>
|
||||||
|
<scope>runtime</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- Testing -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-test</artifactId>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.amqp</groupId>
|
||||||
|
<artifactId>spring-rabbit-test</artifactId>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.batch</groupId>
|
||||||
|
<artifactId>spring-batch-test</artifactId>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- Internal common module -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.mfsys</groupId>
|
||||||
|
<artifactId>common</artifactId>
|
||||||
|
<version>0.0.1</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- Optional Spring Context -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework</groupId>
|
||||||
|
<artifactId>spring-context</artifactId>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
|
<build>
|
||||||
|
<plugins>
|
||||||
|
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
|
<version>3.13.0</version>
|
||||||
|
<configuration>
|
||||||
|
<source>21</source>
|
||||||
|
<target>21</target>
|
||||||
|
<annotationProcessorPaths>
|
||||||
|
<path>
|
||||||
|
<groupId>org.projectlombok</groupId>
|
||||||
|
<artifactId>lombok</artifactId>
|
||||||
|
<version>1.18.34</version>
|
||||||
|
</path>
|
||||||
|
</annotationProcessorPaths>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||||
|
<configuration>
|
||||||
|
<systemPropertyVariables>
|
||||||
|
<spring.profiles.active>${spring.profiles.active}</spring.profiles.active>
|
||||||
|
</systemPropertyVariables>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- Maven Environment Profiles -->
|
||||||
|
<profiles>
|
||||||
|
|
||||||
|
<!-- Development -->
|
||||||
|
<profile>
|
||||||
|
<id>dev</id>
|
||||||
|
<activation>
|
||||||
|
<activeByDefault>true</activeByDefault>
|
||||||
|
</activation>
|
||||||
|
<properties>
|
||||||
|
<spring.profiles.active>dev</spring.profiles.active>
|
||||||
|
</properties>
|
||||||
|
<build>
|
||||||
|
<finalName>aconnect-dev</finalName>
|
||||||
|
</build>
|
||||||
|
</profile>
|
||||||
|
|
||||||
|
<!-- UAT -->
|
||||||
|
<profile>
|
||||||
|
<id>uat</id>
|
||||||
|
<properties>
|
||||||
|
<spring.profiles.active>uat</spring.profiles.active>
|
||||||
|
</properties>
|
||||||
|
<build>
|
||||||
|
<finalName>aconnect-uat</finalName>
|
||||||
|
</build>
|
||||||
|
</profile>
|
||||||
|
|
||||||
|
<!-- Live / Production -->
|
||||||
|
<profile>
|
||||||
|
<id>live</id>
|
||||||
|
<properties>
|
||||||
|
<spring.profiles.active>live</spring.profiles.active>
|
||||||
|
</properties>
|
||||||
|
<build>
|
||||||
|
<finalName>aconnect</finalName>
|
||||||
|
</build>
|
||||||
|
</profile>
|
||||||
|
|
||||||
|
</profiles>
|
||||||
|
|
||||||
|
</project>
|
||||||
@ -0,0 +1,29 @@
|
|||||||
|
package com.mfsys.aconnect;
|
||||||
|
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
|
import org.springframework.boot.SpringApplication;
|
||||||
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
|
import org.springframework.boot.autoconfigure.domain.EntityScan;
|
||||||
|
import org.springframework.boot.web.server.WebServerFactoryCustomizer;
|
||||||
|
import org.springframework.boot.web.servlet.server.ConfigurableServletWebServerFactory;
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
|
||||||
|
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||||
|
|
||||||
|
@EnableScheduling
|
||||||
|
@SpringBootApplication(scanBasePackages = {"com.mfsys"})
|
||||||
|
@EntityScan(basePackages = {"com.mfsys"})
|
||||||
|
@EnableJpaRepositories({"com.mfsys"})
|
||||||
|
public class AconnectApplication {
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
SpringApplication.run(AconnectApplication.class, args);
|
||||||
|
}
|
||||||
|
@Value("${app.base.uri}")
|
||||||
|
private String baseUri;
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
public WebServerFactoryCustomizer<ConfigurableServletWebServerFactory> webServerFactoryCustomizer() {
|
||||||
|
return factory -> factory.setContextPath("/" + baseUri);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,13 @@
|
|||||||
|
package com.mfsys.aconnect;
|
||||||
|
|
||||||
|
import org.springframework.boot.builder.SpringApplicationBuilder;
|
||||||
|
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
|
||||||
|
|
||||||
|
public class ServletInitializer extends SpringBootServletInitializer {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
|
||||||
|
return application.sources(AconnectApplication.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,39 @@
|
|||||||
|
package com.mfsys.aconnect.client.controller;
|
||||||
|
|
||||||
|
import com.mfsys.aconnect.client.dto.SigninRequest;
|
||||||
|
import com.mfsys.aconnect.client.service.AuthService;
|
||||||
|
import com.mfsys.common.configuration.constant.AconnectURI;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
public class AuthController {
|
||||||
|
|
||||||
|
AuthService loginService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
public AuthController(AuthService loginService) {
|
||||||
|
this.loginService = loginService;
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping(AconnectURI.SIGNIN)
|
||||||
|
public ResponseEntity<Map<String, Object>> login(@RequestBody(required = false) SigninRequest login) {
|
||||||
|
if (login == null) {
|
||||||
|
return ResponseEntity.badRequest().body(Map.of("error", "Request body is missing"));
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, String> payload = Map.of(
|
||||||
|
"username", login.getUsername(),
|
||||||
|
"password", login.getPassword()
|
||||||
|
);
|
||||||
|
|
||||||
|
Map<String, Object> response = loginService.authenticate(payload);
|
||||||
|
return ResponseEntity.ok(response);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,34 @@
|
|||||||
|
package com.mfsys.aconnect.client.controller;
|
||||||
|
|
||||||
|
import com.mfsys.aconnect.client.dto.WorkflowRequestDTO;
|
||||||
|
import com.mfsys.aconnect.client.service.CRMService;
|
||||||
|
import com.mfsys.common.configuration.constant.AconnectURI;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestHeader;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
public class CRMController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private CRMService crmService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
public CRMController(CRMService crmService) {
|
||||||
|
this.crmService = crmService;
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping(AconnectURI.INDIVIDUAL_CRM_CREATION_URI)
|
||||||
|
public Object createIndividualCRM(@RequestBody WorkflowRequestDTO workflowRequestDTO,
|
||||||
|
@RequestHeader("Authorization") String token) {
|
||||||
|
return crmService.createIndividualCRM(workflowRequestDTO, token);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping(AconnectURI.BUSINESS_CRM_CREATION_URI)
|
||||||
|
public Object createBusinessCRM(@RequestBody WorkflowRequestDTO workflowRequestDTO,
|
||||||
|
@RequestHeader("Authorization") String token) {
|
||||||
|
return crmService.createBusinessCRM(workflowRequestDTO, token);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,38 @@
|
|||||||
|
package com.mfsys.aconnect.client.controller;
|
||||||
|
|
||||||
|
import com.mfsys.aconnect.client.dto.WorkflowRequestDTO;
|
||||||
|
import com.mfsys.aconnect.client.service.CRMService;
|
||||||
|
import com.mfsys.aconnect.client.service.DepositAccountService;
|
||||||
|
import com.mfsys.common.configuration.constant.AconnectURI;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
public class DepositAccountController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private DepositAccountService depositAccountService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
public DepositAccountController(DepositAccountService depositAccountService) {
|
||||||
|
this.depositAccountService = depositAccountService;
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping(AconnectURI.INDIVIDUAL_DEPOSIT_CREATION_URI)
|
||||||
|
public Object createIndividualDeposit(@RequestBody WorkflowRequestDTO workflowRequestDTO,
|
||||||
|
@RequestHeader("Authorization") String token) {
|
||||||
|
return depositAccountService.createIndividualDeposit(workflowRequestDTO, token);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PatchMapping(AconnectURI.UPDATE_DEPOSIT_CREATION_URI)
|
||||||
|
public Object updateIndividualDeposit(@RequestBody WorkflowRequestDTO workflowRequestDTO,
|
||||||
|
@RequestHeader("Authorization") String token) {
|
||||||
|
return depositAccountService.approvalIndividualDeposit(workflowRequestDTO, token);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping(AconnectURI.BUSINESS_DEPOSIT_CREATION_URI)
|
||||||
|
public Object createBusinessCRM(@RequestBody WorkflowRequestDTO workflowRequestDTO,
|
||||||
|
@RequestHeader("Authorization") String token) {
|
||||||
|
return depositAccountService.createBusinessDeposit(workflowRequestDTO, token);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,30 @@
|
|||||||
|
package com.mfsys.aconnect.client.controller;
|
||||||
|
|
||||||
|
import com.mfsys.aconnect.client.dto.WorkflowRequestDTO;
|
||||||
|
import com.mfsys.aconnect.client.service.DepositAccountService;
|
||||||
|
import com.mfsys.aconnect.client.service.LoanAccountService;
|
||||||
|
import com.mfsys.common.configuration.constant.AconnectURI;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestHeader;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
public class LoanAccountController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private LoanAccountService loanAccountService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
public LoanAccountController(LoanAccountService loanAccountService) {
|
||||||
|
this.loanAccountService = loanAccountService;
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping(AconnectURI.INDIVIDUAL_LOAN_CREATION_URI)
|
||||||
|
public Object createIndividualCRM(@RequestBody WorkflowRequestDTO workflowRequestDTO,
|
||||||
|
@RequestHeader("Authorization") String token) {
|
||||||
|
return loanAccountService.createIndividualLoan(workflowRequestDTO, token);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,35 @@
|
|||||||
|
package com.mfsys.aconnect.client.controller;
|
||||||
|
|
||||||
|
import com.mfsys.aconnect.client.dto.DepositAuthorizationRequest;
|
||||||
|
import com.mfsys.aconnect.client.dto.GLAuthorizationDTO;
|
||||||
|
import com.mfsys.aconnect.client.service.TransactionAuthorizationService;
|
||||||
|
import com.mfsys.common.configuration.constant.AconnectURI;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestHeader;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
public class TransactionAuthorizationController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private TransactionAuthorizationService transactionAuthorizationService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
public TransactionAuthorizationController(TransactionAuthorizationService transactionAuthorizationService) {
|
||||||
|
this.transactionAuthorizationService = transactionAuthorizationService;
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping(AconnectURI.DEPOSIT_AUTHORIZATION_URI)
|
||||||
|
public Object depositAuthorizationTransaction(@RequestBody DepositAuthorizationRequest authorizationRequest,
|
||||||
|
@RequestHeader("Authorization") String token) {
|
||||||
|
return transactionAuthorizationService.processDepositAuthTransaction(authorizationRequest, token);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping(AconnectURI.GENERALLEDGER_AUTHORIZATION_URI)
|
||||||
|
public Object glAuthorizationTransaction(@RequestBody GLAuthorizationDTO glAuthorizationRequest,
|
||||||
|
@RequestHeader("Authorization") String token) {
|
||||||
|
return transactionAuthorizationService.processGLAuthTransaction(glAuthorizationRequest, token);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,36 @@
|
|||||||
|
package com.mfsys.aconnect.client.controller;
|
||||||
|
|
||||||
|
import com.mfsys.aconnect.client.dto.DepositCancellationDTO;
|
||||||
|
import com.mfsys.aconnect.client.dto.GLCancellationDTO;
|
||||||
|
import com.mfsys.aconnect.client.service.CancellationTransactionService;
|
||||||
|
import com.mfsys.aconnect.client.service.TransactionService;
|
||||||
|
import com.mfsys.common.configuration.constant.AconnectURI;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestHeader;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
public class TransactionCancellationController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private CancellationTransactionService cancellationTransactionService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
public TransactionCancellationController(CancellationTransactionService cancellationTransactionService) {
|
||||||
|
this.cancellationTransactionService = cancellationTransactionService;
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping(AconnectURI.DEPOSIT_CANCELLATION_URI)
|
||||||
|
public Object depositCancellationTransaction(@RequestBody DepositCancellationDTO depositCancellationDTO,
|
||||||
|
@RequestHeader("Authorization") String token) {
|
||||||
|
return cancellationTransactionService.processDepositCancellationTransaction(depositCancellationDTO, token);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping(AconnectURI.GENERALLEDGER_CANCELLATION_URI)
|
||||||
|
public Object glCancellationTransaction(@RequestBody GLCancellationDTO glCancellationRequest,
|
||||||
|
@RequestHeader("Authorization") String token) {
|
||||||
|
return cancellationTransactionService.processGLCancellationTransaction(glCancellationRequest, token);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,63 @@
|
|||||||
|
package com.mfsys.aconnect.client.controller;
|
||||||
|
|
||||||
|
import com.mfsys.aconnect.client.dto.AccountToAccountDTO;
|
||||||
|
import com.mfsys.aconnect.client.dto.AccountGLTransactionRequest;
|
||||||
|
import com.mfsys.aconnect.client.dto.GLtoGLRequest;
|
||||||
|
import com.mfsys.aconnect.client.dto.GlToAccountDTO;
|
||||||
|
import com.mfsys.aconnect.client.service.TransactionService;
|
||||||
|
import com.mfsys.common.configuration.constant.AconnectURI;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
|
|
||||||
|
@RestController()
|
||||||
|
public class TransactionController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private TransactionService transactionService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
public TransactionController(TransactionService transactionService) {
|
||||||
|
this.transactionService = transactionService;
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/account/getAccountDetails")
|
||||||
|
public ResponseEntity activeAccountDetails(
|
||||||
|
@RequestParam("porOrgacode") String porOrgacode,
|
||||||
|
@RequestParam("mbmBkmsnumber") String mbmBkmsnumber,
|
||||||
|
@RequestParam(required = false)
|
||||||
|
@DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate sgtGntrvaluedate,
|
||||||
|
@RequestHeader("Authorization") String token,
|
||||||
|
@RequestHeader("SUS_USERCODE") String userCode) {
|
||||||
|
|
||||||
|
return transactionService.getActiveAccountDetails(porOrgacode, mbmBkmsnumber, sgtGntrvaluedate, token, userCode);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping(AconnectURI.TRANSACTION_ACCOUNT_GL_URI)
|
||||||
|
public Object accountGLTransaction(@RequestBody AccountGLTransactionRequest request,
|
||||||
|
@RequestHeader("Authorization") String token) {
|
||||||
|
return transactionService.processAccountTransaction(request, token);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping(AconnectURI.TRANSACTION_GL_GL_URI)
|
||||||
|
public Object glGlTransaction(@RequestBody GLtoGLRequest request,
|
||||||
|
@RequestHeader("Authorization") String token) {
|
||||||
|
return transactionService.processGLTransaction(request, token);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping(AconnectURI.ACCOUNT_TO_ACCOUNT_TRANSACTION_URI)
|
||||||
|
public Object accToAccTransaction(@RequestBody AccountToAccountDTO request,
|
||||||
|
@RequestHeader("Authorization") String token) {
|
||||||
|
return transactionService.processAccToAccTransaction(request, token);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping(AconnectURI.GL_TO_ACCOUNT_TRANSACTION_URI)
|
||||||
|
public Object glToAccTransaction(@RequestBody GlToAccountDTO glToAccountDTO,
|
||||||
|
@RequestHeader("Authorization") String token) {
|
||||||
|
return transactionService.processGLtoAccTransaction(glToAccountDTO, token);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,26 @@
|
|||||||
|
package com.mfsys.aconnect.client.controller;
|
||||||
|
|
||||||
|
import com.mfsys.aconnect.client.model.TransactionLog;
|
||||||
|
import com.mfsys.aconnect.client.service.TransactionLogService;
|
||||||
|
import com.mfsys.common.configuration.constant.AconnectURI;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@RestController()
|
||||||
|
@RequestMapping(AconnectURI.TRANSACTION)
|
||||||
|
public class TransactionLogController {
|
||||||
|
|
||||||
|
private final TransactionLogService transactionLogService;
|
||||||
|
|
||||||
|
public TransactionLogController(TransactionLogService transactionLogService) {
|
||||||
|
this.transactionLogService = transactionLogService;
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping(AconnectURI.LOGS)
|
||||||
|
public List<TransactionLog> getAllTransactionLogs() {
|
||||||
|
return transactionLogService.getAllTransactionLogs();
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,35 @@
|
|||||||
|
package com.mfsys.aconnect.client.controller;
|
||||||
|
|
||||||
|
import com.mfsys.aconnect.client.dto.DepositRejectDTO;
|
||||||
|
import com.mfsys.aconnect.client.service.RejectTransactionService;
|
||||||
|
import com.mfsys.aconnect.client.service.TransactionService;
|
||||||
|
import com.mfsys.common.configuration.constant.AconnectURI;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestHeader;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
public class TransactionRejectController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private RejectTransactionService rejectTransactionService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
public TransactionRejectController(RejectTransactionService rejectTransactionService) {
|
||||||
|
this.rejectTransactionService = rejectTransactionService;
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping(AconnectURI.DEPOSIT_TRANSACTION_REJECT_URI)
|
||||||
|
public Object depositRejectionTransaction(@RequestBody DepositRejectDTO rejectRequest,
|
||||||
|
@RequestHeader("Authorization") String token) {
|
||||||
|
return rejectTransactionService.processDepositRejectionTransaction(rejectRequest, token);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping(AconnectURI.GENERALLEDGER_TRANSACTION_REJECT_URI)
|
||||||
|
public Object glRejectionTransaction(@RequestBody DepositRejectDTO rejectRequest,
|
||||||
|
@RequestHeader("Authorization") String token) {
|
||||||
|
return rejectTransactionService.processGLRejectionTransaction(rejectRequest, token);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,36 @@
|
|||||||
|
package com.mfsys.aconnect.client.controller;
|
||||||
|
|
||||||
|
import com.mfsys.aconnect.client.dto.DepositReversalDTO;
|
||||||
|
import com.mfsys.aconnect.client.dto.GLReversalDTO;
|
||||||
|
import com.mfsys.aconnect.client.service.ReversalTransactionService;
|
||||||
|
import com.mfsys.aconnect.client.service.TransactionService;
|
||||||
|
import com.mfsys.common.configuration.constant.AconnectURI;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestHeader;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
public class TransactionReversalController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ReversalTransactionService reversalTransactionService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
public TransactionReversalController(ReversalTransactionService reversalTransactionService) {
|
||||||
|
this.reversalTransactionService = reversalTransactionService;
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping(AconnectURI.DEPOSIT_TRANSACTION_REVERSAL_URI)
|
||||||
|
public Object depositReversalTransaction(@RequestBody DepositReversalDTO depositReversalDTO,
|
||||||
|
@RequestHeader("Authorization") String token) {
|
||||||
|
return reversalTransactionService.processDepositReversalTransaction(depositReversalDTO, token);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping(AconnectURI.GENERALLEDGER_TRANSACTION_REVERSAL_URI)
|
||||||
|
public Object glReversalTransaction(@RequestBody GLReversalDTO glReversalRequest,
|
||||||
|
@RequestHeader("Authorization") String token) {
|
||||||
|
return reversalTransactionService.processGLReversalTransaction(glReversalRequest, token);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,40 @@
|
|||||||
|
package com.mfsys.aconnect.client.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class AccountGLTransactionRequest {
|
||||||
|
|
||||||
|
private AdditionalInfo additionalInfo;
|
||||||
|
private CreditGl creditGl;
|
||||||
|
private DebitAcc debitAcc;
|
||||||
|
|
||||||
|
private String plcLocacode;
|
||||||
|
private String porOrgacode;
|
||||||
|
private String ptrTrancode;
|
||||||
|
private String ppmPymdcode;
|
||||||
|
private String sgtGntrcreateusr;
|
||||||
|
private String sgtGntrnarration;
|
||||||
|
private String sgtGntrvaluedate;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public static class AdditionalInfo {
|
||||||
|
private Boolean sgtRemittancetrans;
|
||||||
|
private String sgtTrandate;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public static class CreditGl {
|
||||||
|
private String pcaGlaccode;
|
||||||
|
private String plcLocacode;
|
||||||
|
private Double sgtGntramtfc;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public static class DebitAcc {
|
||||||
|
private String mbmBkmsnumber;
|
||||||
|
private String pitInstcode;
|
||||||
|
private Double sgtGntramtfc;
|
||||||
|
private String sgtGntrinstrumentno;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,41 @@
|
|||||||
|
package com.mfsys.aconnect.client.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class AccountToAccountDTO {
|
||||||
|
|
||||||
|
private AdditionalInfo additionalInfo;
|
||||||
|
|
||||||
|
private AccountTranInfo debitAcc;
|
||||||
|
private AccountTranInfo creditAcc;
|
||||||
|
|
||||||
|
private String plcLocacode;
|
||||||
|
private String porOrgacode;
|
||||||
|
private String ppmPymdcode;
|
||||||
|
private String sgtGntrcreateusr;
|
||||||
|
private String sgtGntrnarration;
|
||||||
|
private LocalDate sgtGntrvaluedate;
|
||||||
|
|
||||||
|
// ---------------- INNER CLASSES ----------------
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public static class AdditionalInfo {
|
||||||
|
private String sgtBnfowner;
|
||||||
|
private String sgtPrcRlcscodec;
|
||||||
|
private String sgtPtrtrancode;
|
||||||
|
private String sgtRelwithbnfowner;
|
||||||
|
private String sgtTranreason;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public static class AccountTranInfo {
|
||||||
|
private String mbmBkmsnumber;
|
||||||
|
private BigDecimal sgtGntramtfc;
|
||||||
|
private String pitInstcode;
|
||||||
|
private String sgtGntrinstrumentno;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,12 @@
|
|||||||
|
package com.mfsys.aconnect.client.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class DepositAuthorizationRequest {
|
||||||
|
private List<TranDetail> tranDetailList;
|
||||||
|
private String porOrgacode;
|
||||||
|
private String susUsercode;
|
||||||
|
}
|
||||||
@ -0,0 +1,12 @@
|
|||||||
|
package com.mfsys.aconnect.client.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class DepositCancellationDTO {
|
||||||
|
private String sgtGntrtranlink;
|
||||||
|
private String nodeId;
|
||||||
|
private String sgtGntrnarration;
|
||||||
|
private String porOrgacode;
|
||||||
|
private String susUsercode;
|
||||||
|
}
|
||||||
@ -0,0 +1,12 @@
|
|||||||
|
package com.mfsys.aconnect.client.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class DepositRejectDTO {
|
||||||
|
private List<TranDetail> tranDetailList;
|
||||||
|
private String porOrgacode;
|
||||||
|
private String susUsercode;
|
||||||
|
}
|
||||||
@ -0,0 +1,11 @@
|
|||||||
|
package com.mfsys.aconnect.client.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class DepositReversalDTO {
|
||||||
|
private String porOrgacode;
|
||||||
|
private String susUsercode;
|
||||||
|
private String nodeId;
|
||||||
|
private String sgtGntrtranlink;
|
||||||
|
}
|
||||||
@ -0,0 +1,12 @@
|
|||||||
|
package com.mfsys.aconnect.client.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class GLAuthorizationDTO {
|
||||||
|
private List<TranDetail> tranDetailList;
|
||||||
|
private String porOrgacode;
|
||||||
|
private String susUsercode;
|
||||||
|
}
|
||||||
@ -0,0 +1,12 @@
|
|||||||
|
package com.mfsys.aconnect.client.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class GLCancellationDTO {
|
||||||
|
private String sgtGntrtranlink;
|
||||||
|
private String nodeId;
|
||||||
|
private String sgtGntrnarration;
|
||||||
|
private String porOrgacode;
|
||||||
|
private String susUsercode;
|
||||||
|
}
|
||||||
@ -0,0 +1,12 @@
|
|||||||
|
package com.mfsys.aconnect.client.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class GLRejectDTO {
|
||||||
|
private List<TranDetail> tranDetailList;
|
||||||
|
private String porOrgacode;
|
||||||
|
private String susUsercode;
|
||||||
|
}
|
||||||
@ -0,0 +1,11 @@
|
|||||||
|
package com.mfsys.aconnect.client.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class GLReversalDTO {
|
||||||
|
private String porOrgacode;
|
||||||
|
private String susUsercode;
|
||||||
|
private String nodeId;
|
||||||
|
private String sgtGntrtranlink;
|
||||||
|
}
|
||||||
@ -0,0 +1,38 @@
|
|||||||
|
package com.mfsys.aconnect.client.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class GLtoGLRequest {
|
||||||
|
private GLtoGLRequest.AdditionalInfo additionalInfo;
|
||||||
|
private GLtoGLRequest.CreditGl creditGl;
|
||||||
|
private GLtoGLRequest.DebitGl debitGl;
|
||||||
|
|
||||||
|
private String plcLocacode;
|
||||||
|
private String ptrTrancode;
|
||||||
|
private String porOrgacode;
|
||||||
|
private String ppmPymdcode;
|
||||||
|
private String sgtGntrcreateusr;
|
||||||
|
private String sgtGntrnarration;
|
||||||
|
private String sgtGntrvaluedate;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public static class AdditionalInfo {
|
||||||
|
private Boolean sgtRemittancetrans;
|
||||||
|
private String sgtTrandate;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public static class CreditGl {
|
||||||
|
private String pcaGlaccode;
|
||||||
|
private String plcLocacode;
|
||||||
|
private Double sgtGntramtfc;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public static class DebitGl {
|
||||||
|
private String pcaGlaccode;
|
||||||
|
private String plcLocacode;
|
||||||
|
private Double sgtGntramtfc;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,49 @@
|
|||||||
|
package com.mfsys.aconnect.client.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class GlToAccountDTO {
|
||||||
|
|
||||||
|
private Map<String, Object> additionalInfo;
|
||||||
|
|
||||||
|
private DebitGl debitGl;
|
||||||
|
private CreditAcc creditAcc;
|
||||||
|
|
||||||
|
private String plcLocacode;
|
||||||
|
private String porOrgacode;
|
||||||
|
private String ppmPymdcode;
|
||||||
|
private String sgtGntrcreateusr;
|
||||||
|
private String sgtGntrnarration;
|
||||||
|
private LocalDate sgtGntrvaluedate;
|
||||||
|
|
||||||
|
private String sgtGntrtmudf1;
|
||||||
|
private String sgtGntrtmudf2;
|
||||||
|
private String sgtGntrudf3;
|
||||||
|
private String sgtGntrudf4;
|
||||||
|
private String sgtGntrudf5;
|
||||||
|
private String refNo;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public static class DebitGl {
|
||||||
|
private String pcaGlaccode;
|
||||||
|
private String plcLocacode;
|
||||||
|
private BigDecimal sgtGntramtfc;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public static class CreditAcc {
|
||||||
|
private String mbmBkmsnumber;
|
||||||
|
private BigDecimal sgtGntramtfc;
|
||||||
|
private String accsgtGntrnarration;
|
||||||
|
private String accsgtGntrudf3;
|
||||||
|
private String accsgtGntrudf4;
|
||||||
|
private String accsgtGntrudf5;
|
||||||
|
private String pitInstcode;
|
||||||
|
private String sgtGntrinstrumentno;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,13 @@
|
|||||||
|
package com.mfsys.aconnect.client.dto;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class SigninRequest {
|
||||||
|
private String username;
|
||||||
|
private String password;
|
||||||
|
}
|
||||||
@ -0,0 +1,9 @@
|
|||||||
|
package com.mfsys.aconnect.client.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class TranDetail {
|
||||||
|
private String sgtGntrtranlink;
|
||||||
|
private String nodeId;
|
||||||
|
}
|
||||||
@ -0,0 +1,39 @@
|
|||||||
|
package com.mfsys.aconnect.client.dto;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class WorkflowRequestDTO {
|
||||||
|
|
||||||
|
private String workFlowId;
|
||||||
|
|
||||||
|
@JsonProperty("SUS_USERCODE")
|
||||||
|
private String susUsercode;
|
||||||
|
|
||||||
|
private Map<String, Object> filesMap;
|
||||||
|
private List<AutoIncrementField> autoIncrementFields;
|
||||||
|
private String formId;
|
||||||
|
private String postProcessFormId;
|
||||||
|
private String payload;
|
||||||
|
private String operation;
|
||||||
|
|
||||||
|
@JsonProperty("POR_ORGACODE")
|
||||||
|
private String porOrgacode;
|
||||||
|
|
||||||
|
private List<List<String>> uniqueConstraints;
|
||||||
|
private List<Object> formCounters;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public static class AutoIncrementField {
|
||||||
|
private String key;
|
||||||
|
private String type;
|
||||||
|
private List<Object> position;
|
||||||
|
private Boolean incrementByCategoryTag;
|
||||||
|
private Boolean incrementIfFlowTerminated;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@ -0,0 +1,26 @@
|
|||||||
|
package com.mfsys.aconnect.client.model;
|
||||||
|
|
||||||
|
public enum IDType {
|
||||||
|
|
||||||
|
cnic("CNIC","01"),
|
||||||
|
poc("POC","04"),
|
||||||
|
nicop("NICOP","05"),
|
||||||
|
passport("PASSPORT","02");
|
||||||
|
|
||||||
|
private final String value;
|
||||||
|
private final String code;
|
||||||
|
|
||||||
|
IDType(String value, String code) {
|
||||||
|
this.value = value;
|
||||||
|
this.code = code;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getValue() {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCode() {
|
||||||
|
return code;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,58 @@
|
|||||||
|
package com.mfsys.aconnect.client.model;
|
||||||
|
|
||||||
|
import com.mfsys.common.configuration.constant.FieldNameLength;
|
||||||
|
import jakarta.persistence.*;
|
||||||
|
import lombok.Data;
|
||||||
|
import org.hibernate.annotations.CreationTimestamp;
|
||||||
|
import org.hibernate.annotations.UpdateTimestamp;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
@Entity(name = "TBL_AC_TRANSACTION_LOGS")
|
||||||
|
@Table(name = "TBL_AC_TRANSACTION_LOGS")
|
||||||
|
@Data
|
||||||
|
public class TransactionLog {
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
|
@Column(name = "LOG_ID", nullable = false, updatable = false)
|
||||||
|
private Long logId;
|
||||||
|
|
||||||
|
@Column(name = "POR_ORGACODE", nullable = false, updatable = false, columnDefinition = FieldNameLength.POR_ORGACODE)
|
||||||
|
private String porOrgacode;
|
||||||
|
|
||||||
|
@Column(name = "DR_MBMBKMSNUMBER", nullable = true, updatable = false, columnDefinition = FieldNameLength.ACCOUNT_NUMBER)
|
||||||
|
private String drMbmbkmsnumber;
|
||||||
|
|
||||||
|
@Column(name = "CR_MBMBKMSNUMBER", nullable = true, updatable = false, columnDefinition = FieldNameLength.ACCOUNT_NUMBER)
|
||||||
|
private String crMbmbkmsnumber;
|
||||||
|
|
||||||
|
@Column(name = "CR_PCAGLACCODE", nullable = true, updatable = false, columnDefinition = FieldNameLength.ACCOUNT_NUMBER)
|
||||||
|
private String crPcaglacode;
|
||||||
|
|
||||||
|
@Column(name = "DR_PCAGLACCODE", nullable = true, updatable = false, columnDefinition = FieldNameLength.ACCOUNT_NUMBER)
|
||||||
|
private String drPcaGlacode;
|
||||||
|
|
||||||
|
@Column(name = "PPM_PYMDCODE", nullable=true, updatable=false, columnDefinition=FieldNameLength.PPM_PYMDCODE)
|
||||||
|
private String ppmPymdcode;
|
||||||
|
|
||||||
|
@Column(name = "SGT_GNTRDATE", nullable=false, updatable=false, columnDefinition=FieldNameLength.DATE)
|
||||||
|
private LocalDate sgtGntrdate;
|
||||||
|
|
||||||
|
@Column(name = "SGT_GNTRCREATEAT",nullable=false, updatable=false, columnDefinition=FieldNameLength.PLC_LOCACODE)
|
||||||
|
private String sgtGntrcreateat;
|
||||||
|
|
||||||
|
@Column(name = "CHANNEL_CODE", columnDefinition=FieldNameLength.CHANNEL_CODE)
|
||||||
|
private String channelCode;
|
||||||
|
|
||||||
|
@Column(name = "TRANSACTION_ID", columnDefinition=FieldNameLength.ACCOUNT_TITLE)
|
||||||
|
private String transactionID;
|
||||||
|
|
||||||
|
@CreationTimestamp
|
||||||
|
@Column(name = "CREATED_AT", updatable = false)
|
||||||
|
private LocalDateTime createdAt;
|
||||||
|
|
||||||
|
@UpdateTimestamp
|
||||||
|
@Column(name = "UPDATED_AT")
|
||||||
|
private LocalDateTime updatedAt;
|
||||||
|
}
|
||||||
@ -0,0 +1,7 @@
|
|||||||
|
package com.mfsys.aconnect.client.repository;
|
||||||
|
|
||||||
|
import com.mfsys.aconnect.client.model.TransactionLog;
|
||||||
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
|
|
||||||
|
public interface TransactionLogRepository extends JpaRepository<TransactionLog, Long> {
|
||||||
|
}
|
||||||
@ -0,0 +1,52 @@
|
|||||||
|
package com.mfsys.aconnect.client.service;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.databind.JsonNode;
|
||||||
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
|
import org.springframework.http.*;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.web.client.RestTemplate;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class AuthService {
|
||||||
|
|
||||||
|
@Value("${app.organization.uri}")
|
||||||
|
private String OrgaCode;
|
||||||
|
|
||||||
|
@Value("${app.security.uri}")
|
||||||
|
private String securityURI;
|
||||||
|
|
||||||
|
private final RestTemplate restTemplate = new RestTemplate();
|
||||||
|
private final ObjectMapper objectMapper = new ObjectMapper();
|
||||||
|
|
||||||
|
public Map<String, Object> authenticate(Map<String, String> payload) {
|
||||||
|
|
||||||
|
HttpHeaders headers = new HttpHeaders();
|
||||||
|
headers.setContentType(MediaType.APPLICATION_JSON);
|
||||||
|
headers.set("mobileLogin", "false");
|
||||||
|
|
||||||
|
Map<String, String> requestPayload = new HashMap<>(payload);
|
||||||
|
requestPayload.put("clientid", OrgaCode);
|
||||||
|
HttpEntity<Map<String, String>> request = new HttpEntity<>(requestPayload, headers);
|
||||||
|
|
||||||
|
try {
|
||||||
|
ResponseEntity<String> response = restTemplate.postForEntity(securityURI, request, String.class);
|
||||||
|
JsonNode jsonNode = objectMapper.readTree(response.getBody());
|
||||||
|
|
||||||
|
Map<String, Object> result = new HashMap<>();
|
||||||
|
result.put("authenticated", jsonNode.get("authenticated").asBoolean());
|
||||||
|
result.put("token", jsonNode.get("token").asText());
|
||||||
|
result.put("userName", jsonNode.get("userName").asText());
|
||||||
|
return result;
|
||||||
|
|
||||||
|
} catch (Exception e) {
|
||||||
|
return Map.of(
|
||||||
|
"authenticated", false,
|
||||||
|
"error", "Authentication failed: " + e.getMessage()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,65 @@
|
|||||||
|
package com.mfsys.aconnect.client.service;
|
||||||
|
|
||||||
|
import com.mfsys.aconnect.client.dto.WorkflowRequestDTO;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
|
import org.springframework.http.*;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.web.client.RestTemplate;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class CRMService {
|
||||||
|
|
||||||
|
@Value("${app.crm.uri}")
|
||||||
|
private String crmURI;
|
||||||
|
|
||||||
|
private final RestTemplate restTemplate;
|
||||||
|
public CRMService(RestTemplate restTemplate) {
|
||||||
|
this.restTemplate = restTemplate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Object createIndividualCRM(WorkflowRequestDTO workflowRequestDTO, String token) {
|
||||||
|
String porOrgacode = workflowRequestDTO.getPorOrgacode();
|
||||||
|
String url = crmURI + "/crm" + "/mongodb/formdata" ;
|
||||||
|
HttpHeaders headers = new HttpHeaders();
|
||||||
|
headers.set("Authorization", token);
|
||||||
|
headers.set("POR_ORGACODE", porOrgacode);
|
||||||
|
headers.set("SUS_USERCODE", workflowRequestDTO.getSusUsercode());
|
||||||
|
headers.setContentType(MediaType.APPLICATION_JSON);
|
||||||
|
|
||||||
|
HttpEntity<WorkflowRequestDTO> entity = new HttpEntity<>(workflowRequestDTO, headers);
|
||||||
|
|
||||||
|
ResponseEntity<Map> response = restTemplate.exchange(
|
||||||
|
url,
|
||||||
|
HttpMethod.POST,
|
||||||
|
entity,
|
||||||
|
Map.class
|
||||||
|
);
|
||||||
|
|
||||||
|
return ResponseEntity.status(response.getStatusCode()).body(response.getBody());
|
||||||
|
}
|
||||||
|
|
||||||
|
public Object createBusinessCRM(WorkflowRequestDTO workflowRequestDTO, String token) {
|
||||||
|
String porOrgacode = workflowRequestDTO.getPorOrgacode();
|
||||||
|
String url = crmURI + "/crm" + "/mongodb/formdata" ;
|
||||||
|
HttpHeaders headers = new HttpHeaders();
|
||||||
|
headers.set("Authorization", token);
|
||||||
|
headers.set("POR_ORGACODE", porOrgacode);
|
||||||
|
headers.set("SUS_USERCODE", workflowRequestDTO.getSusUsercode());
|
||||||
|
headers.setContentType(MediaType.APPLICATION_JSON);
|
||||||
|
|
||||||
|
HttpEntity<WorkflowRequestDTO> entity = new HttpEntity<>(workflowRequestDTO, headers);
|
||||||
|
|
||||||
|
ResponseEntity<Map> response = restTemplate.exchange(
|
||||||
|
url,
|
||||||
|
HttpMethod.POST,
|
||||||
|
entity,
|
||||||
|
Map.class
|
||||||
|
);
|
||||||
|
|
||||||
|
return ResponseEntity.status(response.getStatusCode()).body(response.getBody());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,76 @@
|
|||||||
|
package com.mfsys.aconnect.client.service;
|
||||||
|
|
||||||
|
import com.mfsys.aconnect.client.dto.DepositCancellationDTO;
|
||||||
|
import com.mfsys.aconnect.client.dto.GLCancellationDTO;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
|
import org.springframework.http.*;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.web.client.RestTemplate;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import static com.mfsys.common.configuration.constant.AconnectURI.ACONNECT;
|
||||||
|
import static com.mfsys.common.configuration.constant.AconnectURI.GENERALLEDGER;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class CancellationTransactionService {
|
||||||
|
|
||||||
|
@Value("${app.deposit.uri}")
|
||||||
|
private String depositURI;
|
||||||
|
|
||||||
|
@Value("${app.generalledger.uri}")
|
||||||
|
private String generalledgerURI;
|
||||||
|
|
||||||
|
private final RestTemplate restTemplate;
|
||||||
|
public CancellationTransactionService(RestTemplate restTemplate) {
|
||||||
|
this.restTemplate = restTemplate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Object processDepositCancellationTransaction(DepositCancellationDTO depositCancellationDTO, String tokenHeader) {
|
||||||
|
String porOrgacode = depositCancellationDTO.getPorOrgacode();
|
||||||
|
String url = depositURI + "/deposit" + "/organizations/" + depositCancellationDTO.getPorOrgacode() +
|
||||||
|
"/transactions" + ACONNECT + "/cancel/nodes/" + depositCancellationDTO.getNodeId() +
|
||||||
|
"/trannums/" + depositCancellationDTO.getSgtGntrtranlink();
|
||||||
|
|
||||||
|
HttpHeaders headers = new HttpHeaders();
|
||||||
|
headers.set("Authorization", tokenHeader);
|
||||||
|
headers.set("POR_ORGACODE", porOrgacode);
|
||||||
|
headers.set("SUS_USERCODE", depositCancellationDTO.getSusUsercode());
|
||||||
|
headers.setContentType(MediaType.APPLICATION_JSON);
|
||||||
|
|
||||||
|
HttpEntity<DepositCancellationDTO> entity = new HttpEntity<>(depositCancellationDTO, headers);
|
||||||
|
|
||||||
|
ResponseEntity<Map> response = restTemplate.exchange(
|
||||||
|
url,
|
||||||
|
HttpMethod.POST,
|
||||||
|
entity,
|
||||||
|
Map.class
|
||||||
|
);
|
||||||
|
|
||||||
|
return ResponseEntity.status(response.getStatusCode()).body(response.getBody());
|
||||||
|
}
|
||||||
|
|
||||||
|
public Object processGLCancellationTransaction(GLCancellationDTO glCancellationDTO, String tokenHeader) {
|
||||||
|
String porOrgacode = glCancellationDTO.getPorOrgacode();
|
||||||
|
String url = generalledgerURI + GENERALLEDGER + "/organizations/" + glCancellationDTO.getPorOrgacode() +
|
||||||
|
"/transactions" + ACONNECT + "/cancel/nodes/" + glCancellationDTO.getNodeId() +
|
||||||
|
"/trannums/" + glCancellationDTO.getSgtGntrtranlink();
|
||||||
|
|
||||||
|
HttpHeaders headers = new HttpHeaders();
|
||||||
|
headers.set("Authorization", tokenHeader);
|
||||||
|
headers.set("POR_ORGACODE", porOrgacode);
|
||||||
|
headers.set("SUS_USERCODE", glCancellationDTO.getSusUsercode());
|
||||||
|
headers.setContentType(MediaType.APPLICATION_JSON);
|
||||||
|
|
||||||
|
HttpEntity<GLCancellationDTO> entity = new HttpEntity<>(glCancellationDTO, headers);
|
||||||
|
ResponseEntity<Map> response = restTemplate.exchange(
|
||||||
|
url,
|
||||||
|
HttpMethod.POST,
|
||||||
|
entity,
|
||||||
|
Map.class
|
||||||
|
);
|
||||||
|
|
||||||
|
return ResponseEntity.status(response.getStatusCode()).body(response.getBody());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,88 @@
|
|||||||
|
package com.mfsys.aconnect.client.service;
|
||||||
|
|
||||||
|
import com.mfsys.aconnect.client.dto.WorkflowRequestDTO;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
|
import org.springframework.http.*;
|
||||||
|
import org.springframework.http.client.HttpComponentsClientHttpRequestFactory;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.web.client.RestTemplate;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class DepositAccountService {
|
||||||
|
|
||||||
|
@Value("${app.deposit.uri}")
|
||||||
|
private String depositURI;
|
||||||
|
|
||||||
|
|
||||||
|
private final RestTemplate restTemplate;
|
||||||
|
public DepositAccountService(RestTemplate restTemplate) {
|
||||||
|
this.restTemplate = restTemplate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Object createIndividualDeposit(WorkflowRequestDTO workflowRequestDTO, String token) {
|
||||||
|
String porOrgacode = workflowRequestDTO.getPorOrgacode();
|
||||||
|
String url = depositURI + "/deposit" + "/mongodb/formdata" ;
|
||||||
|
HttpHeaders headers = new HttpHeaders();
|
||||||
|
headers.set("Authorization", token);
|
||||||
|
headers.set("POR_ORGACODE", porOrgacode);
|
||||||
|
headers.set("SUS_USERCODE", workflowRequestDTO.getSusUsercode());
|
||||||
|
headers.setContentType(MediaType.APPLICATION_JSON);
|
||||||
|
|
||||||
|
HttpEntity<WorkflowRequestDTO> entity = new HttpEntity<>(workflowRequestDTO, headers);
|
||||||
|
|
||||||
|
ResponseEntity<Map> response = restTemplate.exchange(
|
||||||
|
url,
|
||||||
|
HttpMethod.POST,
|
||||||
|
entity,
|
||||||
|
Map.class
|
||||||
|
);
|
||||||
|
|
||||||
|
return ResponseEntity.status(response.getStatusCode()).body(response.getBody());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public Object approvalIndividualDeposit(WorkflowRequestDTO workflowRequestDTO, String token) {
|
||||||
|
String porOrgacode = workflowRequestDTO.getPorOrgacode();
|
||||||
|
String url = depositURI + "/deposit" + "/mongodb/formdata" ;
|
||||||
|
HttpHeaders headers = new HttpHeaders();
|
||||||
|
headers.set("Authorization", token);
|
||||||
|
headers.set("POR_ORGACODE", porOrgacode);
|
||||||
|
headers.set("SUS_USERCODE", workflowRequestDTO.getSusUsercode());
|
||||||
|
headers.setContentType(MediaType.APPLICATION_JSON);
|
||||||
|
|
||||||
|
HttpEntity<WorkflowRequestDTO> entity = new HttpEntity<>(workflowRequestDTO, headers);
|
||||||
|
restTemplate.setRequestFactory(new HttpComponentsClientHttpRequestFactory());
|
||||||
|
|
||||||
|
ResponseEntity<Map> response = restTemplate.exchange(
|
||||||
|
url,
|
||||||
|
HttpMethod.PATCH,
|
||||||
|
entity,
|
||||||
|
Map.class
|
||||||
|
);
|
||||||
|
|
||||||
|
return ResponseEntity.status(response.getStatusCode()).body(response.getBody());
|
||||||
|
}
|
||||||
|
|
||||||
|
public Object createBusinessDeposit(WorkflowRequestDTO workflowRequestDTO, String token) {
|
||||||
|
String porOrgacode = workflowRequestDTO.getPorOrgacode();
|
||||||
|
String url = depositURI + "/deposit" + "/mongodb/formdata" ;
|
||||||
|
HttpHeaders headers = new HttpHeaders();
|
||||||
|
headers.set("Authorization", token);
|
||||||
|
headers.set("POR_ORGACODE", porOrgacode);
|
||||||
|
headers.set("SUS_USERCODE", workflowRequestDTO.getSusUsercode());
|
||||||
|
headers.setContentType(MediaType.APPLICATION_JSON);
|
||||||
|
|
||||||
|
HttpEntity<WorkflowRequestDTO> entity = new HttpEntity<>(workflowRequestDTO, headers);
|
||||||
|
|
||||||
|
ResponseEntity<Map> response = restTemplate.exchange(
|
||||||
|
url,
|
||||||
|
HttpMethod.POST,
|
||||||
|
entity,
|
||||||
|
Map.class
|
||||||
|
);
|
||||||
|
|
||||||
|
return ResponseEntity.status(response.getStatusCode()).body(response.getBody());
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,43 @@
|
|||||||
|
package com.mfsys.aconnect.client.service;
|
||||||
|
|
||||||
|
import com.mfsys.aconnect.client.dto.WorkflowRequestDTO;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
|
import org.springframework.http.*;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.web.client.RestTemplate;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class LoanAccountService {
|
||||||
|
|
||||||
|
@Value("${app.loan.uri}")
|
||||||
|
private String loanURI;
|
||||||
|
|
||||||
|
private final RestTemplate restTemplate;
|
||||||
|
public LoanAccountService(RestTemplate restTemplate) {
|
||||||
|
this.restTemplate = restTemplate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Object createIndividualLoan(WorkflowRequestDTO workflowRequestDTO, String token) {
|
||||||
|
String porOrgacode = workflowRequestDTO.getPorOrgacode();
|
||||||
|
String url = loanURI + "/loan" + "/mongodb/formdata" ;
|
||||||
|
HttpHeaders headers = new HttpHeaders();
|
||||||
|
headers.set("Authorization", token);
|
||||||
|
headers.set("POR_ORGACODE", porOrgacode);
|
||||||
|
headers.set("SUS_USERCODE", workflowRequestDTO.getSusUsercode());
|
||||||
|
headers.setContentType(MediaType.APPLICATION_JSON);
|
||||||
|
|
||||||
|
HttpEntity<WorkflowRequestDTO> entity = new HttpEntity<>(workflowRequestDTO, headers);
|
||||||
|
|
||||||
|
ResponseEntity<Map> response = restTemplate.exchange(
|
||||||
|
url,
|
||||||
|
HttpMethod.POST,
|
||||||
|
entity,
|
||||||
|
Map.class
|
||||||
|
);
|
||||||
|
|
||||||
|
return ResponseEntity.status(response.getStatusCode()).body(response.getBody());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,69 @@
|
|||||||
|
package com.mfsys.aconnect.client.service;
|
||||||
|
|
||||||
|
import com.mfsys.aconnect.client.dto.DepositRejectDTO;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
|
import org.springframework.http.*;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.web.client.RestTemplate;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import static com.mfsys.common.configuration.constant.AconnectURI.ACONNECT;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class RejectTransactionService {
|
||||||
|
|
||||||
|
@Value("${app.deposit.uri}")
|
||||||
|
private String depositURI;
|
||||||
|
|
||||||
|
@Value("${app.generalledger.uri}")
|
||||||
|
private String generalledgerURI;
|
||||||
|
|
||||||
|
private final RestTemplate restTemplate;
|
||||||
|
public RejectTransactionService(RestTemplate restTemplate) {
|
||||||
|
this.restTemplate = restTemplate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Object processDepositRejectionTransaction(DepositRejectDTO rejectRequest, String tokenHeader) {
|
||||||
|
String porOrgacode = rejectRequest.getPorOrgacode();
|
||||||
|
String url = depositURI + "/deposit/" + "/organizations/" + porOrgacode + "/transactions" + ACONNECT +"/rejection";
|
||||||
|
HttpHeaders headers = new HttpHeaders();
|
||||||
|
headers.set("Authorization", tokenHeader);
|
||||||
|
headers.set("POR_ORGACODE", porOrgacode);
|
||||||
|
headers.set("SUS_USERCODE", rejectRequest.getSusUsercode());
|
||||||
|
headers.setContentType(MediaType.APPLICATION_JSON);
|
||||||
|
|
||||||
|
HttpEntity<DepositRejectDTO> entity = new HttpEntity<>(rejectRequest, headers);
|
||||||
|
|
||||||
|
ResponseEntity<Map> response = restTemplate.exchange(
|
||||||
|
url,
|
||||||
|
HttpMethod.POST,
|
||||||
|
entity,
|
||||||
|
Map.class
|
||||||
|
);
|
||||||
|
|
||||||
|
return ResponseEntity.status(response.getStatusCode()).body(response.getBody());
|
||||||
|
}
|
||||||
|
|
||||||
|
public Object processGLRejectionTransaction(DepositRejectDTO rejectRequest, String tokenHeader) {
|
||||||
|
String porOrgacode = rejectRequest.getPorOrgacode();
|
||||||
|
String url = generalledgerURI + "/generalledger/" + "/organizations/" + porOrgacode + "/transactions" + ACONNECT +"/rejection";
|
||||||
|
HttpHeaders headers = new HttpHeaders();
|
||||||
|
headers.set("Authorization", tokenHeader);
|
||||||
|
headers.set("POR_ORGACODE", porOrgacode);
|
||||||
|
headers.set("SUS_USERCODE", rejectRequest.getSusUsercode());
|
||||||
|
headers.setContentType(MediaType.APPLICATION_JSON);
|
||||||
|
|
||||||
|
HttpEntity<DepositRejectDTO> entity = new HttpEntity<>(rejectRequest, headers);
|
||||||
|
|
||||||
|
ResponseEntity<Map> response = restTemplate.exchange(
|
||||||
|
url,
|
||||||
|
HttpMethod.POST,
|
||||||
|
entity,
|
||||||
|
Map.class
|
||||||
|
);
|
||||||
|
|
||||||
|
return ResponseEntity.status(response.getStatusCode()).body(response.getBody());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,75 @@
|
|||||||
|
package com.mfsys.aconnect.client.service;
|
||||||
|
|
||||||
|
import com.mfsys.aconnect.client.dto.DepositReversalDTO;
|
||||||
|
import com.mfsys.aconnect.client.dto.GLReversalDTO;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
|
import org.springframework.http.*;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.web.client.RestTemplate;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import static com.mfsys.common.configuration.constant.AconnectURI.ACONNECT;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class ReversalTransactionService {
|
||||||
|
|
||||||
|
@Value("${app.deposit.uri}")
|
||||||
|
private String depositURI;
|
||||||
|
|
||||||
|
@Value("${app.generalledger.uri}")
|
||||||
|
private String generalledgerURI;
|
||||||
|
|
||||||
|
private final RestTemplate restTemplate;
|
||||||
|
public ReversalTransactionService(RestTemplate restTemplate) {
|
||||||
|
this.restTemplate = restTemplate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Object processDepositReversalTransaction(DepositReversalDTO reversalRequest, String tokenHeader) {
|
||||||
|
String porOrgacode = reversalRequest.getPorOrgacode();
|
||||||
|
String nodeID = reversalRequest.getNodeId();
|
||||||
|
String sgtGntrtranlink = reversalRequest.getSgtGntrtranlink();
|
||||||
|
String url = depositURI + "/deposit/" + "/organizations/" + porOrgacode + "/transactions" + ACONNECT + "/reversals/nodes/" + nodeID + "/trannums/" + sgtGntrtranlink;
|
||||||
|
HttpHeaders headers = new HttpHeaders();
|
||||||
|
headers.set("Authorization", tokenHeader);
|
||||||
|
headers.set("POR_ORGACODE", porOrgacode);
|
||||||
|
headers.set("SUS_USERCODE", reversalRequest.getSusUsercode());
|
||||||
|
headers.setContentType(MediaType.APPLICATION_JSON);
|
||||||
|
|
||||||
|
HttpEntity<DepositReversalDTO> entity = new HttpEntity<>(reversalRequest, headers);
|
||||||
|
|
||||||
|
ResponseEntity<Map> response = restTemplate.exchange(
|
||||||
|
url,
|
||||||
|
HttpMethod.POST,
|
||||||
|
entity,
|
||||||
|
Map.class
|
||||||
|
);
|
||||||
|
|
||||||
|
return ResponseEntity.status(response.getStatusCode()).body(response.getBody());
|
||||||
|
}
|
||||||
|
|
||||||
|
public Object processGLReversalTransaction(GLReversalDTO reversalRequest, String tokenHeader) {
|
||||||
|
String porOrgacode = reversalRequest.getPorOrgacode();
|
||||||
|
String nodeID = reversalRequest.getNodeId();
|
||||||
|
String sgtGntrtranlink = reversalRequest.getSgtGntrtranlink();
|
||||||
|
|
||||||
|
String url = generalledgerURI + "/generalledger/" + "/organizations/" + porOrgacode + "/transactions"+ ACONNECT +"/reversals/nodes/" + nodeID + "/trannums/" + sgtGntrtranlink;
|
||||||
|
HttpHeaders headers = new HttpHeaders();
|
||||||
|
headers.set("Authorization", tokenHeader);
|
||||||
|
headers.set("POR_ORGACODE", porOrgacode);
|
||||||
|
headers.set("SUS_USERCODE", reversalRequest.getSusUsercode());
|
||||||
|
headers.setContentType(MediaType.APPLICATION_JSON);
|
||||||
|
|
||||||
|
HttpEntity<GLReversalDTO> entity = new HttpEntity<>(reversalRequest, headers);
|
||||||
|
|
||||||
|
ResponseEntity<Map> response = restTemplate.exchange(
|
||||||
|
url,
|
||||||
|
HttpMethod.POST,
|
||||||
|
entity,
|
||||||
|
Map.class
|
||||||
|
);
|
||||||
|
|
||||||
|
return ResponseEntity.status(response.getStatusCode()).body(response.getBody());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,71 @@
|
|||||||
|
package com.mfsys.aconnect.client.service;
|
||||||
|
|
||||||
|
import com.mfsys.aconnect.client.dto.DepositAuthorizationRequest;
|
||||||
|
import com.mfsys.aconnect.client.dto.GLAuthorizationDTO;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
|
import org.springframework.http.*;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.web.client.RestTemplate;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import static com.mfsys.common.configuration.constant.AconnectURI.ACONNECT;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class TransactionAuthorizationService {
|
||||||
|
|
||||||
|
@Value("${app.deposit.uri}")
|
||||||
|
private String depositURI;
|
||||||
|
|
||||||
|
@Value("${app.generalledger.uri}")
|
||||||
|
private String generalledgerURI;
|
||||||
|
|
||||||
|
private final RestTemplate restTemplate;
|
||||||
|
public TransactionAuthorizationService(RestTemplate restTemplate) {
|
||||||
|
this.restTemplate = restTemplate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Object processDepositAuthTransaction(DepositAuthorizationRequest authorizationRequest, String tokenHeader) {
|
||||||
|
String porOrgacode = authorizationRequest.getPorOrgacode();
|
||||||
|
String url = depositURI + "/deposit/" + "/organizations/" + porOrgacode + "/transactions" + ACONNECT + "/authorizations";
|
||||||
|
HttpHeaders headers = new HttpHeaders();
|
||||||
|
headers.set("Authorization", tokenHeader);
|
||||||
|
headers.set("POR_ORGACODE", porOrgacode);
|
||||||
|
headers.set("SUS_USERCODE", authorizationRequest.getSusUsercode());
|
||||||
|
headers.setContentType(MediaType.APPLICATION_JSON);
|
||||||
|
headers.setAccept(java.util.List.of(MediaType.APPLICATION_JSON));
|
||||||
|
|
||||||
|
HttpEntity<DepositAuthorizationRequest> entity = new HttpEntity<>(authorizationRequest, headers);
|
||||||
|
|
||||||
|
ResponseEntity<Map> response = restTemplate.exchange(
|
||||||
|
url,
|
||||||
|
HttpMethod.POST,
|
||||||
|
entity,
|
||||||
|
Map.class
|
||||||
|
);
|
||||||
|
|
||||||
|
return ResponseEntity.status(response.getStatusCode()).body(response.getBody());
|
||||||
|
}
|
||||||
|
|
||||||
|
public Object processGLAuthTransaction(GLAuthorizationDTO authorizationRequest, String tokenHeader) {
|
||||||
|
String porOrgacode = authorizationRequest.getPorOrgacode();
|
||||||
|
String url = generalledgerURI + "/generalledger/" + "/organizations/" + porOrgacode + "/transactions/authorizations";
|
||||||
|
HttpHeaders headers = new HttpHeaders();
|
||||||
|
headers.set("Authorization", tokenHeader);
|
||||||
|
headers.set("POR_ORGACODE", porOrgacode);
|
||||||
|
headers.set("SUS_USERCODE", authorizationRequest.getSusUsercode());
|
||||||
|
headers.setContentType(MediaType.APPLICATION_JSON);
|
||||||
|
|
||||||
|
HttpEntity<GLAuthorizationDTO> entity = new HttpEntity<>(authorizationRequest, headers);
|
||||||
|
|
||||||
|
ResponseEntity<Map> response = restTemplate.exchange(
|
||||||
|
url,
|
||||||
|
HttpMethod.POST,
|
||||||
|
entity,
|
||||||
|
Map.class
|
||||||
|
);
|
||||||
|
|
||||||
|
return ResponseEntity.status(response.getStatusCode()).body(response.getBody());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,110 @@
|
|||||||
|
package com.mfsys.aconnect.client.service;
|
||||||
|
|
||||||
|
import com.mfsys.aconnect.client.repository.TransactionLogRepository;
|
||||||
|
import com.mfsys.aconnect.client.dto.AccountGLTransactionRequest;
|
||||||
|
import com.mfsys.aconnect.client.dto.AccountToAccountDTO;
|
||||||
|
import com.mfsys.aconnect.client.dto.GLtoGLRequest;
|
||||||
|
import com.mfsys.aconnect.client.dto.GlToAccountDTO;
|
||||||
|
import com.mfsys.aconnect.client.model.TransactionLog;
|
||||||
|
import jakarta.transaction.Transactional;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class TransactionLogService {
|
||||||
|
private final TransactionLogRepository transactionLogRepository;
|
||||||
|
|
||||||
|
public TransactionLogService(TransactionLogRepository transactionLogRepository) {
|
||||||
|
this.transactionLogRepository = transactionLogRepository;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<TransactionLog> getAllTransactionLogs() {
|
||||||
|
return transactionLogRepository.findAll();
|
||||||
|
}
|
||||||
|
|
||||||
|
public TransactionLog createTransactionLog(AccountGLTransactionRequest accountGLTransactionRequest) {
|
||||||
|
TransactionLog transactionLog = new TransactionLog();
|
||||||
|
transactionLog.setPorOrgacode(accountGLTransactionRequest.getPorOrgacode());
|
||||||
|
transactionLog.setChannelCode(accountGLTransactionRequest.getSgtGntrcreateusr());
|
||||||
|
transactionLog.setSgtGntrcreateat(accountGLTransactionRequest.getSgtGntrcreateusr());
|
||||||
|
transactionLog.setCrMbmbkmsnumber("");
|
||||||
|
transactionLog.setDrMbmbkmsnumber(accountGLTransactionRequest.getDebitAcc().getMbmBkmsnumber());
|
||||||
|
transactionLog.setCrPcaglacode(accountGLTransactionRequest.getCreditGl().getPcaGlaccode());
|
||||||
|
transactionLog.setDrPcaGlacode("");
|
||||||
|
transactionLog.setPpmPymdcode(accountGLTransactionRequest.getPpmPymdcode());
|
||||||
|
transactionLog.setSgtGntrdate(LocalDate.parse(accountGLTransactionRequest.getSgtGntrvaluedate()));
|
||||||
|
transactionLog.setCreatedAt(LocalDateTime.now());
|
||||||
|
transactionLog.setUpdatedAt(LocalDateTime.now());
|
||||||
|
transactionLog.setSgtGntrdate(LocalDate.parse(accountGLTransactionRequest.getSgtGntrvaluedate()));
|
||||||
|
return transactionLogRepository.save(transactionLog);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional
|
||||||
|
public void updateResponseFields(Long logId, Map<String, Object> response) {
|
||||||
|
transactionLogRepository.findById(logId).ifPresent(log -> {
|
||||||
|
if (response == null) return;
|
||||||
|
Object argsObj = response.get("arguments");
|
||||||
|
if (!(argsObj instanceof List<?> args) || args.isEmpty()) return;
|
||||||
|
|
||||||
|
String transactionId = args.get(0).toString();
|
||||||
|
|
||||||
|
log.setTransactionID(transactionId);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public TransactionLog createGLtoGLTransactionLog(GLtoGLRequest gLtoGLRequest) {
|
||||||
|
TransactionLog transactionLog = new TransactionLog();
|
||||||
|
transactionLog.setPorOrgacode(gLtoGLRequest.getPorOrgacode());
|
||||||
|
transactionLog.setChannelCode(gLtoGLRequest.getSgtGntrcreateusr());
|
||||||
|
transactionLog.setSgtGntrcreateat(gLtoGLRequest.getSgtGntrcreateusr());
|
||||||
|
transactionLog.setCrMbmbkmsnumber("");
|
||||||
|
transactionLog.setDrMbmbkmsnumber("");
|
||||||
|
transactionLog.setCrPcaglacode(gLtoGLRequest.getCreditGl().getPcaGlaccode());
|
||||||
|
transactionLog.setDrPcaGlacode(gLtoGLRequest.getDebitGl().getPcaGlaccode());
|
||||||
|
transactionLog.setPpmPymdcode(gLtoGLRequest.getPpmPymdcode());
|
||||||
|
transactionLog.setSgtGntrdate(LocalDate.parse(gLtoGLRequest.getSgtGntrvaluedate()));
|
||||||
|
transactionLog.setCreatedAt(LocalDateTime.now());
|
||||||
|
transactionLog.setUpdatedAt(LocalDateTime.now());
|
||||||
|
transactionLog.setSgtGntrdate(LocalDate.parse(gLtoGLRequest.getSgtGntrvaluedate()));
|
||||||
|
return transactionLogRepository.save(transactionLog);
|
||||||
|
}
|
||||||
|
|
||||||
|
public TransactionLog createAccToAccTransactionLog(AccountToAccountDTO accountToAccountDTO) {
|
||||||
|
TransactionLog transactionLog = new TransactionLog();
|
||||||
|
transactionLog.setPorOrgacode(accountToAccountDTO.getPorOrgacode());
|
||||||
|
transactionLog.setChannelCode(accountToAccountDTO.getSgtGntrcreateusr());
|
||||||
|
transactionLog.setSgtGntrcreateat(accountToAccountDTO.getSgtGntrcreateusr());
|
||||||
|
transactionLog.setCrMbmbkmsnumber(accountToAccountDTO.getCreditAcc().getMbmBkmsnumber());
|
||||||
|
transactionLog.setDrMbmbkmsnumber(accountToAccountDTO.getDebitAcc().getMbmBkmsnumber());
|
||||||
|
transactionLog.setCrPcaglacode("");
|
||||||
|
transactionLog.setDrPcaGlacode("");
|
||||||
|
transactionLog.setPpmPymdcode(accountToAccountDTO.getPpmPymdcode());
|
||||||
|
transactionLog.setSgtGntrdate(accountToAccountDTO.getSgtGntrvaluedate());
|
||||||
|
transactionLog.setCreatedAt(LocalDateTime.now());
|
||||||
|
transactionLog.setUpdatedAt(LocalDateTime.now());
|
||||||
|
transactionLog.setSgtGntrdate(accountToAccountDTO.getSgtGntrvaluedate());
|
||||||
|
return transactionLogRepository.save(transactionLog);
|
||||||
|
}
|
||||||
|
|
||||||
|
public TransactionLog createGLToAccTransactionLog(GlToAccountDTO glToAccountDTO) {
|
||||||
|
TransactionLog transactionLog = new TransactionLog();
|
||||||
|
transactionLog.setPorOrgacode(glToAccountDTO.getPorOrgacode());
|
||||||
|
transactionLog.setChannelCode(glToAccountDTO.getSgtGntrcreateusr());
|
||||||
|
transactionLog.setSgtGntrcreateat(glToAccountDTO.getSgtGntrcreateusr());
|
||||||
|
transactionLog.setCrMbmbkmsnumber(glToAccountDTO.getCreditAcc().getMbmBkmsnumber());
|
||||||
|
transactionLog.setDrMbmbkmsnumber("");
|
||||||
|
transactionLog.setCrPcaglacode("");
|
||||||
|
transactionLog.setDrPcaGlacode("");
|
||||||
|
transactionLog.setPpmPymdcode(glToAccountDTO.getPpmPymdcode());
|
||||||
|
transactionLog.setSgtGntrdate(glToAccountDTO.getSgtGntrvaluedate());
|
||||||
|
transactionLog.setCreatedAt(LocalDateTime.now());
|
||||||
|
transactionLog.setUpdatedAt(LocalDateTime.now());
|
||||||
|
transactionLog.setSgtGntrdate(glToAccountDTO.getSgtGntrvaluedate());
|
||||||
|
return transactionLogRepository.save(transactionLog);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,182 @@
|
|||||||
|
package com.mfsys.aconnect.client.service;
|
||||||
|
|
||||||
|
import com.mfsys.aconnect.client.dto.*;
|
||||||
|
import com.mfsys.aconnect.client.model.TransactionLog;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
|
import org.springframework.http.HttpEntity;
|
||||||
|
import org.springframework.http.HttpMethod;
|
||||||
|
import org.springframework.http.MediaType;
|
||||||
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.web.client.RestTemplate;
|
||||||
|
|
||||||
|
import org.springframework.http.HttpHeaders;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import static com.mfsys.common.configuration.constant.AconnectURI.*;
|
||||||
|
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class TransactionService {
|
||||||
|
|
||||||
|
@Value("${app.deposit.uri}")
|
||||||
|
private String depositURI;
|
||||||
|
|
||||||
|
@Value("${app.generalledger.uri}")
|
||||||
|
private String generalledgerURI;
|
||||||
|
|
||||||
|
private final RestTemplate restTemplate;
|
||||||
|
private final TransactionLogService transactionLogService;
|
||||||
|
public TransactionService(RestTemplate restTemplate, TransactionLogService transactionLogService) {
|
||||||
|
this.restTemplate = restTemplate;
|
||||||
|
this.transactionLogService = transactionLogService;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ResponseEntity getActiveAccountDetails(String porOrgacode, String mbmBkmsnumber, LocalDate sgtGntrvaluedate, String tokenHeader, String userCode) {
|
||||||
|
|
||||||
|
String url = depositURI + DEPOSIT_CIIHIVE_ACCOUNT_MISCELLANEOUS_DETAILS_URI + "?porOrgacode=" + porOrgacode + "&mbmBkmsnumber=" + mbmBkmsnumber;
|
||||||
|
if (sgtGntrvaluedate != null) {
|
||||||
|
url += "&sgtGntrvaluedate=" + sgtGntrvaluedate;
|
||||||
|
}
|
||||||
|
|
||||||
|
HttpHeaders headers = new HttpHeaders();
|
||||||
|
headers.set("Authorization", tokenHeader);
|
||||||
|
headers.set("POR_ORGACODE", porOrgacode);
|
||||||
|
headers.set("SUS_USERCODE", userCode);
|
||||||
|
headers.setAccept(java.util.List.of(MediaType.APPLICATION_JSON));
|
||||||
|
|
||||||
|
HttpEntity<Void> entity = new HttpEntity<>(headers);
|
||||||
|
ResponseEntity<Map> response = restTemplate.exchange(url,HttpMethod.GET,entity,Map.class);
|
||||||
|
|
||||||
|
return ResponseEntity.status(response.getStatusCode()).body(response.getBody());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public ResponseEntity processAccountTransaction(AccountGLTransactionRequest accountGLTransactionRequest, String tokenHeader) {
|
||||||
|
Double creditAmount = accountGLTransactionRequest.getCreditGl().getSgtGntramtfc();
|
||||||
|
Double debitAmount = accountGLTransactionRequest.getDebitAcc().getSgtGntramtfc();
|
||||||
|
|
||||||
|
if (!creditAmount.equals(debitAmount)) {
|
||||||
|
return ResponseEntity
|
||||||
|
.badRequest()
|
||||||
|
.body("Credit and Debit amounts must be equal");
|
||||||
|
}
|
||||||
|
|
||||||
|
String porOrgacode = accountGLTransactionRequest.getPorOrgacode();
|
||||||
|
String url = depositURI + "/deposit/" + "/organizations/" + porOrgacode + "/transactions" + ACONNECT + "/accounttogls";
|
||||||
|
|
||||||
|
HttpHeaders headers = new HttpHeaders();
|
||||||
|
headers.set("Authorization", tokenHeader);
|
||||||
|
headers.set("POR_ORGACODE", porOrgacode);
|
||||||
|
headers.set("SUS_USERCODE", accountGLTransactionRequest.getSgtGntrcreateusr());
|
||||||
|
headers.setContentType(MediaType.APPLICATION_JSON);
|
||||||
|
headers.setAccept(java.util.List.of(MediaType.APPLICATION_JSON));
|
||||||
|
HttpEntity<AccountGLTransactionRequest> entity = new HttpEntity<>(accountGLTransactionRequest, headers);
|
||||||
|
|
||||||
|
TransactionLog log = transactionLogService.createTransactionLog(accountGLTransactionRequest);
|
||||||
|
RestTemplate restTemplate = new RestTemplate();
|
||||||
|
ResponseEntity<Map> response = restTemplate.exchange(
|
||||||
|
url,
|
||||||
|
HttpMethod.POST,
|
||||||
|
entity,
|
||||||
|
Map.class
|
||||||
|
);
|
||||||
|
if (response.getBody() != null) {
|
||||||
|
transactionLogService.updateResponseFields(log.getLogId(), response.getBody());
|
||||||
|
}
|
||||||
|
|
||||||
|
return ResponseEntity.status(response.getStatusCode()).body(response.getBody());
|
||||||
|
}
|
||||||
|
|
||||||
|
public Object processGLTransaction(GLtoGLRequest gLtoGLRequest, String tokenHeader) {
|
||||||
|
Double creditAmount = gLtoGLRequest.getCreditGl().getSgtGntramtfc();
|
||||||
|
Double debitAmount = gLtoGLRequest.getDebitGl().getSgtGntramtfc();
|
||||||
|
|
||||||
|
if (!creditAmount.equals(debitAmount)) {
|
||||||
|
return ResponseEntity
|
||||||
|
.badRequest()
|
||||||
|
.body("Credit and Debit amounts must be equal");
|
||||||
|
}
|
||||||
|
String porOrgacode = gLtoGLRequest.getPorOrgacode();
|
||||||
|
String url = generalledgerURI + "/generalledger/" + "/organizations/" + porOrgacode + "/transactions" + ACONNECT +"/gltogls";
|
||||||
|
HttpHeaders headers = new HttpHeaders();
|
||||||
|
headers.set("Authorization", tokenHeader);
|
||||||
|
headers.set("POR_ORGACODE", porOrgacode);
|
||||||
|
headers.set("SUS_USERCODE", gLtoGLRequest.getSgtGntrcreateusr());
|
||||||
|
headers.setContentType(MediaType.APPLICATION_JSON);
|
||||||
|
headers.setAccept(java.util.List.of(MediaType.APPLICATION_JSON));
|
||||||
|
HttpEntity<GLtoGLRequest> entity = new HttpEntity<>(gLtoGLRequest, headers);
|
||||||
|
|
||||||
|
RestTemplate restTemplate = new RestTemplate();
|
||||||
|
TransactionLog log = transactionLogService.createGLtoGLTransactionLog(gLtoGLRequest);
|
||||||
|
ResponseEntity<Map> response = restTemplate.exchange(
|
||||||
|
url,
|
||||||
|
HttpMethod.POST,
|
||||||
|
entity,
|
||||||
|
Map.class
|
||||||
|
);
|
||||||
|
if (response.getBody() != null) {
|
||||||
|
transactionLogService.updateResponseFields(log.getLogId(), response.getBody());
|
||||||
|
}
|
||||||
|
|
||||||
|
return ResponseEntity.status(response.getStatusCode()).body(response.getBody());
|
||||||
|
}
|
||||||
|
|
||||||
|
public Object processAccToAccTransaction(AccountToAccountDTO accountToAccountDTO, String tokenHeader) {
|
||||||
|
String porOrgacode = accountToAccountDTO.getPorOrgacode();
|
||||||
|
String url = depositURI + "/deposit/" + "transactions/account-account";
|
||||||
|
HttpHeaders headers = new HttpHeaders();
|
||||||
|
headers.set("Authorization", tokenHeader);
|
||||||
|
headers.set("POR_ORGACODE", porOrgacode);
|
||||||
|
headers.set("SUS_USERCODE", accountToAccountDTO.getSgtGntrcreateusr());
|
||||||
|
headers.setContentType(MediaType.APPLICATION_JSON);
|
||||||
|
headers.setAccept(java.util.List.of(MediaType.APPLICATION_JSON));
|
||||||
|
HttpEntity<AccountToAccountDTO> entity = new HttpEntity<>(accountToAccountDTO, headers);
|
||||||
|
|
||||||
|
RestTemplate restTemplate = new RestTemplate();
|
||||||
|
TransactionLog log = transactionLogService.createAccToAccTransactionLog(accountToAccountDTO);
|
||||||
|
ResponseEntity<Map> response = restTemplate.exchange(
|
||||||
|
url,
|
||||||
|
HttpMethod.POST,
|
||||||
|
entity,
|
||||||
|
Map.class
|
||||||
|
);
|
||||||
|
if (response.getBody() != null) {
|
||||||
|
transactionLogService.updateResponseFields(log.getLogId(), response.getBody());
|
||||||
|
}
|
||||||
|
|
||||||
|
return ResponseEntity.status(response.getStatusCode()).body(response.getBody());
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public Object processGLtoAccTransaction(GlToAccountDTO glToAccountDTO, String tokenHeader) {
|
||||||
|
|
||||||
|
String porOrgacode = glToAccountDTO.getPorOrgacode();
|
||||||
|
String url = depositURI + "/deposit/" + "transactions/gl-account";
|
||||||
|
HttpHeaders headers = new HttpHeaders();
|
||||||
|
headers.set("Authorization", tokenHeader);
|
||||||
|
headers.set("POR_ORGACODE", porOrgacode);
|
||||||
|
headers.set("SUS_USERCODE", glToAccountDTO.getSgtGntrcreateusr());
|
||||||
|
headers.setContentType(MediaType.APPLICATION_JSON);
|
||||||
|
headers.setAccept(java.util.List.of(MediaType.APPLICATION_JSON));
|
||||||
|
HttpEntity<GlToAccountDTO> entity = new HttpEntity<>(glToAccountDTO, headers);
|
||||||
|
|
||||||
|
RestTemplate restTemplate = new RestTemplate();
|
||||||
|
TransactionLog log = transactionLogService.createGLToAccTransactionLog(glToAccountDTO);
|
||||||
|
|
||||||
|
ResponseEntity<Map> response = restTemplate.exchange(
|
||||||
|
url,
|
||||||
|
HttpMethod.POST,
|
||||||
|
entity,
|
||||||
|
Map.class
|
||||||
|
);
|
||||||
|
if (response.getBody() != null) {
|
||||||
|
transactionLogService.updateResponseFields(log.getLogId(), response.getBody());
|
||||||
|
}
|
||||||
|
|
||||||
|
return ResponseEntity.status(response.getStatusCode()).body(response.getBody());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,15 @@
|
|||||||
|
package com.mfsys.aconnect.configuration.config;
|
||||||
|
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
import org.springframework.http.client.HttpComponentsClientHttpRequestFactory;
|
||||||
|
import org.springframework.web.client.RestTemplate;
|
||||||
|
|
||||||
|
@Configuration
|
||||||
|
public class RestTemplateConfig {
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
public RestTemplate restTemplate() {
|
||||||
|
return new RestTemplate(new HttpComponentsClientHttpRequestFactory());
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,25 @@
|
|||||||
|
package com.mfsys.aconnect.configuration.config;
|
||||||
|
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
import org.springframework.security.config.Customizer;
|
||||||
|
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
|
||||||
|
import org.springframework.security.web.SecurityFilterChain;
|
||||||
|
|
||||||
|
@Configuration
|
||||||
|
public class SecurityConfig {
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception {
|
||||||
|
System.out.println("✅ Custom SecurityFilterChain loaded");
|
||||||
|
http
|
||||||
|
.csrf(csrf -> csrf.disable()) // Disable CSRF for API use
|
||||||
|
.authorizeHttpRequests(auth -> auth
|
||||||
|
.anyRequest().permitAll() // Allow all requests
|
||||||
|
)
|
||||||
|
.httpBasic(Customizer.withDefaults()); // Optional — won't do anything since all requests are permitted
|
||||||
|
|
||||||
|
return http.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,23 @@
|
|||||||
|
package com.mfsys.aconnect.configuration.config;
|
||||||
|
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
import org.springframework.http.HttpHeaders;
|
||||||
|
import org.springframework.http.MediaType;
|
||||||
|
import org.springframework.web.reactive.function.client.WebClient;
|
||||||
|
|
||||||
|
|
||||||
|
@Configuration
|
||||||
|
public class WebClientConfig {
|
||||||
|
|
||||||
|
private final String baseUrl = "http://localhost:8080/digitalkisaan";
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
public WebClient webClient(WebClient.Builder builder) {
|
||||||
|
return builder
|
||||||
|
.baseUrl(baseUrl) // Set the base URL for all requests
|
||||||
|
.defaultHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON_VALUE) // Set a default content type
|
||||||
|
.defaultHeader(HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON_VALUE) // Set a default accept header
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,65 @@
|
|||||||
|
package com.mfsys.aconnect.configuration.service;
|
||||||
|
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class RequestRateLimiterService {
|
||||||
|
|
||||||
|
private final ConcurrentHashMap<String, RateLimitData> requestCounts = new ConcurrentHashMap<>();
|
||||||
|
|
||||||
|
public boolean isRequestAllowed(String userId, String requestURI, int maxRequestsPerMinute) {
|
||||||
|
String key = userId + ":" + requestURI;
|
||||||
|
long currentTimeMillis = System.currentTimeMillis();
|
||||||
|
|
||||||
|
requestCounts.putIfAbsent(key, new RateLimitData(currentTimeMillis, 0));
|
||||||
|
|
||||||
|
RateLimitData data = requestCounts.get(key);
|
||||||
|
|
||||||
|
// Check if a minute has passed since the last reset
|
||||||
|
if (TimeUnit.MILLISECONDS.toMinutes(currentTimeMillis - data.getTimestamp()) >= 1) {
|
||||||
|
// Reset the counter if a minute has passed
|
||||||
|
data.setCount(1);
|
||||||
|
data.setTimestamp(currentTimeMillis);
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
// Increment and check the count
|
||||||
|
data.incrementCount();
|
||||||
|
if (data.getCount() > maxRequestsPerMinute) {
|
||||||
|
return false; // Request denied
|
||||||
|
}
|
||||||
|
return true; // Request allowed
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class RateLimitData {
|
||||||
|
private long timestamp;
|
||||||
|
private int count;
|
||||||
|
|
||||||
|
public RateLimitData(long timestamp, int count) {
|
||||||
|
this.timestamp = timestamp;
|
||||||
|
this.count = count;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getTimestamp() {
|
||||||
|
return timestamp;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTimestamp(long timestamp) {
|
||||||
|
this.timestamp = timestamp;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getCount() {
|
||||||
|
return count;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCount(int count) {
|
||||||
|
this.count = count;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void incrementCount() {
|
||||||
|
this.count++;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,9 @@
|
|||||||
|
package com.mfsys.aconnect.security.constant;
|
||||||
|
|
||||||
|
public interface SecurityURI {
|
||||||
|
String AUTHENTICATION = "/authentication";
|
||||||
|
String LOGIN = "/login";
|
||||||
|
String REGISTER = "/signup";
|
||||||
|
String CHANGE_PASSWORD = "/change-password";
|
||||||
|
String RESET_PASSWORD = "/reset-password";
|
||||||
|
}
|
||||||
@ -0,0 +1,71 @@
|
|||||||
|
package com.mfsys.aconnect.security.controller;
|
||||||
|
|
||||||
|
import com.mfsys.aconnect.security.constant.SecurityURI;
|
||||||
|
import com.mfsys.aconnect.security.dto.ChangePasswordDTO;
|
||||||
|
import com.mfsys.aconnect.security.dto.LoginRequest;
|
||||||
|
import com.mfsys.aconnect.security.dto.LoginResponse;
|
||||||
|
import com.mfsys.aconnect.security.dto.ResetPasswordDTO;
|
||||||
|
import com.mfsys.aconnect.security.service.AuthenticationService;
|
||||||
|
import com.mfsys.aconnect.usermanagement.constant.UserManagementURI;
|
||||||
|
import com.mfsys.aconnect.usermanagement.dto.UserDTOs;
|
||||||
|
import com.mfsys.aconnect.usermanagement.service.UserService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.http.HttpStatus;
|
||||||
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping(SecurityURI.AUTHENTICATION)
|
||||||
|
public class AuthenticationController {
|
||||||
|
|
||||||
|
private final AuthenticationService authenticationService;
|
||||||
|
private final UserService userService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
public AuthenticationController(AuthenticationService authenticationService, UserService userService) {
|
||||||
|
this.authenticationService = authenticationService;
|
||||||
|
this.userService = userService;
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping(SecurityURI.LOGIN)
|
||||||
|
public ResponseEntity<LoginResponse> login(@RequestBody LoginRequest loginRequest) {
|
||||||
|
try {
|
||||||
|
LoginResponse response = authenticationService.login(loginRequest);
|
||||||
|
return ResponseEntity.ok(response);
|
||||||
|
} catch (RuntimeException e) {
|
||||||
|
return ResponseEntity.status(HttpStatus.UNAUTHORIZED).build();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@PostMapping(SecurityURI.REGISTER)
|
||||||
|
public ResponseEntity<UserDTOs.UserResponse> signupUser(@RequestBody UserDTOs.UserRequest request) {
|
||||||
|
UserDTOs.UserResponse response = userService.createUser(request);
|
||||||
|
return new ResponseEntity<>(response, HttpStatus.CREATED);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping(SecurityURI.CHANGE_PASSWORD)
|
||||||
|
public ResponseEntity<Map<String, String>> changePassword(@RequestBody ChangePasswordDTO request) {
|
||||||
|
String message = userService.changePassword(request);
|
||||||
|
Map<String, String> response = new HashMap<>();
|
||||||
|
response.put("message", message);
|
||||||
|
|
||||||
|
return new ResponseEntity<>(response, HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping(SecurityURI.RESET_PASSWORD)
|
||||||
|
public ResponseEntity<Map<String, String>> resetPassword(@RequestBody ResetPasswordDTO request) {
|
||||||
|
String message = userService.resetPassword(request);
|
||||||
|
Map<String, String> response = new HashMap<>();
|
||||||
|
response.put("message", message);
|
||||||
|
|
||||||
|
return new ResponseEntity<>(response, HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,11 @@
|
|||||||
|
package com.mfsys.aconnect.security.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class ChangePasswordDTO {
|
||||||
|
private String userId;
|
||||||
|
private String porOrgacode;
|
||||||
|
private String oldPassword;
|
||||||
|
private String newPassword;
|
||||||
|
}
|
||||||
@ -0,0 +1,13 @@
|
|||||||
|
package com.mfsys.aconnect.security.dto;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class LoginRequest {
|
||||||
|
private String userId;
|
||||||
|
private String password;
|
||||||
|
}
|
||||||
@ -0,0 +1,16 @@
|
|||||||
|
package com.mfsys.aconnect.security.dto;
|
||||||
|
|
||||||
|
import com.mfsys.aconnect.usermanagement.model.User;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class LoginResponse {
|
||||||
|
private User user;
|
||||||
|
private boolean requiresOtp;
|
||||||
|
private boolean requiresPasswordChange;
|
||||||
|
private String token;
|
||||||
|
}
|
||||||
@ -0,0 +1,10 @@
|
|||||||
|
package com.mfsys.aconnect.security.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class ResetPasswordDTO {
|
||||||
|
private String userId;
|
||||||
|
private String porOrgacode;
|
||||||
|
private String newPassword;
|
||||||
|
}
|
||||||
@ -0,0 +1,48 @@
|
|||||||
|
package com.mfsys.aconnect.security.model;
|
||||||
|
|
||||||
|
import com.mfsys.aconnect.usermanagement.model.User;
|
||||||
|
import jakarta.persistence.*;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import org.springframework.data.annotation.CreatedDate;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
@Entity(name = "OTP_TOKENS")
|
||||||
|
@Table(name = "OTP_TOKENS")
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class OtpToken {
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@ManyToOne(fetch = FetchType.LAZY)
|
||||||
|
@JoinColumn(name = "user_id", nullable = false)
|
||||||
|
private User user;
|
||||||
|
|
||||||
|
@Column(nullable = false, length = 10)
|
||||||
|
private String token;
|
||||||
|
|
||||||
|
@Enumerated(EnumType.STRING)
|
||||||
|
@Column(name = "token_type", nullable = false)
|
||||||
|
private TokenType tokenType;
|
||||||
|
|
||||||
|
@Column(name = "is_used")
|
||||||
|
private Boolean isUsed = false;
|
||||||
|
|
||||||
|
@Column(name = "expires_at", nullable = false)
|
||||||
|
private LocalDateTime expiresAt;
|
||||||
|
|
||||||
|
@CreatedDate
|
||||||
|
@Column(name = "created_at")
|
||||||
|
private LocalDateTime createdAt;
|
||||||
|
|
||||||
|
public enum TokenType {
|
||||||
|
LOGIN,
|
||||||
|
PASSWORD_RESET,
|
||||||
|
EMAIL_VERIFICATION
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,42 @@
|
|||||||
|
package com.mfsys.aconnect.security.service;
|
||||||
|
|
||||||
|
import com.mfsys.common.configuration.service.JwtService;
|
||||||
|
import com.mfsys.common.configuration.service.PasswordEncryptionService;
|
||||||
|
import com.mfsys.aconnect.security.dto.LoginRequest;
|
||||||
|
import com.mfsys.aconnect.security.dto.LoginResponse;
|
||||||
|
import com.mfsys.aconnect.usermanagement.model.User;
|
||||||
|
import com.mfsys.aconnect.usermanagement.repository.UserRepository;
|
||||||
|
import jakarta.transaction.Transactional;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class AuthenticationService {
|
||||||
|
|
||||||
|
private final UserRepository userRepository;
|
||||||
|
private final JwtService jwtService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
public AuthenticationService (UserRepository userRepository, PasswordEncryptionService passwordEncryptionService,
|
||||||
|
JwtService jwtService) {
|
||||||
|
this.userRepository = userRepository;
|
||||||
|
this.jwtService = jwtService;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional
|
||||||
|
public LoginResponse login(LoginRequest loginRequest) {
|
||||||
|
// Find user by email
|
||||||
|
User user = userRepository.findByUserIdAndIsActiveTrue(loginRequest.getUserId())
|
||||||
|
.orElseThrow(() -> new RuntimeException("Invalid credentials"));
|
||||||
|
|
||||||
|
// Verify password
|
||||||
|
if (!PasswordEncryptionService.verifyPassword(loginRequest.getPassword(), user.getPassword())) {
|
||||||
|
throw new RuntimeException("Invalid credentials");
|
||||||
|
}
|
||||||
|
|
||||||
|
String token = jwtService.generateToken(loginRequest.getUserId());
|
||||||
|
|
||||||
|
return new LoginResponse(user, false, user.isFirstLogin(), token);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,7 @@
|
|||||||
|
package com.mfsys.aconnect.security.service;
|
||||||
|
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class OtpService {
|
||||||
|
}
|
||||||
@ -0,0 +1,21 @@
|
|||||||
|
package com.mfsys.aconnect.usermanagement.constant;
|
||||||
|
|
||||||
|
public interface UserManagementURI {
|
||||||
|
String USER = "/user";
|
||||||
|
String GET_USER = "/getUser";
|
||||||
|
String CREATE_USER = "/createUser";
|
||||||
|
String UPDATE_USER = "/updateUser";
|
||||||
|
String DELETE_USER = "/deleteUser";
|
||||||
|
String GET_ALL_USERS = "/getAllUsers";
|
||||||
|
|
||||||
|
String GET_USER_PERMISSIONS = "/getPermissions";
|
||||||
|
String SAVE_USER_PERMISSIONS = "/savePermissions";
|
||||||
|
String UPDATE_USER_PERMISSIONS = "/updatePermissions";
|
||||||
|
|
||||||
|
String USER_SUBSCRIPTION = "/userSubscription";
|
||||||
|
String GET_USER_SUBSCRIPTION = "/getUserSubscription";
|
||||||
|
String CREATE_USER_SUBSCRIPTION = "/createUserSubscription";
|
||||||
|
String UPDATE_USER_SUBSCRIPTION = "/updateUserSubscription";
|
||||||
|
String DELETE_USER_SUBSCRIPTION = "/deleteUserSubscription";
|
||||||
|
String GET_ALL_USER_SUBSCRIPTIONS = "/getAllUserSubscriptions";
|
||||||
|
}
|
||||||
@ -0,0 +1,41 @@
|
|||||||
|
package com.mfsys.aconnect.usermanagement.controller;
|
||||||
|
|
||||||
|
import com.mfsys.aconnect.usermanagement.constant.UserManagementURI;
|
||||||
|
import com.mfsys.aconnect.usermanagement.dto.PermissionDTO;
|
||||||
|
import com.mfsys.aconnect.usermanagement.dto.UserDTOs;
|
||||||
|
import com.mfsys.aconnect.usermanagement.service.PermissionService;
|
||||||
|
import org.springframework.http.HttpStatus;
|
||||||
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping(UserManagementURI.USER)
|
||||||
|
public class PermissionController {
|
||||||
|
private final PermissionService permissionService;
|
||||||
|
public PermissionController(PermissionService permissionService) {
|
||||||
|
this.permissionService = permissionService;
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping(UserManagementURI.SAVE_USER_PERMISSIONS)
|
||||||
|
public ResponseEntity<UserDTOs.UserResponse> saveUserPermissions(
|
||||||
|
@RequestBody PermissionDTO permissionDTO) {
|
||||||
|
|
||||||
|
UserDTOs.UserResponse response = permissionService.saveUserPermissions(permissionDTO);
|
||||||
|
return new ResponseEntity<>(response, HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping(UserManagementURI.GET_USER_PERMISSIONS)
|
||||||
|
public ResponseEntity<PermissionDTO> getUserPermissions(@RequestParam String userId) {
|
||||||
|
PermissionDTO dto = permissionService.getUserPermissions(userId);
|
||||||
|
return new ResponseEntity<>(dto, HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping(UserManagementURI.UPDATE_USER_PERMISSIONS)
|
||||||
|
public ResponseEntity<UserDTOs.UserResponse> updateUserPermissions(
|
||||||
|
@RequestBody PermissionDTO permissionDTO) {
|
||||||
|
|
||||||
|
UserDTOs.UserResponse response = permissionService.updateUserPermissions(permissionDTO);
|
||||||
|
return new ResponseEntity<>(response, HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,66 @@
|
|||||||
|
package com.mfsys.aconnect.usermanagement.controller;
|
||||||
|
|
||||||
|
import com.mfsys.aconnect.usermanagement.constant.UserManagementURI;
|
||||||
|
import com.mfsys.aconnect.usermanagement.dto.UserDTOs;
|
||||||
|
import com.mfsys.aconnect.usermanagement.service.UserService;
|
||||||
|
import jakarta.persistence.EntityNotFoundException;
|
||||||
|
import org.springframework.http.HttpStatus;
|
||||||
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping(UserManagementURI.USER)
|
||||||
|
public class UserController {
|
||||||
|
|
||||||
|
private final UserService userService;
|
||||||
|
|
||||||
|
public UserController(UserService userService) {
|
||||||
|
this.userService = userService;
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping(UserManagementURI.CREATE_USER)
|
||||||
|
public ResponseEntity<UserDTOs.UserResponse> createUser(@RequestBody UserDTOs.UserRequest request) {
|
||||||
|
UserDTOs.UserResponse response = userService.createUser(request);
|
||||||
|
return new ResponseEntity<>(response, HttpStatus.CREATED);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping(UserManagementURI.GET_ALL_USERS)
|
||||||
|
public ResponseEntity<List<UserDTOs.UserResponse>> getAllUsers() {
|
||||||
|
List<UserDTOs.UserResponse> users = userService.getAllUsers();
|
||||||
|
return new ResponseEntity<>(users, HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping(UserManagementURI.GET_USER)
|
||||||
|
public ResponseEntity<UserDTOs.UserResponse> getUserById(@RequestParam String userId) {
|
||||||
|
try {
|
||||||
|
UserDTOs.UserResponse user = userService.getUserById(userId);
|
||||||
|
return new ResponseEntity<>(user, HttpStatus.OK);
|
||||||
|
} catch (EntityNotFoundException ex) {
|
||||||
|
return new ResponseEntity<>(HttpStatus.NOT_FOUND);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping(UserManagementURI.UPDATE_USER)
|
||||||
|
public ResponseEntity<UserDTOs.UserResponse> updateUser(@RequestParam String userId, @RequestBody UserDTOs.UserRequest request) {
|
||||||
|
try {
|
||||||
|
UserDTOs.UserResponse response = userService.updateUser(userId, request);
|
||||||
|
return new ResponseEntity<>(response, HttpStatus.OK);
|
||||||
|
} catch (EntityNotFoundException ex) {
|
||||||
|
return new ResponseEntity<>(HttpStatus.NOT_FOUND);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping(UserManagementURI.DELETE_USER)
|
||||||
|
public ResponseEntity<Void> deleteUser(@RequestParam String userId) {
|
||||||
|
try {
|
||||||
|
userService.deleteUser(userId);
|
||||||
|
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||||
|
} catch (EntityNotFoundException ex) {
|
||||||
|
return new ResponseEntity<>(HttpStatus.NOT_FOUND);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,62 @@
|
|||||||
|
package com.mfsys.aconnect.usermanagement.controller;
|
||||||
|
|
||||||
|
import com.mfsys.aconnect.usermanagement.constant.UserManagementURI;
|
||||||
|
import com.mfsys.aconnect.usermanagement.dto.UserSubscriptionDTOs.UserSubscriptionRequest;
|
||||||
|
import com.mfsys.aconnect.usermanagement.dto.UserSubscriptionDTOs.UserSubscriptionResponse;
|
||||||
|
import com.mfsys.aconnect.usermanagement.service.UserSubscriptionService;
|
||||||
|
import jakarta.validation.Valid;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.http.HttpStatus;
|
||||||
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping(UserManagementURI.USER_SUBSCRIPTION)
|
||||||
|
public class UserSubscriptionController {
|
||||||
|
|
||||||
|
private final UserSubscriptionService userSubscriptionService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
public UserSubscriptionController(UserSubscriptionService userSubscriptionService) {
|
||||||
|
this.userSubscriptionService = userSubscriptionService;
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping(UserManagementURI.CREATE_USER_SUBSCRIPTION)
|
||||||
|
public ResponseEntity<UserSubscriptionResponse> createSubscription(
|
||||||
|
@RequestParam String userId,
|
||||||
|
@Valid @RequestBody UserSubscriptionRequest request) {
|
||||||
|
UserSubscriptionResponse createdSubscription = userSubscriptionService.createSubscription(userId, request);
|
||||||
|
return new ResponseEntity<>(createdSubscription, HttpStatus.CREATED);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping(UserManagementURI.GET_ALL_USER_SUBSCRIPTIONS)
|
||||||
|
public ResponseEntity<List<UserSubscriptionResponse>> getSubscriptionsByUserId(@RequestParam String userId) {
|
||||||
|
List<UserSubscriptionResponse> subscriptions = userSubscriptionService.getSubscriptionsByUserId(userId);
|
||||||
|
return ResponseEntity.ok(subscriptions);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping(UserManagementURI.GET_USER_SUBSCRIPTION)
|
||||||
|
public ResponseEntity<UserSubscriptionResponse> getSubscriptionById(
|
||||||
|
@RequestParam Long subscriptionId) {
|
||||||
|
return userSubscriptionService.getSubscriptionById(subscriptionId)
|
||||||
|
.map(ResponseEntity::ok)
|
||||||
|
.orElse(ResponseEntity.notFound().build());
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping(UserManagementURI.UPDATE_USER_SUBSCRIPTION)
|
||||||
|
public ResponseEntity<UserSubscriptionResponse> updateSubscription(
|
||||||
|
@RequestParam Long subscriptionId,
|
||||||
|
@Valid @RequestBody UserSubscriptionRequest request) {
|
||||||
|
UserSubscriptionResponse updatedSubscription = userSubscriptionService.updateSubscription(subscriptionId, request);
|
||||||
|
return ResponseEntity.ok(updatedSubscription);
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping(UserManagementURI.DELETE_USER_SUBSCRIPTION)
|
||||||
|
public ResponseEntity<Void> deleteSubscription(
|
||||||
|
@RequestParam Long subscriptionId) {
|
||||||
|
userSubscriptionService.deleteSubscription(subscriptionId);
|
||||||
|
return ResponseEntity.noContent().build();
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,10 @@
|
|||||||
|
package com.mfsys.aconnect.usermanagement.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class PermissionDTO {
|
||||||
|
private String permissions;
|
||||||
|
private String userId;
|
||||||
|
}
|
||||||
@ -0,0 +1,39 @@
|
|||||||
|
package com.mfsys.aconnect.usermanagement.dto;
|
||||||
|
|
||||||
|
import com.mfsys.aconnect.usermanagement.model.Role;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* DTOs (Data Transfer Objects) for User.
|
||||||
|
* This separates the API contract from the internal entity model for security and flexibility.
|
||||||
|
*/
|
||||||
|
public class UserDTOs {
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
public static class UserRequest {
|
||||||
|
private String userId;
|
||||||
|
private String porOrgacode;
|
||||||
|
private String userFullname;
|
||||||
|
private String password;
|
||||||
|
private String email;
|
||||||
|
private Role role;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
public static class UserResponse {
|
||||||
|
private String userId;
|
||||||
|
private String porOrgacode;
|
||||||
|
private String userFullname;
|
||||||
|
private String email;
|
||||||
|
private Role role;
|
||||||
|
private Boolean isFirstLogin;
|
||||||
|
private Boolean isActive;
|
||||||
|
private LocalDateTime createdAt;
|
||||||
|
private LocalDateTime updatedAt;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,51 @@
|
|||||||
|
package com.mfsys.aconnect.usermanagement.dto;
|
||||||
|
|
||||||
|
import com.mfsys.aconnect.usermanagement.model.UserSubscription;
|
||||||
|
import jakarta.validation.constraints.NotBlank;
|
||||||
|
import jakarta.validation.constraints.NotNull;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
public class UserSubscriptionDTOs {
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public static class UserSubscriptionRequest {
|
||||||
|
@NotBlank(message = "Endpoint path is required")
|
||||||
|
private String endpointPath;
|
||||||
|
private String description;
|
||||||
|
@NotNull(message = "isActive status is required")
|
||||||
|
private Boolean isActive;
|
||||||
|
@NotNull(message = "Max requests per minute is required")
|
||||||
|
private Integer maxRequestsPerMinute;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public static class UserSubscriptionResponse {
|
||||||
|
private Long id;
|
||||||
|
private String userId;
|
||||||
|
private String endpointPath;
|
||||||
|
private String description;
|
||||||
|
private Boolean isActive;
|
||||||
|
private Integer maxRequestsPerMinute;
|
||||||
|
private LocalDateTime createdAt;
|
||||||
|
|
||||||
|
public static UserSubscriptionResponse fromEntity(UserSubscription userSubscription) {
|
||||||
|
return new UserSubscriptionResponse(
|
||||||
|
userSubscription.getId(),
|
||||||
|
userSubscription.getUserId(),
|
||||||
|
userSubscription.getEndpointPath(),
|
||||||
|
userSubscription.getDescription(),
|
||||||
|
userSubscription.getIsActive(),
|
||||||
|
userSubscription.getMaxRequestsPerMinute(),
|
||||||
|
userSubscription.getCreatedAt()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,11 @@
|
|||||||
|
package com.mfsys.aconnect.usermanagement.exceptions;
|
||||||
|
|
||||||
|
import com.mfsys.common.configuration.constant.ERRCode;
|
||||||
|
import com.mfsys.common.configuration.exception.ApplicationException;
|
||||||
|
|
||||||
|
public class EmailAlreadyExistException extends ApplicationException {
|
||||||
|
public EmailAlreadyExistException(String porOrgacode) {
|
||||||
|
super(porOrgacode, ERRCode.EMAIL_ALREADY_EXIST);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@ -0,0 +1,12 @@
|
|||||||
|
package com.mfsys.aconnect.usermanagement.exceptions;
|
||||||
|
|
||||||
|
import com.mfsys.common.configuration.constant.ERRCode;
|
||||||
|
import com.mfsys.common.configuration.exception.ResourceNotFoundException;
|
||||||
|
|
||||||
|
public class OldPasswordNotMatch extends ResourceNotFoundException {
|
||||||
|
|
||||||
|
public OldPasswordNotMatch(String porOrgacode) {
|
||||||
|
super(porOrgacode, ERRCode.PASSWORD_ALREADY_EXIST);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@ -0,0 +1,10 @@
|
|||||||
|
package com.mfsys.aconnect.usermanagement.exceptions;
|
||||||
|
|
||||||
|
import com.mfsys.common.configuration.constant.ERRCode;
|
||||||
|
import com.mfsys.common.configuration.exception.ApplicationException;
|
||||||
|
|
||||||
|
public class UsernameAlreadyExistException extends ApplicationException {
|
||||||
|
public UsernameAlreadyExistException(String porOrgacode) {
|
||||||
|
super(porOrgacode, ERRCode.USERNAME_ALREADY_EXIST);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,64 @@
|
|||||||
|
//package com.mfsys.aconnect.usermanagement.filter;
|
||||||
|
//
|
||||||
|
//import com.mfsys.common.configuration.constant.FilterPriority;
|
||||||
|
//import com.mfsys.common.configuration.constant.TokenBypassURI;
|
||||||
|
//import com.mfsys.aconnect.configuration.service.RequestRateLimiterService;
|
||||||
|
//import com.mfsys.aconnect.usermanagement.model.Role;
|
||||||
|
//import com.mfsys.aconnect.usermanagement.model.User;
|
||||||
|
//import com.mfsys.aconnect.usermanagement.model.UserSubscription;
|
||||||
|
//import com.mfsys.aconnect.usermanagement.service.UserService;
|
||||||
|
//import com.mfsys.aconnect.usermanagement.service.UserSubscriptionService;
|
||||||
|
//import jakarta.servlet.FilterChain;
|
||||||
|
//import jakarta.servlet.ServletException;
|
||||||
|
//import jakarta.servlet.http.HttpServletRequest;
|
||||||
|
//import jakarta.servlet.http.HttpServletResponse;
|
||||||
|
//import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
//import org.springframework.core.annotation.Order;
|
||||||
|
//import org.springframework.stereotype.Component;
|
||||||
|
//import org.springframework.web.filter.OncePerRequestFilter;
|
||||||
|
//
|
||||||
|
//import java.io.IOException;
|
||||||
|
//
|
||||||
|
//@Component
|
||||||
|
//@Order(FilterPriority.SUBSCRIPTION)
|
||||||
|
//public class SubscriptionFilter extends OncePerRequestFilter {
|
||||||
|
//
|
||||||
|
// private final UserService userService;
|
||||||
|
// private final UserSubscriptionService userSubscriptionService;
|
||||||
|
// private final RequestRateLimiterService requestRateLimiterService;
|
||||||
|
//
|
||||||
|
// @Autowired
|
||||||
|
// public SubscriptionFilter(UserService userService, UserSubscriptionService userSubscriptionService,
|
||||||
|
// RequestRateLimiterService requestRateLimiterService) {
|
||||||
|
// this.userService = userService;
|
||||||
|
// this.userSubscriptionService = userSubscriptionService;
|
||||||
|
// this.requestRateLimiterService = requestRateLimiterService;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain)
|
||||||
|
// throws ServletException, IOException {
|
||||||
|
// if (!(request.getMethod().equals("OPTIONS"))) {
|
||||||
|
//
|
||||||
|
// System.out.println(">> " + request.getRequestURI() + " <<");
|
||||||
|
// System.out.println(request.getHeaderNames());
|
||||||
|
// if (!(TokenBypassURI.URIs.contains(request.getRequestURI()) || request.getRequestURI().startsWith("/MCONNECT/actuator"))) {
|
||||||
|
// String userId = request.getHeader("userId");
|
||||||
|
// User user = userService.findActiveUserById(userId)
|
||||||
|
// .orElseThrow(() -> new RuntimeException("Invalid credentials"));
|
||||||
|
// if(user.getRole().equals(Role.USER)){
|
||||||
|
// UserSubscription userSubscription = userSubscriptionService.findByUserIdAndEndpointPath(userId, request.getRequestURI())
|
||||||
|
// .orElseThrow(() -> new RuntimeException("No Active Subscription"));
|
||||||
|
//
|
||||||
|
// int maxRequests = userSubscription.getMaxRequestsPerMinute();
|
||||||
|
//
|
||||||
|
// if (!requestRateLimiterService.isRequestAllowed(userId, request.getRequestURI(), maxRequests)) {
|
||||||
|
// throw new RuntimeException("Too many requests");
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// filterChain.doFilter(request, response);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
//}
|
||||||
@ -0,0 +1,5 @@
|
|||||||
|
package com.mfsys.aconnect.usermanagement.model;
|
||||||
|
|
||||||
|
public enum Role {
|
||||||
|
USER, ADMIN
|
||||||
|
}
|
||||||
@ -0,0 +1,61 @@
|
|||||||
|
package com.mfsys.aconnect.usermanagement.model;
|
||||||
|
|
||||||
|
import com.mfsys.common.configuration.constant.FieldNameLength;
|
||||||
|
import jakarta.persistence.*;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import org.hibernate.annotations.CreationTimestamp;
|
||||||
|
import org.hibernate.annotations.UpdateTimestamp;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.HashSet;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
|
@Entity(name = "users")
|
||||||
|
@Table(name = "users")
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class User {
|
||||||
|
|
||||||
|
@Id
|
||||||
|
@Column(name = "user_id", unique = true, nullable = false)
|
||||||
|
private String userId;
|
||||||
|
|
||||||
|
@Column(name = "POR_ORGACODE", nullable = false, updatable = false, columnDefinition = FieldNameLength.POR_ORGACODE)
|
||||||
|
private String porOrgacode;
|
||||||
|
|
||||||
|
@Column(name = "user_fullname", nullable = false)
|
||||||
|
private String userFullname;
|
||||||
|
|
||||||
|
@Column(name = "password", nullable = false)
|
||||||
|
private String password;
|
||||||
|
|
||||||
|
@Column(name = "email", nullable = false, unique = true)
|
||||||
|
private String email;
|
||||||
|
|
||||||
|
@Enumerated(EnumType.STRING)
|
||||||
|
@Column(name = "role", nullable = false)
|
||||||
|
private Role role = Role.USER;
|
||||||
|
|
||||||
|
@Column(name = "permissions", columnDefinition = "TEXT")
|
||||||
|
private String permissions;
|
||||||
|
|
||||||
|
@Column(name = "is_first_login", columnDefinition = FieldNameLength.BOOLEAN_BIT)
|
||||||
|
private boolean isFirstLogin = true;
|
||||||
|
|
||||||
|
@Column(name = "is_active", columnDefinition = FieldNameLength.BOOLEAN_BIT)
|
||||||
|
private boolean isActive = true;
|
||||||
|
|
||||||
|
@CreationTimestamp
|
||||||
|
@Column(name = "created_at", updatable = false)
|
||||||
|
private LocalDateTime createdAt;
|
||||||
|
|
||||||
|
@UpdateTimestamp
|
||||||
|
@Column(name = "updated_at")
|
||||||
|
private LocalDateTime updatedAt;
|
||||||
|
|
||||||
|
@OneToMany(mappedBy = "user", cascade = CascadeType.ALL, fetch = FetchType.LAZY)
|
||||||
|
private Set<UserSubscription> userSubscriptions = new HashSet<>();
|
||||||
|
}
|
||||||
@ -0,0 +1,46 @@
|
|||||||
|
package com.mfsys.aconnect.usermanagement.model;
|
||||||
|
|
||||||
|
import jakarta.persistence.*;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
@Entity(name = "user_subscriptions")
|
||||||
|
@Table(name = "user_subscriptions")
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class UserSubscription {
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Column(name = "endpoint_path", nullable = false, unique = true)
|
||||||
|
private String endpointPath;
|
||||||
|
|
||||||
|
@Column(columnDefinition = "TEXT")
|
||||||
|
private String description;
|
||||||
|
|
||||||
|
@Column(name = "is_active")
|
||||||
|
private Boolean isActive = true;
|
||||||
|
|
||||||
|
@Column(name = "max_requests_per_minute")
|
||||||
|
private Integer maxRequestsPerMinute = 60;
|
||||||
|
|
||||||
|
@Column(name = "created_at")
|
||||||
|
private LocalDateTime createdAt;
|
||||||
|
|
||||||
|
@Column(name = "user_id", nullable = false, updatable = false)
|
||||||
|
private String userId;
|
||||||
|
|
||||||
|
@ManyToOne(fetch = FetchType.LAZY)
|
||||||
|
@JoinColumn(name = "user_id", nullable = false, insertable = false, updatable = false)
|
||||||
|
private User user;
|
||||||
|
|
||||||
|
@PrePersist
|
||||||
|
protected void onCreate() {
|
||||||
|
createdAt = LocalDateTime.now();
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,7 @@
|
|||||||
|
package com.mfsys.aconnect.usermanagement.repository;
|
||||||
|
|
||||||
|
import com.mfsys.aconnect.usermanagement.model.User;
|
||||||
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
|
|
||||||
|
public interface PermissionRepository extends JpaRepository<User, String> {
|
||||||
|
}
|
||||||
@ -0,0 +1,14 @@
|
|||||||
|
package com.mfsys.aconnect.usermanagement.repository;
|
||||||
|
|
||||||
|
import com.mfsys.aconnect.usermanagement.model.User;
|
||||||
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
|
@Repository
|
||||||
|
public interface UserRepository extends JpaRepository<User, String> {
|
||||||
|
Optional<User> findByUserIdAndIsActiveTrue(String userId);
|
||||||
|
boolean existsByUserId(String userId);
|
||||||
|
boolean existsByEmail(String email);
|
||||||
|
}
|
||||||
@ -0,0 +1,14 @@
|
|||||||
|
package com.mfsys.aconnect.usermanagement.repository;
|
||||||
|
|
||||||
|
import com.mfsys.aconnect.usermanagement.model.UserSubscription;
|
||||||
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
|
@Repository
|
||||||
|
public interface UserSubscriptionRepository extends JpaRepository<UserSubscription, Long> {
|
||||||
|
Optional<UserSubscription> findByUserIdAndEndpointPathAndIsActiveTrue(String userId, String endpointPath);
|
||||||
|
List<UserSubscription> findByUserId(String userId);
|
||||||
|
}
|
||||||
@ -0,0 +1,70 @@
|
|||||||
|
package com.mfsys.aconnect.usermanagement.service;
|
||||||
|
|
||||||
|
import com.mfsys.aconnect.usermanagement.dto.PermissionDTO;
|
||||||
|
import com.mfsys.aconnect.usermanagement.dto.UserDTOs;
|
||||||
|
import com.mfsys.aconnect.usermanagement.model.User;
|
||||||
|
import com.mfsys.aconnect.usermanagement.repository.PermissionRepository;
|
||||||
|
import jakarta.persistence.EntityNotFoundException;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class PermissionService {
|
||||||
|
private final PermissionRepository permissionRepository;
|
||||||
|
|
||||||
|
public PermissionService(PermissionRepository permissionRepository) {
|
||||||
|
this.permissionRepository = permissionRepository;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional
|
||||||
|
public UserDTOs.UserResponse saveUserPermissions(PermissionDTO permissionDTO) {
|
||||||
|
User user = permissionRepository.findById(permissionDTO.getUserId())
|
||||||
|
.orElseThrow(() -> new EntityNotFoundException("User not found with ID: " + permissionDTO.getUserId()));
|
||||||
|
|
||||||
|
String permissions = String.join(",", permissionDTO.getPermissions());
|
||||||
|
user.setPermissions(permissions);
|
||||||
|
User updatedUser = permissionRepository.save(user);
|
||||||
|
|
||||||
|
return mapToResponseDTO(updatedUser);
|
||||||
|
}
|
||||||
|
|
||||||
|
public PermissionDTO getUserPermissions(String userId) {
|
||||||
|
User user = permissionRepository.findById(userId)
|
||||||
|
.orElseThrow(() -> new EntityNotFoundException("User not found with ID: " + userId));
|
||||||
|
|
||||||
|
PermissionDTO dto = new PermissionDTO();
|
||||||
|
dto.setUserId(userId);
|
||||||
|
if (user.getPermissions() != null && !user.getPermissions().isEmpty()) {
|
||||||
|
dto.setPermissions((user.getPermissions()));
|
||||||
|
}
|
||||||
|
return dto;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional
|
||||||
|
public UserDTOs.UserResponse updateUserPermissions(PermissionDTO permissionDTO) {
|
||||||
|
|
||||||
|
User user = permissionRepository.findById(permissionDTO.getUserId())
|
||||||
|
.orElseThrow(() ->
|
||||||
|
new EntityNotFoundException("User not found with ID: " + permissionDTO.getUserId())
|
||||||
|
);
|
||||||
|
|
||||||
|
String permissions = String.join(",", permissionDTO.getPermissions());
|
||||||
|
user.setPermissions(permissions);
|
||||||
|
|
||||||
|
User updatedUser = permissionRepository.save(user);
|
||||||
|
return mapToResponseDTO(updatedUser);
|
||||||
|
}
|
||||||
|
|
||||||
|
private UserDTOs.UserResponse mapToResponseDTO(User user) {
|
||||||
|
UserDTOs.UserResponse response = new UserDTOs.UserResponse();
|
||||||
|
response.setUserId(user.getUserId());
|
||||||
|
response.setUserFullname(user.getUserFullname());
|
||||||
|
response.setEmail(user.getEmail());
|
||||||
|
response.setRole(user.getRole());
|
||||||
|
response.setIsFirstLogin(user.isFirstLogin());
|
||||||
|
response.setIsActive(user.isActive());
|
||||||
|
response.setCreatedAt(user.getCreatedAt());
|
||||||
|
response.setUpdatedAt(user.getUpdatedAt());
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,119 @@
|
|||||||
|
package com.mfsys.aconnect.usermanagement.service;
|
||||||
|
|
||||||
|
import com.mfsys.aconnect.security.dto.ChangePasswordDTO;
|
||||||
|
import com.mfsys.aconnect.security.dto.ResetPasswordDTO;
|
||||||
|
import com.mfsys.aconnect.usermanagement.exceptions.EmailAlreadyExistException;
|
||||||
|
import com.mfsys.aconnect.usermanagement.exceptions.OldPasswordNotMatch;
|
||||||
|
import com.mfsys.aconnect.usermanagement.exceptions.UsernameAlreadyExistException;
|
||||||
|
import com.mfsys.common.configuration.service.PasswordEncryptionService;
|
||||||
|
import com.mfsys.aconnect.usermanagement.dto.UserDTOs;
|
||||||
|
import com.mfsys.aconnect.usermanagement.model.User;
|
||||||
|
import com.mfsys.aconnect.usermanagement.repository.UserRepository;
|
||||||
|
import jakarta.persistence.EntityNotFoundException;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class UserService {
|
||||||
|
|
||||||
|
private final UserRepository userRepository;
|
||||||
|
private final PasswordEncryptionService passwordEncryptionService;
|
||||||
|
|
||||||
|
public UserService(UserRepository userRepository, PasswordEncryptionService passwordEncryptionService) {
|
||||||
|
this.userRepository = userRepository;
|
||||||
|
this.passwordEncryptionService = passwordEncryptionService;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional
|
||||||
|
public UserDTOs.UserResponse createUser(UserDTOs.UserRequest request) {
|
||||||
|
if (userRepository.existsByUserId(request.getUserId())) {
|
||||||
|
throw new UsernameAlreadyExistException(request.getPorOrgacode());
|
||||||
|
}
|
||||||
|
if (userRepository.existsByEmail(request.getEmail())) {
|
||||||
|
throw new EmailAlreadyExistException(request.getPorOrgacode());
|
||||||
|
}
|
||||||
|
User user = new User();
|
||||||
|
user.setUserId(request.getUserId());
|
||||||
|
user.setPorOrgacode(request.getPorOrgacode());
|
||||||
|
user.setUserFullname(request.getUserFullname());
|
||||||
|
user.setEmail(request.getEmail());
|
||||||
|
user.setRole(request.getRole());
|
||||||
|
user.setPassword(passwordEncryptionService.hashPassword(request.getPassword()));
|
||||||
|
User savedUser = userRepository.save(user);
|
||||||
|
return mapToResponseDTO(savedUser);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional
|
||||||
|
public String changePassword(ChangePasswordDTO request) {
|
||||||
|
User user = userRepository.findById(request.getUserId())
|
||||||
|
.orElseThrow(() -> new EntityNotFoundException("User not found with ID: " + request.getUserId()));
|
||||||
|
|
||||||
|
boolean isPasswordValid = PasswordEncryptionService.verifyPassword(request.getOldPassword(), user.getPassword());
|
||||||
|
if(!isPasswordValid) {
|
||||||
|
throw new OldPasswordNotMatch(request.getPorOrgacode());
|
||||||
|
}
|
||||||
|
user.setPassword(passwordEncryptionService.hashPassword(request.getNewPassword()));
|
||||||
|
userRepository.save(user);
|
||||||
|
return "Password changed successfully";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional
|
||||||
|
public String resetPassword(ResetPasswordDTO request) {
|
||||||
|
User user = userRepository.findById(request.getUserId())
|
||||||
|
.orElseThrow(() -> new EntityNotFoundException("User not found with ID: " + request.getUserId()));
|
||||||
|
|
||||||
|
user.setPassword(passwordEncryptionService.hashPassword(request.getNewPassword()));
|
||||||
|
userRepository.save(user);
|
||||||
|
return "Password changed successfully";
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<UserDTOs.UserResponse> getAllUsers() {
|
||||||
|
return userRepository.findAll().stream()
|
||||||
|
.map(this::mapToResponseDTO)
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
|
||||||
|
public UserDTOs.UserResponse getUserById(String userId) {
|
||||||
|
User user = userRepository.findById(userId)
|
||||||
|
.orElseThrow(() -> new EntityNotFoundException("User not found with ID: " + userId));
|
||||||
|
return mapToResponseDTO(user);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional
|
||||||
|
public UserDTOs.UserResponse updateUser(String userId, UserDTOs.UserRequest request) {
|
||||||
|
User user = userRepository.findById(userId)
|
||||||
|
.orElseThrow(() -> new EntityNotFoundException("User not found with ID: " + userId));
|
||||||
|
user.setUserFullname(request.getUserFullname());
|
||||||
|
user.setEmail(request.getEmail());
|
||||||
|
user.setRole(request.getRole());
|
||||||
|
user.setPassword(passwordEncryptionService.hashPassword(request.getPassword()));
|
||||||
|
User updatedUser = userRepository.save(user);
|
||||||
|
return mapToResponseDTO(updatedUser);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional
|
||||||
|
public void deleteUser(String userId) {
|
||||||
|
if (!userRepository.existsById(userId)) {
|
||||||
|
throw new EntityNotFoundException("User not found with ID: " + userId);
|
||||||
|
}
|
||||||
|
userRepository.deleteById(userId);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private UserDTOs.UserResponse mapToResponseDTO(User user) {
|
||||||
|
UserDTOs.UserResponse response = new UserDTOs.UserResponse();
|
||||||
|
response.setUserId(user.getUserId());
|
||||||
|
response.setUserFullname(user.getUserFullname());
|
||||||
|
response.setEmail(user.getEmail());
|
||||||
|
response.setRole(user.getRole());
|
||||||
|
response.setIsFirstLogin(user.isFirstLogin());
|
||||||
|
response.setIsActive(user.isActive());
|
||||||
|
response.setCreatedAt(user.getCreatedAt());
|
||||||
|
response.setUpdatedAt(user.getUpdatedAt());
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,84 @@
|
|||||||
|
package com.mfsys.aconnect.usermanagement.service;
|
||||||
|
|
||||||
|
import com.mfsys.aconnect.usermanagement.dto.UserSubscriptionDTOs.UserSubscriptionRequest;
|
||||||
|
import com.mfsys.aconnect.usermanagement.model.User;
|
||||||
|
import com.mfsys.aconnect.usermanagement.model.UserSubscription;
|
||||||
|
import com.mfsys.aconnect.usermanagement.repository.UserRepository;
|
||||||
|
import com.mfsys.aconnect.usermanagement.repository.UserSubscriptionRepository;
|
||||||
|
import jakarta.persistence.EntityNotFoundException;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Optional;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
import com.mfsys.aconnect.usermanagement.dto.UserSubscriptionDTOs.UserSubscriptionResponse;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class UserSubscriptionService {
|
||||||
|
|
||||||
|
private final UserSubscriptionRepository userSubscriptionRepository;
|
||||||
|
private final UserRepository userRepository;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
public UserSubscriptionService(UserSubscriptionRepository userSubscriptionRepository, UserRepository userRepository) {
|
||||||
|
this.userSubscriptionRepository = userSubscriptionRepository;
|
||||||
|
this.userRepository = userRepository;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional
|
||||||
|
public UserSubscriptionResponse createSubscription(String userId, UserSubscriptionRequest request) {
|
||||||
|
User user = userRepository.findById(userId)
|
||||||
|
.orElseThrow(() -> new EntityNotFoundException("User not found with id: " + userId));
|
||||||
|
|
||||||
|
UserSubscription userSubscription = new UserSubscription();
|
||||||
|
userSubscription.setUserId(userId);
|
||||||
|
userSubscription.setEndpointPath(request.getEndpointPath());
|
||||||
|
userSubscription.setDescription(request.getDescription());
|
||||||
|
userSubscription.setIsActive(request.getIsActive());
|
||||||
|
userSubscription.setMaxRequestsPerMinute(request.getMaxRequestsPerMinute());
|
||||||
|
userSubscription.setUser(user);
|
||||||
|
|
||||||
|
UserSubscription savedSubscription = userSubscriptionRepository.save(userSubscription);
|
||||||
|
return UserSubscriptionResponse.fromEntity(savedSubscription);
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<UserSubscriptionResponse> getSubscriptionsByUserId(String userId) {
|
||||||
|
return userSubscriptionRepository.findByUserId(userId)
|
||||||
|
.stream()
|
||||||
|
.map(UserSubscriptionResponse::fromEntity)
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
|
||||||
|
public Optional<UserSubscriptionResponse> getSubscriptionById(Long subscriptionId) {
|
||||||
|
return userSubscriptionRepository.findById(subscriptionId)
|
||||||
|
.map(UserSubscriptionResponse::fromEntity);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional
|
||||||
|
public UserSubscriptionResponse updateSubscription(Long subscriptionId, UserSubscriptionRequest request) {
|
||||||
|
UserSubscription existingSubscription = userSubscriptionRepository.findById(subscriptionId)
|
||||||
|
.orElseThrow(() -> new EntityNotFoundException("User subscription not found with id: " + subscriptionId));
|
||||||
|
|
||||||
|
existingSubscription.setEndpointPath(request.getEndpointPath());
|
||||||
|
existingSubscription.setDescription(request.getDescription());
|
||||||
|
existingSubscription.setIsActive(request.getIsActive());
|
||||||
|
existingSubscription.setMaxRequestsPerMinute(request.getMaxRequestsPerMinute());
|
||||||
|
|
||||||
|
UserSubscription updatedSubscription = userSubscriptionRepository.save(existingSubscription);
|
||||||
|
return UserSubscriptionResponse.fromEntity(updatedSubscription);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional
|
||||||
|
public void deleteSubscription(Long subscriptionId) {
|
||||||
|
if (!userSubscriptionRepository.existsById(subscriptionId)) {
|
||||||
|
throw new EntityNotFoundException("User subscription not found with id: " + subscriptionId);
|
||||||
|
}
|
||||||
|
userSubscriptionRepository.deleteById(subscriptionId);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Optional<UserSubscription> findByUserIdAndEndpointPath(String userId, String endpointPath) {
|
||||||
|
return userSubscriptionRepository.findByUserIdAndEndpointPathAndIsActiveTrue(userId, endpointPath);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,8 @@
|
|||||||
|
app.security.uri=http://localhost:9090/security/auth/user
|
||||||
|
app.deposit.uri=http://localhost:9095
|
||||||
|
app.generalledger.uri=http://localhost:9093
|
||||||
|
app.onlinebanking.uri=http://localhost:9099
|
||||||
|
app.crm.uri=http://localhost:9096
|
||||||
|
app.loan.uri=http://localhost:9094
|
||||||
|
app.organization.uri=0005
|
||||||
|
|
||||||
@ -0,0 +1,4 @@
|
|||||||
|
app.deposit.uri=${CMB_DEPOSIT_SERVER_URL}
|
||||||
|
app.generalledger.uri=${CMB_GL_SERVER_URL}
|
||||||
|
app.organization.uri=${CMB_ORGA_CODE}
|
||||||
|
app.security.uri=${CMB_SECURITY_SERVER_URL}/security/auth/user
|
||||||
@ -0,0 +1,4 @@
|
|||||||
|
app.deposit.uri=${CMB_DEPOSIT_SERVER_URL}
|
||||||
|
app.generalledger.uri=${CMB_GL_SERVER_URL}
|
||||||
|
app.organization.uri=${CMB_ORGA_CODE}
|
||||||
|
app.security.uri=${CMB_SECURITY_SERVER_URL}/security/auth/user
|
||||||
@ -0,0 +1,4 @@
|
|||||||
|
app.deposit.uri=${CMB_DEPOSIT_SERVER_URL}
|
||||||
|
app.generalledger.uri=${CMB_GL_SERVER_URL}
|
||||||
|
app.organization.uri=${CMB_ORGA_CODE}
|
||||||
|
app.security.uri=${CMB_SECURITY_SERVER_URL}/security/auth/user
|
||||||
@ -0,0 +1,23 @@
|
|||||||
|
spring.application.name = aconnect
|
||||||
|
app.base.uri=aconnect
|
||||||
|
app.db.dbname = aconnect
|
||||||
|
app.db.dbuser=${CMB_SQL_DB_USER}
|
||||||
|
app.db.dbpassword=${CMB_SQL_DB_PASSWORD}
|
||||||
|
app.db.url=${CMB_SQL_DB_MACHINE_IP}
|
||||||
|
app.server.timezone=${APP_SERVER_TIMEZONE}
|
||||||
|
spring.datasource.username = ${app.db.dbuser}
|
||||||
|
spring.datasource.password = ${app.db.dbpassword}
|
||||||
|
spring.datasource.url = jdbc:mysql://${app.db.url}/${app.db.dbname}?createDatabaseIfNotExist=true&serverTimezone=${app.server.timezone}&useLegacyDatetimeCode=false&useUnicode=yes&characterEncoding=UTF-8&characterSetResults=UTF-8
|
||||||
|
|
||||||
|
spring.jpa.properties.hibernate.connection.characterEncoding=utf-8
|
||||||
|
spring.jpa.properties.hibernate.connection.CharSet=utf-8
|
||||||
|
spring.jpa.properties.hibernate.connection.useUnicode=true
|
||||||
|
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQLDialect
|
||||||
|
spring.jpa.hibernate.ddl-auto=update
|
||||||
|
|
||||||
|
spring.profiles.active=@spring.profiles.active@
|
||||||
|
|
||||||
|
jwt.secret = D1kD4fP8wQ2zL6hM9sR3vX7yU0tJ5nB2cV8pG4qW6eY1iK3oA9uH7jN2mZ5xT9bS4rF0lP3dQ8wE1
|
||||||
|
jwt.expiration = 86400000
|
||||||
|
jwt.refresh-expiration= 604800000
|
||||||
|
|
||||||
@ -0,0 +1,13 @@
|
|||||||
|
package com.mfsys.aconnect;
|
||||||
|
|
||||||
|
import org.junit.jupiter.api.Test;
|
||||||
|
import org.springframework.boot.test.context.SpringBootTest;
|
||||||
|
|
||||||
|
@SpringBootTest
|
||||||
|
class AconnectApplicationTests {
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void contextLoads() {
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,19 @@
|
|||||||
|
# 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=only-script
|
||||||
|
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.9/apache-maven-3.9.9-bin.zip
|
||||||
@ -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
|
||||||
|
#
|
||||||
|
# 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.
|
||||||
|
# ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
# ----------------------------------------------------------------------------
|
||||||
|
# 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-<version>,maven-mvnd-<version>-<platform>}/<hash>
|
||||||
|
[ -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 "$@"
|
||||||
@ -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 http://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-<version>,maven-mvnd-<version>-<platform>}/<hash>
|
||||||
|
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"
|
||||||
@ -0,0 +1,132 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<parent>
|
||||||
|
<groupId>com.mfsys</groupId>
|
||||||
|
<artifactId>parent</artifactId>
|
||||||
|
<version>0.0.1</version>
|
||||||
|
<relativePath>../parent/pom.xml</relativePath>
|
||||||
|
</parent>
|
||||||
|
<groupId>com.mfsys</groupId>
|
||||||
|
<artifactId>common</artifactId>
|
||||||
|
<version>0.0.1</version>
|
||||||
|
<name>common</name>
|
||||||
|
<description>aConnect</description>
|
||||||
|
<url/>
|
||||||
|
<licenses>
|
||||||
|
<license/>
|
||||||
|
</licenses>
|
||||||
|
<developers>
|
||||||
|
<developer/>
|
||||||
|
</developers>
|
||||||
|
<scm>
|
||||||
|
<connection/>
|
||||||
|
<developerConnection/>
|
||||||
|
<tag/>
|
||||||
|
<url/>
|
||||||
|
</scm>
|
||||||
|
<properties>
|
||||||
|
<java.version>21</java.version>
|
||||||
|
</properties>
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-data-jpa</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.modelmapper</groupId>
|
||||||
|
<artifactId>modelmapper</artifactId>
|
||||||
|
<version>3.1.1</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-security</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-web</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.httpcomponents.client5</groupId>
|
||||||
|
<artifactId>httpclient5</artifactId>
|
||||||
|
<version>5.2.1</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.projectlombok</groupId>
|
||||||
|
<artifactId>lombok</artifactId>
|
||||||
|
<optional>true</optional>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-tomcat</artifactId>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-test</artifactId>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.security</groupId>
|
||||||
|
<artifactId>spring-security-test</artifactId>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>mysql</groupId>
|
||||||
|
<artifactId>mysql-connector-java</artifactId>
|
||||||
|
<version>8.0.33</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.mindrot</groupId>
|
||||||
|
<artifactId>jbcrypt</artifactId>
|
||||||
|
<version>0.4</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>io.jsonwebtoken</groupId>
|
||||||
|
<artifactId>jjwt-api</artifactId>
|
||||||
|
<version>0.12.3</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>io.jsonwebtoken</groupId>
|
||||||
|
<artifactId>jjwt-impl</artifactId>
|
||||||
|
<version>0.12.3</version>
|
||||||
|
<scope>runtime</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>io.jsonwebtoken</groupId>
|
||||||
|
<artifactId>jjwt-jackson</artifactId>
|
||||||
|
<version>0.12.3</version>
|
||||||
|
<scope>runtime</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.fasterxml.jackson.core</groupId>
|
||||||
|
<artifactId>jackson-databind</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
|
<build>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
|
<version>3.13.0</version>
|
||||||
|
<configuration>
|
||||||
|
<source>21</source>
|
||||||
|
<target>21</target>
|
||||||
|
<annotationProcessorPaths>
|
||||||
|
<path>
|
||||||
|
<groupId>org.projectlombok</groupId>
|
||||||
|
<artifactId>lombok</artifactId>
|
||||||
|
<version>1.18.34</version>
|
||||||
|
</path>
|
||||||
|
</annotationProcessorPaths>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
|
||||||
|
</project>
|
||||||
@ -0,0 +1,52 @@
|
|||||||
|
package com.mfsys.common.configuration.constant;
|
||||||
|
|
||||||
|
public interface AconnectURI {
|
||||||
|
String ACONNECT = "/aconnect";
|
||||||
|
String REFRESH_TOKEN = "/refreshtoken";
|
||||||
|
String DEPOSIT = "/deposit";
|
||||||
|
String CRM = "/crm";
|
||||||
|
String LOAN = "/loan";
|
||||||
|
String GENERALLEDGER = "/generalledger";
|
||||||
|
String SIGNIN = "/signin";
|
||||||
|
String TRANSACTION_URI = "/transactions";
|
||||||
|
String TRANSACTION = "/transaction";
|
||||||
|
String LOGS = "/logs";
|
||||||
|
String CANCEL_URI = "/cancel";
|
||||||
|
String REJECT_URI = "/rejection";
|
||||||
|
String INDIVIDUAL = "/individual";
|
||||||
|
String BUSINESS = "/business";
|
||||||
|
String REVERSE_URI = "/reversal";
|
||||||
|
String AUTHORIZATION_URI = "/authorizations";
|
||||||
|
String DEPOSIT_AUTHORIZATION_URI = DEPOSIT + AUTHORIZATION_URI;
|
||||||
|
String GENERALLEDGER_AUTHORIZATION_URI = GENERALLEDGER + AUTHORIZATION_URI;
|
||||||
|
|
||||||
|
// Cancellation
|
||||||
|
String DEPOSIT_CANCELLATION_URI = DEPOSIT + TRANSACTION_URI + CANCEL_URI;
|
||||||
|
String GENERALLEDGER_CANCELLATION_URI = GENERALLEDGER + TRANSACTION_URI + CANCEL_URI;
|
||||||
|
|
||||||
|
String TRANSACTION_ACCOUNT_GL_URI = TRANSACTION_URI + "/accounttogl";
|
||||||
|
String TRANSACTION_GL_GL_URI = TRANSACTION_URI + "/gltogls";
|
||||||
|
String ACCOUNT_TO_ACCOUNT_TRANSACTION_URI = TRANSACTION_URI + "/accounttoaccount";
|
||||||
|
String GL_TO_ACCOUNT_TRANSACTION_URI = TRANSACTION_URI + "/gl-account";
|
||||||
|
String INDIVIDUAL_CRM_CREATION_URI = CRM + INDIVIDUAL + "/create";
|
||||||
|
String BUSINESS_CRM_CREATION_URI = CRM + BUSINESS + "/create";
|
||||||
|
String INDIVIDUAL_DEPOSIT_CREATION_URI = DEPOSIT + INDIVIDUAL + "/create";
|
||||||
|
String UPDATE_DEPOSIT_CREATION_URI = DEPOSIT + INDIVIDUAL + "/approval";
|
||||||
|
|
||||||
|
String BUSINESS_DEPOSIT_CREATION_URI = DEPOSIT + BUSINESS + "/create";
|
||||||
|
|
||||||
|
String INDIVIDUAL_LOAN_CREATION_URI = LOAN + INDIVIDUAL + "/create";
|
||||||
|
|
||||||
|
String TRANSACTION_CANCEL_URI = TRANSACTION_URI + CANCEL_URI + "/nodes/{nodeId}/trannums/{sgtGntrtranlink}";
|
||||||
|
String DEPOSIT_TRANSACTION_REJECT_URI = DEPOSIT + TRANSACTION_URI + REJECT_URI;
|
||||||
|
String GENERALLEDGER_TRANSACTION_REJECT_URI = GENERALLEDGER + TRANSACTION_URI + REJECT_URI;
|
||||||
|
|
||||||
|
String DEPOSIT_TRANSACTION_REVERSAL_URI = DEPOSIT + TRANSACTION_URI + REVERSE_URI;
|
||||||
|
String GENERALLEDGER_TRANSACTION_REVERSAL_URI = GENERALLEDGER + TRANSACTION_URI + REVERSE_URI;
|
||||||
|
|
||||||
|
String TRANSACTION_CIIHIVE_AUTHORIZATION_URI = TRANSACTION_URI + AUTHORIZATION_URI;
|
||||||
|
String TRANSACTION_CIIHIVE_REVERSAL_URI = TRANSACTION_URI + REVERSE_URI + "/nodes/{nodeId}/trannums/{sgtGntrtranlink}";
|
||||||
|
String DEPOSIT_CIIHIVE_ACCOUNT_MISCELLANEOUS_DETAILS_URI = "/deposit/account/miscDetails";
|
||||||
|
String DEPOSIT_ACONNECT_ACCOUNT_DETAILS_URI = "/aconnect/account/getAccountDetails";
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,5 @@
|
|||||||
|
package com.mfsys.common.configuration.constant;
|
||||||
|
|
||||||
|
public interface DBFieldNameConstant {
|
||||||
|
String POR_ORGACODE = "POR_ORGACODE";
|
||||||
|
}
|
||||||
@ -0,0 +1,28 @@
|
|||||||
|
package com.mfsys.common.configuration.constant;
|
||||||
|
|
||||||
|
import com.mfsys.common.configuration.exception.ErrorMessage;
|
||||||
|
|
||||||
|
public enum ERRCode implements ErrorMessage {
|
||||||
|
EMAIL_ALREADY_EXIST("ERR_SEC_0001", "Email already exists"),
|
||||||
|
USERNAME_ALREADY_EXIST("ERR_SEC_0002", "Username already exists"),
|
||||||
|
PASSWORD_ALREADY_EXIST("ERR_SEC_0003", "Old Password is not correct");
|
||||||
|
|
||||||
|
|
||||||
|
private String code;
|
||||||
|
private String description;
|
||||||
|
|
||||||
|
private ERRCode(String code, String description) {
|
||||||
|
this.code = code;
|
||||||
|
this.description = description;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getCode() {
|
||||||
|
return this.code;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getDescription() {
|
||||||
|
return this.description;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,444 @@
|
|||||||
|
package com.mfsys.common.configuration.constant;
|
||||||
|
|
||||||
|
public enum FieldNameConstant implements DBFieldNameConstant {
|
||||||
|
|
||||||
|
PTR_TRANCODE("ptrTrancode", "PTR_TRANCODE"),
|
||||||
|
MODULE("module","MODULE"),
|
||||||
|
|
||||||
|
PTR_TRANDESC("ptrTrandesc", "PTR_TRANDESC"),
|
||||||
|
PDT_DOTYCODE("pdtdotycode", "PDT_DOTYCODE"),
|
||||||
|
PDT_DOTYTYPE("pdtdotytype", "PDT_DOTYTYPE"),
|
||||||
|
POR_ORGACODE("porOrgacode", DBFieldNameConstant.POR_ORGACODE),
|
||||||
|
SUS_USERCODE("susUsercode", "SUS_USERCODE"),
|
||||||
|
SUS_NAME("susName", "SUS_NAME"),
|
||||||
|
PCR_CURRCODE("pcrCurrcode", "PCR_CURRCODE"),
|
||||||
|
PCR_CURRBASE("pcrCurrbase", "PCR_CURRBASE"),
|
||||||
|
SGT_GNTRAMTFC("sgtGntramtfc", "SGT_GNTRAMTFC"),
|
||||||
|
PLC_LOCACODE("plcLocacode", "PLC_LOCACODE"),
|
||||||
|
CHARGE_WAVIER("CHARGE_WAVIER","CHARGE_WAVIER"),
|
||||||
|
SGT_GNTRVALUEDATE("sgtGntrvaluedate", "SGT_GNTRVALUEDATE"),
|
||||||
|
MBM_BKMSNUMBER("mbmBkmsnumber","MBM_BKMSNUMBER"),
|
||||||
|
MBM_BKMSCLOSED("mbmBkmsclosed","MBM_BKMSCLOSED"),
|
||||||
|
MBM_BKMSCLOSEDBY("mbmBkmsclosedby","MBM_BKMSCLOSEDBY"),
|
||||||
|
MBM_BKMSTITLE("mbmBkmstitle","MBM_BKMSTITLE"),
|
||||||
|
MBM_CHARGE_EXEMPTED("mbmChargeExempted","MBM_CHARGE_EXEMPTED"),
|
||||||
|
DMP_PRODCODE("dmpProdcode", "DMP_PRODCODE"),
|
||||||
|
MLT_LNTRPRINCIPAL("mltLntrprincipal","MLT_LNTRPRINCIPAL"),
|
||||||
|
MLT_LNTRINTEREST("mltLntrinterest","MLT_LNTRINTEREST"),
|
||||||
|
MLT_LNTRPENALTY("mltLntrpenalty","MLT_LNTRPENALTY"),
|
||||||
|
SGT_GNTRNARRATION("sgtGntrnarration", "SGT_GNTRNARRATION"),
|
||||||
|
BLA_LNACFINANCEDAMTFC("blaLnacfinancedamtfc","BLA_LNACFINANCEDAMTFC"),
|
||||||
|
BLA_LNACDISBURSEMENTFC("blaLnacdisbursementfc","BLA_LNACDISBURSEMENTFC"),
|
||||||
|
DMP_PRODDESC("dmpProddesc","DMP_PRODDESC"),
|
||||||
|
PER_ERATRATEACT("perEratrateact","PER_ERATRATEACT"),
|
||||||
|
PCR_CURRDESC("pcrCurrdesc","PCR_CURRDESC"),
|
||||||
|
PLC_LOCADESC("plcLocadesc","PLC_LOCADESC"),
|
||||||
|
PLC_LOCASHORT("plcLocashort", "PLC_LOCASHORT"),
|
||||||
|
PLC_LOCATYPE("plcLocatype", "PLC_LOCATYPE"),
|
||||||
|
PRG_REGNCODE("prgRegncode","PRG_REGNCODE"),
|
||||||
|
PLC_OPENDATE("plcOpendate","PLC_OPENDATE"),
|
||||||
|
BRANCH_DATA("branchStep", "BRANCH_STEP"),
|
||||||
|
CHARGES_BIFURCATION("chargesBifurcation", "CHARGES_BIFURCATION"),
|
||||||
|
CMP_CUSTCODE("cmpCustcode", "CMP_CUSTCODE"),
|
||||||
|
IS_DEBITFREEZE("isDebitFreeze","IS_DEBIT_FREEZE"),
|
||||||
|
IS_CREDITFREEZE("iscreditFreeze","IS_CREDIT_FREEZE"),
|
||||||
|
MARKED_STATUS("markedStatus", "MARKED_STATUS"),
|
||||||
|
CMP_CUSTSEX("cmpcustsex","CMP_CUSTSEX"),
|
||||||
|
CMP_GRPOUPCODE("cmpGrpoupcode","CMP_GRPOUPCODE"),
|
||||||
|
PCC_CSCGCODE("pccCscgcode","PCC_CSCGCODE"),
|
||||||
|
PFS_FUSOID("pfsFusoid", "PFS_FUSOID"),
|
||||||
|
PAT_AMTYCODE("patAmtycode","PAT_AMTYCODE"),
|
||||||
|
BLA_LNMBSHARE_APPROVED("blaLnmbshareApproved","BLA_LNMBSHARE_APPROVED"),
|
||||||
|
BLA_ASSOCIATECUSTOMER("blaAssociatecustomer","BLA_ASSOCIATECUSTOMER"),
|
||||||
|
CMP_CUSTCODE_GRP("cmpCustcodeGrp","CMP_CUSTCODE_GRP"),
|
||||||
|
CORRELATION_CUSTCODE("correlationCustcode","CORRELATION_CUSTCODE"),
|
||||||
|
CMP_COMPANYCODE("cmpCompanycode", "CMP_COMPANYCODE"),
|
||||||
|
CMP_COMPANYCODE_REF("cmpCompanycodeRef","CMP_COMPANYCODE_REF"),
|
||||||
|
CMP_COMPANYNAME("cmpCompanyname", "CMP_COMPANYNAME"),
|
||||||
|
CMP_JOINTCUSTCODE("cmpJointcustcode", "CMP_JOINTCUSTCODE"),
|
||||||
|
CMP_JOINTNAME("cmpJointName", "CMP_JOINTNAME"),
|
||||||
|
ACC_ATTORTYPE("accAttortype", "ACC_ATTORTYPE"),
|
||||||
|
ACC_ATTORTYPE_B("accAttortypeB", "ACC_ATTORTYPE_B"),
|
||||||
|
ACC_JOINT_STATUS("accJointStatus", "ACC_JOINT_STATUS"),
|
||||||
|
ACC_JOINT_STATUS_B("accJointStatusB", "ACC_JOINT_STATUS_B"),
|
||||||
|
PIT_JOINTIDENVALUE("pitJoinidenvalue", "PIT_JOINTIDENVALUE"),
|
||||||
|
PIT_JOINTIDENCODE("pitJoinidenCode","PIT_JOINTIDENCODE"),
|
||||||
|
PAS_ACSTCODE("pasAcstcode","PAS_ACSTCODE"),
|
||||||
|
BDA_DPACBLOCKAMT("bdaDpacblockamt","BDA_DPACBLOCKAMT"),
|
||||||
|
BDA_DPACPROFITACCRUEDAMTFC("bdaDpacprofitaccruedamtfc","BDA_DPACPROFITACCRUEDAMTFC"),
|
||||||
|
MLS_LNSHTYPE("mlsLnshtype","MLS_LNSHTYPE"),
|
||||||
|
MLS_LNSHINSTNO("mlsLnshinstno","MLS_LNSHINSTNO"),
|
||||||
|
MLS_LNSHDUEDATE("mlsLnshduedate","MLS_LNSHDUEDATE"),
|
||||||
|
MLS_LNSHPRINCIPAL("mlsLnshprincipal","MLS_LNSHPRINCIPAL"),
|
||||||
|
MLS_LNSHINTEREST("mlsLnshinterest","MLS_LNSHINTEREST"),
|
||||||
|
BLA_LNAPPROVEDAMOUNTFC("blaLnapprovedamountfc","BLA_LNAPPROVEDAMOUNTFC"),
|
||||||
|
BLA_LNACAPPROVEDATE("blaLnacapprovedate", "BLA_LNACAPPROVEDATE"),
|
||||||
|
CLOSING_DETAILS("closingBalanceDetails",""),
|
||||||
|
WORKFLOWREFNUM("workFlowRefNum", "workFlowRefNum"),
|
||||||
|
PIN_LENGTH("4","pinLength"),
|
||||||
|
POR_ORGADESC("porOrgadesc","POR_ORGADESC"),
|
||||||
|
POR_ORGASHORT("porOrgashort","POR_ORGASHORT"),
|
||||||
|
POR_ORGAREGDATE("porOrgaregdate","POR_ORGAREGDATE"),
|
||||||
|
POR_ORGALOGO("porOrgalogo","POR_ORGALOGO"),
|
||||||
|
POR_ORGAREPORTLOGO("porOrgareportlogo","POR_ORGAREPORTLOGO"),
|
||||||
|
POR_TRANINTEGRALVALUE("porTranintegralvalue", "POR_TRANINTEGRALVALUE"),
|
||||||
|
POR_TRANPRECISIONVALUE("porTranrprecisionvalue", "POR_TRANPRECISIONVALUE"),
|
||||||
|
POR_TRANROUNDTYPE("porTranroundtype", "POR_TRANROUNDTYPE"),
|
||||||
|
POR_ROUNDINGMODETRANSACTION("porRoundingmodetransactions","POR_ROUNDINGMODETRANSACTION"),
|
||||||
|
POR_ORGAEXPDATE("porOrgaexpdate","POR_ORGAEXPDATE"),
|
||||||
|
POR_ORGAFAX("porOrgafax","POR_ORGAFAX"),
|
||||||
|
POR_ADRSLNDPHONE("porAdrslndphone","POR_ADRSLNDPHONE"),
|
||||||
|
POR_ORGAADDRESSLINE1("por_orgaaddressline1","POR_ORGAADDRESSLINE1"),
|
||||||
|
POR_ORGAADDRESSLINE2("por_orgaaddressline2","POR_ORGAADDRESSLINE2"),
|
||||||
|
POR_ORGAWEBSITE("porOrgawebsite","POR_ORGAWEBSITE"),
|
||||||
|
POR_ORGACODE_ENTRY("porOrgacodeEntry", "POR_ORGACODE_ENTRY"),
|
||||||
|
POR_ACTIVE("porActive", "POR_ACTIVE"),
|
||||||
|
SUS_USERNAME("susUsername", "SUS_USERNAME"),
|
||||||
|
SUS_PASSWORD("susPassword", "SUS_PASSWORD"),
|
||||||
|
SUS_USERCELLNO("susUsercellno", "SUS_USERCELLNO"),
|
||||||
|
SUL_LEVELCODE("sulLevelCode", "SUL_LEVELCODE"),
|
||||||
|
SUL_DESC("sulDesc", "SUL_DESC"),
|
||||||
|
SUL_STATUS("sulStatus", "SUL_STATUS")
|
||||||
|
,SUS_MULTILOGIN("susMultilogin","SUS_MULTILOGIN") ,
|
||||||
|
SUS_HOMELOCATION("susHomelocation","SUS_HOMELOCATION"),
|
||||||
|
SUS_ACTIVE("susActive", "SUS_ACTIVE"),
|
||||||
|
SUS_SIGNLOG("susSignlog","SUS_SIGNLOG"),
|
||||||
|
USER_DATA("userStep","USER_STEP"),
|
||||||
|
ROLE_DATA("roleStep", "ROLE_STEP"),
|
||||||
|
PCA_GLACDEBIT("pcaGlacdebit","PCA_GLACDEBIT"),
|
||||||
|
PCA_GLACCREDIT("pcaGlaccredit","PCA_GLACCREDIT"),
|
||||||
|
PCH_CHRGCODE("pchChrgcode","PCH_CHRGCODE"),
|
||||||
|
PCH_CHRGDESC("pchChrgdesc","PCH_CHRGDESC"),
|
||||||
|
PET_EVENTCODE_POST("petEventcodePost","PET_EVENTCODE_POST"),
|
||||||
|
PET_EXRTCODE("petExrtcode","PET_EXRTCODE"),
|
||||||
|
PER_ERATDATE("perEratdate","PER_ERATDATE"),
|
||||||
|
PLT_LOCATYPEDESC("pltLocatypedesc", "PLT_LOCATYPEDESC"),
|
||||||
|
CMP_CREATEDBY("cmpCreatedby", "CMP_CREATEDBY"),
|
||||||
|
PLC_LOCACODE_ENTRY("PLC_LOCACODE_ENTRY", "PLC_LOCACODE_ENTRY"),
|
||||||
|
POR_ORGATIMEZONE("porOrgatimezone", "POR_ORGATIMEZONE"),
|
||||||
|
POR_ORGAUTCTIMEZONE("porOrgautctimezone", "POR_ORGAUTCTIMEZONE"),
|
||||||
|
POR_IBANFORMAT("porIbanformat", "POR_IBANFORMAT"),
|
||||||
|
PLC_LOCATIMEZONE("plcLocatimezone", "PLC_LOCATIMEZONE"),
|
||||||
|
PLC_ACTIVE("plcActive","PLC_ACTIVE"),
|
||||||
|
PCA_GLACCODE("pcaGlaccode", "PCA_GLACCODE"),
|
||||||
|
SGT_GNTRDATE("sgtGntrdate", "SGT_GNTRDATE"),
|
||||||
|
SGT_GNTRCANCELLED("sgtGntrcancelled", "SGT_GNTRCANCELLED"),
|
||||||
|
SGT_GNTRAMT("sgtGntramt", "SGT_GNTRAMT"),
|
||||||
|
SUB_BRANCH("subBranch", "SUB_BRANCH"),
|
||||||
|
PFS_ACNTDATEFROM("pfs_acntdatefrom","PFS_ACNTDATEFROM"),
|
||||||
|
PFS_ACNTDATETO("pfs_acntdateto", "PFS_ACNTDATETO"),
|
||||||
|
PFS_ACNTDESC("pfs_acntdesc","PFS_ACNTDESC"),
|
||||||
|
BGP_GLPRCOMPANYDATE("bgpGlprcompanydate","BGP_GLPRCOMPANYDATE"),
|
||||||
|
BGP_GLPRCOMPANYTIMEZONE("bgpGlprcompanytimezone","BGP_GLPRCOMPANYDATE"),
|
||||||
|
BGP_GLPROPERATIONCLOSE("bgpGlproperationclose", "BGP_GLPROPERATIONCLOSE"),
|
||||||
|
BGP_GLPRNEXTDATE("bgpGlprnextdate", "BGP_GLPRNEXTDATE"),
|
||||||
|
PCO_CLDSTATUS("pcoCldstatus", "PCO_CLDSTATUS"),
|
||||||
|
PCO_CLDSHADOWED("pcoCldshadowed", "PCO_CLDSHADOWED"),
|
||||||
|
PCO_CLDBATCHPROCESS("pcoCldbatchprocess", "PCO_CLDBATCHPROCESS"),
|
||||||
|
PCO_CLDBATCHPROCESSFIRSTSTEP("pcoCldbatchprocessfirststep", "PCO_CLDBATCHPROCESSFIRSTSTEP"),
|
||||||
|
PCO_CLDERRMESSAGE("pcoClderrmessage", "PCO_CLDERRMESSAGE"),
|
||||||
|
BLA_LNAPPLIEDAMOUNTFC ("blaLnappliedamountfc","BLA_LNAPPLIEDAMOUNTFC"),
|
||||||
|
BLA_LNACINTERESTRATE("blaLnacinterestrate","BLA_LNACINTERESTRATE"),
|
||||||
|
PCD_CORDCODE("pcdCordcode","PCD_CORDCODE"),
|
||||||
|
PPO_PURPCODE("ppoPurpcode","PPO_PURPCODE"),
|
||||||
|
OLD_PCD_CORDCODE("oldPcdCordcode","OLD_PCD_CORDCODE"),
|
||||||
|
NEW_PCD_CORDCODE("newPcdCordcode","NEW_PCD_CORDCODE"),
|
||||||
|
PCD_CORDCOMMENT ("pcdCordcomment","PCD_CORDCOMMENT"),
|
||||||
|
SGT_GNTRNUMBER("sgtGntrnumber", "SGT_GNTRNUMBER"),
|
||||||
|
SGT_GNTRTRANLINK("sgtGntrtranlink", "SGT_GNTRTRANLINK"),
|
||||||
|
SGT_GNTRCREATEDAT("sgtGntrcreatedat", "SGT_GNTRCREATEDAT"),
|
||||||
|
BTA_BOOKINGAMOUNT("btaBookingamount", "BTA_BOOKINGAMOUNT"),
|
||||||
|
BTA_DURATION("btaDuration", "BTA_DURATION"),
|
||||||
|
PFM_FMODCODE("pfmFmodcode", "PFM_FMODCODE"),
|
||||||
|
PRO_RLOVCODE("proRlovcode", "PRO_RLOVCODE"),
|
||||||
|
PTM_TMETCODE("ptmTmetcode", "PTM_TMETCODE"),
|
||||||
|
PTM_TMETDESC("ptmTmetdesc", "PTM_TMETDESC"),
|
||||||
|
PLC_CHARGECALCRATE("plcChargecalcrate", "PLC_CHARGECALCRATE"),
|
||||||
|
SVH_VCHDUPDATETIMESTAMP("svhVchdupdatetimestamp","SVH_VCHDUPDATETIMESTAMP"),
|
||||||
|
SVH_VCHDFLDCOMB("svhVchdfldcomb", "SVH_VCHDFLDCOMB"),
|
||||||
|
SVH_VCHDVALCOMBDESC("svhVchdvalcombdesc", "SVH_VCHDVALCOMBDESC"),
|
||||||
|
PAA_TAAUTIMESTAMP("paaTaautimestamp", "PAA_TAAUTIMESTAMP"),
|
||||||
|
MBM_BKMSBALANCE("mbmBkmsbalance", "MBM_BKMSBALANCE"),
|
||||||
|
MBM_BKMSUNAUTHDRBALANCE("mbmBkmsunauthdrbalance", "MBM_BKMSUNAUTHDRBALANCE"),
|
||||||
|
MBM_BKMSUNAUTHCRBALANCE("mbmBkmsunauthcrbalance", "MBM_BKMSUNAUTHCRBALANCE"),
|
||||||
|
CURRENT_AMOUNT("currentAmount", "CURRENT_AMOUNT"),
|
||||||
|
CURRENCY_DENOMINATION_DETIAL("currencyDenominationDetail", "currencyDenominationDetail"),
|
||||||
|
CLOSE_OPERATION_DATA("closeOperationData", "closeOperationData"),
|
||||||
|
PCA_GLACOPITEM("pcaGlacopitem", "PCA_GLACOPITEM"),
|
||||||
|
PCT_CALCODE("pctCalcode", "PCT_CALCODE"),
|
||||||
|
NODE_ID("nodeId", "NODE_ID"),
|
||||||
|
SVV_VCVRREFNO("svvVcvrrefno", "SVV_VCVRREFNO"),
|
||||||
|
PIT_INSTCODE("pitInstcode", "PIT_INSTCODE"),
|
||||||
|
MIT_INSTCODE("mitInstcode", "MIT_INSTCODE"),
|
||||||
|
MIS_INSEBOOKNO("misInsebookno", "MIS_INSEBOOKNO"),
|
||||||
|
PIS_INSTCODE("pisInstcode", "PIS_INSTCODE"),
|
||||||
|
PIN_INVSCODE("pinInvscode", "PIN_INVSCODE"),
|
||||||
|
MIS_INSERANGEFROM("misInserangefrom", "MIS_INSERANGEFROM"),
|
||||||
|
MIS_INSERANGETO("misInserangeto", "MIS_INSERANGETO"),
|
||||||
|
MIS_INSERECVDATE("misInserecvdate", "MIS_INSERECVDATE"),
|
||||||
|
MIS_INSEISSUEACNTDATE("misInseissueacntdate", "MIS_INSEISSUEACNTDATE"),
|
||||||
|
PPM_PYMDCODE("ppmPymdcode","PPM_PYMDCODE"),
|
||||||
|
CRDR_CODE("crdrcode","CRDRCODE"),
|
||||||
|
ACCOUNT_TRA_NO("pcaGlaccodeAc","ACCOUNT_TRANSFER_NO"),
|
||||||
|
MBM_BKMSNUMBER_REF("mbmBkmsnumberRef","MBM_BKMSNUMBER_REF"),
|
||||||
|
PLC_LOCACODE_REF("plcLocacodeRef","PLC_LOCACODE_REF"),
|
||||||
|
MBM_BKMSNUMBER_REF_OPERATIONAL("mbmBkmsnumberRefOperational","MBM_BKMSNUMBER_REF_OPERATIONAL"),
|
||||||
|
DMP_PRODCODE_REF("dmpProdcodeRef","DMP_PRODCODE_REF"),
|
||||||
|
DMP_PRODCODE_REF_OPERATIONAL("dmpProdcodeRefOperational","DMP_PRODCODE_REF_OPERATIONAL"),
|
||||||
|
DMP_PRODGRCEINTEREST("dmpProdgrceinterest","DMP_PRODGRCEINTEREST"),
|
||||||
|
DMP_LNACGRACEPRINCIPLE("dmpLnacgraceprinciple","DMP_LNACGRACEPRINCIPLE"),
|
||||||
|
DMP_LNACGRACEPENALTY("dmpLnacgracepenlaty","DMP_LNACGRACEPENALTY"),
|
||||||
|
DMP_LNACGRACEPENALTY_PERIOD("dmpLnacgracepenlatyPeriod","DMP_LNACGRACEPENALTY_PERIOD"),
|
||||||
|
BLN_RESTRUCTUREPRINCIPALAMT("blnRestructureprincipalamt","BLN_RESTRUCTUREPRINCIPALAMT"),
|
||||||
|
BLA_LNACDISBURSEMENTDATE("bla_lnacdisbursementdate","BLA_LNACDISBURSEMENTDATE"),
|
||||||
|
PROCESS_COMPLETED("processCompleted","processCompleted"),
|
||||||
|
MIS_INSELOST( "MIS_INSELOST", "MIS_INSELOST"),
|
||||||
|
BATCH_USERCODE("@_CREATEUSER", "@_CREATEUSER"),
|
||||||
|
SGT_GNTRCREATEAT("sgtGntrcreateat", "SGT_GNTRCREATEAT"),
|
||||||
|
CMP_ACCOUNT_TITLE_FL("cmpAccountTitleFl","CMP_ACCOUNT_TITLE_FL"),
|
||||||
|
CMP_ACCOUNT_TITLE_LF("cmpAccountTitleLf","CMP_ACCOUNT_TITLE_LF"),
|
||||||
|
BN_CS_IT_IDENTIFIER("bnCsItIdentifier","BN_CS_IT_IDENTIFIER"),
|
||||||
|
CIT_IDENVALUE("citIdenValue","CIT_IDENVALUE"),
|
||||||
|
CIT_IDENVALUE_2("citIdenValue2","CIT_IDENVALUE_2"),
|
||||||
|
CIT_IDENEXPIRYDATE("citIdenexpirydate", "CIT_IDENEXPIRYDATE"),
|
||||||
|
PIT_IDENVALUE("pitIdenvalue", "PIT_IDENVALUE"),
|
||||||
|
PIT_IDENCODE("pitIdenCode","PIT_IDENCODE"),
|
||||||
|
PIT_IDENCODE_2("pitIdenCode2","PIT_IDENCODE_2"),
|
||||||
|
PIT_PRIMARYIDENCODE("pitPrimaryidencode", "PIT_PRIMARYIDENCODE"),
|
||||||
|
PIT_IDENEXPIRYDATE("pitIdenexpirydate", "PIT_IDENEXPIRYDATE"),
|
||||||
|
PED_INSTALLMENT("pedInstallment", "PED_INSTALLMENT"),
|
||||||
|
|
||||||
|
TO_DATE("todate","TO_DATE"),
|
||||||
|
FROM_DATE("fromdate","FROM_DATE"),
|
||||||
|
MBM_BKMSLOANCYCLE("mbmBkmsloancycle","MBM_BKMSLOANCYCLE"),
|
||||||
|
DEBIT_AMOUNT("totalDebitAmount", "totalDebitAmount"),
|
||||||
|
CREDIT_AMOUNT("totalCreditAmount", "totalCreditAmount"),
|
||||||
|
PBD_BANKCODE("pbdBankcode", "PBD_BANKCODE"),
|
||||||
|
PBB_BRANCHCODE("pbbBranchcode", "PBB_BRANCHCODE"),
|
||||||
|
|
||||||
|
|
||||||
|
BTA_AUTOROLLED("BtaAutorolled","BTA_AUTOROLLED"),
|
||||||
|
|
||||||
|
BLN_RESTRUCTUREADDITIONALAMT("blnRestructureadditionalamt","BLN_RESTRUCTUREADDITIONALAMT"),
|
||||||
|
CMP_BLACKLISTED("cmpBlacklisted", "CMP_BLACKLISTED"),
|
||||||
|
CMP_BLOCKED("cmpBlocked","CMP_BLOCKED"),
|
||||||
|
CMP_FREEZED("cmpFreezed","CMP_FREEZED"),
|
||||||
|
CMP_FREEZETYPE("cmpFreezetype","CMP_FREEZETYPE"),
|
||||||
|
BGP_FRACTIONALSCALE("bgpFractionalscale", "BGP_FRACTIONALSCALE"),
|
||||||
|
BGP_BLACKLISTSETUP("bgpBlacklistsetup", "BGP_BLACKLISTSETUP"),
|
||||||
|
BGP_BIOMETRICSETUP("bgpBiometricsetup", "BGP_BIOMETRICSETUP"),
|
||||||
|
BGP_PRIMARYIDENEXPIRYVALIDATION("bgpIdenexpiryvalidation", "BGP_IDENEXPIRYVALIDATION"),
|
||||||
|
PLC_CHARGECALCRATE_ACCOUNT("plcChargecalcrateAccount", "PLC_CHARGECALCRATE_ACCOUNT"),
|
||||||
|
DST_STIERVALUE("dstStiervalueAccount","DST_STIERVALUE"),
|
||||||
|
DST_STIERVALUE_ACCOUNT("dstStiervalue","DST_STIERVALUE_ACCOUNT"),
|
||||||
|
BLA_ASSOCIATENAME("blaAssociatename","BLA_ASSOCIATENAME"),
|
||||||
|
ANR_ACNRCODE("anrAcnrcode", "ANR_ACNRCODE"),
|
||||||
|
BLG_CUSTCODE("blgCustcode", "BLG_CUSTCODE"),
|
||||||
|
BLG_CUSTNAME("blgCustname", "BLG_CUSTNAME"),
|
||||||
|
BLG_LOCACODE("blgLocacode","BLG_LOCACODE"),
|
||||||
|
BDA_LIENREASON("bdaLienreason","BDA_LIENREASON"),
|
||||||
|
PREV_BLOCKAMT("prevBlockedamt","PREV_BLOCKAMT"),
|
||||||
|
BDA_LIENDATE("bdaLiendate","BDA_LIENDATE"),
|
||||||
|
BDA_LIENTIME("bdaLientime","BDA_LIENTIME"),
|
||||||
|
MBM_LOAN_LIEN_ALLOWED("mbmLoanLienAllowed","MBM_LOAN_LIEN_ALLOWED"),
|
||||||
|
MBM_BKMSNUMBER_LOAN_REF("mbmBkmsnumberLoanRef ","MBM_BKMSNUMBER_LOAN_REF"),
|
||||||
|
MBM_BKMSTITLE_LOAN_REF("mbmBkmstitleLoanRef ","MBM_BKMSTITLE_LOAN_REF"),
|
||||||
|
BLA_LNACMATURITYDATE_LOAN_REF("blaLnacmaturitydateLoanRef ","BLA_LNACMATURITYDATE_LOAN_REF"),
|
||||||
|
|
||||||
|
RATE_AMOUNT("rateAmount","RATE_AMOUNT"),
|
||||||
|
|
||||||
|
|
||||||
|
PLC_ALLOWED_LOCA("plcallowedloca","PLC_ALLOWED_LOCA"),
|
||||||
|
PLC_AMOUNTFROM("plcamountfrom","PLC_AMOUNTFROM"),
|
||||||
|
PLC_AMOUNTTO("plcamountto","PLC_AMOUNTTO"),
|
||||||
|
PLC_CHARGECALCRATE_PRODUCT("plcchargecalcrateproduct","PLC_CHARGECALCRATE_PRODUCT"),
|
||||||
|
|
||||||
|
//Online Banking
|
||||||
|
CMP_CUSTPASSWORD("cmpCustpassword","CMP_CUSTPASSWORD"),
|
||||||
|
CMP_CUSTSTATUS("cmpCuststatus", "CMP_CUSTSTATUS"),
|
||||||
|
CMP_CUSTSTATUSDATE("cmpCuststatusdate", "CMP_CUSTSTATUSDATE"),
|
||||||
|
CMP_CUSTLASTLOGIN("cmpCustlastlogin", "CMP_CUSTLASTLOGIN"),
|
||||||
|
PCT_CSTYCODE("pctCstycode", "PCT_CSTYCODE"),
|
||||||
|
CMP_FIRSTNAME("cmpFirstname", "CMP_FIRSTNAME"),
|
||||||
|
CMP_LASTNAME("cmpLastname", "CMP_LASTNAME"),
|
||||||
|
CMP_FATHERNAME("cmpFathername","CMP_FATHERNAME"),
|
||||||
|
CMP_CUSTDATEBIRTH("cmpCustdatebirth", "CMP_CUSTDATEBIRTH"),
|
||||||
|
BLG_IDENCODE("blgIdencode","BLG_IDENCODE"),
|
||||||
|
BLG_IDENVALUE("blgIdenvalue","BLG_IDENVALUE"),
|
||||||
|
CMP_IDENVALUE("cmpIdenvalue", "CMP_IDENVALUE"),
|
||||||
|
CMP_IDENCODE("cmpIdencode", "CMP_IDENCODE"),
|
||||||
|
PAD_ADRSMOBPHONE("padAdrsmobphone", "PAD_ADRSMOBPHONE"),
|
||||||
|
CMP_NAME("cmpName","CMP_NAME"),
|
||||||
|
PAD_ADRSEMAIL("padAdrsemail", "PAD_ADRSEMAIL"),
|
||||||
|
PAD_ADRSCORRESPONDENCE("padAdrscorrespondence", "PAD_ADRSCORRESPONDENCE"),
|
||||||
|
OCB_BENEFICIARYVERIFIED("ocbBeneficiaryverified", "OCB_BENEFICIARYVERIFIED"),
|
||||||
|
OCB_BENEFICIARYVERIFYDATE("ocbBeneficiaryverifydate", "OCB_BENEFICIARYVERIFYDATE"),
|
||||||
|
PRC_CLASSIFICATION("prcClassification", "PRC_CLASSIFICATION"),
|
||||||
|
OTD_TRANSACTIONPOSTED("otdTransactionposted", "OTD_TRANSACTIONPOSTED"),
|
||||||
|
OTD_TRANSACTIONPOSTDATE("otdTransactionpostdate", "OTD_TRANSACTIONPOSTDATE"),
|
||||||
|
OTD_TRANSACTIONID("otdTransactionid", "OTD_TRANSACTIONID"),
|
||||||
|
|
||||||
|
ORGANIZATION("organization", "ORGANIZATION"),
|
||||||
|
LOCATION("location", "LOCATION"),
|
||||||
|
CURRENCY("currency", "CURRENCY"),
|
||||||
|
GLOBALPARAMETER("globalparameter", "GLOBALPARAMETER"),
|
||||||
|
PCA_GLACODE_DEBIT("pcaGlacodeDebit","PCA_GLACODE_DEBIT"),
|
||||||
|
PCA_GLACODE_CREDIT("pcaGlacodeCredit","PCA_GLACODE_CREDIT"),
|
||||||
|
PLC_APPLYACCRUAL("plcApplyaccrual", "PLC_APPLYACCRUAL"),
|
||||||
|
PFS_ACNTSTATUS("pfsAcntstatus","PFS_ACNTSTATUS"),
|
||||||
|
PRO_RLOVTONEWACCOUNT("proRlovtonewaccount", "PRO_RLOVTONEWACCOUNT"),
|
||||||
|
BBS_BATCHSTATUS("bbsBatchstatus", "BBS_BATCHSTATUS"),
|
||||||
|
BBS_BATCHAMT("bbsBatchamt", "BBS_BATCHAMT"),
|
||||||
|
BLA_LNACGRACEPRINCIPLE("blaLnacgraceprinciple","BLA_LNACGRACEPRINCIPLE"),
|
||||||
|
BLA_LNACTOTALDURATION("blaLnactotalduration", "BLA_LNACTOTALDURATION"),
|
||||||
|
BLA_LNACEFFECTIVEDATE("blaLnaceffectivedate","BLA_LNACEFFECTIVEDATE"),
|
||||||
|
BN_MS_LS_LOANSCHEDULE("BN_MS_LS_LOANSCHEDULE","BN_MS_LS_LOANSCHEDULE"),
|
||||||
|
BLC_SERIALNO("blcSerialno", "BLC_SERIALNO"),
|
||||||
|
CMP_CUSTCODE_REF("cmpCustcodeRef", "CMP_CUSTCODE_REF"),
|
||||||
|
SYNC_STATUS("syncStatus", "SYNC_STATUS"),
|
||||||
|
MLS_LNSHINSTTOTAL("mlsLnshinsttotal","MLS_LNSHINSTTOTAL"),
|
||||||
|
SYSTEM_ORGA("SYSTEM_ORGA","SYSTEM_ORGA"),
|
||||||
|
PLC_SUBLOCACODE("plcSublocacode","PLC_SUBLOCACODE"),
|
||||||
|
PLC_SUBLOCADESC("plcSublocadesc","PLC_SUBLOCADESC"),
|
||||||
|
ISC_AUTO_REVERSAL("iscAutoReversal", "ISC_AUTO_REVERSAL"),
|
||||||
|
MBM_NOTIFICATIONSERVICE("mbmNotificationService","MBM_NOTIFICATIONSERVICE"),
|
||||||
|
SERIAL_NO("serialNo" , "SERIAL_NO"),
|
||||||
|
NOTIFICATION_STATUS("notificationStatus", "NOTIFICATION_STATUS"),
|
||||||
|
MESSAGE("Message", "MESSAGE"),
|
||||||
|
SGT_GNTRDRCR("sgtGntrdrcr", "SGT_GNTRDRCR"),
|
||||||
|
PIT_JOINTCUSTCODE("pitJoincustcode", "PIT_JOINTCUSTCODE"),
|
||||||
|
PCO_CTRYCODE("pcoCtrycode","PCO_CTRYCODE"),
|
||||||
|
UDF3("prgntmUdf3","PR_GN_TM_UDF3"),
|
||||||
|
UDF1("prgntmUdf1","PR_GN_TM_UDF1"),
|
||||||
|
UDF4("prgntmUdf4","PR_GN_TM_UDF4"),
|
||||||
|
PFS_ACNTYEAR("pfsAcntyear","PFS_ACNTYEAR"),
|
||||||
|
|
||||||
|
//cdr
|
||||||
|
CDR_REASON("cdrReason","cdr_reason"),
|
||||||
|
LIMIT("limit","LIMIT"),
|
||||||
|
MBM_BKMSFREEZETYPE("mbmBkmsfreezetype", "MBM_BKMSFREEZETYPE"),MBM_BKMSFREEZE("mbmBkmsfreeze","mbm_Bkmsfreeze"),
|
||||||
|
MBM_BKMSCREDITFREEZE("mbmBkmscreditfreeze","MBM_BKMSCREDITFREEZE"),MBM_BKMSDEBITFREEZE("mbmBkmsdebitfreeze","MBM_BKMSDEBITFREEZE"),
|
||||||
|
MBM_REGULATORYRESTRICTION("mbmRegulatoryRestriction","MBM_REGULATORYRESTRICTION"),
|
||||||
|
MBM_ACCBLOCKED("mbmAccblocked","mbm_Accblocked"),
|
||||||
|
CMP_ACCOUNTYPE("cmpAccounttype", "CMP_ACCOUNTTYPE"), MBM_ACTIVITYPOOL("mbmActivitypool", "MBM_ACTIVITYPOOL"),
|
||||||
|
PCT_COLTCATCODE("pctColtcatcode","PCT_COLTCATCODE"), PCT_COLTCODE("pctColtcode","PCT_COLTCODE"),
|
||||||
|
MBM_BKMSZAKATEXEMPTION("mbm_bkmszakatexemption","MBM_BKMSZAKATEXEMPTION"),PRS_RESNCODE("prsResncode","PRS_RESNCODE"),
|
||||||
|
IBAN_COUNTRY("ibanCountry","C"),
|
||||||
|
IBAN_CHECKSUM("ibanChecksum","X"),
|
||||||
|
IBAN_BANK("ibanBank","B"),
|
||||||
|
IBAN_RESERVE("ibanReserve","R"),
|
||||||
|
IBAN_BRANCH("ibanBranch","L"),
|
||||||
|
IBAN_PRODUCT("ibanProduct","P"),
|
||||||
|
IBAN_ACCOUNT("ibanAccount","A"),
|
||||||
|
MBM_BKMSNUMBER_IBAN("mbmBkmsnumberIban","MBM_BKMSNUMBER_IBAN"),
|
||||||
|
MBM_IBANACTIVATION("mbmIbanActivation","MBM_IBANACTIVATION"),
|
||||||
|
|
||||||
|
PRC_ATTORCODE("prcAttorcode", "PRC_ATTORCODE"),
|
||||||
|
PRC_ATTORDESC("pcrAttordesc", "PRC_ATTORDESC"),
|
||||||
|
KYC_RENEWAL_DATE("kycRenewalDate", "KYC_RENEWAL_DATE"),
|
||||||
|
IS_DEDUCTION("isDeduction", "IS_DEDUCTION"),
|
||||||
|
SGT_GNTRUDF3("sgtGntrudf3", "SGT_GNTRUDF3"),
|
||||||
|
KYC_B_RENEWAL_DATE("kycRenewalDate","KYC_B_RENEWAL_DATE"),
|
||||||
|
|
||||||
|
POR_PASSREMINDDAYS("porPassreminddays","POR_PASSREMINDDAYS"),
|
||||||
|
POR_PASSEXPIRYDURATION("porPassexpiryduration","POR_PASSEXPIRYDURATION"),
|
||||||
|
PCT_BACKUPTYPE("pctBackuptype", "PCT_BACKUPTYPE"),
|
||||||
|
|
||||||
|
//national and international blacklist upload for FMFI
|
||||||
|
CMP_FULLNAME("cmpFullname", "CMP_FULLNAME"),
|
||||||
|
CMP_FIRSTNAME_EN("cmpFirstnameEn", "CMP_FIRSTNAME_ENGLISH"),
|
||||||
|
CMP_LASTNAME_EN("cmpLastnameEn", "CMP_LASTNAME_EN"),
|
||||||
|
CMP_FULLNAME_EN("cmpFullnameEn", "CMP_FULLNAME_EN"),
|
||||||
|
CMP_COMPANYNAME_ENG("cmpCompanyEng", "CMP_COMPANYNAME_ENG"),
|
||||||
|
|
||||||
|
ACCOUNT_TYPE("accountType", "ACCOUNT_TYPE"), STATUS_CODE("statusCode", "status_code"), TRANSACTION_NO("tranNo", "TRAN_NO"),
|
||||||
|
|
||||||
|
//for Notification Module
|
||||||
|
PNS_NOTIFTYPE("pnsNotiftype", "PNS_NOTIFTYPE"), PNS_TEMPTCODE("pnsTemptcode", "PNS_TEMPTCODE"), PNS_NOTIFDESC("pnsNotifdesc", "PNS_NOTIFDESC"),
|
||||||
|
PNS_MASKED("pnsMasked", "PNS_MASKED"), PNS_MASKLENGTH("pnsMaskLength", "PNS_MASKLENGTH"),
|
||||||
|
ATTRIBUTES("attributes", "ATTRIBUTES"), PARAMETER_LIST("paramList","PARAM_LIST"), VOUCHER_NO("voucherNo", "VOUCHER_NO"), STATUS("status", "STATUS"),
|
||||||
|
|
||||||
|
// for User Batch
|
||||||
|
CREDIT("CREDIT","CREDIT"),
|
||||||
|
DEBIT("DEBIT","DEBIT"),
|
||||||
|
SGT_GNTRCRDR("SGT_GNTRCRDR","SGT_GNTRCRDR"),
|
||||||
|
|
||||||
|
// BankerCheque
|
||||||
|
BANKCHQREF_NUMBER("bankerChequeRefNo","BANKCHQREF_NUMBER"),BNK_CHQLEAF_NUMBER("bnkChqLeafNumber","BNK_CHQLEAF_NUMBER"),
|
||||||
|
|
||||||
|
//classificationType
|
||||||
|
CLASSIFICATION_TYPE("classificationType","CLASSIFICATION_TYPE"),
|
||||||
|
|
||||||
|
MIRGE("MIRGE","MIRGE"),PENSEMBLE("PENSEMBLE","PENSEMBLE"),
|
||||||
|
FORMAT("RSA","RSA"),
|
||||||
|
MBM_BKMSBALAMOUNT("mbmBkmsbalamount","MBM_BKMSBALAMOUNT"),
|
||||||
|
MBM_BKMSBALDATE("mbmBkmsbaldate","MBM_BKMSBALDATE"),
|
||||||
|
BAL_TYPE("balType", "BAL_TYPE"),
|
||||||
|
LOAN_CYCLE("loanCycle", "LOANCYCLE"),
|
||||||
|
BN_MS_LC_LOANCOMMITTEE("bnMsLcLoanCommitee", "BN_MS_LC_LOANCOMMITTEE"),
|
||||||
|
BLC_VOTES("blcVotes","BLC_VOTES"),
|
||||||
|
APPLICATION_STATUS("applicationStatus","APPLICATION_STATUS"),
|
||||||
|
OLD_CREDIT_COMMITTE("oldCreditcommitee","OLD_CREDITCOMMITEE"),
|
||||||
|
NEW_CREDIT_COMMITTEE("newCreditcommitee","NEW_CREDITCOMMITEE"),
|
||||||
|
|
||||||
|
// Early Closure Account
|
||||||
|
TERMINATE_ACCOUNT("terminateAccount", "EC02"),
|
||||||
|
EARLY_CLOSURE_CHARGE("earlyClosureCharge","107"),
|
||||||
|
TAF_CHARGE("tafCharge","903"),
|
||||||
|
|
||||||
|
DMP_AUTODEPOSITPRODUCT("dmpAutoDepositProduct","DMP_AUTODEPOSITPRODUCT"),
|
||||||
|
MBM_BKMSTITLE_REF("mbmBkmstitleRef","MBM_BKMSTITLE_REF"),
|
||||||
|
ZAKAT_DEDUCTION_DATA("zakatDeductionData", "zakatDeductionData"),
|
||||||
|
CREATE("create","CREATE"),
|
||||||
|
FAILED("failed","FAILED"),
|
||||||
|
RFDEPOSIT("rfDeposit","210"),
|
||||||
|
PFM_FMODCODE_ACNTPOST("pfmFmodcodeAcntpost","PFM_FMODCODE_ACNTPOST"),
|
||||||
|
NEW_NODE_ID("newNodeId","NEW_NODE_ID"),
|
||||||
|
NEW_SGT_GNTRNUMBER("newSgtGntrnumber","NEW_SGT_GNTRNUMBER"),
|
||||||
|
|
||||||
|
// Third Party Enums
|
||||||
|
COMMISSION_AMOUNT("commissionAmount", "COMMISSION_AMOUNT"),
|
||||||
|
TRANSACTION_AMOUNT("tranAmount", "TRANSACTION_AMOUNT"),
|
||||||
|
IDENTIFICATION_NUMBER("idenValue", "IDEN_VALUE"),
|
||||||
|
USERNAME("username", "USERNAME"),
|
||||||
|
SGT_GNTRCREATEUSR("sgtGntrcreateusr", "SGT_GNTRCREATEUSR"),
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
MLS_NEXTINSTALLMENT_DATE("mlsNextinstallmentDate","MLS_NEXTINSTALLMENT_DATE"),
|
||||||
|
SGT_GNTRAMT_DUE("sgtGntramtDue","SGT_GNTRAMT_DUE"),
|
||||||
|
CMP_MIDDLENAME("cmpMiddlename","CMP_MIDDLENAME"),
|
||||||
|
PAD_ADRSDEFAULT("padAdrsdefault","PAD_ADRSDEFAULT"),
|
||||||
|
PST_STREET("pstStreet","PST_STREET"),
|
||||||
|
PBD_BUILDING("pbdBuilding","PBD_BUILDING"),
|
||||||
|
PCT_CITYCODE("pctCitycode","PCT_CITYCODE"),
|
||||||
|
PPV_PROVCODE("ppvProvcode","PPV_PROVCODE"),
|
||||||
|
PCO_CTRYDESC("pcoCtrycode","PCO_CTRYDESC"),
|
||||||
|
PCT_CITYDESC("pctCitydesc","PCT_CITYDESC"),
|
||||||
|
PPV_PROVDESC("ppvProvdesc","PPV_PROVDESC"),
|
||||||
|
|
||||||
|
LIMIT_TYPE("limitType","LIMIT_TYPE"),
|
||||||
|
TRANSACTION_TYPE("transactionType", "TRANSACTION_TYPE"),
|
||||||
|
AGENT("agent", "AGENT")
|
||||||
|
;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
FieldNameConstant(String variableName, String dbFieldName) {
|
||||||
|
this.variableName = variableName;
|
||||||
|
this.dbFieldName = dbFieldName;
|
||||||
|
}
|
||||||
|
|
||||||
|
private final String variableName;
|
||||||
|
private final String dbFieldName;
|
||||||
|
|
||||||
|
public String getVariableName() {
|
||||||
|
return variableName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDbFieldName() {
|
||||||
|
return dbFieldName;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,151 @@
|
|||||||
|
package com.mfsys.common.configuration.constant;
|
||||||
|
|
||||||
|
public interface FieldNameLength {
|
||||||
|
|
||||||
|
String CODE_1 = "VARCHAR(1)";
|
||||||
|
String CODE_2 = "VARCHAR(2)";
|
||||||
|
String CODE_3 = "VARCHAR(3)";
|
||||||
|
String CODE_4 = "VARCHAR(4)";
|
||||||
|
String CODE_5 = "VARCHAR(5)";
|
||||||
|
String CODE_6 = "VARCHAR(60)";
|
||||||
|
String CODE_7 = "VARCHAR(7)";
|
||||||
|
String CODE_10 = "VARCHAR(10)";
|
||||||
|
String CODE_12 = "VARCHAR(12)";
|
||||||
|
String CODE_20 = "VARCHAR(20)";
|
||||||
|
String CODE_25 = "VARCHAR(25)";
|
||||||
|
String CODE_IBAN = "VARCHAR(40)";
|
||||||
|
String CODE_30 = "VARCHAR(30)";
|
||||||
|
String CODE_50 = "VARCHAR(50)";
|
||||||
|
String CODE_100 = "VARCHAR(100)";
|
||||||
|
String CODE_150 = "VARCHAR(150)";
|
||||||
|
String CODE_200 = "VARCHAR(200)";
|
||||||
|
String CODE_500 = "VARCHAR(500)";
|
||||||
|
|
||||||
|
String DESCRIPTION_LONG = "VARCHAR(40)";
|
||||||
|
String DESCRIPTION_SHORT = "VARCHAR(20)";
|
||||||
|
String BOOLEAN_BIT = "TINYINT(1)";
|
||||||
|
String AMOUNT_REAL = "DECIMAL(20,6)";
|
||||||
|
String AMOUNT_INT = "DECIMAL(20,0)";
|
||||||
|
String DECIMAL = "DECIMAL(6,0)";
|
||||||
|
|
||||||
|
String DATE = "DATE";
|
||||||
|
String DATETIME = "DATETIME";
|
||||||
|
String TIMESTAMP = "TIMESTAMP";
|
||||||
|
String TIMESTAMP_NULLABLE = "TIMESTAMP NULL";
|
||||||
|
String PASSWORD = "VARCHAR(50)";
|
||||||
|
|
||||||
|
String BIGINT = "BIGINT";
|
||||||
|
String INT = "INT";
|
||||||
|
String RATE_REAL = "DECIMAL(20,10)";
|
||||||
|
String XML = "TEXT";
|
||||||
|
String TEXT = "TEXT";
|
||||||
|
String DAYS = INT;
|
||||||
|
String TINYINT = "TINYINT";
|
||||||
|
|
||||||
|
String FISCALYEAR = "INT(4)";
|
||||||
|
|
||||||
|
String POR_ORGACODE = CODE_10;
|
||||||
|
String PLC_LOCACODE = CODE_10;
|
||||||
|
String PLC_SUBLOCACODE = CODE_10;
|
||||||
|
String DMP_PRODCODE = CODE_5;
|
||||||
|
String PCA_GLACCODE = CODE_20;
|
||||||
|
String CHANNEL_CODE = CODE_25;
|
||||||
|
|
||||||
|
String PCC_ACTGCODE = CODE_4;
|
||||||
|
String PPC_PRCGCODE = CODE_10;
|
||||||
|
String PLT_LIMTCODE = CODE_3;
|
||||||
|
String PLE_ELMTCODE = CODE_5;
|
||||||
|
String PLE_EXPTPCODE = CODE_10;
|
||||||
|
String NEW_STATUS = CODE_10;
|
||||||
|
String OVER_DUEDAYS = CODE_10;
|
||||||
|
String T_DAY = CODE_10;
|
||||||
|
String UN_DORMANTBY = CODE_10;
|
||||||
|
String UN_DORMANTDATE = CODE_10;
|
||||||
|
String FILE_NAME_LENGTH = CODE_100;
|
||||||
|
|
||||||
|
String PAS_ACSTCODE = CODE_4;
|
||||||
|
String PCR_CURRCODE = CODE_3;
|
||||||
|
String PTR_TRANCODE = CODE_3;
|
||||||
|
String PCH_CHRGCODE = CODE_3;
|
||||||
|
String SGT_GNTRNUMBER = BIGINT;
|
||||||
|
String NODE_ID = CODE_5;
|
||||||
|
String PSP_STYPCODE = CODE_6;
|
||||||
|
String PSA_SACTACCOUNT = PCA_GLACCODE;
|
||||||
|
String PST_SCHTCODE = CODE_6;
|
||||||
|
|
||||||
|
String DEBIT_CREDIT = CODE_2;
|
||||||
|
String LOG_ID = CODE_200;
|
||||||
|
String FIELD_VAL_COMB = CODE_150;
|
||||||
|
String SUS_USERCODE = CODE_25;
|
||||||
|
String ACCOUNT_NUMBER = CODE_20;
|
||||||
|
String ACCOUNT_TITLE = CODE_200;
|
||||||
|
String CUSTOMER_CODE = CODE_20;
|
||||||
|
|
||||||
|
String FILE_PATH = CODE_200;
|
||||||
|
|
||||||
|
String SVH_VCHDCOMBID = CODE_3;
|
||||||
|
String PIT_INSTCODE = CODE_3;
|
||||||
|
String PET_EVENTCODE = INT;
|
||||||
|
|
||||||
|
String PFM_FMODCODE = CODE_2;
|
||||||
|
String PRO_RLOVCODE = CODE_7;
|
||||||
|
|
||||||
|
String PCB_CBLTCODE = CODE_4;
|
||||||
|
String PTM_TMETCODE = CODE_10;
|
||||||
|
String PRT_REQTCODE = CODE_10;
|
||||||
|
String PCT_COLTCODE = CODE_10;
|
||||||
|
String PDT_DOTYCODE = CODE_10;
|
||||||
|
String PDT_DTYPCODE = CODE_10;
|
||||||
|
String PPM_PYMDCODE = CODE_3;
|
||||||
|
|
||||||
|
String PPO_PURPCODE = CODE_30;
|
||||||
|
String ERROR_CODE = CODE_10;
|
||||||
|
String ERROR_DESC = CODE_500;
|
||||||
|
|
||||||
|
String MLSLNSHTYPE = CODE_1;
|
||||||
|
|
||||||
|
String PET_EXRTCODE = CODE_4;
|
||||||
|
String REMARKS = CODE_200;
|
||||||
|
|
||||||
|
String ATTRIBUTE_PATH = CODE_200;
|
||||||
|
|
||||||
|
String STORED_PROCEDURE = CODE_200;
|
||||||
|
String PPF_PRFNCODE = CODE_3;
|
||||||
|
String PPM_PRMSCODE = CODE_3;
|
||||||
|
|
||||||
|
String PCA_GLACDESC = CODE_200;
|
||||||
|
String COMMENTS = CODE_200;
|
||||||
|
String MODULE_ID = CODE_50;
|
||||||
|
String INTERSERVICE_OPERATION = CODE_20; //
|
||||||
|
|
||||||
|
String PHONE_NUM = CODE_20;
|
||||||
|
String FAX_NUM = CODE_20;
|
||||||
|
String EMAIL_ADDRESS = CODE_100;
|
||||||
|
|
||||||
|
String PFS_ACNTYEAR = "YEAR";
|
||||||
|
|
||||||
|
String PIN_LENGTH = TINYINT;
|
||||||
|
String PIN_VALUE = CODE_4;
|
||||||
|
|
||||||
|
String PNT_NOTFCODE = CODE_10;
|
||||||
|
String PCL_CLASSIFICATION = CODE_10;
|
||||||
|
String PCC_CLSSUBJECT = CODE_50;
|
||||||
|
String SCL_SUBCLSCODE = CODE_10;
|
||||||
|
String PCC_CLSMESSAGE = CODE_500;
|
||||||
|
String MESSAGE_PARAMS = CODE_100;
|
||||||
|
|
||||||
|
String GCD_DENUMCODE = CODE_10;
|
||||||
|
String PCT_CSTYCODE = CODE_1;
|
||||||
|
|
||||||
|
String PCD_CORDCODE = CODE_50;
|
||||||
|
String MIT_INSTCODE = CODE_3;
|
||||||
|
String MIS_INSEBOOKNO = INT;
|
||||||
|
String PIS_INSTCODE = CODE_1;
|
||||||
|
String PIN_INVSCODE = CODE_2;
|
||||||
|
String SGT_GNTRINSTRUMENTNO = CODE_10;
|
||||||
|
String PIS_INSTLEAFSTATUS = CODE_3;
|
||||||
|
String PRT_RESNCODE = CODE_5;
|
||||||
|
String GCC_COSTCENTERID = CODE_4;
|
||||||
|
String GCC_DESCRIPTION = DESCRIPTION_SHORT;
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,10 @@
|
|||||||
|
package com.mfsys.common.configuration.constant;
|
||||||
|
|
||||||
|
public interface FilterPriority {
|
||||||
|
|
||||||
|
int CORS = 1;
|
||||||
|
int LOGGING = 2;
|
||||||
|
int AUTHENTICATION = 3;
|
||||||
|
int SUBSCRIPTION = 4;
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,5 @@
|
|||||||
|
package com.mfsys.common.configuration.constant;
|
||||||
|
|
||||||
|
public interface LoggerURI {
|
||||||
|
String GET_LOGS_BY_DATES = "/logs/getByDate";
|
||||||
|
}
|
||||||
@ -0,0 +1,5 @@
|
|||||||
|
package com.mfsys.common.configuration.constant;
|
||||||
|
|
||||||
|
public interface PropertyConstant {
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,39 @@
|
|||||||
|
package com.mfsys.common.configuration.constant;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface TokenBypassURI {
|
||||||
|
List<String> URIs = new ArrayList<String>(Arrays.asList(
|
||||||
|
"/aconnect/authentication/login",
|
||||||
|
"/aconnect/authentication/signup",
|
||||||
|
"/aconnect/signin",
|
||||||
|
|
||||||
|
"/aconnect/transactions/accounttogl",
|
||||||
|
"/aconnect/account/miscDetails",
|
||||||
|
"/deposit/account/miscDetails",
|
||||||
|
"/aconnect/account/getAccountDetails",
|
||||||
|
"/aconnect/transactions/gltogls",
|
||||||
|
"/aconnect/transactions/accounttoaccount",
|
||||||
|
"/aconnect/transactions/gl-account",
|
||||||
|
"/aconnect/deposit/authorizations",
|
||||||
|
"/aconnect/generalledger/authorizations",
|
||||||
|
"/aconnect/deposit/authorizations",
|
||||||
|
"/aconnect/crm/individual/create",
|
||||||
|
"/aconnect/crm/business/create",
|
||||||
|
"/aconnect/deposit/individual/create",
|
||||||
|
"/aconnect/deposit/individual/approval",
|
||||||
|
"/aconnect/deposit/business/create",
|
||||||
|
"/aconnect/loan/individual/create",
|
||||||
|
"/aconnect/deposit/transactions/cancel",
|
||||||
|
"/aconnect/generalledger/transactions/cancel",
|
||||||
|
|
||||||
|
"/aconnect/deposit/transactions/reversal",
|
||||||
|
"/aconnect/generalledger/transactions/reversal",
|
||||||
|
|
||||||
|
"/aconnect/deposit/transactions/rejection",
|
||||||
|
"/aconnect/generalledger/transactions/rejection"
|
||||||
|
|
||||||
|
));
|
||||||
|
}
|
||||||
@ -0,0 +1,31 @@
|
|||||||
|
package com.mfsys.common.configuration.controller;
|
||||||
|
|
||||||
|
import com.mfsys.common.configuration.constant.LoggerURI;
|
||||||
|
import com.mfsys.common.configuration.model.Logger;
|
||||||
|
import com.mfsys.common.configuration.service.LoggerService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
public class LoggerController {
|
||||||
|
LoggerService loggerService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
LoggerController(LoggerService loggerService) {
|
||||||
|
this.loggerService = loggerService;
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping(LoggerURI.GET_LOGS_BY_DATES)
|
||||||
|
public List<Logger> findLogsBetweenDates(
|
||||||
|
@RequestParam @DateTimeFormat(pattern = "dd-MM-yyyy") LocalDate fromDate,
|
||||||
|
@RequestParam @DateTimeFormat(pattern = "dd-MM-yyyy") LocalDate toDate) {
|
||||||
|
return loggerService.findLogsBetweenDates(fromDate, toDate);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue