Browse Source

birth service initial commit

master
hariprakash 2 years ago
commit
11c6681d45
  1. 33
      .gitignore
  2. 19
      .mvn/wrapper/maven-wrapper.properties
  3. 259
      mvnw
  4. 149
      mvnw.cmd
  5. 122
      pom.xml
  6. 13
      src/main/java/com/crs_birth_service/Controller/BirthServiceController.java
  7. 15
      src/main/java/com/crs_birth_service/CrsBirthServiceApplication.java
  8. 629
      src/main/java/com/crs_birth_service/Entity/BirthDetails.java
  9. 649
      src/main/java/com/crs_birth_service/Entity/BirthParentAddress.java
  10. 285
      src/main/java/com/crs_birth_service/Entity/BirthParentsInformation.java
  11. 24
      src/main/java/com/crs_birth_service/Entity/NewRegister.java
  12. 15
      src/main/java/com/crs_birth_service/Repository/BirthDetailsRepository.java
  13. 7
      src/main/java/com/crs_birth_service/Repository/BirthParentAddressRepository.java
  14. 7
      src/main/java/com/crs_birth_service/Repository/BirthParentsInformationRepository.java
  15. 338
      src/main/java/com/crs_birth_service/Service/BirthConsumer.java
  16. 62
      src/main/java/com/crs_birth_service/Service/ByteArrayMultipartFile.java
  17. 57
      src/main/java/com/crs_birth_service/config/ClientCall.java
  18. 44
      src/main/java/com/crs_birth_service/config/KafkaListenerConfig.java
  19. 60
      src/main/java/com/crs_birth_service/config/Listeners.java
  20. 1420
      src/main/java/com/crs_birth_service/dto/BirthDetailsDto.java
  21. 54
      src/main/java/com/crs_birth_service/dto/DtoforBirthConsum.java
  22. 30
      src/main/java/com/crs_birth_service/exception/GlobalExceptionHandler.java
  23. 16
      src/main/java/com/crs_birth_service/fileUtil/FileService.java
  24. 18
      src/main/resources/application.properties
  25. 13
      src/test/java/com/crs_birth_service/CrsBirthServiceApplicationTests.java

33
.gitignore

@ -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/

19
.mvn/wrapper/maven-wrapper.properties

@ -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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
wrapperVersion=3.3.2
distributionType=only-script
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.7/apache-maven-3.9.7-bin.zip

259
mvnw

@ -0,0 +1,259 @@
#!/bin/sh
# ----------------------------------------------------------------------------
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
# ----------------------------------------------------------------------------
# ----------------------------------------------------------------------------
# Apache Maven Wrapper startup batch script, version 3.3.2
#
# Optional ENV vars
# -----------------
# JAVA_HOME - location of a JDK home dir, required when download maven via java source
# MVNW_REPOURL - repo url base for downloading maven distribution
# MVNW_USERNAME/MVNW_PASSWORD - user and password for downloading maven
# MVNW_VERBOSE - true: enable verbose log; debug: trace the mvnw script; others: silence the output
# ----------------------------------------------------------------------------
set -euf
[ "${MVNW_VERBOSE-}" != debug ] || set -x
# OS specific support.
native_path() { printf %s\\n "$1"; }
case "$(uname)" in
CYGWIN* | MINGW*)
[ -z "${JAVA_HOME-}" ] || JAVA_HOME="$(cygpath --unix "$JAVA_HOME")"
native_path() { cygpath --path --windows "$1"; }
;;
esac
# set JAVACMD and JAVACCMD
set_java_home() {
# For Cygwin and MinGW, ensure paths are in Unix format before anything is touched
if [ -n "${JAVA_HOME-}" ]; then
if [ -x "$JAVA_HOME/jre/sh/java" ]; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
JAVACCMD="$JAVA_HOME/jre/sh/javac"
else
JAVACMD="$JAVA_HOME/bin/java"
JAVACCMD="$JAVA_HOME/bin/javac"
if [ ! -x "$JAVACMD" ] || [ ! -x "$JAVACCMD" ]; then
echo "The JAVA_HOME environment variable is not defined correctly, so mvnw cannot run." >&2
echo "JAVA_HOME is set to \"$JAVA_HOME\", but \"\$JAVA_HOME/bin/java\" or \"\$JAVA_HOME/bin/javac\" does not exist." >&2
return 1
fi
fi
else
JAVACMD="$(
'set' +e
'unset' -f command 2>/dev/null
'command' -v java
)" || :
JAVACCMD="$(
'set' +e
'unset' -f command 2>/dev/null
'command' -v javac
)" || :
if [ ! -x "${JAVACMD-}" ] || [ ! -x "${JAVACCMD-}" ]; then
echo "The java/javac command does not exist in PATH nor is JAVA_HOME set, so mvnw cannot run." >&2
return 1
fi
fi
}
# hash string like Java String::hashCode
hash_string() {
str="${1:-}" h=0
while [ -n "$str" ]; do
char="${str%"${str#?}"}"
h=$(((h * 31 + $(LC_CTYPE=C printf %d "'$char")) % 4294967296))
str="${str#?}"
done
printf %x\\n $h
}
verbose() { :; }
[ "${MVNW_VERBOSE-}" != true ] || verbose() { printf %s\\n "${1-}"; }
die() {
printf %s\\n "$1" >&2
exit 1
}
trim() {
# MWRAPPER-139:
# Trims trailing and leading whitespace, carriage returns, tabs, and linefeeds.
# Needed for removing poorly interpreted newline sequences when running in more
# exotic environments such as mingw bash on Windows.
printf "%s" "${1}" | tr -d '[:space:]'
}
# parse distributionUrl and optional distributionSha256Sum, requires .mvn/wrapper/maven-wrapper.properties
while IFS="=" read -r key value; do
case "${key-}" in
distributionUrl) distributionUrl=$(trim "${value-}") ;;
distributionSha256Sum) distributionSha256Sum=$(trim "${value-}") ;;
esac
done <"${0%/*}/.mvn/wrapper/maven-wrapper.properties"
[ -n "${distributionUrl-}" ] || die "cannot read distributionUrl property in ${0%/*}/.mvn/wrapper/maven-wrapper.properties"
case "${distributionUrl##*/}" in
maven-mvnd-*bin.*)
MVN_CMD=mvnd.sh _MVNW_REPO_PATTERN=/maven/mvnd/
case "${PROCESSOR_ARCHITECTURE-}${PROCESSOR_ARCHITEW6432-}:$(uname -a)" in
*AMD64:CYGWIN* | *AMD64:MINGW*) distributionPlatform=windows-amd64 ;;
:Darwin*x86_64) distributionPlatform=darwin-amd64 ;;
:Darwin*arm64) distributionPlatform=darwin-aarch64 ;;
:Linux*x86_64*) distributionPlatform=linux-amd64 ;;
*)
echo "Cannot detect native platform for mvnd on $(uname)-$(uname -m), use pure java version" >&2
distributionPlatform=linux-amd64
;;
esac
distributionUrl="${distributionUrl%-bin.*}-$distributionPlatform.zip"
;;
maven-mvnd-*) MVN_CMD=mvnd.sh _MVNW_REPO_PATTERN=/maven/mvnd/ ;;
*) MVN_CMD="mvn${0##*/mvnw}" _MVNW_REPO_PATTERN=/org/apache/maven/ ;;
esac
# apply MVNW_REPOURL and calculate MAVEN_HOME
# maven home pattern: ~/.m2/wrapper/dists/{apache-maven-<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 "$@"

149
mvnw.cmd

@ -0,0 +1,149 @@
<# : batch portion
@REM ----------------------------------------------------------------------------
@REM Licensed to the Apache Software Foundation (ASF) under one
@REM or more contributor license agreements. See the NOTICE file
@REM distributed with this work for additional information
@REM regarding copyright ownership. The ASF licenses this file
@REM to you under the Apache License, Version 2.0 (the
@REM "License"); you may not use this file except in compliance
@REM with the License. You may obtain a copy of the License at
@REM
@REM https://www.apache.org/licenses/LICENSE-2.0
@REM
@REM Unless required by applicable law or agreed to in writing,
@REM software distributed under the License is distributed on an
@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@REM KIND, either express or implied. See the License for the
@REM specific language governing permissions and limitations
@REM under the License.
@REM ----------------------------------------------------------------------------
@REM ----------------------------------------------------------------------------
@REM Apache Maven Wrapper startup batch script, version 3.3.2
@REM
@REM Optional ENV vars
@REM MVNW_REPOURL - repo url base for downloading maven distribution
@REM MVNW_USERNAME/MVNW_PASSWORD - user and password for downloading maven
@REM MVNW_VERBOSE - true: enable verbose log; others: silence the output
@REM ----------------------------------------------------------------------------
@IF "%__MVNW_ARG0_NAME__%"=="" (SET __MVNW_ARG0_NAME__=%~nx0)
@SET __MVNW_CMD__=
@SET __MVNW_ERROR__=
@SET __MVNW_PSMODULEP_SAVE=%PSModulePath%
@SET PSModulePath=
@FOR /F "usebackq tokens=1* delims==" %%A IN (`powershell -noprofile "& {$scriptDir='%~dp0'; $script='%__MVNW_ARG0_NAME__%'; icm -ScriptBlock ([Scriptblock]::Create((Get-Content -Raw '%~f0'))) -NoNewScope}"`) DO @(
IF "%%A"=="MVN_CMD" (set __MVNW_CMD__=%%B) ELSE IF "%%B"=="" (echo %%A) ELSE (echo %%A=%%B)
)
@SET PSModulePath=%__MVNW_PSMODULEP_SAVE%
@SET __MVNW_PSMODULEP_SAVE=
@SET __MVNW_ARG0_NAME__=
@SET MVNW_USERNAME=
@SET MVNW_PASSWORD=
@IF NOT "%__MVNW_CMD__%"=="" (%__MVNW_CMD__% %*)
@echo Cannot start maven from wrapper >&2 && exit /b 1
@GOTO :EOF
: end batch / begin powershell #>
$ErrorActionPreference = "Stop"
if ($env:MVNW_VERBOSE -eq "true") {
$VerbosePreference = "Continue"
}
# calculate distributionUrl, requires .mvn/wrapper/maven-wrapper.properties
$distributionUrl = (Get-Content -Raw "$scriptDir/.mvn/wrapper/maven-wrapper.properties" | ConvertFrom-StringData).distributionUrl
if (!$distributionUrl) {
Write-Error "cannot read distributionUrl property in $scriptDir/.mvn/wrapper/maven-wrapper.properties"
}
switch -wildcard -casesensitive ( $($distributionUrl -replace '^.*/','') ) {
"maven-mvnd-*" {
$USE_MVND = $true
$distributionUrl = $distributionUrl -replace '-bin\.[^.]*$',"-windows-amd64.zip"
$MVN_CMD = "mvnd.cmd"
break
}
default {
$USE_MVND = $false
$MVN_CMD = $script -replace '^mvnw','mvn'
break
}
}
# apply MVNW_REPOURL and calculate MAVEN_HOME
# maven home pattern: ~/.m2/wrapper/dists/{apache-maven-<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"

122
pom.xml

@ -0,0 +1,122 @@
<?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>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.3.1</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com</groupId>
<artifactId>crs_birth_service</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>crs_birth_service</name>
<description>crs birth service</description>
<url/>
<licenses>
<license/>
</licenses>
<developers>
<developer/>
</developers>
<scm>
<connection/>
<developerConnection/>
<tag/>
<url/>
</scm>
<properties>
<java.version>17</java.version>
<spring-cloud.version>2023.0.3</spring-cloud.version>
</properties>
<dependencies>
<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.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-openfeign</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web-services</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-webflux</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.kafka</groupId>
<artifactId>spring-kafka</artifactId>
</dependency>
<dependency>
<groupId>com.mysql</groupId>
<artifactId>mysql-connector-j</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
</dependency>
<dependency>
<groupId>io.projectreactor</groupId>
<artifactId>reactor-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.kafka</groupId>
<artifactId>spring-kafka-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>${spring-cloud.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<excludes>
<exclude>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
</build>
</project>

13
src/main/java/com/crs_birth_service/Controller/BirthServiceController.java

@ -0,0 +1,13 @@
package com.crs_birth_service.Controller;
import org.springframework.web.bind.annotation.*;
@RestController
@RequestMapping("/BirthService")
public class BirthServiceController {
@GetMapping("/test")
public String getTest(@PathVariable String uuid){
return "Sucess";
}
}

15
src/main/java/com/crs_birth_service/CrsBirthServiceApplication.java

@ -0,0 +1,15 @@
package com.crs_birth_service;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.openfeign.EnableFeignClients;
@SpringBootApplication
@EnableFeignClients
public class CrsBirthServiceApplication {
public static void main(String[] args) {
SpringApplication.run(CrsBirthServiceApplication.class, args);
}
}

629
src/main/java/com/crs_birth_service/Entity/BirthDetails.java

@ -0,0 +1,629 @@
package com.crs_birth_service.Entity;
import jakarta.persistence.*;
import lombok.*;
import java.util.Date;
@Entity
@Builder
//@Getter
//@Setter
//@NoArgsConstructor
//@AllArgsConstructor
public class BirthDetails {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private int Birth_id;
private Date Reporting_Date;
private String PICME_No;
private String Pre_Register_No;
// -------------------PICME Pre - register:
private String PICME_Applicant_Name;
private String PICME_Building_door_flat_no;
private String PICME_Street;
private String PICME_Area;
private String PICME_District;
private String PICME_Block;
private String PICME_Village;
private int PICME_Pincode;
private long PICME_Mobile_number;
//////////////////////////////
private Date Child_Birth_Date;
private String Gender;
private String Child_Name_English;
private String Child_Name_Tamil;
private String Aadhar_number;
//------------------------Birth Place Information:
//---------------Hospital
private String Hospital_name;
private String Hospital_Address_Line1_English;
private String Hospital_Address_Line2_English;
private String Hospital_Address_Line3_English;
private String Hospital_Address_Line1_Tamil;
private String Hospital_Address_Line2_Tamil;
private String Hospital_Address_Line3_Tamil;
private int Hospital_pincode;
//------------Home
private String Home_Address_Line1_English;
private String Home_Address_Line2_English;
private String Home_Address_Line3_English;
private String Home_Address_Line1_Tamil;
private String Home_Address_Line2_Tamil;
private String Home_Address_Line3_Tamil;
private int Home_pincode;
//----------------Other
private String Other_Option;
private String Other_Address_Line1_English;
private String Other_Address_Line2_English;
private String Other_Address_Line3_English;
private String Other_Address_Line1_Tamil;
private String Other_Address_Line2_Tamil;
private String Other_Address_Line3_Tamil;
private int Other_pincode;
//------------------Informers Information:
private String Informer_name;
private String Informer_Address_Line1_English;
private String Informer_Address_Line2_English;
private String Informer_Address_Line1_Tamil;
private String Informer_Address_Line2_Tamil;
private int Informer_pincode;
//-------------------Residence info of mother:
private String Mother_State;
private String Mother_District;
private String Mother_Sub_District;
private String Mother_Town_Village;
private String Mother_Name_of_Town_English;
private String Mother_Name_of_Town_Tamil;
//--------------------Reporting Form:
private String Upload_reporting_Form;
private String uuid;
// @OneToOne(fetch = FetchType.EAGER ,mappedBy = "birthDetails", cascade = CascadeType.ALL)
//@JoinColumn(name = "Parent_Id")
@OneToOne(fetch = FetchType.LAZY ,cascade = CascadeType.ALL)
@JoinColumn(name = "Parent_Id")
private BirthParentsInformation birthParentsInformation;
// @OneToOne(cascade = CascadeType.ALL)
@OneToOne(fetch = FetchType.LAZY ,cascade = CascadeType.ALL)
@JoinColumn(name = "Address_Id")
private BirthParentAddress birthParentAddress;
public int getBirth_id() {
return Birth_id;
}
public void setBirth_id(int birth_id) {
Birth_id = birth_id;
}
public Date getReporting_Date() {
return Reporting_Date;
}
public void setReporting_Date(Date reporting_Date) {
Reporting_Date = reporting_Date;
}
public String getPICME_No() {
return PICME_No;
}
public void setPICME_No(String PICME_No) {
this.PICME_No = PICME_No;
}
public String getPre_Register_No() {
return Pre_Register_No;
}
public void setPre_Register_No(String pre_Register_No) {
Pre_Register_No = pre_Register_No;
}
public String getPICME_Applicant_Name() {
return PICME_Applicant_Name;
}
public void setPICME_Applicant_Name(String PICME_Applicant_Name) {
this.PICME_Applicant_Name = PICME_Applicant_Name;
}
public String getPICME_Building_door_flat_no() {
return PICME_Building_door_flat_no;
}
public void setPICME_Building_door_flat_no(String PICME_Building_door_flat_no) {
this.PICME_Building_door_flat_no = PICME_Building_door_flat_no;
}
public String getPICME_Street() {
return PICME_Street;
}
public void setPICME_Street(String PICME_Street) {
this.PICME_Street = PICME_Street;
}
public String getPICME_Area() {
return PICME_Area;
}
public void setPICME_Area(String PICME_Area) {
this.PICME_Area = PICME_Area;
}
public String getPICME_District() {
return PICME_District;
}
public void setPICME_District(String PICME_District) {
this.PICME_District = PICME_District;
}
public String getPICME_Block() {
return PICME_Block;
}
public void setPICME_Block(String PICME_Block) {
this.PICME_Block = PICME_Block;
}
public String getPICME_Village() {
return PICME_Village;
}
public void setPICME_Village(String PICME_Village) {
this.PICME_Village = PICME_Village;
}
public int getPICME_Pincode() {
return PICME_Pincode;
}
public void setPICME_Pincode(int PICME_Pincode) {
this.PICME_Pincode = PICME_Pincode;
}
public long getPICME_Mobile_number() {
return PICME_Mobile_number;
}
public void setPICME_Mobile_number(long PICME_Mobile_number) {
this.PICME_Mobile_number = PICME_Mobile_number;
}
public Date getChild_Birth_Date() {
return Child_Birth_Date;
}
public void setChild_Birth_Date(Date child_Birth_Date) {
Child_Birth_Date = child_Birth_Date;
}
public String getGender() {
return Gender;
}
public void setGender(String gender) {
Gender = gender;
}
public String getChild_Name_English() {
return Child_Name_English;
}
public void setChild_Name_English(String child_Name_English) {
Child_Name_English = child_Name_English;
}
public String getChild_Name_Tamil() {
return Child_Name_Tamil;
}
public void setChild_Name_Tamil(String child_Name_Tamil) {
Child_Name_Tamil = child_Name_Tamil;
}
public String getAadhar_number() {
return Aadhar_number;
}
public void setAadhar_number(String aadhar_number) {
Aadhar_number = aadhar_number;
}
public String getHospital_name() {
return Hospital_name;
}
public void setHospital_name(String hospital_name) {
Hospital_name = hospital_name;
}
public String getHospital_Address_Line1_English() {
return Hospital_Address_Line1_English;
}
public void setHospital_Address_Line1_English(String hospital_Address_Line1_English) {
Hospital_Address_Line1_English = hospital_Address_Line1_English;
}
public String getHospital_Address_Line2_English() {
return Hospital_Address_Line2_English;
}
public void setHospital_Address_Line2_English(String hospital_Address_Line2_English) {
Hospital_Address_Line2_English = hospital_Address_Line2_English;
}
public String getHospital_Address_Line3_English() {
return Hospital_Address_Line3_English;
}
public void setHospital_Address_Line3_English(String hospital_Address_Line3_English) {
Hospital_Address_Line3_English = hospital_Address_Line3_English;
}
public String getHospital_Address_Line1_Tamil() {
return Hospital_Address_Line1_Tamil;
}
public void setHospital_Address_Line1_Tamil(String hospital_Address_Line1_Tamil) {
Hospital_Address_Line1_Tamil = hospital_Address_Line1_Tamil;
}
public String getHospital_Address_Line2_Tamil() {
return Hospital_Address_Line2_Tamil;
}
public void setHospital_Address_Line2_Tamil(String hospital_Address_Line2_Tamil) {
Hospital_Address_Line2_Tamil = hospital_Address_Line2_Tamil;
}
public String getHospital_Address_Line3_Tamil() {
return Hospital_Address_Line3_Tamil;
}
public void setHospital_Address_Line3_Tamil(String hospital_Address_Line3_Tamil) {
Hospital_Address_Line3_Tamil = hospital_Address_Line3_Tamil;
}
public int getHospital_pincode() {
return Hospital_pincode;
}
public void setHospital_pincode(int hospital_pincode) {
Hospital_pincode = hospital_pincode;
}
public String getHome_Address_Line1_English() {
return Home_Address_Line1_English;
}
public void setHome_Address_Line1_English(String home_Address_Line1_English) {
Home_Address_Line1_English = home_Address_Line1_English;
}
public String getHome_Address_Line2_English() {
return Home_Address_Line2_English;
}
public void setHome_Address_Line2_English(String home_Address_Line2_English) {
Home_Address_Line2_English = home_Address_Line2_English;
}
public String getHome_Address_Line3_English() {
return Home_Address_Line3_English;
}
public void setHome_Address_Line3_English(String home_Address_Line3_English) {
Home_Address_Line3_English = home_Address_Line3_English;
}
public String getHome_Address_Line1_Tamil() {
return Home_Address_Line1_Tamil;
}
public void setHome_Address_Line1_Tamil(String home_Address_Line1_Tamil) {
Home_Address_Line1_Tamil = home_Address_Line1_Tamil;
}
public String getHome_Address_Line2_Tamil() {
return Home_Address_Line2_Tamil;
}
public void setHome_Address_Line2_Tamil(String home_Address_Line2_Tamil) {
Home_Address_Line2_Tamil = home_Address_Line2_Tamil;
}
public String getHome_Address_Line3_Tamil() {
return Home_Address_Line3_Tamil;
}
public void setHome_Address_Line3_Tamil(String home_Address_Line3_Tamil) {
Home_Address_Line3_Tamil = home_Address_Line3_Tamil;
}
public int getHome_pincode() {
return Home_pincode;
}
public void setHome_pincode(int home_pincode) {
Home_pincode = home_pincode;
}
public String getOther_Option() {
return Other_Option;
}
public void setOther_Option(String other_Option) {
Other_Option = other_Option;
}
public String getOther_Address_Line1_English() {
return Other_Address_Line1_English;
}
public void setOther_Address_Line1_English(String other_Address_Line1_English) {
Other_Address_Line1_English = other_Address_Line1_English;
}
public String getOther_Address_Line2_English() {
return Other_Address_Line2_English;
}
public void setOther_Address_Line2_English(String other_Address_Line2_English) {
Other_Address_Line2_English = other_Address_Line2_English;
}
public String getOther_Address_Line3_English() {
return Other_Address_Line3_English;
}
public void setOther_Address_Line3_English(String other_Address_Line3_English) {
Other_Address_Line3_English = other_Address_Line3_English;
}
public String getOther_Address_Line1_Tamil() {
return Other_Address_Line1_Tamil;
}
public void setOther_Address_Line1_Tamil(String other_Address_Line1_Tamil) {
Other_Address_Line1_Tamil = other_Address_Line1_Tamil;
}
public String getOther_Address_Line2_Tamil() {
return Other_Address_Line2_Tamil;
}
public void setOther_Address_Line2_Tamil(String other_Address_Line2_Tamil) {
Other_Address_Line2_Tamil = other_Address_Line2_Tamil;
}
public String getOther_Address_Line3_Tamil() {
return Other_Address_Line3_Tamil;
}
public void setOther_Address_Line3_Tamil(String other_Address_Line3_Tamil) {
Other_Address_Line3_Tamil = other_Address_Line3_Tamil;
}
public int getOther_pincode() {
return Other_pincode;
}
public void setOther_pincode(int other_pincode) {
Other_pincode = other_pincode;
}
public String getInformer_name() {
return Informer_name;
}
public void setInformer_name(String informer_name) {
Informer_name = informer_name;
}
public String getInformer_Address_Line1_English() {
return Informer_Address_Line1_English;
}
public void setInformer_Address_Line1_English(String informer_Address_Line1_English) {
Informer_Address_Line1_English = informer_Address_Line1_English;
}
public String getInformer_Address_Line2_English() {
return Informer_Address_Line2_English;
}
public void setInformer_Address_Line2_English(String informer_Address_Line2_English) {
Informer_Address_Line2_English = informer_Address_Line2_English;
}
public String getInformer_Address_Line1_Tamil() {
return Informer_Address_Line1_Tamil;
}
public void setInformer_Address_Line1_Tamil(String informer_Address_Line1_Tamil) {
Informer_Address_Line1_Tamil = informer_Address_Line1_Tamil;
}
public String getInformer_Address_Line2_Tamil() {
return Informer_Address_Line2_Tamil;
}
public void setInformer_Address_Line2_Tamil(String informer_Address_Line2_Tamil) {
Informer_Address_Line2_Tamil = informer_Address_Line2_Tamil;
}
public int getInformer_pincode() {
return Informer_pincode;
}
public void setInformer_pincode(int informer_pincode) {
Informer_pincode = informer_pincode;
}
public String getMother_State() {
return Mother_State;
}
public void setMother_State(String mother_State) {
Mother_State = mother_State;
}
public String getMother_District() {
return Mother_District;
}
public void setMother_District(String mother_District) {
Mother_District = mother_District;
}
public String getMother_Sub_District() {
return Mother_Sub_District;
}
public void setMother_Sub_District(String mother_Sub_District) {
Mother_Sub_District = mother_Sub_District;
}
public String getMother_Town_Village() {
return Mother_Town_Village;
}
public void setMother_Town_Village(String mother_Town_Village) {
Mother_Town_Village = mother_Town_Village;
}
public String getMother_Name_of_Town_English() {
return Mother_Name_of_Town_English;
}
public void setMother_Name_of_Town_English(String mother_Name_of_Town_English) {
Mother_Name_of_Town_English = mother_Name_of_Town_English;
}
public String getMother_Name_of_Town_Tamil() {
return Mother_Name_of_Town_Tamil;
}
public void setMother_Name_of_Town_Tamil(String mother_Name_of_Town_Tamil) {
Mother_Name_of_Town_Tamil = mother_Name_of_Town_Tamil;
}
public String getUpload_reporting_Form() {
return Upload_reporting_Form;
}
public void setUpload_reporting_Form(String upload_reporting_Form) {
Upload_reporting_Form = upload_reporting_Form;
}
public BirthParentsInformation getBirthParentsInformation() {
return birthParentsInformation;
}
public void setBirthParentsInformation(BirthParentsInformation birthParentsInformation) {
this.birthParentsInformation = birthParentsInformation;
}
public BirthParentAddress getBirthParentAddress() {
return birthParentAddress;
}
public void setBirthParentAddress(BirthParentAddress birthParentAddress) {
this.birthParentAddress = birthParentAddress;
}
public String getUuid() {
return uuid;
}
public void setUuid(String uuid) {
this.uuid = uuid;
}
public BirthDetails() {
}
public BirthDetails(int birth_id, Date reporting_Date, String PICME_No, String pre_Register_No, String PICME_Applicant_Name, String PICME_Building_door_flat_no, String PICME_Street, String PICME_Area, String PICME_District, String PICME_Block, String PICME_Village, int PICME_Pincode, long PICME_Mobile_number, Date child_Birth_Date, String gender, String child_Name_English, String child_Name_Tamil, String aadhar_number, String hospital_name, String hospital_Address_Line1_English, String hospital_Address_Line2_English, String hospital_Address_Line3_English, String hospital_Address_Line1_Tamil, String hospital_Address_Line2_Tamil, String hospital_Address_Line3_Tamil, int hospital_pincode, String home_Address_Line1_English, String home_Address_Line2_English, String home_Address_Line3_English, String home_Address_Line1_Tamil, String home_Address_Line2_Tamil, String home_Address_Line3_Tamil, int home_pincode, String other_Option, String other_Address_Line1_English, String other_Address_Line2_English, String other_Address_Line3_English, String other_Address_Line1_Tamil, String other_Address_Line2_Tamil, String other_Address_Line3_Tamil, int other_pincode, String informer_name, String informer_Address_Line1_English, String informer_Address_Line2_English, String informer_Address_Line1_Tamil, String informer_Address_Line2_Tamil, int informer_pincode, String mother_State, String mother_District, String mother_Sub_District, String mother_Town_Village, String mother_Name_of_Town_English, String mother_Name_of_Town_Tamil, String upload_reporting_Form, String uuid, BirthParentsInformation birthParentsInformation, BirthParentAddress birthParentAddress) {
Birth_id = birth_id;
Reporting_Date = reporting_Date;
this.PICME_No = PICME_No;
Pre_Register_No = pre_Register_No;
this.PICME_Applicant_Name = PICME_Applicant_Name;
this.PICME_Building_door_flat_no = PICME_Building_door_flat_no;
this.PICME_Street = PICME_Street;
this.PICME_Area = PICME_Area;
this.PICME_District = PICME_District;
this.PICME_Block = PICME_Block;
this.PICME_Village = PICME_Village;
this.PICME_Pincode = PICME_Pincode;
this.PICME_Mobile_number = PICME_Mobile_number;
Child_Birth_Date = child_Birth_Date;
Gender = gender;
Child_Name_English = child_Name_English;
Child_Name_Tamil = child_Name_Tamil;
Aadhar_number = aadhar_number;
Hospital_name = hospital_name;
Hospital_Address_Line1_English = hospital_Address_Line1_English;
Hospital_Address_Line2_English = hospital_Address_Line2_English;
Hospital_Address_Line3_English = hospital_Address_Line3_English;
Hospital_Address_Line1_Tamil = hospital_Address_Line1_Tamil;
Hospital_Address_Line2_Tamil = hospital_Address_Line2_Tamil;
Hospital_Address_Line3_Tamil = hospital_Address_Line3_Tamil;
Hospital_pincode = hospital_pincode;
Home_Address_Line1_English = home_Address_Line1_English;
Home_Address_Line2_English = home_Address_Line2_English;
Home_Address_Line3_English = home_Address_Line3_English;
Home_Address_Line1_Tamil = home_Address_Line1_Tamil;
Home_Address_Line2_Tamil = home_Address_Line2_Tamil;
Home_Address_Line3_Tamil = home_Address_Line3_Tamil;
Home_pincode = home_pincode;
Other_Option = other_Option;
Other_Address_Line1_English = other_Address_Line1_English;
Other_Address_Line2_English = other_Address_Line2_English;
Other_Address_Line3_English = other_Address_Line3_English;
Other_Address_Line1_Tamil = other_Address_Line1_Tamil;
Other_Address_Line2_Tamil = other_Address_Line2_Tamil;
Other_Address_Line3_Tamil = other_Address_Line3_Tamil;
Other_pincode = other_pincode;
Informer_name = informer_name;
Informer_Address_Line1_English = informer_Address_Line1_English;
Informer_Address_Line2_English = informer_Address_Line2_English;
Informer_Address_Line1_Tamil = informer_Address_Line1_Tamil;
Informer_Address_Line2_Tamil = informer_Address_Line2_Tamil;
Informer_pincode = informer_pincode;
Mother_State = mother_State;
Mother_District = mother_District;
Mother_Sub_District = mother_Sub_District;
Mother_Town_Village = mother_Town_Village;
Mother_Name_of_Town_English = mother_Name_of_Town_English;
Mother_Name_of_Town_Tamil = mother_Name_of_Town_Tamil;
Upload_reporting_Form = upload_reporting_Form;
this.uuid = uuid;
this.birthParentsInformation = birthParentsInformation;
this.birthParentAddress = birthParentAddress;
}
}

649
src/main/java/com/crs_birth_service/Entity/BirthParentAddress.java

@ -0,0 +1,649 @@
package com.crs_birth_service.Entity;
import jakarta.persistence.*;
import lombok.*;
@Entity
@Builder
//@Getter
//@Setter
//@NoArgsConstructor
//@AllArgsConstructor
public class BirthParentAddress {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private int Address_Id;
//--------------Parents Address at the time of birth of child:
// ------------In Tamil Nadu:
private String ITN_House_No;
private String ITN_Street_Lane_Name_English;
private String ITN_Locality_Post_Office_English;
private String ITN_Village_Town_English;
private String ITN_District;
private String ITN_State;
private String ITN_Sub_District;
private int ITN_Pincode;
private String ITN_Street_Lane_Name_Tamil;
private String ITN_Locality_Post_Office_Tamil;
private String ITN_Village_Town_Tamil;
//------------------------Outside Tamilnadu:
private String OTN_House_No;
private String OTN_Street_Lane_Name_English;
private String OTN_Locality_Post_Office_English;
private String OTN_Village_Town_English;
private String OTN_District;
private String OTN_State;
private String OTN_Sub_District;
private int OTN_Pincode;
private String OTN_Street_Lane_Name_Tamil;
private String OTN_Locality_Post_Office_Tamil;
private String OTN_Village_Town_Tamil;
//-------------------Outside India:
private String OI_Country;
private String OI_Father_passport_no;
private String OI_Mother_passport_no;
private String OI_Address_Line1;
private String OI_Address_Line2;
private String OI_Address_Line3;
private int OI_Pincode;
//----------------------------Parents Permanent address:
//--------------In Tamil Nadu:
private String PPA_ITN_House_No;
private String PPA_ITN_Street_Lane_Name_English;
private String PPA_ITN_Locality_Post_Office_English;
private String PPA_ITN_Village_Town_English;
private String PPA_ITN_District;
private String PPA_ITN_State;
private String PPA_ITN_Sub_District;
private int PPA_ITN_Pincode;
private String PPA_ITN_Street_Lane_Name_Tamil;
private String PPA_ITN_Locality_Post_Office_Tamil;
private String PPA_ITN_Village_Town_Tamil;
//-----------------------
private String PPA_OTN_House_No;
private String PPA_OTN_Street_Lane_Name_English;
private String PPA_OTN_Locality_Post_Office_English;
private String PPA_OTN_Village_Town_English;
private String PPA_OTN_District;
private String PPA_OTN_State;
private String PPA_OTN_Sub_District;
private int PPA_OTN_Pincode;
private String PPA_OTN_Street_Lane_Name_Tamil;
private String PPA_OTN_Locality_Post_Office_Tamil;
private String PPA_OTN_Village_Town_Tamil;
//-------------------Outside India:
private String PPA_OI_Country;
private String PPA_OI_Father_passport_no;
private String PPA_OI_Mother_passport_no;
private String PPA_OI_Address_Line1;
private String PPA_OI_Address_Line2;
private String PPA_OI_Address_Line3;
private int PPA_OI_Pincode;
private String uuid;
// @OneToOne(mappedBy = "birthParentAddress")
@OneToOne(fetch = FetchType.LAZY, cascade = CascadeType.ALL, mappedBy = "birthParentAddress")
@JoinColumn(name="Birth_id")
private BirthDetails birthDetails;
public int getAddress_Id() {
return Address_Id;
}
public void setAddress_Id(int address_Id) {
Address_Id = address_Id;
}
public String getITN_House_No() {
return ITN_House_No;
}
public void setITN_House_No(String ITN_House_No) {
this.ITN_House_No = ITN_House_No;
}
public String getITN_Street_Lane_Name_English() {
return ITN_Street_Lane_Name_English;
}
public void setITN_Street_Lane_Name_English(String ITN_Street_Lane_Name_English) {
this.ITN_Street_Lane_Name_English = ITN_Street_Lane_Name_English;
}
public String getITN_Locality_Post_Office_English() {
return ITN_Locality_Post_Office_English;
}
public void setITN_Locality_Post_Office_English(String ITN_Locality_Post_Office_English) {
this.ITN_Locality_Post_Office_English = ITN_Locality_Post_Office_English;
}
public String getITN_Village_Town_English() {
return ITN_Village_Town_English;
}
public void setITN_Village_Town_English(String ITN_Village_Town_English) {
this.ITN_Village_Town_English = ITN_Village_Town_English;
}
public String getITN_District() {
return ITN_District;
}
public void setITN_District(String ITN_District) {
this.ITN_District = ITN_District;
}
public String getITN_State() {
return ITN_State;
}
public void setITN_State(String ITN_State) {
this.ITN_State = ITN_State;
}
public String getITN_Sub_District() {
return ITN_Sub_District;
}
public void setITN_Sub_District(String ITN_Sub_District) {
this.ITN_Sub_District = ITN_Sub_District;
}
public int getITN_Pincode() {
return ITN_Pincode;
}
public void setITN_Pincode(int ITN_Pincode) {
this.ITN_Pincode = ITN_Pincode;
}
public String getITN_Street_Lane_Name_Tamil() {
return ITN_Street_Lane_Name_Tamil;
}
public void setITN_Street_Lane_Name_Tamil(String ITN_Street_Lane_Name_Tamil) {
this.ITN_Street_Lane_Name_Tamil = ITN_Street_Lane_Name_Tamil;
}
public String getITN_Locality_Post_Office_Tamil() {
return ITN_Locality_Post_Office_Tamil;
}
public void setITN_Locality_Post_Office_Tamil(String ITN_Locality_Post_Office_Tamil) {
this.ITN_Locality_Post_Office_Tamil = ITN_Locality_Post_Office_Tamil;
}
public String getITN_Village_Town_Tamil() {
return ITN_Village_Town_Tamil;
}
public void setITN_Village_Town_Tamil(String ITN_Village_Town_Tamil) {
this.ITN_Village_Town_Tamil = ITN_Village_Town_Tamil;
}
public String getOTN_House_No() {
return OTN_House_No;
}
public void setOTN_House_No(String OTN_House_No) {
this.OTN_House_No = OTN_House_No;
}
public String getOTN_Street_Lane_Name_English() {
return OTN_Street_Lane_Name_English;
}
public void setOTN_Street_Lane_Name_English(String OTN_Street_Lane_Name_English) {
this.OTN_Street_Lane_Name_English = OTN_Street_Lane_Name_English;
}
public String getOTN_Locality_Post_Office_English() {
return OTN_Locality_Post_Office_English;
}
public void setOTN_Locality_Post_Office_English(String OTN_Locality_Post_Office_English) {
this.OTN_Locality_Post_Office_English = OTN_Locality_Post_Office_English;
}
public String getOTN_Village_Town_English() {
return OTN_Village_Town_English;
}
public void setOTN_Village_Town_English(String OTN_Village_Town_English) {
this.OTN_Village_Town_English = OTN_Village_Town_English;
}
public String getOTN_District() {
return OTN_District;
}
public void setOTN_District(String OTN_District) {
this.OTN_District = OTN_District;
}
public String getOTN_State() {
return OTN_State;
}
public void setOTN_State(String OTN_State) {
this.OTN_State = OTN_State;
}
public String getOTN_Sub_District() {
return OTN_Sub_District;
}
public void setOTN_Sub_District(String OTN_Sub_District) {
this.OTN_Sub_District = OTN_Sub_District;
}
public int getOTN_Pincode() {
return OTN_Pincode;
}
public void setOTN_Pincode(int OTN_Pincode) {
this.OTN_Pincode = OTN_Pincode;
}
public String getOTN_Street_Lane_Name_Tamil() {
return OTN_Street_Lane_Name_Tamil;
}
public void setOTN_Street_Lane_Name_Tamil(String OTN_Street_Lane_Name_Tamil) {
this.OTN_Street_Lane_Name_Tamil = OTN_Street_Lane_Name_Tamil;
}
public String getOTN_Locality_Post_Office_Tamil() {
return OTN_Locality_Post_Office_Tamil;
}
public void setOTN_Locality_Post_Office_Tamil(String OTN_Locality_Post_Office_Tamil) {
this.OTN_Locality_Post_Office_Tamil = OTN_Locality_Post_Office_Tamil;
}
public String getOTN_Village_Town_Tamil() {
return OTN_Village_Town_Tamil;
}
public void setOTN_Village_Town_Tamil(String OTN_Village_Town_Tamil) {
this.OTN_Village_Town_Tamil = OTN_Village_Town_Tamil;
}
public String getOI_Country() {
return OI_Country;
}
public void setOI_Country(String OI_Country) {
this.OI_Country = OI_Country;
}
public String getOI_Father_passport_no() {
return OI_Father_passport_no;
}
public void setOI_Father_passport_no(String OI_Father_passport_no) {
this.OI_Father_passport_no = OI_Father_passport_no;
}
public String getOI_Mother_passport_no() {
return OI_Mother_passport_no;
}
public void setOI_Mother_passport_no(String OI_Mother_passport_no) {
this.OI_Mother_passport_no = OI_Mother_passport_no;
}
public String getOI_Address_Line1() {
return OI_Address_Line1;
}
public void setOI_Address_Line1(String OI_Address_Line1) {
this.OI_Address_Line1 = OI_Address_Line1;
}
public String getOI_Address_Line2() {
return OI_Address_Line2;
}
public void setOI_Address_Line2(String OI_Address_Line2) {
this.OI_Address_Line2 = OI_Address_Line2;
}
public String getOI_Address_Line3() {
return OI_Address_Line3;
}
public void setOI_Address_Line3(String OI_Address_Line3) {
this.OI_Address_Line3 = OI_Address_Line3;
}
public int getOI_Pincode() {
return OI_Pincode;
}
public void setOI_Pincode(int OI_Pincode) {
this.OI_Pincode = OI_Pincode;
}
public String getPPA_ITN_House_No() {
return PPA_ITN_House_No;
}
public void setPPA_ITN_House_No(String PPA_ITN_House_No) {
this.PPA_ITN_House_No = PPA_ITN_House_No;
}
public String getPPA_ITN_Street_Lane_Name_English() {
return PPA_ITN_Street_Lane_Name_English;
}
public void setPPA_ITN_Street_Lane_Name_English(String PPA_ITN_Street_Lane_Name_English) {
this.PPA_ITN_Street_Lane_Name_English = PPA_ITN_Street_Lane_Name_English;
}
public String getPPA_ITN_Locality_Post_Office_English() {
return PPA_ITN_Locality_Post_Office_English;
}
public void setPPA_ITN_Locality_Post_Office_English(String PPA_ITN_Locality_Post_Office_English) {
this.PPA_ITN_Locality_Post_Office_English = PPA_ITN_Locality_Post_Office_English;
}
public String getPPA_ITN_Village_Town_English() {
return PPA_ITN_Village_Town_English;
}
public void setPPA_ITN_Village_Town_English(String PPA_ITN_Village_Town_English) {
this.PPA_ITN_Village_Town_English = PPA_ITN_Village_Town_English;
}
public String getPPA_ITN_District() {
return PPA_ITN_District;
}
public void setPPA_ITN_District(String PPA_ITN_District) {
this.PPA_ITN_District = PPA_ITN_District;
}
public String getPPA_ITN_State() {
return PPA_ITN_State;
}
public void setPPA_ITN_State(String PPA_ITN_State) {
this.PPA_ITN_State = PPA_ITN_State;
}
public String getPPA_ITN_Sub_District() {
return PPA_ITN_Sub_District;
}
public void setPPA_ITN_Sub_District(String PPA_ITN_Sub_District) {
this.PPA_ITN_Sub_District = PPA_ITN_Sub_District;
}
public int getPPA_ITN_Pincode() {
return PPA_ITN_Pincode;
}
public void setPPA_ITN_Pincode(int PPA_ITN_Pincode) {
this.PPA_ITN_Pincode = PPA_ITN_Pincode;
}
public String getPPA_ITN_Street_Lane_Name_Tamil() {
return PPA_ITN_Street_Lane_Name_Tamil;
}
public void setPPA_ITN_Street_Lane_Name_Tamil(String PPA_ITN_Street_Lane_Name_Tamil) {
this.PPA_ITN_Street_Lane_Name_Tamil = PPA_ITN_Street_Lane_Name_Tamil;
}
public String getPPA_ITN_Locality_Post_Office_Tamil() {
return PPA_ITN_Locality_Post_Office_Tamil;
}
public void setPPA_ITN_Locality_Post_Office_Tamil(String PPA_ITN_Locality_Post_Office_Tamil) {
this.PPA_ITN_Locality_Post_Office_Tamil = PPA_ITN_Locality_Post_Office_Tamil;
}
public String getPPA_ITN_Village_Town_Tamil() {
return PPA_ITN_Village_Town_Tamil;
}
public void setPPA_ITN_Village_Town_Tamil(String PPA_ITN_Village_Town_Tamil) {
this.PPA_ITN_Village_Town_Tamil = PPA_ITN_Village_Town_Tamil;
}
public String getPPA_OTN_House_No() {
return PPA_OTN_House_No;
}
public void setPPA_OTN_House_No(String PPA_OTN_House_No) {
this.PPA_OTN_House_No = PPA_OTN_House_No;
}
public String getPPA_OTN_Street_Lane_Name_English() {
return PPA_OTN_Street_Lane_Name_English;
}
public void setPPA_OTN_Street_Lane_Name_English(String PPA_OTN_Street_Lane_Name_English) {
this.PPA_OTN_Street_Lane_Name_English = PPA_OTN_Street_Lane_Name_English;
}
public String getPPA_OTN_Locality_Post_Office_English() {
return PPA_OTN_Locality_Post_Office_English;
}
public void setPPA_OTN_Locality_Post_Office_English(String PPA_OTN_Locality_Post_Office_English) {
this.PPA_OTN_Locality_Post_Office_English = PPA_OTN_Locality_Post_Office_English;
}
public String getPPA_OTN_Village_Town_English() {
return PPA_OTN_Village_Town_English;
}
public void setPPA_OTN_Village_Town_English(String PPA_OTN_Village_Town_English) {
this.PPA_OTN_Village_Town_English = PPA_OTN_Village_Town_English;
}
public String getPPA_OTN_District() {
return PPA_OTN_District;
}
public void setPPA_OTN_District(String PPA_OTN_District) {
this.PPA_OTN_District = PPA_OTN_District;
}
public String getPPA_OTN_State() {
return PPA_OTN_State;
}
public void setPPA_OTN_State(String PPA_OTN_State) {
this.PPA_OTN_State = PPA_OTN_State;
}
public String getPPA_OTN_Sub_District() {
return PPA_OTN_Sub_District;
}
public void setPPA_OTN_Sub_District(String PPA_OTN_Sub_District) {
this.PPA_OTN_Sub_District = PPA_OTN_Sub_District;
}
public int getPPA_OTN_Pincode() {
return PPA_OTN_Pincode;
}
public void setPPA_OTN_Pincode(int PPA_OTN_Pincode) {
this.PPA_OTN_Pincode = PPA_OTN_Pincode;
}
public String getPPA_OTN_Street_Lane_Name_Tamil() {
return PPA_OTN_Street_Lane_Name_Tamil;
}
public void setPPA_OTN_Street_Lane_Name_Tamil(String PPA_OTN_Street_Lane_Name_Tamil) {
this.PPA_OTN_Street_Lane_Name_Tamil = PPA_OTN_Street_Lane_Name_Tamil;
}
public String getPPA_OTN_Locality_Post_Office_Tamil() {
return PPA_OTN_Locality_Post_Office_Tamil;
}
public void setPPA_OTN_Locality_Post_Office_Tamil(String PPA_OTN_Locality_Post_Office_Tamil) {
this.PPA_OTN_Locality_Post_Office_Tamil = PPA_OTN_Locality_Post_Office_Tamil;
}
public String getPPA_OTN_Village_Town_Tamil() {
return PPA_OTN_Village_Town_Tamil;
}
public void setPPA_OTN_Village_Town_Tamil(String PPA_OTN_Village_Town_Tamil) {
this.PPA_OTN_Village_Town_Tamil = PPA_OTN_Village_Town_Tamil;
}
public String getPPA_OI_Country() {
return PPA_OI_Country;
}
public void setPPA_OI_Country(String PPA_OI_Country) {
this.PPA_OI_Country = PPA_OI_Country;
}
public String getPPA_OI_Father_passport_no() {
return PPA_OI_Father_passport_no;
}
public void setPPA_OI_Father_passport_no(String PPA_OI_Father_passport_no) {
this.PPA_OI_Father_passport_no = PPA_OI_Father_passport_no;
}
public String getPPA_OI_Mother_passport_no() {
return PPA_OI_Mother_passport_no;
}
public void setPPA_OI_Mother_passport_no(String PPA_OI_Mother_passport_no) {
this.PPA_OI_Mother_passport_no = PPA_OI_Mother_passport_no;
}
public String getPPA_OI_Address_Line1() {
return PPA_OI_Address_Line1;
}
public void setPPA_OI_Address_Line1(String PPA_OI_Address_Line1) {
this.PPA_OI_Address_Line1 = PPA_OI_Address_Line1;
}
public String getPPA_OI_Address_Line2() {
return PPA_OI_Address_Line2;
}
public void setPPA_OI_Address_Line2(String PPA_OI_Address_Line2) {
this.PPA_OI_Address_Line2 = PPA_OI_Address_Line2;
}
public String getPPA_OI_Address_Line3() {
return PPA_OI_Address_Line3;
}
public void setPPA_OI_Address_Line3(String PPA_OI_Address_Line3) {
this.PPA_OI_Address_Line3 = PPA_OI_Address_Line3;
}
public int getPPA_OI_Pincode() {
return PPA_OI_Pincode;
}
public void setPPA_OI_Pincode(int PPA_OI_Pincode) {
this.PPA_OI_Pincode = PPA_OI_Pincode;
}
public BirthDetails getBirthDetails() {
return birthDetails;
}
public void setBirthDetails(BirthDetails birthDetails) {
this.birthDetails = birthDetails;
}
public String getUuid() {
return uuid;
}
public void setUuid(String uuid) {
this.uuid = uuid;
}
public BirthParentAddress() {
}
public BirthParentAddress(int address_Id, String ITN_House_No, String ITN_Street_Lane_Name_English, String ITN_Locality_Post_Office_English, String ITN_Village_Town_English, String ITN_District, String ITN_State, String ITN_Sub_District, int ITN_Pincode, String ITN_Street_Lane_Name_Tamil, String ITN_Locality_Post_Office_Tamil, String ITN_Village_Town_Tamil, String OTN_House_No, String OTN_Street_Lane_Name_English, String OTN_Locality_Post_Office_English, String OTN_Village_Town_English, String OTN_District, String OTN_State, String OTN_Sub_District, int OTN_Pincode, String OTN_Street_Lane_Name_Tamil, String OTN_Locality_Post_Office_Tamil, String OTN_Village_Town_Tamil, String OI_Country, String OI_Father_passport_no, String OI_Mother_passport_no, String OI_Address_Line1, String OI_Address_Line2, String OI_Address_Line3, int OI_Pincode, String PPA_ITN_House_No, String PPA_ITN_Street_Lane_Name_English, String PPA_ITN_Locality_Post_Office_English, String PPA_ITN_Village_Town_English, String PPA_ITN_District, String PPA_ITN_State, String PPA_ITN_Sub_District, int PPA_ITN_Pincode, String PPA_ITN_Street_Lane_Name_Tamil, String PPA_ITN_Locality_Post_Office_Tamil, String PPA_ITN_Village_Town_Tamil, String PPA_OTN_House_No, String PPA_OTN_Street_Lane_Name_English, String PPA_OTN_Locality_Post_Office_English, String PPA_OTN_Village_Town_English, String PPA_OTN_District, String PPA_OTN_State, String PPA_OTN_Sub_District, int PPA_OTN_Pincode, String PPA_OTN_Street_Lane_Name_Tamil, String PPA_OTN_Locality_Post_Office_Tamil, String PPA_OTN_Village_Town_Tamil, String PPA_OI_Country, String PPA_OI_Father_passport_no, String PPA_OI_Mother_passport_no, String PPA_OI_Address_Line1, String PPA_OI_Address_Line2, String PPA_OI_Address_Line3, int PPA_OI_Pincode, String uuid, BirthDetails birthDetails) {
Address_Id = address_Id;
this.ITN_House_No = ITN_House_No;
this.ITN_Street_Lane_Name_English = ITN_Street_Lane_Name_English;
this.ITN_Locality_Post_Office_English = ITN_Locality_Post_Office_English;
this.ITN_Village_Town_English = ITN_Village_Town_English;
this.ITN_District = ITN_District;
this.ITN_State = ITN_State;
this.ITN_Sub_District = ITN_Sub_District;
this.ITN_Pincode = ITN_Pincode;
this.ITN_Street_Lane_Name_Tamil = ITN_Street_Lane_Name_Tamil;
this.ITN_Locality_Post_Office_Tamil = ITN_Locality_Post_Office_Tamil;
this.ITN_Village_Town_Tamil = ITN_Village_Town_Tamil;
this.OTN_House_No = OTN_House_No;
this.OTN_Street_Lane_Name_English = OTN_Street_Lane_Name_English;
this.OTN_Locality_Post_Office_English = OTN_Locality_Post_Office_English;
this.OTN_Village_Town_English = OTN_Village_Town_English;
this.OTN_District = OTN_District;
this.OTN_State = OTN_State;
this.OTN_Sub_District = OTN_Sub_District;
this.OTN_Pincode = OTN_Pincode;
this.OTN_Street_Lane_Name_Tamil = OTN_Street_Lane_Name_Tamil;
this.OTN_Locality_Post_Office_Tamil = OTN_Locality_Post_Office_Tamil;
this.OTN_Village_Town_Tamil = OTN_Village_Town_Tamil;
this.OI_Country = OI_Country;
this.OI_Father_passport_no = OI_Father_passport_no;
this.OI_Mother_passport_no = OI_Mother_passport_no;
this.OI_Address_Line1 = OI_Address_Line1;
this.OI_Address_Line2 = OI_Address_Line2;
this.OI_Address_Line3 = OI_Address_Line3;
this.OI_Pincode = OI_Pincode;
this.PPA_ITN_House_No = PPA_ITN_House_No;
this.PPA_ITN_Street_Lane_Name_English = PPA_ITN_Street_Lane_Name_English;
this.PPA_ITN_Locality_Post_Office_English = PPA_ITN_Locality_Post_Office_English;
this.PPA_ITN_Village_Town_English = PPA_ITN_Village_Town_English;
this.PPA_ITN_District = PPA_ITN_District;
this.PPA_ITN_State = PPA_ITN_State;
this.PPA_ITN_Sub_District = PPA_ITN_Sub_District;
this.PPA_ITN_Pincode = PPA_ITN_Pincode;
this.PPA_ITN_Street_Lane_Name_Tamil = PPA_ITN_Street_Lane_Name_Tamil;
this.PPA_ITN_Locality_Post_Office_Tamil = PPA_ITN_Locality_Post_Office_Tamil;
this.PPA_ITN_Village_Town_Tamil = PPA_ITN_Village_Town_Tamil;
this.PPA_OTN_House_No = PPA_OTN_House_No;
this.PPA_OTN_Street_Lane_Name_English = PPA_OTN_Street_Lane_Name_English;
this.PPA_OTN_Locality_Post_Office_English = PPA_OTN_Locality_Post_Office_English;
this.PPA_OTN_Village_Town_English = PPA_OTN_Village_Town_English;
this.PPA_OTN_District = PPA_OTN_District;
this.PPA_OTN_State = PPA_OTN_State;
this.PPA_OTN_Sub_District = PPA_OTN_Sub_District;
this.PPA_OTN_Pincode = PPA_OTN_Pincode;
this.PPA_OTN_Street_Lane_Name_Tamil = PPA_OTN_Street_Lane_Name_Tamil;
this.PPA_OTN_Locality_Post_Office_Tamil = PPA_OTN_Locality_Post_Office_Tamil;
this.PPA_OTN_Village_Town_Tamil = PPA_OTN_Village_Town_Tamil;
this.PPA_OI_Country = PPA_OI_Country;
this.PPA_OI_Father_passport_no = PPA_OI_Father_passport_no;
this.PPA_OI_Mother_passport_no = PPA_OI_Mother_passport_no;
this.PPA_OI_Address_Line1 = PPA_OI_Address_Line1;
this.PPA_OI_Address_Line2 = PPA_OI_Address_Line2;
this.PPA_OI_Address_Line3 = PPA_OI_Address_Line3;
this.PPA_OI_Pincode = PPA_OI_Pincode;
this.uuid = uuid;
this.birthDetails = birthDetails;
}
}

285
src/main/java/com/crs_birth_service/Entity/BirthParentsInformation.java

@ -0,0 +1,285 @@
package com.crs_birth_service.Entity;
import jakarta.persistence.*;
import lombok.*;
@Entity
@Builder
//@Getter
//@Setter
//@NoArgsConstructor
//@AllArgsConstructor
public class BirthParentsInformation {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private int Parent_Id;
//------------------------ Parents Information:
private String Parent_Father_name_English;
private String Parent_Mother_name_English;
private String Parent_Father_name_Tamil;
private String Parent_Mother_name_Tamil;
private String Parent_Father_Aadhar_number;
private String Parent_Mother_Aadhar_number;
private String Parent_Father_Email_Id;
private String Parent_Mother_Email_Id;
private String Parent_Father_Mobile_Number;
private String Parent_Mother_Mobile_Number;
//------------------------Parents Information:
private String Parent_Religion;
private String Father_Level_of_Education;
private String Mother_Level_of_Education;
private String Father_Occupation;
private String Mother_Occupation;
private int Age_of_mother_at_time_of_marriage;
private int Age_of_mother_at_time_of_birth;
private int Total_children_to_mother;
private String Type_of_attention_delivery;
private String Delivery_method;
private int Birth_Weight;
private int Pregnancy_Duration;
private String uuid;
//@OneToOne(mappedBy = "birthParentsInformation")
//@OneToOne(fetch = FetchType.LAZY)
//@JoinColumn(name="Birth_id")
@OneToOne(fetch = FetchType.LAZY, cascade = CascadeType.ALL, mappedBy = "birthParentsInformation")
@JoinColumn(name="Birth_id")
private BirthDetails birthDetails;
public int getParent_Id() {
return Parent_Id;
}
public void setParent_Id(int parent_Id) {
Parent_Id = parent_Id;
}
public String getParent_Father_name_English() {
return Parent_Father_name_English;
}
public void setParent_Father_name_English(String parent_Father_name_English) {
Parent_Father_name_English = parent_Father_name_English;
}
public String getParent_Mother_name_English() {
return Parent_Mother_name_English;
}
public void setParent_Mother_name_English(String parent_Mother_name_English) {
Parent_Mother_name_English = parent_Mother_name_English;
}
public String getParent_Father_name_Tamil() {
return Parent_Father_name_Tamil;
}
public void setParent_Father_name_Tamil(String parent_Father_name_Tamil) {
Parent_Father_name_Tamil = parent_Father_name_Tamil;
}
public String getParent_Mother_name_Tamil() {
return Parent_Mother_name_Tamil;
}
public void setParent_Mother_name_Tamil(String parent_Mother_name_Tamil) {
Parent_Mother_name_Tamil = parent_Mother_name_Tamil;
}
public String getParent_Father_Aadhar_number() {
return Parent_Father_Aadhar_number;
}
public void setParent_Father_Aadhar_number(String parent_Father_Aadhar_number) {
Parent_Father_Aadhar_number = parent_Father_Aadhar_number;
}
public String getParent_Mother_Aadhar_number() {
return Parent_Mother_Aadhar_number;
}
public void setParent_Mother_Aadhar_number(String parent_Mother_Aadhar_number) {
Parent_Mother_Aadhar_number = parent_Mother_Aadhar_number;
}
public String getParent_Father_Email_Id() {
return Parent_Father_Email_Id;
}
public void setParent_Father_Email_Id(String parent_Father_Email_Id) {
Parent_Father_Email_Id = parent_Father_Email_Id;
}
public String getParent_Mother_Email_Id() {
return Parent_Mother_Email_Id;
}
public void setParent_Mother_Email_Id(String parent_Mother_Email_Id) {
Parent_Mother_Email_Id = parent_Mother_Email_Id;
}
public String getParent_Father_Mobile_Number() {
return Parent_Father_Mobile_Number;
}
public void setParent_Father_Mobile_Number(String parent_Father_Mobile_Number) {
Parent_Father_Mobile_Number = parent_Father_Mobile_Number;
}
public String getParent_Mother_Mobile_Number() {
return Parent_Mother_Mobile_Number;
}
public void setParent_Mother_Mobile_Number(String parent_Mother_Mobile_Number) {
Parent_Mother_Mobile_Number = parent_Mother_Mobile_Number;
}
public String getParent_Religion() {
return Parent_Religion;
}
public void setParent_Religion(String parent_Religion) {
Parent_Religion = parent_Religion;
}
public String getFather_Level_of_Education() {
return Father_Level_of_Education;
}
public void setFather_Level_of_Education(String father_Level_of_Education) {
Father_Level_of_Education = father_Level_of_Education;
}
public String getMother_Level_of_Education() {
return Mother_Level_of_Education;
}
public void setMother_Level_of_Education(String mother_Level_of_Education) {
Mother_Level_of_Education = mother_Level_of_Education;
}
public String getFather_Occupation() {
return Father_Occupation;
}
public void setFather_Occupation(String father_Occupation) {
Father_Occupation = father_Occupation;
}
public String getMother_Occupation() {
return Mother_Occupation;
}
public void setMother_Occupation(String mother_Occupation) {
Mother_Occupation = mother_Occupation;
}
public int getAge_of_mother_at_time_of_marriage() {
return Age_of_mother_at_time_of_marriage;
}
public void setAge_of_mother_at_time_of_marriage(int age_of_mother_at_time_of_marriage) {
Age_of_mother_at_time_of_marriage = age_of_mother_at_time_of_marriage;
}
public int getAge_of_mother_at_time_of_birth() {
return Age_of_mother_at_time_of_birth;
}
public void setAge_of_mother_at_time_of_birth(int age_of_mother_at_time_of_birth) {
Age_of_mother_at_time_of_birth = age_of_mother_at_time_of_birth;
}
public int getTotal_children_to_mother() {
return Total_children_to_mother;
}
public void setTotal_children_to_mother(int total_children_to_mother) {
Total_children_to_mother = total_children_to_mother;
}
public String getType_of_attention_delivery() {
return Type_of_attention_delivery;
}
public void setType_of_attention_delivery(String type_of_attention_delivery) {
Type_of_attention_delivery = type_of_attention_delivery;
}
public String getDelivery_method() {
return Delivery_method;
}
public void setDelivery_method(String delivery_method) {
Delivery_method = delivery_method;
}
public int getBirth_Weight() {
return Birth_Weight;
}
public void setBirth_Weight(int birth_Weight) {
Birth_Weight = birth_Weight;
}
public int getPregnancy_Duration() {
return Pregnancy_Duration;
}
public void setPregnancy_Duration(int pregnancy_Duration) {
Pregnancy_Duration = pregnancy_Duration;
}
public BirthDetails getBirthDetails() {
return birthDetails;
}
public void setBirthDetails(BirthDetails birthDetails) {
this.birthDetails = birthDetails;
}
public String getUuid() {
return uuid;
}
public void setUuid(String uuid) {
this.uuid = uuid;
}
public BirthParentsInformation() {
}
public BirthParentsInformation(int parent_Id, String parent_Father_name_English, String parent_Mother_name_English, String parent_Father_name_Tamil, String parent_Mother_name_Tamil, String parent_Father_Aadhar_number, String parent_Mother_Aadhar_number, String parent_Father_Email_Id, String parent_Mother_Email_Id, String parent_Father_Mobile_Number, String parent_Mother_Mobile_Number, String parent_Religion, String father_Level_of_Education, String mother_Level_of_Education, String father_Occupation, String mother_Occupation, int age_of_mother_at_time_of_marriage, int age_of_mother_at_time_of_birth, int total_children_to_mother, String type_of_attention_delivery, String delivery_method, int birth_Weight, int pregnancy_Duration, String uuid, BirthDetails birthDetails) {
Parent_Id = parent_Id;
Parent_Father_name_English = parent_Father_name_English;
Parent_Mother_name_English = parent_Mother_name_English;
Parent_Father_name_Tamil = parent_Father_name_Tamil;
Parent_Mother_name_Tamil = parent_Mother_name_Tamil;
Parent_Father_Aadhar_number = parent_Father_Aadhar_number;
Parent_Mother_Aadhar_number = parent_Mother_Aadhar_number;
Parent_Father_Email_Id = parent_Father_Email_Id;
Parent_Mother_Email_Id = parent_Mother_Email_Id;
Parent_Father_Mobile_Number = parent_Father_Mobile_Number;
Parent_Mother_Mobile_Number = parent_Mother_Mobile_Number;
Parent_Religion = parent_Religion;
Father_Level_of_Education = father_Level_of_Education;
Mother_Level_of_Education = mother_Level_of_Education;
Father_Occupation = father_Occupation;
Mother_Occupation = mother_Occupation;
Age_of_mother_at_time_of_marriage = age_of_mother_at_time_of_marriage;
Age_of_mother_at_time_of_birth = age_of_mother_at_time_of_birth;
Total_children_to_mother = total_children_to_mother;
Type_of_attention_delivery = type_of_attention_delivery;
Delivery_method = delivery_method;
Birth_Weight = birth_Weight;
Pregnancy_Duration = pregnancy_Duration;
this.uuid = uuid;
this.birthDetails = birthDetails;
}
}

24
src/main/java/com/crs_birth_service/Entity/NewRegister.java

@ -0,0 +1,24 @@
//package com.crs_birth_service.Entity;
//
//import jakarta.persistence.Entity;
//import jakarta.persistence.GeneratedValue;
//import jakarta.persistence.GenerationType;
//import jakarta.persistence.Id;
//import lombok.*;
//
//@Entity
//@Builder
//@Getter
//@Setter
//@NoArgsConstructor
//@AllArgsConstructor
//public class NewRegister {
//
// @Id
// @GeneratedValue(strategy = GenerationType.SEQUENCE)
// private int id;
//
// private String name;
// private int age;
// private String sex;
//}

15
src/main/java/com/crs_birth_service/Repository/BirthDetailsRepository.java

@ -0,0 +1,15 @@
package com.crs_birth_service.Repository;
import com.crs_birth_service.Entity.BirthDetails;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;
@Repository
public interface BirthDetailsRepository extends JpaRepository<BirthDetails,Integer> {
// @Query(value = "select * from birth_details where uuid=?", nativeQuery = true)
@Query(value="SELECT * FROM birth_service.birth_details where uuid=:uuid",nativeQuery = true)
BirthDetails getdetail(@Param("uuid") String uuid);
}

7
src/main/java/com/crs_birth_service/Repository/BirthParentAddressRepository.java

@ -0,0 +1,7 @@
package com.crs_birth_service.Repository;
import com.crs_birth_service.Entity.BirthParentAddress;
import org.springframework.data.jpa.repository.JpaRepository;
public interface BirthParentAddressRepository extends JpaRepository<BirthParentAddress, Integer> {
}

7
src/main/java/com/crs_birth_service/Repository/BirthParentsInformationRepository.java

@ -0,0 +1,7 @@
package com.crs_birth_service.Repository;
import com.crs_birth_service.Entity.BirthParentsInformation;
import org.springframework.data.jpa.repository.JpaRepository;
public interface BirthParentsInformationRepository extends JpaRepository<BirthParentsInformation, Integer> {
}

338
src/main/java/com/crs_birth_service/Service/BirthConsumer.java

@ -0,0 +1,338 @@
package com.crs_birth_service.Service;
import com.crs_birth_service.Entity.BirthDetails;
import com.crs_birth_service.Entity.BirthParentAddress;
import com.crs_birth_service.Entity.BirthParentsInformation;
import com.crs_birth_service.Repository.BirthDetailsRepository;
import com.crs_birth_service.Repository.BirthParentAddressRepository;
import com.crs_birth_service.Repository.BirthParentsInformationRepository;
import com.crs_birth_service.config.Listeners;
import com.crs_birth_service.dto.BirthDetailsDto;
import com.crs_birth_service.dto.DtoforBirthConsum;
import com.crs_birth_service.fileUtil.FileService;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.web.multipart.MultipartFile;
import java.util.Arrays;
import java.util.Date;
import java.text.ParseException;
import java.text.SimpleDateFormat;
@Configuration
public class BirthConsumer {
@Autowired
private ObjectMapper objectMapper;
@Autowired
private BirthDetailsRepository birthDetailsRepository;
@Autowired
private BirthParentAddressRepository birthParentAddressRepository;
@Autowired
private BirthParentsInformationRepository birthParentsInformationRepository;
@Autowired
private FileService fileService;
private static final Logger log = LoggerFactory.getLogger(Listeners.class);
@KafkaListener(topics = "birth1",groupId = "bith-group")
public void consume(String message) {
try {
BirthDetailsDto birthConsum = objectMapper.readValue(message, BirthDetailsDto.class);
System.out.println("==========>");
log.info("Successfully consumed json:{}", birthConsum);
//log.debug("File upload byte array: {}", Arrays.toString(birthConsum.getFileUpload()));
if(birthConsum.getStatus().equalsIgnoreCase("NEW")) {
BirthDetails birthDetails = new BirthDetails();
// birthDetails.setReporting_Date(convertDate(birthConsum.getReporting_Date()));
birthDetails.setPICME_No(birthConsum.getPICME_No());
birthDetails.setPre_Register_No(birthConsum.getPre_Register_No());
birthDetails.setPICME_Applicant_Name(birthConsum.getPICME_Applicant_Name());
birthDetails.setPICME_Building_door_flat_no(birthConsum.getPICME_Building_door_flat_no());
birthDetails.setPICME_Street(birthConsum.getPICME_Street());
birthDetails.setPICME_Area(birthConsum.getPICME_Area());
birthDetails.setPICME_District(birthConsum.getPICME_District());
birthDetails.setPICME_Block(birthConsum.getPICME_Block());
birthDetails.setPICME_Village(birthConsum.getPICME_Village());
birthDetails.setPICME_Pincode(birthConsum.getPICME_Pincode());
birthDetails.setPICME_Mobile_number(birthConsum.getPICME_Mobile_number());
// birthDetails.setChild_Birth_Date(convertDate(birthConsum.getChild_Birth_Date()));
birthDetails.setGender(birthConsum.getGender());
birthDetails.setChild_Name_English(birthConsum.getChild_Name_English());
birthDetails.setChild_Name_Tamil(birthConsum.getChild_Name_Tamil());
birthDetails.setAadhar_number(birthConsum.getAadhar_number());
birthDetails.setHospital_name(birthConsum.getHospital_name());
birthDetails.setHospital_Address_Line1_English(birthConsum.getHospital_Address_Line1_English());
birthDetails.setHospital_Address_Line2_English(birthConsum.getHospital_Address_Line2_English());
birthDetails.setHospital_Address_Line3_English(birthConsum.getHospital_Address_Line3_English());
birthDetails.setHospital_Address_Line1_Tamil(birthConsum.getHospital_Address_Line1_Tamil());
birthDetails.setHospital_Address_Line2_Tamil(birthConsum.getHospital_Address_Line2_Tamil());
birthDetails.setHospital_Address_Line3_Tamil(birthConsum.getHospital_Address_Line3_Tamil());
birthDetails.setHospital_pincode(birthConsum.getHospital_pincode());
birthDetails.setHome_Address_Line1_English(birthConsum.getHome_Address_Line1_English());
birthDetails.setHome_Address_Line2_English(birthConsum.getHome_Address_Line2_English());
birthDetails.setHome_Address_Line3_English(birthConsum.getHome_Address_Line3_English());
birthDetails.setHome_Address_Line1_Tamil(birthConsum.getHome_Address_Line1_Tamil());
birthDetails.setHome_Address_Line2_Tamil(birthConsum.getHome_Address_Line2_Tamil());
birthDetails.setHome_Address_Line3_Tamil(birthConsum.getHome_Address_Line3_Tamil());
birthDetails.setHome_pincode(birthConsum.getHome_pincode());
birthDetails.setOther_Option(birthConsum.getOther_Option());
birthDetails.setOther_Address_Line1_English(birthConsum.getOther_Address_Line1_English());
birthDetails.setOther_Address_Line2_English(birthConsum.getOther_Address_Line2_English());
birthDetails.setOther_Address_Line3_English(birthConsum.getOther_Address_Line3_English());
birthDetails.setOther_Address_Line1_Tamil(birthConsum.getOther_Address_Line1_Tamil());
birthDetails.setOther_Address_Line2_Tamil(birthConsum.getOther_Address_Line2_Tamil());
birthDetails.setOther_Address_Line3_Tamil(birthConsum.getOther_Address_Line3_Tamil());
birthDetails.setOther_pincode(birthConsum.getOther_pincode());
birthDetails.setInformer_name(birthConsum.getInformer_name());
birthDetails.setInformer_Address_Line1_English(birthConsum.getInformer_Address_Line1_English());
birthDetails.setInformer_Address_Line2_English(birthConsum.getInformer_Address_Line2_English());
birthDetails.setInformer_Address_Line1_Tamil(birthConsum.getInformer_Address_Line1_Tamil());
birthDetails.setInformer_Address_Line2_Tamil(birthConsum.getInformer_Address_Line2_Tamil());
birthDetails.setInformer_pincode(birthConsum.getInformer_pincode());
birthDetails.setMother_State(birthConsum.getMother_State());
birthDetails.setMother_District(birthConsum.getMother_District());
birthDetails.setMother_Sub_District(birthConsum.getMother_Sub_District());
birthDetails.setMother_Town_Village(birthConsum.getMother_Town_Village());
birthDetails.setMother_Name_of_Town_English(birthConsum.getMother_Name_of_Town_English());
birthDetails.setMother_Name_of_Town_Tamil(birthConsum.getMother_Name_of_Town_Tamil());
birthDetails.setUpload_reporting_Form(birthConsum.getUpload_reporting_Form());
birthDetails.setUuid(birthConsum.getUuid());
BirthParentsInformation birthParentsInformation = new BirthParentsInformation();
birthParentsInformation.setParent_Father_name_English(birthConsum.getParent_Father_name_English());
birthParentsInformation.setParent_Mother_name_English(birthConsum.getParent_Mother_name_English());
birthParentsInformation.setParent_Father_name_Tamil(birthConsum.getParent_Father_name_Tamil());
birthParentsInformation.setParent_Mother_name_Tamil(birthConsum.getParent_Mother_name_Tamil());
birthParentsInformation.setParent_Father_Aadhar_number(birthConsum.getParent_Father_Aadhar_number());
birthParentsInformation.setParent_Mother_Aadhar_number(birthConsum.getParent_Mother_Aadhar_number());
birthParentsInformation.setParent_Father_Email_Id(birthConsum.getParent_Father_Email_Id());
birthParentsInformation.setParent_Mother_Email_Id(birthConsum.getParent_Mother_Email_Id());
birthParentsInformation.setParent_Father_Mobile_Number(birthConsum.getParent_Father_Mobile_Number());
birthParentsInformation.setParent_Mother_Mobile_Number(birthConsum.getParent_Mother_Mobile_Number());
birthParentsInformation.setParent_Religion(birthConsum.getParent_Religion());
birthParentsInformation.setFather_Level_of_Education(birthConsum.getFather_Level_of_Education());
birthParentsInformation.setMother_Level_of_Education(birthConsum.getMother_Level_of_Education());
birthParentsInformation.setFather_Occupation(birthConsum.getFather_Occupation());
birthParentsInformation.setMother_Occupation(birthConsum.getMother_Occupation());
birthParentsInformation.setAge_of_mother_at_time_of_marriage(birthConsum.getAge_of_mother_at_time_of_marriage());
birthParentsInformation.setAge_of_mother_at_time_of_birth(birthConsum.getAge_of_mother_at_time_of_birth());
birthParentsInformation.setTotal_children_to_mother(birthConsum.getTotal_children_to_mother());
birthParentsInformation.setType_of_attention_delivery(birthConsum.getType_of_attention_delivery());
birthParentsInformation.setDelivery_method(birthConsum.getDelivery_method());
birthParentsInformation.setBirth_Weight(birthConsum.getBirth_Weight());
birthParentsInformation.setPregnancy_Duration(birthConsum.getPregnancy_Duration());
birthParentsInformation.setUuid(birthConsum.getUuid());
BirthParentAddress birthParentAddress = new BirthParentAddress();
birthParentAddress.setITN_House_No(birthConsum.getITN_House_No());
birthParentAddress.setITN_Street_Lane_Name_English(birthConsum.getITN_Street_Lane_Name_English());
birthParentAddress.setITN_Locality_Post_Office_English(birthConsum.getITN_Locality_Post_Office_English());
birthParentAddress.setITN_Village_Town_English(birthConsum.getITN_Village_Town_English());
birthParentAddress.setITN_District(birthConsum.getITN_District());
birthParentAddress.setITN_State(birthConsum.getITN_State());
birthParentAddress.setITN_Sub_District(birthConsum.getITN_Sub_District());
birthParentAddress.setITN_Pincode(birthConsum.getITN_Pincode());
birthParentAddress.setITN_Street_Lane_Name_Tamil(birthConsum.getITN_Street_Lane_Name_Tamil());
birthParentAddress.setITN_Locality_Post_Office_Tamil(birthConsum.getITN_Locality_Post_Office_Tamil());
birthParentAddress.setITN_Village_Town_Tamil(birthConsum.getITN_Village_Town_Tamil());
birthParentAddress.setOTN_House_No(birthConsum.getOTN_House_No());
birthParentAddress.setOTN_Street_Lane_Name_English(birthConsum.getOTN_Street_Lane_Name_English());
birthParentAddress.setOTN_Locality_Post_Office_English(birthConsum.getOTN_Locality_Post_Office_English());
birthParentAddress.setOTN_Village_Town_English(birthConsum.getOTN_Village_Town_English());
birthParentAddress.setOTN_District(birthConsum.getOTN_District());
birthParentAddress.setOTN_State(birthConsum.getOTN_State());
birthParentAddress.setOTN_Sub_District(birthConsum.getOTN_Sub_District());
birthParentAddress.setOTN_Pincode(birthConsum.getOTN_Pincode());
birthParentAddress.setOTN_Street_Lane_Name_Tamil(birthConsum.getOTN_Street_Lane_Name_Tamil());
birthParentAddress.setOTN_Locality_Post_Office_Tamil(birthConsum.getOTN_Locality_Post_Office_Tamil());
birthParentAddress.setOTN_Village_Town_Tamil(birthConsum.getOTN_Village_Town_Tamil());
birthParentAddress.setOI_Country(birthConsum.getOI_Country());
birthParentAddress.setOI_Father_passport_no(birthConsum.getOI_Father_passport_no());
birthParentAddress.setOI_Mother_passport_no(birthConsum.getOI_Mother_passport_no());
birthParentAddress.setOI_Address_Line1(birthConsum.getOI_Address_Line1());
birthParentAddress.setOI_Address_Line2(birthConsum.getOI_Address_Line2());
birthParentAddress.setOI_Address_Line3(birthConsum.getOI_Address_Line3());
birthParentAddress.setOI_Pincode(birthConsum.getOI_Pincode());
birthParentAddress.setPPA_ITN_House_No(birthConsum.getPPA_ITN_House_No());
birthParentAddress.setPPA_ITN_Street_Lane_Name_English(birthConsum.getPPA_ITN_Street_Lane_Name_English());
birthParentAddress.setPPA_ITN_Locality_Post_Office_English(birthConsum.getPPA_ITN_Locality_Post_Office_English());
birthParentAddress.setPPA_ITN_Village_Town_English(birthConsum.getPPA_ITN_Village_Town_English());
birthParentAddress.setPPA_ITN_District(birthConsum.getPPA_ITN_District());
birthParentAddress.setPPA_ITN_State(birthConsum.getPPA_ITN_State());
birthParentAddress.setPPA_ITN_Sub_District(birthConsum.getPPA_ITN_Sub_District());
birthParentAddress.setPPA_ITN_Pincode(birthConsum.getPPA_ITN_Pincode());
birthParentAddress.setPPA_ITN_Street_Lane_Name_Tamil(birthConsum.getPPA_ITN_Street_Lane_Name_Tamil());
birthParentAddress.setPPA_ITN_Locality_Post_Office_Tamil(birthConsum.getPPA_ITN_Locality_Post_Office_Tamil());
birthParentAddress.setPPA_ITN_Village_Town_Tamil(birthConsum.getPPA_ITN_Village_Town_Tamil());
birthParentAddress.setPPA_OTN_House_No(birthConsum.getPPA_OTN_House_No());
birthParentAddress.setPPA_OTN_Street_Lane_Name_English(birthConsum.getPPA_OTN_Street_Lane_Name_English());
birthParentAddress.setPPA_OTN_Locality_Post_Office_English(birthConsum.getPPA_OTN_Locality_Post_Office_English());
birthParentAddress.setPPA_OTN_Village_Town_English(birthConsum.getPPA_OTN_Village_Town_English());
birthParentAddress.setPPA_OTN_District(birthConsum.getPPA_OTN_District());
birthParentAddress.setPPA_OTN_State(birthConsum.getPPA_OTN_State());
birthParentAddress.setPPA_OTN_Sub_District(birthConsum.getPPA_OTN_Sub_District());
birthParentAddress.setPPA_OTN_Pincode(birthConsum.getPPA_OTN_Pincode());
birthParentAddress.setPPA_OTN_Street_Lane_Name_Tamil(birthConsum.getPPA_OTN_Street_Lane_Name_Tamil());
birthParentAddress.setPPA_OTN_Locality_Post_Office_Tamil(birthConsum.getPPA_OTN_Locality_Post_Office_Tamil());
birthParentAddress.setPPA_OTN_Village_Town_Tamil(birthConsum.getPPA_OTN_Village_Town_Tamil());
birthParentAddress.setPPA_OI_Country(birthConsum.getPPA_OI_Country());
birthParentAddress.setPPA_OI_Father_passport_no(birthConsum.getPPA_OI_Father_passport_no());
birthParentAddress.setPPA_OI_Mother_passport_no(birthConsum.getPPA_OI_Mother_passport_no());
birthParentAddress.setPPA_OI_Address_Line1(birthConsum.getPPA_OI_Address_Line1());
birthParentAddress.setPPA_OI_Address_Line2(birthConsum.getPPA_OI_Address_Line2());
birthParentAddress.setPPA_OI_Address_Line3(birthConsum.getPPA_OI_Address_Line3());
birthParentAddress.setPPA_OI_Pincode(birthConsum.getPPA_OI_Pincode());
birthParentAddress.setUuid(birthConsum.getUuid());
birthDetails.setBirthParentsInformation(birthParentsInformation);
birthDetails.setBirthParentAddress(birthParentAddress);
birthParentsInformation.setBirthDetails(birthDetails);
birthParentAddress.setBirthDetails(birthDetails);
BirthDetails brirthdetail = birthDetailsRepository.save(birthDetails);
// System.out.println("==========>"+fileService.saveFile(birthConsum.getFileUpload() , birthConsum.getUuid()));
// birthParentsInformation.setBirthDetails(brirthdetail);
// birthParentsInformationRepository.save(birthParentsInformation);
// birthParentAddress.setBirthDetails(brirthdetail);
// BirthParentAddress birthParentAddress1= birthParentAddressRepository.save(birthParentAddress);
System.out.println("============>" + brirthdetail.getBirth_id());
System.out.println("============>" + brirthdetail.getBirth_id());
} else if(birthConsum.getStatus().equalsIgnoreCase("nameInclusion")) {
System.out.println("---------------->"+ birthConsum.getFileUpload());
byte[] tr=birthConsum.getFileUpload();
MultipartFile multipartFile = new ByteArrayMultipartFile(
tr,
"image", // Field name, adjust as needed
"image.jpg", // Original file name
"image/jpeg" // Content type, adjust as needed
);
// Now you can work with the multipartFile object
System.out.println(multipartFile.getName()+"===================>............");
// MultipartFile multipartFile = convertToMultipartFile(multipartFile, "fileName.jpg");
fileService.saveFile(birthConsum.getFileUpload() , birthConsum.getUuid());
System.out.println(multipartFile.getName()+"===================>............");
//log.info("File saved at path: {}", filepath);
System.out.println("Feign Service======"+ fileService.saveFile(birthConsum.getFileUpload() , birthConsum.getUuid()));
///////////////////////
BirthDetails details = birthDetailsRepository.getdetail(birthConsum.getUuid());
System.out.println("CHECKINGGG");
//////////////////////////////////////
System.out.println("UUID = "+details.getUuid());
// log.debug("Fetched details from DB: {}", details);
details.setChild_Name_English(birthConsum.getChild_Name_English());
System.out.println("CHECKINGGG1");
// System.out.println("---------------->"+ filepath);
birthDetailsRepository.save(details);
}
log.info("Successfully consumed json:{}");
// log.info("Successfully consumed json:{}", eventType);
// log.info("Successfully consumed json:{}", Originator);
// log.info("Successfully consumed json:{}", Vin);
log.info("Successfully call and saved through through Kafka Listener userGuid: {} ");
} catch (JsonMappingException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (JsonProcessingException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
//public Date convertDate(String input) {
// String dateFormat = "dd/MM/yyyy";
// SimpleDateFormat formatter = new SimpleDateFormat(dateFormat);
// Date dates = null;
// try {
//
// dates = formatter.parse(input);
// System.out.println("Date object: " + dates);
// } catch (ParseException e) {
// // Handle the exception if the string cannot be parsed
// System.out.println("Invalid date format");
// e.printStackTrace();
// }
// return dates;
//}
public Date convertDate(String input) {
// Adjust the date format to match the input date format
String dateFormat = "yyyy-MM-dd";
SimpleDateFormat formatter = new SimpleDateFormat(dateFormat);
Date dates = null;
try {
dates = formatter.parse(input);
System.out.println("Date object: " + dates);
} catch (ParseException e) {
// Handle the exception if the string cannot be parsed
System.out.println("Invalid date format");
e.printStackTrace();
}
return dates;
}
}

62
src/main/java/com/crs_birth_service/Service/ByteArrayMultipartFile.java

@ -0,0 +1,62 @@
package com.crs_birth_service.Service;
import org.springframework.web.multipart.MultipartFile;
import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
public class ByteArrayMultipartFile implements MultipartFile {
private final byte[] content;
private final String name;
private final String originalFilename;
private final String contentType;
public ByteArrayMultipartFile(byte[] content, String name, String originalFilename, String contentType) {
this.content = content;
this.name = name;
this.originalFilename = originalFilename;
this.contentType = contentType;
}
@Override
public String getName() {
return name;
}
@Override
public String getOriginalFilename() {
return originalFilename;
}
@Override
public String getContentType() {
return contentType;
}
@Override
public boolean isEmpty() {
return content.length == 0;
}
@Override
public long getSize() {
return content.length;
}
@Override
public byte[] getBytes() throws IOException {
return content;
}
@Override
public InputStream getInputStream() throws IOException {
return new ByteArrayInputStream(content);
}
@Override
public void transferTo(java.io.File dest) throws IOException, IllegalStateException {
// Implement file transfer logic if needed
}
}

57
src/main/java/com/crs_birth_service/config/ClientCall.java

@ -0,0 +1,57 @@
package com.crs_birth_service.config;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.http.HttpStatus;
import org.springframework.http.HttpStatusCode;
import org.springframework.stereotype.Component;
import reactor.core.publisher.Mono;
import static org.springframework.http.MediaType.APPLICATION_JSON;
@Component
public class ClientCall {
//
// private static final Logger LOGGER = LoggerFactory.getLogger(ClientCall.class);
//
//
// private final WebClient webClient;
//
//
// public ClientCall(WebClient.Builder webClientBuilder) {
// this.webClient = webClientBuilder.baseUrl("http://localhost:8099").build();
// }
//
//
//
//
// public void saveUser(BirthDto birthDto) {
// LOGGER.info("User call to saveAPI : {}",birthDto);
// try {
// webClient.post()
// .uri("http://localhost:8099/api/birth/save")
// .contentType(APPLICATION_JSON)
// .bodyValue(birthDto)
// .retrieve()
// .onStatus(HttpStatusCode::isError, response ->
// handleError(response))
// .toBodilessEntity()
// .block();
// LOGGER.info(String.format("User %s saved successfully",birthDto.getName()));
// } catch(WebClientResponseException e){
// LOGGER.error(String.format("Error save user ",birthDto.getName()));
// throw new GlobalExceptionHandler.ServiceUnavailableException(String.format("Error save user",birthDto.getName()));
// }
// }
// private Mono<Throwable> handleError(ClientResponse response) {
// if (response.statusCode() == HttpStatus.BAD_REQUEST) {
// return Mono.error(new GlobalExceptionHandler.ValidationException("Bad Request. Please check the inputs"));
// } else if (response.statusCode() == HttpStatus.NOT_FOUND){
// return Mono.error(new GlobalExceptionHandler.NotFoundException("Not Found"));
// } else{
// return Mono.error(new GlobalExceptionHandler.ServiceUnavailableException("Unable to reach save Server"));
// }
// }
}

44
src/main/java/com/crs_birth_service/config/KafkaListenerConfig.java

@ -0,0 +1,44 @@
package com.crs_birth_service.config;
import com.fasterxml.jackson.databind.deser.std.StringDeserializer;
import org.apache.kafka.clients.consumer.ConsumerConfig;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.kafka.annotation.EnableKafka;
import org.springframework.kafka.core.ConsumerFactory;
import org.springframework.kafka.core.DefaultKafkaConsumerFactory;
import org.springframework.kafka.support.serializer.JsonDeserializer;
import java.util.HashMap;
import java.util.Map;
@Configuration
@EnableKafka
public class KafkaListenerConfig {
//1
@Bean
public Map<String, Object> consumerConfig() {
Map<String, Object> config = new HashMap();
config.put(ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG,"localhost:9092");
config.put(ConsumerConfig.GROUP_ID_CONFIG, "bith-group");
config.put(ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class);
config.put(ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG, JsonDeserializer.class.getName());
config.put(ConsumerConfig.AUTO_OFFSET_RESET_CONFIG,"earliest");
config.put(ConsumerConfig.ENABLE_AUTO_COMMIT_CONFIG,"true");
return config;
}
//2
@Bean
public ConsumerFactory<String, String> consumerFactory(){
return new DefaultKafkaConsumerFactory<>(consumerConfig());
}
}

60
src/main/java/com/crs_birth_service/config/Listeners.java

@ -0,0 +1,60 @@
package com.crs_birth_service.config;
import com.crs_birth_service.dto.DtoforBirthConsum;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.kafka.annotation.KafkaListener;
@Configuration
public class Listeners {
@Autowired
private ObjectMapper objectMapper;
@Autowired
private ClientCall call;
private static final Logger log = LoggerFactory.getLogger(Listeners.class);
// @KafkaListener(topics = "birth",groupId = "bith-group")
// public void consume(String message) {
// try {
// DtoforBirthConsum birthConsum=objectMapper.readValue(message, DtoforBirthConsum.class);
// log.info("Successfully consumed json:{}",birthConsum);
// String eventid= birthConsum.getEventId();
// String eventType=birthConsum.getEventType();
// String Originator=birthConsum.getOriginator();
// String Vin= birthConsum.getVin();
// log.info("Successfully consumed json:{}",eventid);
// log.info("Successfully consumed json:{}",eventType);
// log.info("Successfully consumed json:{}",Originator);
// log.info("Successfully consumed json:{}",Vin);
//
//
//// DtoforBirthConsum buildRequest = DtoforBirthConsum.builder()
//// .name(eventid).adderss(eventType).father(Originator).password(Vin)
//// .build();
// //call.saveUser(buildRequest);
// log.info("Successfully call and saved through through Kafka Listener userGuid: {} ",eventid);
//
//
//
// } catch (JsonMappingException e) {
// // TODO Auto-generated catch block
// e.printStackTrace();
// } catch (JsonProcessingException e) {
// // TODO Auto-generated catch block
// e.printStackTrace();
// }
//
//
//
// }
}

1420
src/main/java/com/crs_birth_service/dto/BirthDetailsDto.java
File diff suppressed because it is too large
View File

54
src/main/java/com/crs_birth_service/dto/DtoforBirthConsum.java

@ -0,0 +1,54 @@
package com.crs_birth_service.dto;
public class DtoforBirthConsum {
private String eventType;
private String eventId;
private String userGuid;
private String vin;
private String originator;
public String getEventType() {
return eventType;
}
public void setEventType(String eventType) {
this.eventType = eventType;
}
public String getEventId() {
return eventId;
}
public void setEventId(String eventId) {
this.eventId = eventId;
}
public String getUserGuid() {
return userGuid;
}
public void setUserGuid(String userGuid) {
this.userGuid = userGuid;
}
public String getVin() {
return vin;
}
public void setVin(String vin) {
this.vin = vin;
}
public String getOriginator() {
return originator;
}
public void setOriginator(String originator) {
this.originator = originator;
}
public DtoforBirthConsum(String eventType, String eventId, String userGuid, String vin, String originator) {
super();
this.eventType = eventType;
this.eventId = eventId;
this.userGuid = userGuid;
this.vin = vin;
this.originator = originator;
}
public DtoforBirthConsum() {
super();
}
}

30
src/main/java/com/crs_birth_service/exception/GlobalExceptionHandler.java

@ -0,0 +1,30 @@
package com.crs_birth_service.exception;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.ResponseStatus;
import org.springframework.web.bind.annotation.RestControllerAdvice;
@RestControllerAdvice
public class GlobalExceptionHandler {
@ResponseStatus(HttpStatus.BAD_REQUEST)
public static class ValidationException extends RuntimeException{
public ValidationException(String message){super(message);}
}
@ResponseStatus(HttpStatus.NOT_FOUND)
public static class NotFoundException extends RuntimeException {
public NotFoundException(String message) {
super(message);
}
}
@ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR)
public static class ServiceUnavailableException extends RuntimeException {
public ServiceUnavailableException(String message) {
super(message);
}
}
}

16
src/main/java/com/crs_birth_service/fileUtil/FileService.java

@ -0,0 +1,16 @@
package com.crs_birth_service.fileUtil;
import org.springframework.cloud.openfeign.FeignClient;
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.RequestParam;
import org.springframework.web.multipart.MultipartFile;
import java.sql.Blob;
@FeignClient(value="fileService", url="http://localhost:9098")
public interface FileService {
@PostMapping("/photo")
public String saveFile(@RequestBody byte[] files, @RequestParam("uuid") String uuid);
}

18
src/main/resources/application.properties

@ -0,0 +1,18 @@
spring.application.name=crs-birth-service
server.port=9096
#eureka.instance.hostname=localhost
eureka.client.register-with-eureka= true
eureka.client.fetch-registry= true
eureka.client.service-url.defaultZone= http://localhost:8761/eureka/
eureka.client.service-url.instance.hostname = localhost
spring.datasource.url=jdbc:mysql://localhost:3306/birth_service
spring.datasource.username=root
spring.datasource.password=root
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.jpa.hibernate.ddl-auto=update
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQLDialect
spring.jpa.show-sql=true
spring.jpa.generate-ddl = true

13
src/test/java/com/crs_birth_service/CrsBirthServiceApplicationTests.java

@ -0,0 +1,13 @@
package com.crs_birth_service;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
class CrsBirthServiceApplicationTests {
@Test
void contextLoads() {
}
}
Loading…
Cancel
Save