Skip to content

Commit

Permalink
Merge pull request #2 from manoj-7899/tf_nira
Browse files Browse the repository at this point in the history
customcode
  • Loading branch information
SowmyaGoudar authored Aug 19, 2024
2 parents 2b2d624 + 711efbb commit 6f57d28
Show file tree
Hide file tree
Showing 155 changed files with 4,237 additions and 835 deletions.
1 change: 1 addition & 0 deletions .github/workflows/push_trigger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ on:
- master
- 1.*
- develop
- tf_nira

jobs:

Expand Down
1 change: 1 addition & 0 deletions registration/SCHEMA_3.3.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions registration/SCHEMA_3.8.json

Large diffs are not rendered by default.

192 changes: 192 additions & 0 deletions registration/applicanttype.mvel
Original file line number Diff line number Diff line change
@@ -0,0 +1,192 @@
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.time.Period;
import java.util.List;
import java.time.ZoneId;
import java.time.temporal.ValueRange;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

String CHILD = "INFANT";
String ADULT = "ADULT";
String MINOR = "MINOR";
String MALE = 'MLE';
String FEMALE = 'FLE';
String NonResident = "FR";
String Resident = "NFR";
String Others = "OTH";
String DATE_PATTERN = "yyyy/MM/dd";
String regex = "^\\d{4}(\\/)(((0)[1-9])|((1)[0-2]))(\\/)([0-2][0-9]|(3)[0-1])$";
Pattern pattern = Pattern.compile(regex);

def isUpdateFlow(identity) {
Object val = identity.getOrDefault('_flow', null);
return (val == 'Update') ? true : false;
}

def getResidenceStatus(identity) {
if(identity.containsKey('residenceStatusCode')) {
return identity.getOrDefault('residenceStatusCode', null);
}

if(identity.containsKey('residenceStatus')) {
Object val = identity.getOrDefault('residenceStatus', null);
return val == null ? null :
(val instanceof String ? ; (String)val : (String) ((List)val).get(0).value);
}

return null;
}

def getGenderType(identity) {
if(identity.containsKey('genderCode')) {
return identity.getOrDefault('genderCode', null);
}

if(identity.containsKey('gender')) {
Object val = identity.getOrDefault('gender', null);
return val == null ? null :
(val instanceof String ? ; (String)val : (String) ((List)val).get(0).value);
}

return null;
}

def getAgeCode(identity) {
if(ageGroups == null || !identity.containsKey('dateOfBirth'))
return null;

String dob = identity.get('dateOfBirth');
if(!pattern.matcher(dob).matches())
return null;

LocalDate date = LocalDate.parse(dob, DateTimeFormatter.ofPattern(DATE_PATTERN));
LocalDate currentDate = LocalDate.now(ZoneId.of("UTC"));

if(date.isAfter(currentDate)) { return 'KER-MSD-151'; }

int ageInYears = Period.between(date, currentDate).getYears();

String ageGroup = null;
for(String groupName : ageGroups.keySet()) {
String[] range = ((String)ageGroups.get(groupName)).split('-');
if(ValueRange.of(Long.valueOf(range[0]), Long.valueOf(range[1])).isValidIntValue(ageInYears)) {
ageGroup = groupName;
}
}

return ageGroup == null ? null : ageGroup;
}


def getBioExceptionFlag(identity) {
if(!identity.containsKey('isBioException')) { return false; }
Object val = identity.getOrDefault('isBioException', null);
return (val == 'true') ? true : (( val == 'false' ) ? false : null);
}

def getApplicantType() {
String itc = getResidenceStatus(identity);
String genderType = getGenderType(identity);
String ageCode = getAgeCode(identity);
boolean isBioExPresent = getBioExceptionFlag(identity);

if( ageCode == 'KER-MSD-151' ) { return "KER-MSD-151"; }

if(itc == null || genderType == null || ageCode == null || isBioExPresent == null ) {
return isUpdateFlow(identity) ? "000" : "KER-MSD-147";
}

System.out.println(itc + " - " + genderType + " - " + ageCode + " - " + isBioExPresent);

if (itc == NonResident && genderType == MALE && ageCode == CHILD && !isBioExPresent) {
return "001";
} else if (itc == NonResident && genderType == MALE && ageCode == ADULT && !isBioExPresent) {
return "002";
} else if (itc == Resident && genderType == MALE && ageCode == CHILD && !isBioExPresent) {
return "003";
} else if (itc == Resident && genderType == MALE && ageCode == ADULT && !isBioExPresent) {
return "004";
} else if (itc == NonResident && genderType == FEMALE && ageCode == CHILD && !isBioExPresent) {
return "005";
} else if (itc == NonResident && genderType == FEMALE && ageCode == ADULT && !isBioExPresent) {
return "006";
} else if (itc == Resident && genderType == FEMALE && ageCode == CHILD && !isBioExPresent) {
return "007";
} else if (itc == Resident && genderType == FEMALE && ageCode == ADULT && !isBioExPresent) {
return "008";
} else if (itc == NonResident && genderType == Others && ageCode == CHILD && !isBioExPresent) {
return "005";
} else if (itc == NonResident && genderType == Others && ageCode == ADULT && !isBioExPresent) {
return "006";
} else if (itc == Resident && genderType == Others && ageCode == CHILD && !isBioExPresent) {
return "007";
} else if (itc == Resident && genderType == Others && ageCode == ADULT && !isBioExPresent) {
return "008";
} else if (itc == NonResident && genderType == MALE && ageCode == CHILD && isBioExPresent) {
return "009";
} else if (itc == NonResident && genderType == MALE && ageCode == ADULT && isBioExPresent) {
return "010";
} else if (itc == Resident && genderType == MALE && ageCode == CHILD && isBioExPresent) {
return "011";
} else if (itc == Resident && genderType == MALE && ageCode == ADULT && isBioExPresent) {
return "012";
} else if (itc == NonResident && genderType == FEMALE && ageCode == CHILD && isBioExPresent) {
return "013";
} else if (itc == NonResident && genderType == FEMALE && ageCode == ADULT && isBioExPresent) {
return "014";
} else if (itc == Resident && genderType == FEMALE && ageCode == CHILD && isBioExPresent) {
return "015";
} else if (itc == Resident && genderType == FEMALE && ageCode == ADULT && isBioExPresent) {
return "016";
} else if (itc == NonResident && genderType == Others && ageCode == CHILD && isBioExPresent) {
return "013";
} else if (itc == NonResident && genderType == Others && ageCode == ADULT && isBioExPresent) {
return "014";
} else if (itc == Resident && genderType == Others && ageCode == CHILD && isBioExPresent) {
return "015";
} else if (itc == Resident && genderType == Others && ageCode == ADULT && isBioExPresent) {
return "016";
}

else if (itc == NonResident && genderType == MALE && ageCode == MINOR && isBioExPresent) {
return "014";
} else if (itc == Resident && genderType == MALE && ageCode == MINOR && isBioExPresent) {
return "015";
}

else if (itc == NonResident && genderType == FEMALE && ageCode == MINOR && isBioExPresent) {
return "014";
} else if (itc == Resident && genderType == FEMALE && ageCode == MINOR && isBioExPresent) {
return "015";
}

else if (itc == NonResident && genderType == Others && ageCode == MINOR && isBioExPresent) {
return "014";
} else if (itc == Resident && genderType == Others && ageCode == MINOR && isBioExPresent) {
return "015";
}

else if (itc == NonResident && genderType == MALE && ageCode == MINOR && !isBioExPresent) {
return "014";
} else if (itc == Resident && genderType == MALE && ageCode == MINOR && !isBioExPresent) {
return "015";
}

else if (itc == NonResident && genderType == FEMALE && ageCode == MINOR && !isBioExPresent) {
return "014";
} else if (itc == Resident && genderType == FEMALE && ageCode == MINOR && !isBioExPresent) {
return "015";
}

else if (itc == NonResident && genderType == Others && ageCode == MINOR && !isBioExPresent) {
return "014";
} else if (itc == Resident && genderType == Others && ageCode == MINOR && !isBioExPresent) {
return "015";
}


return "000";
}
29 changes: 17 additions & 12 deletions registration/configure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,23 @@ chmod -R a+x "${work_dir}"/registration-client/target/jre
cp "${work_dir}"/build_files/logback.xml "${work_dir}"/registration-client/target/lib/logback.xml
cp "${work_dir}"/registration-client/target/registration-client-${client_version_env}.jar "${work_dir}"/registration-client/target/lib/registration-client-${client_version_env}.jar

echo "@echo off" > "${work_dir}"/registration-client/target/run.bat
echo "if exist jre\jre (" >> "${work_dir}"/registration-client/target/run.bat
echo "xcopy /s /k /y /q jre\jre jre && rmdir /s /q jre\jre" >> "${work_dir}"/registration-client/target/run.bat
echo ")" >> "${work_dir}"/registration-client/target/run.bat
echo "if exist .UNKNOWN_JARS (" >> "${work_dir}"/registration-client/target/run.bat
echo "FOR /F \"tokens=* delims=\" %%x in (.UNKNOWN_JARS) DO DEL /Q lib\%%x" >> "${work_dir}"/registration-client/target/run.bat
echo ")" >> "${work_dir}"/registration-client/target/run.bat
echo "if exist .TEMP (" >> "${work_dir}"/registration-client/target/run.bat
echo "echo Starting Registration Client after Upgrade" >> "${work_dir}"/registration-client/target/run.bat
echo "xcopy /f/k/y/v/q .TEMP lib && rmdir /s /q .TEMP && start jre\bin\javaw -Xmx2048m -Xms2048m -Dfile.encoding=UTF-8 -cp lib/*;/* io.mosip.registration.controller.Initialization > startup.log 2>&1" >> "${work_dir}"/registration-client/target/run.bat
echo ") else (" >> "${work_dir}"/registration-client/target/run.bat
echo "echo Starting Registration Client" >> "${work_dir}"/registration-client/target/run.bat
echo "start jre\bin\javaw -Xmx2048m -Xms2048m -Dfile.encoding=UTF-8 -cp lib/*;/* io.mosip.registration.controller.Initialization > startup.log 2>&1" >> "${work_dir}"/registration-client/target/run.bat
echo ")" >> "${work_dir}"/registration-client/target/run.bat

cp "${work_dir}"/registration-client/target/run.bat "${work_dir}"/registration-client/target/lib/114to1201_run.bat

## jar signing
jarsigner -keystore "${work_dir}"/build_files/keystore.p12 -storepass ${keystore_secret} -tsa ${signer_timestamp_url_env} -digestalg SHA-256 "${work_dir}"/registration-client/target/lib/registration-client-${client_version_env}.jar CodeSigning
jarsigner -keystore "${work_dir}"/build_files/keystore.p12 -storepass ${keystore_secret} -tsa ${signer_timestamp_url_env} -digestalg SHA-256 "${work_dir}"/registration-client/target/lib/registration-services-${client_version_env}.jar CodeSigning
Expand All @@ -103,18 +120,6 @@ echo "Started to create the registration client zip"

ls -ltr lib | grep bc

echo "@echo off" > run.bat
echo "if exist .UNKNOWN_JARS (" >> run.bat
echo "FOR /F \"tokens=* delims=\" %%x in (.UNKNOWN_JARS) DO DEL /Q lib\%%x" >> run.bat
echo ")" >> run.bat
echo "if exist .TEMP (" >> run.bat
echo "echo Starting Registration Client after Upgrade" >> run.bat
echo "xcopy /f/k/y/v/q .TEMP lib && rmdir /s /q .TEMP && start jre\bin\javaw -Xmx2048m -Xms2048m -Dfile.encoding=UTF-8 -cp lib/*;/* io.mosip.registration.controller.Initialization > startup.log 2>&1" >> run.bat
echo ") else (" >> run.bat
echo "echo Starting Registration Client" >> run.bat
echo "start jre\bin\javaw -Xmx2048m -Xms2048m -Dfile.encoding=UTF-8 -cp lib/*;/* io.mosip.registration.controller.Initialization > startup.log 2>&1" >> run.bat
echo ")" >> run.bat

/usr/bin/zip -r reg-client.zip jre
/usr/bin/zip -r reg-client.zip lib
/usr/bin/zip -r reg-client.zip MANIFEST.MF
Expand Down
1 change: 1 addition & 0 deletions registration/lostProcess.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions registration/newProcess.json

Large diffs are not rendered by default.

38 changes: 31 additions & 7 deletions registration/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
<!--<parent>
<groupId>io.mosip</groupId>
<artifactId>registration</artifactId>
<version>1.2.0.1-B1</version>
<version>1.2.0.1</version>
</parent>-->

<groupId>io.mosip.registration</groupId>
<version>1.2.0.1-B1</version>
<version>1.2.0.2-SNAPSHOT</version>
<artifactId>registration-client-parent</artifactId>
<packaging>pom</packaging>
<name>MOSIP Registration Client</name>
Expand Down Expand Up @@ -103,11 +103,12 @@
<apache.commons.dpce.version>2.1.1</apache.commons.dpce.version>

<!-- Jackson -->
<jackson.version>2.10.1</jackson.version>
<jackson.version>2.14.0</jackson.version>
<jackson.mapper.asl.version>1.7.1</jackson.mapper.asl.version>

<mosip.core.kernel.version>1.2.0.1-B1</mosip.core.kernel.version>
<mosip.biometric.util.version>1.2.0.1-B1-SNAPSHOT</mosip.biometric.util.version>
<mosip.core.kernel.version>1.2.0.1</mosip.core.kernel.version>
<mosip.commons.packet.manager.version>1.2.0.1</mosip.commons.packet.manager.version>
<mosip.biometric.util.version>1.2.0.2</mosip.biometric.util.version>
<mosip.kernel.virusscanner.version>1.1.3</mosip.kernel.virusscanner.version>
<!-- Derby Version -->
<apache.derby.version>10.13.1.1</apache.derby.version>
Expand Down Expand Up @@ -171,7 +172,6 @@
<!--<module>ref-impl/ref-document-scanner</module>
<module>ref-impl/ref-geoposition-rxtx</module>-->
<module>registration-test</module>

</modules>

<dependencyManagement>
Expand Down Expand Up @@ -439,6 +439,9 @@
<artifactId>cglib-nodep</artifactId>
<version>3.2.7</version>
</dependency>



</dependencies>
</dependencyManagement>

Expand All @@ -449,6 +452,7 @@
<artifactId>maven-surefire-plugin</artifactId>
<version>${maven.surefire.plugin.version}</version>
<configuration>
<!--suppress UnresolvedMavenProperty -->
<skipTests>${skipTests}</skipTests>
<skip>false</skip>
<argLine>
Expand Down Expand Up @@ -536,7 +540,7 @@
</execution>
</executions>
</plugin>
<plugin>
<plugin>
<groupId>pl.project13.maven</groupId>
<artifactId>git-commit-id-plugin</artifactId>
<version>3.0.1</version>
Expand Down Expand Up @@ -603,6 +607,26 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>3.0.0</version>
<executions>
<execution>
<id>make-jar-executable</id>
<phase>package</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<!-- Create a shell script to run the JAR file with executable permission -->
<chmod file="${project.build.directory}/*.jar" perm="ugo+rx"/>
</target>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
Expand Down
24 changes: 22 additions & 2 deletions registration/ref-impl/ref-document-scanner/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>io.mosip.registration</groupId>
<artifactId>ref-document-scanner</artifactId>
<version>1.2.0.1-B1</version>
<version>1.2.0.2-SNAPSHOT</version>

<properties>
<maven.compiler.source>11</maven.compiler.source>
Expand All @@ -20,7 +20,7 @@
<dependency>
<groupId>io.mosip.registration</groupId>
<artifactId>registration-api</artifactId>
<version>1.2.0.1-B1</version>
<version>1.2.0.2</version>
<scope>compile</scope>
</dependency>

Expand Down Expand Up @@ -124,6 +124,26 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>3.0.0</version>
<executions>
<execution>
<id>make-jar-executable</id>
<phase>package</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<!-- Create a shell script to run the JAR file with executable permission -->
<chmod file="${project.build.directory}/*.jar" perm="ugo+rx"/>
</target>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

Expand Down
Loading

0 comments on commit 6f57d28

Please sign in to comment.