Compare commits

..

6 Commits

Author SHA1 Message Date
Harish Kumar b40e1de14c 03-02-2025 18:23 2025-02-03 18:23:37 +05:30
Harish Kumar f2eafc9149 03-02-2025 10:57 2025-02-03 10:57:42 +05:30
Harish Kumar 8f95df0a27 01-02-2025 09:31 2025-02-01 09:31:36 +05:30
Harish Kumar e551e238ba 31-01-2025 10:07 2025-01-31 10:10:00 +05:30
Harish Kumar 2725268aa9 31-01-2025 10:07 2025-01-31 10:07:39 +05:30
Harish Kumar 3b312c7533 31-01-2025 09:58 2025-01-31 09:58:51 +05:30
140 changed files with 16092 additions and 0 deletions

51
.classpath Normal file
View File

@ -0,0 +1,51 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/classes" path="src/main/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
<attribute name="optional" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
<attributes>
<attribute name="test" value="true"/>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
<attributes>
<attribute name="test" value="true"/>
<attribute name="maven.pomderived" value="true"/>
<attribute name="optional" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-17">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" path="target/generated-sources/annotations">
<attributes>
<attribute name="optional" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="target/generated-test-sources/test-annotations">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>

118
.factorypath Normal file
View File

@ -0,0 +1,118 @@
<factorypath>
<factorypathentry kind="VARJAR" id="M2_REPO/org/springframework/boot/spring-boot-starter-data-jpa/3.4.1/spring-boot-starter-data-jpa-3.4.1.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/org/springframework/boot/spring-boot-starter/3.4.1/spring-boot-starter-3.4.1.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/org/springframework/boot/spring-boot-starter-logging/3.4.1/spring-boot-starter-logging-3.4.1.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/ch/qos/logback/logback-classic/1.5.12/logback-classic-1.5.12.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/ch/qos/logback/logback-core/1.5.12/logback-core-1.5.12.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/org/apache/logging/log4j/log4j-to-slf4j/2.24.3/log4j-to-slf4j-2.24.3.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/org/apache/logging/log4j/log4j-api/2.24.3/log4j-api-2.24.3.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/org/slf4j/jul-to-slf4j/2.0.16/jul-to-slf4j-2.0.16.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/jakarta/annotation/jakarta.annotation-api/2.1.1/jakarta.annotation-api-2.1.1.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/org/yaml/snakeyaml/2.3/snakeyaml-2.3.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/org/springframework/boot/spring-boot-starter-jdbc/3.4.1/spring-boot-starter-jdbc-3.4.1.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/com/zaxxer/HikariCP/5.1.0/HikariCP-5.1.0.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/org/springframework/spring-jdbc/6.2.1/spring-jdbc-6.2.1.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/org/hibernate/orm/hibernate-core/6.6.4.Final/hibernate-core-6.6.4.Final.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/jakarta/persistence/jakarta.persistence-api/3.1.0/jakarta.persistence-api-3.1.0.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/jakarta/transaction/jakarta.transaction-api/2.0.1/jakarta.transaction-api-2.0.1.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/org/jboss/logging/jboss-logging/3.6.1.Final/jboss-logging-3.6.1.Final.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/org/hibernate/common/hibernate-commons-annotations/7.0.3.Final/hibernate-commons-annotations-7.0.3.Final.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/io/smallrye/jandex/3.2.0/jandex-3.2.0.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/com/fasterxml/classmate/1.7.0/classmate-1.7.0.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/net/bytebuddy/byte-buddy/1.15.11/byte-buddy-1.15.11.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/org/glassfish/jaxb/jaxb-runtime/4.0.5/jaxb-runtime-4.0.5.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/org/glassfish/jaxb/jaxb-core/4.0.5/jaxb-core-4.0.5.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/org/eclipse/angus/angus-activation/2.0.2/angus-activation-2.0.2.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/org/glassfish/jaxb/txw2/4.0.5/txw2-4.0.5.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/com/sun/istack/istack-commons-runtime/4.1.2/istack-commons-runtime-4.1.2.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/jakarta/inject/jakarta.inject-api/2.0.1/jakarta.inject-api-2.0.1.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/org/antlr/antlr4-runtime/4.13.0/antlr4-runtime-4.13.0.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/org/springframework/data/spring-data-jpa/3.4.1/spring-data-jpa-3.4.1.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/org/springframework/data/spring-data-commons/3.4.1/spring-data-commons-3.4.1.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/org/springframework/spring-orm/6.2.1/spring-orm-6.2.1.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/org/springframework/spring-context/6.2.1/spring-context-6.2.1.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/org/springframework/spring-aop/6.2.1/spring-aop-6.2.1.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/org/springframework/spring-tx/6.2.1/spring-tx-6.2.1.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/org/springframework/spring-beans/6.2.1/spring-beans-6.2.1.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/org/springframework/spring-aspects/6.2.1/spring-aspects-6.2.1.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/org/aspectj/aspectjweaver/1.9.22.1/aspectjweaver-1.9.22.1.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/org/springframework/boot/spring-boot-starter-web/3.4.1/spring-boot-starter-web-3.4.1.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/org/springframework/boot/spring-boot-starter-json/3.4.1/spring-boot-starter-json-3.4.1.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/com/fasterxml/jackson/core/jackson-databind/2.18.2/jackson-databind-2.18.2.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/com/fasterxml/jackson/core/jackson-annotations/2.18.2/jackson-annotations-2.18.2.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/com/fasterxml/jackson/core/jackson-core/2.18.2/jackson-core-2.18.2.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/com/fasterxml/jackson/datatype/jackson-datatype-jdk8/2.18.2/jackson-datatype-jdk8-2.18.2.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/com/fasterxml/jackson/datatype/jackson-datatype-jsr310/2.18.2/jackson-datatype-jsr310-2.18.2.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/com/fasterxml/jackson/module/jackson-module-parameter-names/2.18.2/jackson-module-parameter-names-2.18.2.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/org/springframework/boot/spring-boot-starter-tomcat/3.4.1/spring-boot-starter-tomcat-3.4.1.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/org/apache/tomcat/embed/tomcat-embed-core/10.1.34/tomcat-embed-core-10.1.34.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/org/apache/tomcat/embed/tomcat-embed-websocket/10.1.34/tomcat-embed-websocket-10.1.34.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/org/springframework/spring-web/6.2.1/spring-web-6.2.1.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/io/micrometer/micrometer-observation/1.14.2/micrometer-observation-1.14.2.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/io/micrometer/micrometer-commons/1.14.2/micrometer-commons-1.14.2.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/org/springframework/spring-webmvc/6.2.1/spring-webmvc-6.2.1.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/org/springframework/spring-expression/6.2.1/spring-expression-6.2.1.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/org/springframework/boot/spring-boot-starter-validation/3.4.1/spring-boot-starter-validation-3.4.1.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/org/apache/tomcat/embed/tomcat-embed-el/10.1.34/tomcat-embed-el-10.1.34.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/org/hibernate/validator/hibernate-validator/8.0.2.Final/hibernate-validator-8.0.2.Final.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/jakarta/validation/jakarta.validation-api/3.0.2/jakarta.validation-api-3.0.2.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/org/springframework/cloud/spring-cloud-starter-openfeign/3.1.3/spring-cloud-starter-openfeign-3.1.3.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/org/springframework/cloud/spring-cloud-starter/3.1.3/spring-cloud-starter-3.1.3.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/org/springframework/cloud/spring-cloud-context/3.1.3/spring-cloud-context-3.1.3.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/org/springframework/security/spring-security-rsa/1.0.10.RELEASE/spring-security-rsa-1.0.10.RELEASE.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/org/bouncycastle/bcpkix-jdk15on/1.68/bcpkix-jdk15on-1.68.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/org/bouncycastle/bcprov-jdk15on/1.68/bcprov-jdk15on-1.68.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/org/springframework/cloud/spring-cloud-openfeign-core/3.1.3/spring-cloud-openfeign-core-3.1.3.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/org/springframework/boot/spring-boot-starter-aop/3.4.1/spring-boot-starter-aop-3.4.1.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/io/github/openfeign/form/feign-form-spring/3.8.0/feign-form-spring-3.8.0.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/io/github/openfeign/form/feign-form/3.8.0/feign-form-3.8.0.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/commons-fileupload/commons-fileupload/1.4/commons-fileupload-1.4.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/commons-io/commons-io/2.2/commons-io-2.2.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/org/springframework/cloud/spring-cloud-commons/3.1.3/spring-cloud-commons-3.1.3.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/org/springframework/security/spring-security-crypto/6.4.2/spring-security-crypto-6.4.2.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/io/github/openfeign/feign-core/11.8/feign-core-11.8.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/io/github/openfeign/feign-slf4j/11.8/feign-slf4j-11.8.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/org/springframework/boot/spring-boot-starter-webflux/3.4.1/spring-boot-starter-webflux-3.4.1.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/org/springframework/boot/spring-boot-starter-reactor-netty/3.4.1/spring-boot-starter-reactor-netty-3.4.1.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/io/projectreactor/netty/reactor-netty-http/1.2.1/reactor-netty-http-1.2.1.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/io/netty/netty-codec-http/4.1.116.Final/netty-codec-http-4.1.116.Final.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/io/netty/netty-common/4.1.116.Final/netty-common-4.1.116.Final.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/io/netty/netty-buffer/4.1.116.Final/netty-buffer-4.1.116.Final.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/io/netty/netty-transport/4.1.116.Final/netty-transport-4.1.116.Final.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/io/netty/netty-codec/4.1.116.Final/netty-codec-4.1.116.Final.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/io/netty/netty-handler/4.1.116.Final/netty-handler-4.1.116.Final.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/io/netty/netty-codec-http2/4.1.116.Final/netty-codec-http2-4.1.116.Final.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/io/netty/netty-resolver-dns/4.1.116.Final/netty-resolver-dns-4.1.116.Final.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/io/netty/netty-resolver/4.1.116.Final/netty-resolver-4.1.116.Final.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/io/netty/netty-codec-dns/4.1.116.Final/netty-codec-dns-4.1.116.Final.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/io/netty/netty-resolver-dns-native-macos/4.1.116.Final/netty-resolver-dns-native-macos-4.1.116.Final-osx-x86_64.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/io/netty/netty-resolver-dns-classes-macos/4.1.116.Final/netty-resolver-dns-classes-macos-4.1.116.Final.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/io/netty/netty-transport-native-epoll/4.1.116.Final/netty-transport-native-epoll-4.1.116.Final-linux-x86_64.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/io/netty/netty-transport-native-unix-common/4.1.116.Final/netty-transport-native-unix-common-4.1.116.Final.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/io/netty/netty-transport-classes-epoll/4.1.116.Final/netty-transport-classes-epoll-4.1.116.Final.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/io/projectreactor/netty/reactor-netty-core/1.2.1/reactor-netty-core-1.2.1.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/io/netty/netty-handler-proxy/4.1.116.Final/netty-handler-proxy-4.1.116.Final.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/io/netty/netty-codec-socks/4.1.116.Final/netty-codec-socks-4.1.116.Final.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/org/springframework/spring-webflux/6.2.1/spring-webflux-6.2.1.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/io/projectreactor/reactor-core/3.7.1/reactor-core-3.7.1.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/org/reactivestreams/reactive-streams/1.0.4/reactive-streams-1.0.4.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/jakarta/xml/bind/jakarta.xml.bind-api/4.0.2/jakarta.xml.bind-api-4.0.2.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/jakarta/activation/jakarta.activation-api/2.1.3/jakarta.activation-api-2.1.3.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/org/springframework/spring-core/6.2.1/spring-core-6.2.1.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/org/springframework/spring-jcl/6.2.1/spring-jcl-6.2.1.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/org/springframework/boot/spring-boot-devtools/3.4.1/spring-boot-devtools-3.4.1.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/org/springframework/boot/spring-boot/3.4.1/spring-boot-3.4.1.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/org/springframework/boot/spring-boot-autoconfigure/3.4.1/spring-boot-autoconfigure-3.4.1.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/javax/validation/validation-api/2.0.1.Final/validation-api-2.0.1.Final.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/com/mysql/mysql-connector-j/9.1.0/mysql-connector-j-9.1.0.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/org/projectlombok/lombok/1.18.36/lombok-1.18.36.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/com/google/code/gson/gson/2.11.0/gson-2.11.0.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/com/google/errorprone/error_prone_annotations/2.27.0/error_prone_annotations-2.27.0.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/org/codehaus/jettison/jettison/1.4.1/jettison-1.4.1.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/net/sf/dozer/dozer/5.5.1/dozer-5.5.1.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/commons-beanutils/commons-beanutils/1.9.1/commons-beanutils-1.9.1.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/commons-collections/commons-collections/3.2.1/commons-collections-3.2.1.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/org/apache/commons/commons-lang3/3.17.0/commons-lang3-3.17.0.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/org/slf4j/slf4j-api/2.0.16/slf4j-api-2.0.16.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/org/slf4j/jcl-over-slf4j/2.0.16/jcl-over-slf4j-2.0.16.jar" enabled="true" runInBatchMode="false"/>
</factorypath>

2
.gitattributes vendored Normal file
View File

@ -0,0 +1,2 @@
/mvnw text eol=lf
*.cmd text eol=crlf

33
.gitignore vendored Normal file
View File

@ -0,0 +1,33 @@
HELP.md
target/
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**/target/
!**/src/test/**/target/
### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr
### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
build/
!**/src/main/**/build/
!**/src/test/**/build/
### VS Code ###
.vscode/

0
.metadata/.lock Normal file
View File

4
.metadata/.lock_info Normal file
View File

@ -0,0 +1,4 @@
#Fri Jan 31 14:33:49 IST 2025
host=DESKTOP-2TQ3QR4
process-id=194304
user=Admin

61
.metadata/.log Normal file
View File

@ -0,0 +1,61 @@
!SESSION 2025-01-31 14:33:34.782 -----------------------------------------------
eclipse.buildId=4.34.0.202411281622
java.version=21.0.5
java.vendor=Eclipse Adoptium
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US
Framework arguments: -product org.springframework.boot.ide.branding.sts4
Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.springframework.boot.ide.branding.sts4
!ENTRY ch.qos.logback.classic 1 0 2025-01-31 14:33:37.787
!MESSAGE Activated before the state location was initialized. Retry after the state location is initialized.
!ENTRY ch.qos.logback.classic 1 0 2025-01-31 14:33:50.397
!MESSAGE Logback config file: C:\MyProject\CODE\Source Code\Git\Backup\inbound-user-service\.metadata\.plugins\org.eclipse.m2e.logback\logback.2.7.0.20241001-1350.xml
!ENTRY org.eclipse.ui 2 0 2025-01-31 14:33:50.852
!MESSAGE Warnings while parsing the commands from the 'org.eclipse.ui.commands' and 'org.eclipse.ui.actionDefinitions' extension points.
!SUBENTRY 1 org.eclipse.ui 2 0 2025-01-31 14:33:50.852
!MESSAGE Commands should really have a category: plug-in='org.springframework.tooling.boot.ls', id='spring.initializr.addStarters', categoryId='org.eclipse.lsp4e.commandCategory'
!ENTRY org.eclipse.ui 4 4 2025-01-31 14:33:51.049
!MESSAGE Invalid workspace location to be set for Edge browser.
!STACK 0
java.net.URISyntaxException: Illegal character in path at index 30: file:/C:/MyProject/CODE/Source Code/Git/Backup/inbound-user-service/.metadata/.plugins/org.eclipse.swt
at java.base/java.net.URI$Parser.fail(URI.java:2995)
at java.base/java.net.URI$Parser.checkChars(URI.java:3166)
at java.base/java.net.URI$Parser.parseHierarchical(URI.java:3248)
at java.base/java.net.URI$Parser.parse(URI.java:3196)
at java.base/java.net.URI.<init>(URI.java:645)
at java.base/java.net.URL.toURI(URL.java:1220)
at org.eclipse.ui.internal.Workbench.setEdgeDataDirectory(Workbench.java:530)
at org.eclipse.ui.internal.Workbench.<init>(Workbench.java:461)
at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:598)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:339)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:570)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:173)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:178)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:208)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:143)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:109)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:439)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:271)
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
at java.base/java.lang.reflect.Method.invoke(Method.java:580)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:668)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:605)
at org.eclipse.equinox.launcher.Main.run(Main.java:1481)
!ENTRY org.eclipse.ui 2 0 2025-01-31 14:33:51.188
!MESSAGE Warnings while parsing the commands from the 'org.eclipse.ui.commands' and 'org.eclipse.ui.actionDefinitions' extension points.
!SUBENTRY 1 org.eclipse.ui 2 0 2025-01-31 14:33:51.189
!MESSAGE Commands should really have a category: plug-in='org.springframework.tooling.boot.ls', id='spring.initializr.addStarters', categoryId='org.eclipse.lsp4e.commandCategory'
!ENTRY org.eclipse.mylyn.tasks.ui 2 0 2025-01-31 14:33:54.735
!MESSAGE No search provider was registered. Tasks search is not available.
!ENTRY org.eclipse.egit.ui 2 0 2025-01-31 14:33:55.706
!MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git
user global configuration and to define the default location to store repositories: 'C:\Users\Admin'. If this is
not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and
EGit might behave differently since they see different configuration options.
This warning can be switched off on the Team > Git > Confirmations and Warnings preference page.

Binary file not shown.

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<section name="Workbench">
<list key="EGit.KnownHosts">
<item value="git.eclipse.org"/>
<item value="github.com"/>
<item value="bitbucket.org"/>
</list>
</section>

View File

@ -0,0 +1 @@
java

View File

@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<typeInfoHistroy/>

View File

@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<qualifiedTypeNameHistroy/>

View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<section name="Workbench">
<section name="org.eclipse.jdt.internal.ui.packageview.PackageExplorerPart">
<item key="group_libraries" value="true"/>
<item key="layout" value="2"/>
<item key="rootMode" value="1"/>
<item key="linkWithEditor" value="false"/>
<item key="memento" value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&#x0D;&#x0A;&lt;packageExplorer group_libraries=&quot;1&quot; layout=&quot;2&quot; linkWithEditor=&quot;0&quot; rootMode=&quot;1&quot; workingSetName=&quot;&quot;&gt;&#x0D;&#x0A;&lt;customFilters userDefinedPatternsEnabled=&quot;false&quot;&gt;&#x0D;&#x0A;&lt;xmlDefinedFilters&gt;&#x0D;&#x0A;&lt;child filterId=&quot;org.eclipse.jdt.ui.PackageExplorer.StaticsFilter&quot; isEnabled=&quot;false&quot;/&gt;&#x0D;&#x0A;&lt;child filterId=&quot;org.eclipse.buildship.ui.packageexplorer.filter.gradle.buildfolder&quot; isEnabled=&quot;true&quot;/&gt;&#x0D;&#x0A;&lt;child filterId=&quot;org.eclipse.jdt.ui.PackageExplorer.NonSharedProjectsFilter&quot; isEnabled=&quot;false&quot;/&gt;&#x0D;&#x0A;&lt;child filterId=&quot;bndtools.jareditor.tempfiles.packageexplorer.filter&quot; isEnabled=&quot;true&quot;/&gt;&#x0D;&#x0A;&lt;child filterId=&quot;org.eclipse.jdt.internal.ui.PackageExplorer.EmptyInnerPackageFilter&quot; isEnabled=&quot;true&quot;/&gt;&#x0D;&#x0A;&lt;child filterId=&quot;org.eclipse.m2e.MavenModuleFilter&quot; isEnabled=&quot;false&quot;/&gt;&#x0D;&#x0A;&lt;child filterId=&quot;org.eclipse.buildship.ui.packageexplorer.filter.gradle.subProject&quot; isEnabled=&quot;true&quot;/&gt;&#x0D;&#x0A;&lt;child filterId=&quot;org.eclipse.jdt.ui.PackageExplorer.ClosedProjectsFilter&quot; isEnabled=&quot;false&quot;/&gt;&#x0D;&#x0A;&lt;child filterId=&quot;org.eclipse.jdt.ui.PackageExplorer.EmptyLibraryContainerFilter&quot; isEnabled=&quot;true&quot;/&gt;&#x0D;&#x0A;&lt;child filterId=&quot;org.eclipse.jdt.ui.PackageExplorer.PackageDeclarationFilter&quot; isEnabled=&quot;true&quot;/&gt;&#x0D;&#x0A;&lt;child filterId=&quot;org.eclipse.pde.ui.BinaryProjectFilter1&quot; isEnabled=&quot;false&quot;/&gt;&#x0D;&#x0A;&lt;child filterId=&quot;org.eclipse.jdt.ui.PackageExplorer.LocalTypesFilter&quot; isEnabled=&quot;false&quot;/&gt;&#x0D;&#x0A;&lt;child filterId=&quot;org.eclipse.pde.ui.ExternalPluginLibrariesFilter1&quot; isEnabled=&quot;true&quot;/&gt;&#x0D;&#x0A;&lt;child filterId=&quot;org.eclipse.jdt.ui.PackageExplorer.FieldsFilter&quot; isEnabled=&quot;false&quot;/&gt;&#x0D;&#x0A;&lt;child filterId=&quot;org.eclipse.jdt.ui.PackageExplorer.NonJavaProjectsFilter&quot; isEnabled=&quot;false&quot;/&gt;&#x0D;&#x0A;&lt;child filterId=&quot;org.eclipse.jdt.ui.PackageExplorer_patternFilterId_.*&quot; isEnabled=&quot;true&quot;/&gt;&#x0D;&#x0A;&lt;child filterId=&quot;org.eclipse.jdt.ui.PackageExplorer.SyntheticMembersFilter&quot; isEnabled=&quot;true&quot;/&gt;&#x0D;&#x0A;&lt;child filterId=&quot;org.eclipse.jdt.ui.PackageExplorer.ContainedLibraryFilter&quot; isEnabled=&quot;false&quot;/&gt;&#x0D;&#x0A;&lt;child filterId=&quot;org.eclipse.jdt.internal.ui.PackageExplorer.HideInnerClassFilesFilter&quot; isEnabled=&quot;true&quot;/&gt;&#x0D;&#x0A;&lt;child filterId=&quot;org.eclipse.jdt.ui.PackageExplorer.DeprecatedMembersFilter&quot; isEnabled=&quot;false&quot;/&gt;&#x0D;&#x0A;&lt;child filterId=&quot;org.eclipse.jdt.ui.PackageExplorer.ImportDeclarationFilter&quot; isEnabled=&quot;true&quot;/&gt;&#x0D;&#x0A;&lt;child filterId=&quot;org.eclipse.jdt.ui.PackageExplorer.NonJavaElementFilter&quot; isEnabled=&quot;false&quot;/&gt;&#x0D;&#x0A;&lt;child filterId=&quot;org.eclipse.jdt.ui.PackageExplorer.LibraryFilter&quot; isEnabled=&quot;false&quot;/&gt;&#x0D;&#x0A;&lt;child filterId=&quot;org.eclipse.jdt.ui.PackageExplorer.CuAndClassFileFilter&quot; isEnabled=&quot;false&quot;/&gt;&#x0D;&#x0A;&lt;child filterId=&quot;org.eclipse.jdt.internal.ui.PackageExplorer.EmptyPackageFilter&quot; isEnabled=&quot;false&quot;/&gt;&#x0D;&#x0A;&lt;child filterId=&quot;org.eclipse.jdt.ui.PackageExplorer.NonPublicFilter&quot; isEnabled=&quot;false&quot;/&gt;&#x0D;&#x0A;&lt;/xmlDefinedFilters&gt;&#x0D;&#x0A;&lt;/customFilters&gt;&#x0D;&#x0A;&lt;/packageExplorer&gt;"/>
</section>
</section>

View File

@ -0,0 +1 @@
2025-01-31 14:33:55,667 [Worker-4: Loading available Gradle versions] INFO o.e.b.c.i.u.g.PublishedGradleVersions - Gradle version information cache is not available. Remote download required.

View File

@ -0,0 +1,41 @@
<configuration scan="true">
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<pattern>%date [%thread] %-5level %logger{35} - %msg%n</pattern>
</encoder>
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>${org.eclipse.m2e.log.console.threshold:-OFF}</level> <!-- change to DEBUG to mimic '-consolelog' behaviour -->
</filter>
</appender>
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<File>${org.eclipse.m2e.log.dir}/0.log</File>
<rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
<FileNamePattern>${org.eclipse.m2e.log.dir}/%i.log</FileNamePattern>
<MinIndex>1</MinIndex>
<MaxIndex>10</MaxIndex>
</rollingPolicy>
<triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
<MaxFileSize>10MB</MaxFileSize>
</triggeringPolicy>
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<pattern>%date [%thread] %-5level %logger{35} - %msg%n</pattern>
</encoder>
</appender>
<appender name="EclipseLog" class="org.eclipse.m2e.logback.appender.EclipseLogAppender">
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>WARN</level>
</filter>
</appender>
<appender name="MavenConsoleLog" class="org.eclipse.m2e.logback.appender.MavenConsoleAppender">
</appender>
<root level="INFO">
<appender-ref ref="FILE" />
<appender-ref ref="STDOUT" />
<appender-ref ref="EclipseLog" />
<appender-ref ref="MavenConsoleLog" />
</root>
</configuration>

View File

@ -0,0 +1,2 @@
#Cached timestamps
#Fri Jan 31 14:34:12 IST 2025

View File

@ -0,0 +1,3 @@
<?xml version="1.0" encoding="UTF-8"?>
<section name="Workbench">
</section>

View File

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<section name="Workbench">
<section name="SmartImportWizard">
<item key="SmartImportRootWizardPage.STORE_HIDE_ALREADY_OPEN" value="false"/>
<item key="SmartImportRootWizardPage.STORE_CLOSE_IMPORTED" value="false"/>
<item key="SmartImportRootWizardPage.STORE_NESTED_PROJECTS" value="true"/>
<item key="SmartImportRootWizardPage.STORE_CONFIGURE_NATURES" value="true"/>
<section name="SmartImportWizard.dialogBounds">
<item key="DIALOG_X_ORIGIN" value="479"/>
<item key="DIALOG_Y_ORIGIN" value="11"/>
<item key="DIALOG_WIDTH" value="984"/>
<item key="DIALOG_HEIGHT" value="837"/>
<item key="DIALOG_FONT_NAME" value="1|Segoe UI|9.0|0|WINDOWS|1|-18|0|0|0|400|0|0|0|1|0|0|0|0|Segoe UI"/>
</section>
</section>
</section>

View File

@ -0,0 +1,3 @@
<?xml version="1.0" encoding="UTF-8"?>
<section name="Workbench">
</section>

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<workingSetManager>
<workingSet editPageId="org.eclipse.jdt.internal.ui.DynamicSourcesWorkingSet" factoryID="org.eclipse.ui.internal.WorkingSetFactory" id="1738314233456_0" label="Java Main Sources" name="Java Main Sources"/>
<workingSet editPageId="org.eclipse.jdt.internal.ui.DynamicSourcesWorkingSet" factoryID="org.eclipse.ui.internal.WorkingSetFactory" id="1738314233472_1" label="Java Test Sources" name="Java Test Sources"/>
<workingSet aggregate="true" factoryID="org.eclipse.ui.internal.WorkingSetFactory" id="1738314234853_2" label="Window Working Set" name="Aggregate for window 1738314234852"/>
</workingSetManager>

3
.metadata/version.ini Normal file
View File

@ -0,0 +1,3 @@
#Fri Jan 31 14:33:49 IST 2025
org.eclipse.core.runtime=2
org.eclipse.platform=4.34.0.v20241120-1800

19
.mvn/wrapper/maven-wrapper.properties vendored Normal file
View File

@ -0,0 +1,19 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
wrapperVersion=3.3.2
distributionType=only-script
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.9/apache-maven-3.9.9-bin.zip

28
.project Normal file
View File

@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>inbound-user-service</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.springframework.ide.eclipse.boot.validation.springbootbuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
</natures>
</projectDescription>

View File

@ -0,0 +1,6 @@
eclipse.preferences.version=1
encoding//src/main/java=UTF-8
encoding//src/main/resources=UTF-8
encoding//src/test/java=UTF-8
encoding//src/test/resources=UTF-8
encoding/<project>=UTF-8

View File

@ -0,0 +1,4 @@
eclipse.preferences.version=1
org.eclipse.jdt.apt.aptEnabled=true
org.eclipse.jdt.apt.genSrcDir=target/generated-sources/annotations
org.eclipse.jdt.apt.genTestSrcDir=target/generated-test-sources/test-annotations

View File

@ -0,0 +1,10 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.methodParameters=generate
org.eclipse.jdt.core.compiler.codegen.targetPlatform=17
org.eclipse.jdt.core.compiler.compliance=17
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore
org.eclipse.jdt.core.compiler.processAnnotations=enabled
org.eclipse.jdt.core.compiler.release=enabled
org.eclipse.jdt.core.compiler.source=17

View File

@ -0,0 +1,4 @@
activeProfiles=
eclipse.preferences.version=1
resolveWorkspaceProjects=true
version=1

29
HELP.md Normal file
View File

@ -0,0 +1,29 @@
# Getting Started
### Reference Documentation
For further reference, please consider the following sections:
* [Official Apache Maven documentation](https://maven.apache.org/guides/index.html)
* [Spring Boot Maven Plugin Reference Guide](https://docs.spring.io/spring-boot/3.4.1/maven-plugin)
* [Create an OCI image](https://docs.spring.io/spring-boot/3.4.1/maven-plugin/build-image.html)
* [Spring Data JPA](https://docs.spring.io/spring-boot/3.4.1/reference/data/sql.html#data.sql.jpa-and-spring-data)
* [Spring Boot DevTools](https://docs.spring.io/spring-boot/3.4.1/reference/using/devtools.html)
* [Validation](https://docs.spring.io/spring-boot/3.4.1/reference/io/validation.html)
* [Spring Web](https://docs.spring.io/spring-boot/3.4.1/reference/web/servlet.html)
### Guides
The following guides illustrate how to use some features concretely:
* [Accessing Data with JPA](https://spring.io/guides/gs/accessing-data-jpa/)
* [Validation](https://spring.io/guides/gs/validating-form-input/)
* [Building a RESTful Web Service](https://spring.io/guides/gs/rest-service/)
* [Serving Web Content with Spring MVC](https://spring.io/guides/gs/serving-web-content/)
* [Building REST services with Spring](https://spring.io/guides/tutorials/rest/)
### Maven Parent overrides
Due to Maven's design, elements are inherited from the parent POM to the project POM.
While most of the inheritance is fine, it also inherits unwanted elements like `<license>` and `<developers>` from the parent.
To prevent this, the project POM contains empty overrides for these elements.
If you manually switch to a different parent and actually want the inheritance, you need to remove those overrides.

259
mvnw vendored Normal file
View File

@ -0,0 +1,259 @@
#!/bin/sh
# ----------------------------------------------------------------------------
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
# ----------------------------------------------------------------------------
# ----------------------------------------------------------------------------
# Apache Maven Wrapper startup batch script, version 3.3.2
#
# Optional ENV vars
# -----------------
# JAVA_HOME - location of a JDK home dir, required when download maven via java source
# MVNW_REPOURL - repo url base for downloading maven distribution
# MVNW_USERNAME/MVNW_PASSWORD - user and password for downloading maven
# MVNW_VERBOSE - true: enable verbose log; debug: trace the mvnw script; others: silence the output
# ----------------------------------------------------------------------------
set -euf
[ "${MVNW_VERBOSE-}" != debug ] || set -x
# OS specific support.
native_path() { printf %s\\n "$1"; }
case "$(uname)" in
CYGWIN* | MINGW*)
[ -z "${JAVA_HOME-}" ] || JAVA_HOME="$(cygpath --unix "$JAVA_HOME")"
native_path() { cygpath --path --windows "$1"; }
;;
esac
# set JAVACMD and JAVACCMD
set_java_home() {
# For Cygwin and MinGW, ensure paths are in Unix format before anything is touched
if [ -n "${JAVA_HOME-}" ]; then
if [ -x "$JAVA_HOME/jre/sh/java" ]; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
JAVACCMD="$JAVA_HOME/jre/sh/javac"
else
JAVACMD="$JAVA_HOME/bin/java"
JAVACCMD="$JAVA_HOME/bin/javac"
if [ ! -x "$JAVACMD" ] || [ ! -x "$JAVACCMD" ]; then
echo "The JAVA_HOME environment variable is not defined correctly, so mvnw cannot run." >&2
echo "JAVA_HOME is set to \"$JAVA_HOME\", but \"\$JAVA_HOME/bin/java\" or \"\$JAVA_HOME/bin/javac\" does not exist." >&2
return 1
fi
fi
else
JAVACMD="$(
'set' +e
'unset' -f command 2>/dev/null
'command' -v java
)" || :
JAVACCMD="$(
'set' +e
'unset' -f command 2>/dev/null
'command' -v javac
)" || :
if [ ! -x "${JAVACMD-}" ] || [ ! -x "${JAVACCMD-}" ]; then
echo "The java/javac command does not exist in PATH nor is JAVA_HOME set, so mvnw cannot run." >&2
return 1
fi
fi
}
# hash string like Java String::hashCode
hash_string() {
str="${1:-}" h=0
while [ -n "$str" ]; do
char="${str%"${str#?}"}"
h=$(((h * 31 + $(LC_CTYPE=C printf %d "'$char")) % 4294967296))
str="${str#?}"
done
printf %x\\n $h
}
verbose() { :; }
[ "${MVNW_VERBOSE-}" != true ] || verbose() { printf %s\\n "${1-}"; }
die() {
printf %s\\n "$1" >&2
exit 1
}
trim() {
# MWRAPPER-139:
# Trims trailing and leading whitespace, carriage returns, tabs, and linefeeds.
# Needed for removing poorly interpreted newline sequences when running in more
# exotic environments such as mingw bash on Windows.
printf "%s" "${1}" | tr -d '[:space:]'
}
# parse distributionUrl and optional distributionSha256Sum, requires .mvn/wrapper/maven-wrapper.properties
while IFS="=" read -r key value; do
case "${key-}" in
distributionUrl) distributionUrl=$(trim "${value-}") ;;
distributionSha256Sum) distributionSha256Sum=$(trim "${value-}") ;;
esac
done <"${0%/*}/.mvn/wrapper/maven-wrapper.properties"
[ -n "${distributionUrl-}" ] || die "cannot read distributionUrl property in ${0%/*}/.mvn/wrapper/maven-wrapper.properties"
case "${distributionUrl##*/}" in
maven-mvnd-*bin.*)
MVN_CMD=mvnd.sh _MVNW_REPO_PATTERN=/maven/mvnd/
case "${PROCESSOR_ARCHITECTURE-}${PROCESSOR_ARCHITEW6432-}:$(uname -a)" in
*AMD64:CYGWIN* | *AMD64:MINGW*) distributionPlatform=windows-amd64 ;;
:Darwin*x86_64) distributionPlatform=darwin-amd64 ;;
:Darwin*arm64) distributionPlatform=darwin-aarch64 ;;
:Linux*x86_64*) distributionPlatform=linux-amd64 ;;
*)
echo "Cannot detect native platform for mvnd on $(uname)-$(uname -m), use pure java version" >&2
distributionPlatform=linux-amd64
;;
esac
distributionUrl="${distributionUrl%-bin.*}-$distributionPlatform.zip"
;;
maven-mvnd-*) MVN_CMD=mvnd.sh _MVNW_REPO_PATTERN=/maven/mvnd/ ;;
*) MVN_CMD="mvn${0##*/mvnw}" _MVNW_REPO_PATTERN=/org/apache/maven/ ;;
esac
# apply MVNW_REPOURL and calculate MAVEN_HOME
# maven home pattern: ~/.m2/wrapper/dists/{apache-maven-<version>,maven-mvnd-<version>-<platform>}/<hash>
[ -z "${MVNW_REPOURL-}" ] || distributionUrl="$MVNW_REPOURL$_MVNW_REPO_PATTERN${distributionUrl#*"$_MVNW_REPO_PATTERN"}"
distributionUrlName="${distributionUrl##*/}"
distributionUrlNameMain="${distributionUrlName%.*}"
distributionUrlNameMain="${distributionUrlNameMain%-bin}"
MAVEN_USER_HOME="${MAVEN_USER_HOME:-${HOME}/.m2}"
MAVEN_HOME="${MAVEN_USER_HOME}/wrapper/dists/${distributionUrlNameMain-}/$(hash_string "$distributionUrl")"
exec_maven() {
unset MVNW_VERBOSE MVNW_USERNAME MVNW_PASSWORD MVNW_REPOURL || :
exec "$MAVEN_HOME/bin/$MVN_CMD" "$@" || die "cannot exec $MAVEN_HOME/bin/$MVN_CMD"
}
if [ -d "$MAVEN_HOME" ]; then
verbose "found existing MAVEN_HOME at $MAVEN_HOME"
exec_maven "$@"
fi
case "${distributionUrl-}" in
*?-bin.zip | *?maven-mvnd-?*-?*.zip) ;;
*) die "distributionUrl is not valid, must match *-bin.zip or maven-mvnd-*.zip, but found '${distributionUrl-}'" ;;
esac
# prepare tmp dir
if TMP_DOWNLOAD_DIR="$(mktemp -d)" && [ -d "$TMP_DOWNLOAD_DIR" ]; then
clean() { rm -rf -- "$TMP_DOWNLOAD_DIR"; }
trap clean HUP INT TERM EXIT
else
die "cannot create temp dir"
fi
mkdir -p -- "${MAVEN_HOME%/*}"
# Download and Install Apache Maven
verbose "Couldn't find MAVEN_HOME, downloading and installing it ..."
verbose "Downloading from: $distributionUrl"
verbose "Downloading to: $TMP_DOWNLOAD_DIR/$distributionUrlName"
# select .zip or .tar.gz
if ! command -v unzip >/dev/null; then
distributionUrl="${distributionUrl%.zip}.tar.gz"
distributionUrlName="${distributionUrl##*/}"
fi
# verbose opt
__MVNW_QUIET_WGET=--quiet __MVNW_QUIET_CURL=--silent __MVNW_QUIET_UNZIP=-q __MVNW_QUIET_TAR=''
[ "${MVNW_VERBOSE-}" != true ] || __MVNW_QUIET_WGET='' __MVNW_QUIET_CURL='' __MVNW_QUIET_UNZIP='' __MVNW_QUIET_TAR=v
# normalize http auth
case "${MVNW_PASSWORD:+has-password}" in
'') MVNW_USERNAME='' MVNW_PASSWORD='' ;;
has-password) [ -n "${MVNW_USERNAME-}" ] || MVNW_USERNAME='' MVNW_PASSWORD='' ;;
esac
if [ -z "${MVNW_USERNAME-}" ] && command -v wget >/dev/null; then
verbose "Found wget ... using wget"
wget ${__MVNW_QUIET_WGET:+"$__MVNW_QUIET_WGET"} "$distributionUrl" -O "$TMP_DOWNLOAD_DIR/$distributionUrlName" || die "wget: Failed to fetch $distributionUrl"
elif [ -z "${MVNW_USERNAME-}" ] && command -v curl >/dev/null; then
verbose "Found curl ... using curl"
curl ${__MVNW_QUIET_CURL:+"$__MVNW_QUIET_CURL"} -f -L -o "$TMP_DOWNLOAD_DIR/$distributionUrlName" "$distributionUrl" || die "curl: Failed to fetch $distributionUrl"
elif set_java_home; then
verbose "Falling back to use Java to download"
javaSource="$TMP_DOWNLOAD_DIR/Downloader.java"
targetZip="$TMP_DOWNLOAD_DIR/$distributionUrlName"
cat >"$javaSource" <<-END
public class Downloader extends java.net.Authenticator
{
protected java.net.PasswordAuthentication getPasswordAuthentication()
{
return new java.net.PasswordAuthentication( System.getenv( "MVNW_USERNAME" ), System.getenv( "MVNW_PASSWORD" ).toCharArray() );
}
public static void main( String[] args ) throws Exception
{
setDefault( new Downloader() );
java.nio.file.Files.copy( java.net.URI.create( args[0] ).toURL().openStream(), java.nio.file.Paths.get( args[1] ).toAbsolutePath().normalize() );
}
}
END
# For Cygwin/MinGW, switch paths to Windows format before running javac and java
verbose " - Compiling Downloader.java ..."
"$(native_path "$JAVACCMD")" "$(native_path "$javaSource")" || die "Failed to compile Downloader.java"
verbose " - Running Downloader.java ..."
"$(native_path "$JAVACMD")" -cp "$(native_path "$TMP_DOWNLOAD_DIR")" Downloader "$distributionUrl" "$(native_path "$targetZip")"
fi
# If specified, validate the SHA-256 sum of the Maven distribution zip file
if [ -n "${distributionSha256Sum-}" ]; then
distributionSha256Result=false
if [ "$MVN_CMD" = mvnd.sh ]; then
echo "Checksum validation is not supported for maven-mvnd." >&2
echo "Please disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties." >&2
exit 1
elif command -v sha256sum >/dev/null; then
if echo "$distributionSha256Sum $TMP_DOWNLOAD_DIR/$distributionUrlName" | sha256sum -c >/dev/null 2>&1; then
distributionSha256Result=true
fi
elif command -v shasum >/dev/null; then
if echo "$distributionSha256Sum $TMP_DOWNLOAD_DIR/$distributionUrlName" | shasum -a 256 -c >/dev/null 2>&1; then
distributionSha256Result=true
fi
else
echo "Checksum validation was requested but neither 'sha256sum' or 'shasum' are available." >&2
echo "Please install either command, or disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties." >&2
exit 1
fi
if [ $distributionSha256Result = false ]; then
echo "Error: Failed to validate Maven distribution SHA-256, your Maven distribution might be compromised." >&2
echo "If you updated your Maven version, you need to update the specified distributionSha256Sum property." >&2
exit 1
fi
fi
# unzip and move
if command -v unzip >/dev/null; then
unzip ${__MVNW_QUIET_UNZIP:+"$__MVNW_QUIET_UNZIP"} "$TMP_DOWNLOAD_DIR/$distributionUrlName" -d "$TMP_DOWNLOAD_DIR" || die "failed to unzip"
else
tar xzf${__MVNW_QUIET_TAR:+"$__MVNW_QUIET_TAR"} "$TMP_DOWNLOAD_DIR/$distributionUrlName" -C "$TMP_DOWNLOAD_DIR" || die "failed to untar"
fi
printf %s\\n "$distributionUrl" >"$TMP_DOWNLOAD_DIR/$distributionUrlNameMain/mvnw.url"
mv -- "$TMP_DOWNLOAD_DIR/$distributionUrlNameMain" "$MAVEN_HOME" || [ -d "$MAVEN_HOME" ] || die "fail to move MAVEN_HOME"
clean || :
exec_maven "$@"

149
mvnw.cmd vendored Normal file
View File

@ -0,0 +1,149 @@
<# : batch portion
@REM ----------------------------------------------------------------------------
@REM Licensed to the Apache Software Foundation (ASF) under one
@REM or more contributor license agreements. See the NOTICE file
@REM distributed with this work for additional information
@REM regarding copyright ownership. The ASF licenses this file
@REM to you under the Apache License, Version 2.0 (the
@REM "License"); you may not use this file except in compliance
@REM with the License. You may obtain a copy of the License at
@REM
@REM http://www.apache.org/licenses/LICENSE-2.0
@REM
@REM Unless required by applicable law or agreed to in writing,
@REM software distributed under the License is distributed on an
@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@REM KIND, either express or implied. See the License for the
@REM specific language governing permissions and limitations
@REM under the License.
@REM ----------------------------------------------------------------------------
@REM ----------------------------------------------------------------------------
@REM Apache Maven Wrapper startup batch script, version 3.3.2
@REM
@REM Optional ENV vars
@REM MVNW_REPOURL - repo url base for downloading maven distribution
@REM MVNW_USERNAME/MVNW_PASSWORD - user and password for downloading maven
@REM MVNW_VERBOSE - true: enable verbose log; others: silence the output
@REM ----------------------------------------------------------------------------
@IF "%__MVNW_ARG0_NAME__%"=="" (SET __MVNW_ARG0_NAME__=%~nx0)
@SET __MVNW_CMD__=
@SET __MVNW_ERROR__=
@SET __MVNW_PSMODULEP_SAVE=%PSModulePath%
@SET PSModulePath=
@FOR /F "usebackq tokens=1* delims==" %%A IN (`powershell -noprofile "& {$scriptDir='%~dp0'; $script='%__MVNW_ARG0_NAME__%'; icm -ScriptBlock ([Scriptblock]::Create((Get-Content -Raw '%~f0'))) -NoNewScope}"`) DO @(
IF "%%A"=="MVN_CMD" (set __MVNW_CMD__=%%B) ELSE IF "%%B"=="" (echo %%A) ELSE (echo %%A=%%B)
)
@SET PSModulePath=%__MVNW_PSMODULEP_SAVE%
@SET __MVNW_PSMODULEP_SAVE=
@SET __MVNW_ARG0_NAME__=
@SET MVNW_USERNAME=
@SET MVNW_PASSWORD=
@IF NOT "%__MVNW_CMD__%"=="" (%__MVNW_CMD__% %*)
@echo Cannot start maven from wrapper >&2 && exit /b 1
@GOTO :EOF
: end batch / begin powershell #>
$ErrorActionPreference = "Stop"
if ($env:MVNW_VERBOSE -eq "true") {
$VerbosePreference = "Continue"
}
# calculate distributionUrl, requires .mvn/wrapper/maven-wrapper.properties
$distributionUrl = (Get-Content -Raw "$scriptDir/.mvn/wrapper/maven-wrapper.properties" | ConvertFrom-StringData).distributionUrl
if (!$distributionUrl) {
Write-Error "cannot read distributionUrl property in $scriptDir/.mvn/wrapper/maven-wrapper.properties"
}
switch -wildcard -casesensitive ( $($distributionUrl -replace '^.*/','') ) {
"maven-mvnd-*" {
$USE_MVND = $true
$distributionUrl = $distributionUrl -replace '-bin\.[^.]*$',"-windows-amd64.zip"
$MVN_CMD = "mvnd.cmd"
break
}
default {
$USE_MVND = $false
$MVN_CMD = $script -replace '^mvnw','mvn'
break
}
}
# apply MVNW_REPOURL and calculate MAVEN_HOME
# maven home pattern: ~/.m2/wrapper/dists/{apache-maven-<version>,maven-mvnd-<version>-<platform>}/<hash>
if ($env:MVNW_REPOURL) {
$MVNW_REPO_PATTERN = if ($USE_MVND) { "/org/apache/maven/" } else { "/maven/mvnd/" }
$distributionUrl = "$env:MVNW_REPOURL$MVNW_REPO_PATTERN$($distributionUrl -replace '^.*'+$MVNW_REPO_PATTERN,'')"
}
$distributionUrlName = $distributionUrl -replace '^.*/',''
$distributionUrlNameMain = $distributionUrlName -replace '\.[^.]*$','' -replace '-bin$',''
$MAVEN_HOME_PARENT = "$HOME/.m2/wrapper/dists/$distributionUrlNameMain"
if ($env:MAVEN_USER_HOME) {
$MAVEN_HOME_PARENT = "$env:MAVEN_USER_HOME/wrapper/dists/$distributionUrlNameMain"
}
$MAVEN_HOME_NAME = ([System.Security.Cryptography.MD5]::Create().ComputeHash([byte[]][char[]]$distributionUrl) | ForEach-Object {$_.ToString("x2")}) -join ''
$MAVEN_HOME = "$MAVEN_HOME_PARENT/$MAVEN_HOME_NAME"
if (Test-Path -Path "$MAVEN_HOME" -PathType Container) {
Write-Verbose "found existing MAVEN_HOME at $MAVEN_HOME"
Write-Output "MVN_CMD=$MAVEN_HOME/bin/$MVN_CMD"
exit $?
}
if (! $distributionUrlNameMain -or ($distributionUrlName -eq $distributionUrlNameMain)) {
Write-Error "distributionUrl is not valid, must end with *-bin.zip, but found $distributionUrl"
}
# prepare tmp dir
$TMP_DOWNLOAD_DIR_HOLDER = New-TemporaryFile
$TMP_DOWNLOAD_DIR = New-Item -Itemtype Directory -Path "$TMP_DOWNLOAD_DIR_HOLDER.dir"
$TMP_DOWNLOAD_DIR_HOLDER.Delete() | Out-Null
trap {
if ($TMP_DOWNLOAD_DIR.Exists) {
try { Remove-Item $TMP_DOWNLOAD_DIR -Recurse -Force | Out-Null }
catch { Write-Warning "Cannot remove $TMP_DOWNLOAD_DIR" }
}
}
New-Item -Itemtype Directory -Path "$MAVEN_HOME_PARENT" -Force | Out-Null
# Download and Install Apache Maven
Write-Verbose "Couldn't find MAVEN_HOME, downloading and installing it ..."
Write-Verbose "Downloading from: $distributionUrl"
Write-Verbose "Downloading to: $TMP_DOWNLOAD_DIR/$distributionUrlName"
$webclient = New-Object System.Net.WebClient
if ($env:MVNW_USERNAME -and $env:MVNW_PASSWORD) {
$webclient.Credentials = New-Object System.Net.NetworkCredential($env:MVNW_USERNAME, $env:MVNW_PASSWORD)
}
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
$webclient.DownloadFile($distributionUrl, "$TMP_DOWNLOAD_DIR/$distributionUrlName") | Out-Null
# If specified, validate the SHA-256 sum of the Maven distribution zip file
$distributionSha256Sum = (Get-Content -Raw "$scriptDir/.mvn/wrapper/maven-wrapper.properties" | ConvertFrom-StringData).distributionSha256Sum
if ($distributionSha256Sum) {
if ($USE_MVND) {
Write-Error "Checksum validation is not supported for maven-mvnd. `nPlease disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties."
}
Import-Module $PSHOME\Modules\Microsoft.PowerShell.Utility -Function Get-FileHash
if ((Get-FileHash "$TMP_DOWNLOAD_DIR/$distributionUrlName" -Algorithm SHA256).Hash.ToLower() -ne $distributionSha256Sum) {
Write-Error "Error: Failed to validate Maven distribution SHA-256, your Maven distribution might be compromised. If you updated your Maven version, you need to update the specified distributionSha256Sum property."
}
}
# unzip and move
Expand-Archive "$TMP_DOWNLOAD_DIR/$distributionUrlName" -DestinationPath "$TMP_DOWNLOAD_DIR" | Out-Null
Rename-Item -Path "$TMP_DOWNLOAD_DIR/$distributionUrlNameMain" -NewName $MAVEN_HOME_NAME | Out-Null
try {
Move-Item -Path "$TMP_DOWNLOAD_DIR/$MAVEN_HOME_NAME" -Destination $MAVEN_HOME_PARENT | Out-Null
} catch {
if (! (Test-Path -Path "$MAVEN_HOME" -PathType Container)) {
Write-Error "fail to move MAVEN_HOME"
}
} finally {
try { Remove-Item $TMP_DOWNLOAD_DIR -Recurse -Force | Out-Null }
catch { Write-Warning "Cannot remove $TMP_DOWNLOAD_DIR" }
}
Write-Output "MVN_CMD=$MAVEN_HOME/bin/$MVN_CMD"

135
pom.xml Normal file
View File

@ -0,0 +1,135 @@
<?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.4.1</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.sahyog.app.inbound</groupId>
<artifactId>inbound-user-service</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>inbound-user-service</name>
<description>project user management services in Spring Boot</description>
<properties>
<java.version>17</java.version>
<spring-cloud.version>2021.0.3</spring-cloud.version>
</properties>
<dependencies>
<!-- START - Local dependency added 2021.0.3 -->
<!-- <dependency>
<groupId>com.sahyog.app.inbound</groupId>
<artifactId>inbound-common-lib</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency> -->
<!-- END - Local dependency -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<!-- dependency added -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</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-webflux</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
<version>2.0.1.Final</version> <!-- Latest version for javax.validation -->
</dependency>
<!-- dependency added -->
<!-- swagger -->
<!--<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-ui</artifactId>
<version>1.6.12</version>
</dependency>-->
<dependency>
<groupId>com.mysql</groupId>
<artifactId>mysql-connector-j</artifactId>
<scope>runtime</scope>
</dependency>
<!-- getter / setter -->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
</dependency>
<dependency>
<groupId>org.codehaus.jettison</groupId>
<artifactId>jettison</artifactId>
<version>1.4.1</version>
</dependency>
<dependency>
<groupId>net.sf.dozer</groupId>
<artifactId>dozer</artifactId>
<version>5.5.1</version>
</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>
<image>
<builder>paketobuildpacks/builder-jammy-base:latest</builder>
</image>
<excludes>
<exclude>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
</build>
</project>

View File

@ -0,0 +1,13 @@
package com.sahyog.app.inbound.user;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class InboundUserServiceApplication {
public static void main(String[] args) {
SpringApplication.run(InboundUserServiceApplication.class, args);
}
}

View File

@ -0,0 +1,18 @@
package com.sahyog.app.inbound.user.config;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import org.springframework.context.annotation.Configuration;
@Configuration
public class CorsConfig implements WebMvcConfigurer {
@Override
public void addCorsMappings(CorsRegistry registry) {
registry.addMapping("/**") // Allow CORS for all paths
.allowedOrigins("*") // Allow requests from all origins
.allowedMethods("GET", "POST", "PUT", "DELETE", "OPTIONS", "PATCH") // Allow specific HTTP methods
.allowedHeaders("*") // Allow all headers
.allowCredentials(false); // Disable credentials for wildcard origins
}
}

View File

@ -0,0 +1,143 @@
package com.sahyog.app.inbound.user.controller;
import java.util.List;
import java.util.Map;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.sahyog.app.inbound.user.dto.MaterialMasterDTO;
import com.sahyog.app.inbound.user.enums.Status;
import com.sahyog.app.inbound.user.model.Response;
import com.sahyog.app.inbound.user.model.User;
import com.sahyog.app.inbound.user.service.MaterialMasterService;
import jakarta.validation.Valid;
@RestController
@RequestMapping("/api/materials")
public class MaterialMasterController {
private static final Logger log = LoggerFactory.getLogger(MaterialMasterController.class);
@Autowired
private MaterialMasterService materialMasterService;
// Process Material endpoint
@PostMapping("/process")
public Response<List<Map<String, Object>>> processMaterial(
@RequestBody @Valid List<MaterialMasterDTO> dtos) {
log.info("Received request to process materials with {} DTOs", dtos.size());
try {
User currentUser = getCurrentUser(); // Fetch the current logged-in user
log.debug("Current user: {}", currentUser);
// Call the service method and get the response
Response<List<Map<String, Object>>> response = materialMasterService.processMaterial(dtos, currentUser);
log.info("Processed materials successfully");
return response;
} catch (Exception e) {
log.error("Error occurred while processing materials: {}", e.getMessage(), e);
return Response.error("Failed to process materials");
}
}
private User getCurrentUser() {
// Replace this with actual logic to fetch the current user
User user = new User();
user.setUserId(1); // Example user ID
log.debug("Fetched current user: {}", user);
return user;
}
@GetMapping("/getAll")
public Response<List<MaterialMasterDTO>> getAllMaterials() {
log.info("Fetching all materials");
try {
List<MaterialMasterDTO> materials = materialMasterService.getAllMaterials();
log.info("Fetched {} materials successfully", materials.size());
return Response.success(materials).withMessage("Fetched all materials successfully.");
} catch (Exception e) {
log.error("Error fetching all materials: {}", e.getMessage(), e);
return Response.error("Failed to fetch all materials");
}
}
@GetMapping("/getByPlantIdAndMaterialId")
public Response<MaterialMasterDTO> getMaterialByPlantIdAndMaterialId(
@RequestParam("plantId") Short plantId,
@RequestParam("materialId") Short materialId) {
log.info("Fetching material with plantId: {} and materialId: {}", plantId, materialId);
try {
MaterialMasterDTO material = materialMasterService.getMaterialByPlantIdAndMaterialId(plantId, materialId);
log.info("Fetched material successfully for plantId: {} and materialId: {}", plantId, materialId);
return Response.success(material).withMessage("Fetched material successfully.");
} catch (Exception e) {
log.error("Error fetching material for plantId: {} and materialId: {}", plantId, materialId, e);
return Response.error("Failed to fetch material");
}
}
@GetMapping("/getAllWithFilter")
public Response<Page<MaterialMasterDTO>> getMaterialsWithFilters(
@RequestParam(required = false) String materialCode,
@RequestParam(required = false) String materialGroup,
@RequestParam(required = false) String materialGroupDesc,
@RequestParam(required = false) Status status,
@RequestParam(defaultValue = "0") int page,
@RequestParam(defaultValue = "5") int size) {
log.info("Fetching materials with filters: materialCode={}, materialGroup={}, materialGroupDesc={}, status={}",
materialCode, materialGroup, materialGroupDesc, status);
try {
Pageable pageable = PageRequest.of(page, size);
Page<MaterialMasterDTO> materials = materialMasterService.getMaterialsWithFilters(
materialCode, materialGroup, materialGroupDesc, status, pageable);
log.info("Fetched {} materials successfully with filters", materials.getTotalElements());
return Response.success(materials).withMessage("Fetched materials successfully.");
} catch (Exception e) {
log.error("Error fetching materials with filters", e);
return Response.error("Failed to fetch materials with filters");
}
}
@PostMapping("/materialdetails")
public ResponseEntity<Response<Page<Map<String, Object>>>> getMaterialDetails(
@RequestBody Map<String, Object> req, Pageable pageable) {
log.info("Fetching material details with request: {}", req);
try {
// Call the service to fetch material details
Page<Map<String, Object>> materialDetails = materialMasterService.getMaterialDetails(req, pageable);
// Check if the result is empty and respond accordingly
if (materialDetails.isEmpty()) {
log.warn("No material details found for the provided filters: {}", req);
return ResponseEntity.ok(new Response<>(204, "No material details found for the provided filters.", materialDetails));
}
log.info("Fetched material details successfully");
return ResponseEntity.ok(new Response<>(200, "Material details fetched successfully.", materialDetails));
} catch (Exception e) {
log.error("Error fetching material details", e);
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(
new Response<>(500, "An error occurred while fetching material details. Please try again later.", null)
);
}
}
}

View File

@ -0,0 +1,154 @@
package com.sahyog.app.inbound.user.controller;
import java.util.List;
import java.util.Map;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;
import org.springframework.data.web.PageableDefault;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PatchMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.sahyog.app.inbound.user.dto.PlantDTO;
import com.sahyog.app.inbound.user.dto.PlantMasterDTO;
import com.sahyog.app.inbound.user.enums.Status;
import com.sahyog.app.inbound.user.model.Response;
import com.sahyog.app.inbound.user.model.User;
import com.sahyog.app.inbound.user.service.PlantMasterService;
import jakarta.validation.Valid;
@RestController
@RequestMapping("/api/plant")
public class PlantMasterController {
private static final Logger log = LoggerFactory.getLogger(PlantMasterController.class);
@Autowired
private PlantMasterService plantMasterService;
@PostMapping("/create")
public Response<List<Map<String, Object>>> processPlant(@RequestBody List<PlantDTO> dtos) {
log.info("Received request to process Plant DTOs: {}", dtos);
try {
User currentUser = getCurrentUser();
log.debug("Current user: {}", currentUser);
// Call the service method and log the response
Response<List<Map<String, Object>>> response = plantMasterService.processPlant(dtos, currentUser);
log.info("Successfully processed Plant DTOs. Response: {}", response);
return response;
} catch (Exception e) {
log.error("Error occurred while processing Plant DTOs: {}", e.getMessage(), e);
return Response.error(500, "Failed to process Plant DTOs");
}
}
private User getCurrentUser() {
log.debug("Fetching current user...");
User user = new User();
user.setUserId(1); // Example user ID
log.debug("Fetched current user: {}", user);
return user;
}
@GetMapping("/get")
public Response<List<PlantDTO>> getPlantsByStatus(@RequestParam(value = "status", required = false) String status) {
log.info("Received request to fetch plants by status: {}", status);
try {
List<PlantDTO> plants;
if (status == null || status.equalsIgnoreCase("B")) {
log.info("Fetching all plants as no specific status is provided");
plants = plantMasterService.getAllPlants();
} else {
log.info("Fetching plants with status: {}", status);
plants = plantMasterService.getPlantsByStatus(Status.valueOf(status.toUpperCase()));
}
log.info("Successfully fetched plants. Count: {}", plants.size());
return Response.success(plants).withMessage("Fetched plants successfully.");
} catch (Exception e) {
log.error("Error occurred while fetching plants: {}", e.getMessage(), e);
return Response.error(500, "Failed to fetch plants");
}
}
@GetMapping("/getAllAndPlantWithStatusPagination")
public Response<Page<PlantDTO>> getPlantsWithPagination(
@RequestParam(defaultValue = "0") int pageNumber,
@RequestParam(defaultValue = "10") int pageSize,
@RequestParam(value = "status", required = false) List<String> statusFilters) {
log.info("Received request for paginated plants. Page: {}, Size: {}, Status Filters: {}", pageNumber, pageSize, statusFilters);
try {
Pageable pageable = PageRequest.of(pageNumber, pageSize, Sort.by(Sort.Direction.DESC, "lastUpdatedOn"));
Page<PlantDTO> plants;
if (statusFilters == null || statusFilters.isEmpty()) {
log.info("Fetching all plants with pagination");
plants = plantMasterService.getAllPlantsWithPagination(pageable);
} else {
log.info("Fetching plants with filters: {} and pagination", statusFilters);
plants = plantMasterService.getPlantsByStatusWithPagination(statusFilters, pageable);
}
log.info("Successfully fetched {} plants with pagination", plants.getTotalElements());
return Response.success(plants).withMessage("Fetched plants successfully.");
} catch (Exception e) {
log.error("Error occurred while fetching plants with pagination: {}", e.getMessage(), e);
return Response.error(500, "Failed to fetch paginated plants");
}
}
@PatchMapping("/updateStatus")
public Response<PlantDTO> updatePlantStatus(
@RequestParam(value = "plantId", required = false) Short plantId,
@RequestParam(value = "plantCode", required = false) String plantCode,
@RequestParam("status") String status) {
log.info("Received request to update plant status. PlantId: {}, PlantCode: {}, Status: {}", plantId, plantCode, status);
try {
// Validate input
if (!status.equalsIgnoreCase("A") && !status.equalsIgnoreCase("I")) {
log.warn("Invalid status provided: {}", status);
throw new IllegalArgumentException("Invalid status. Only 'A' (ACTIVE) or 'I' (INACTIVE) are allowed.");
}
if (plantId == null && plantCode == null) {
log.warn("Neither 'plantId' nor 'plantCode' was provided.");
throw new IllegalArgumentException("Either 'plantId' or 'plantCode' must be provided.");
}
User currentUser = getCurrentUser();
log.debug("Current user for status update: {}", currentUser);
// Call the service method
PlantDTO updatedPlant = plantMasterService.updatePlantStatus(plantId, plantCode, Status.valueOf(status.toUpperCase()), currentUser);
log.info("Successfully updated plant status. Updated Plant: {}", updatedPlant);
return Response.success(updatedPlant).withMessage("Plant status updated successfully.");
} catch (IllegalArgumentException e) {
log.error("Validation error while updating plant status: {}", e.getMessage());
return Response.error(400, e.getMessage());
} catch (Exception e) {
log.error("Error occurred while updating plant status: {}", e.getMessage(), e);
return Response.error(500, "Failed to update plant status");
}
}
}

View File

@ -0,0 +1,85 @@
package com.sahyog.app.inbound.user.controller;
import java.util.List;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.sahyog.app.inbound.user.dto.RoleDTO;
import com.sahyog.app.inbound.user.exception.RoleAlreadyExistsException;
import com.sahyog.app.inbound.user.model.Role;
import com.sahyog.app.inbound.user.service.RoleService;
@RestController
@RequestMapping("/api/roles")
public class RoleController {
private static final Logger log = LoggerFactory.getLogger(RoleController.class);
@Autowired
private RoleService roleService;
// @GetMapping("/user-type/{userTypeId}")
// public ResponseEntity<List<RoleDTO>> getRolesByUserTypeId(@PathVariable short userTypeId) {
// log.info("Fetching roles for userTypeId: {}", userTypeId);
// List<RoleDTO> roles = roleService.getRolesByUserTypeId(userTypeId);
// return ResponseEntity.ok(roles);
// }
// Create Role
// @PostMapping
// public ResponseEntity<Role> createRole(@RequestBody RoleDTO roleDTO) {
// Role createdRole = roleService.createRole(roleDTO);
// return ResponseEntity.status(HttpStatus.CREATED).body(createdRole);
// }
//
// // Get Roles by UserTypeId
// @GetMapping("/userType/{userTypeId}")
// public ResponseEntity<List<Role>> getRolesByUserTypeId(@PathVariable int userTypeId) {
// List<Role> roles = roleService.getRolesByUserTypeId(userTypeId);
// return ResponseEntity.ok(roles);
// }
//
//
// // Get All Roles
// @GetMapping
// public ResponseEntity<List<Role>> getAllRoles() {
// List<Role> roles = roleService.getAllRoles();
// return ResponseEntity.ok(roles);
// }
//
// // Get Role by ID
// @GetMapping("/{roleId}")
// public ResponseEntity<Role> getRoleById(@PathVariable int roleId) {
// Role role = roleService.getRoleById(roleId);
// return ResponseEntity.ok(role);
// }
//
// // Update Role
// @PutMapping("/{roleId}")
// public ResponseEntity<Role> updateRole(@PathVariable int roleId, @RequestBody RoleDTO roleDTO) {
// Role updatedRole = roleService.updateRole(roleId, roleDTO);
// return ResponseEntity.ok(updatedRole);
// }
//
// // Delete Role
// @DeleteMapping("/{roleId}")
// public ResponseEntity<Void> deleteRole(@PathVariable int roleId) {
// roleService.deleteRole(roleId);
// return ResponseEntity.noContent().build();
// }
//
}

View File

@ -0,0 +1,86 @@
package com.sahyog.app.inbound.user.controller;
import java.util.List;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.sahyog.app.inbound.user.dto.TransporterMasterDto;
import com.sahyog.app.inbound.user.dto.TransporterUpdateDTO;
import com.sahyog.app.inbound.user.exception.TransporterProcessingException;
import com.sahyog.app.inbound.user.service.TransporterService;
import jakarta.persistence.EntityNotFoundException;
import jakarta.validation.Valid;
@RestController
@RequestMapping("/users")
public class TransporterController {
private static final Logger log = LoggerFactory.getLogger(TransporterController.class);
@Autowired
private TransporterService transporterService;
@PostMapping(value = "/addUpdateTransporters", consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<String> createOrUpdateTransporters(@Valid @RequestBody List<TransporterMasterDto> transporterRequestDtos) {
try {
log.info("Received request to process transporters: {}", transporterRequestDtos.size());
transporterService.processTransporters(transporterRequestDtos);
log.info("Transporters processed successfully.");
return ResponseEntity.status(HttpStatus.CREATED).body("Transporters processed successfully.");
} catch (TransporterProcessingException e) {
log.error("Error processing transporters: {}", e.getMessage(), e);
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body("Error processing transporters: " + e.getMessage());
} catch (Exception e) {
log.error("Unexpected error occurred: {}", e.getMessage(), e);
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body("Unexpected error occurred.");
}
}
// @PutMapping("/{transporterId}")
// public ResponseEntity<String> updateTransporter(
// @PathVariable Long transporterId,
// @RequestBody TransporterUpdateDTO transporterUpdateDto) {
// try {
// transporterService.updateTransporter(transporterId, transporterUpdateDto);
// return ResponseEntity.ok("Transporter updated successfully.");
// } catch (EntityNotFoundException e) {
// return ResponseEntity.status(HttpStatus.NOT_FOUND).body(e.getMessage());
// } catch (Exception e) {
// return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body("Error updating transporter.");
// }
// }
//
// @PutMapping("/updateBySupplier")
// public ResponseEntity<String> updateTransporters(
// @RequestBody List<TransporterUpdateDTO> transporterUpdateDTOList) {
//
// try {
// // Call the service to update the list of transporters
// boolean allUpdatesSuccessful = transporterService.updateTransporters(transporterUpdateDTOList);
//
// if (allUpdatesSuccessful) {
// // Return success response if all transporters are updated
// return ResponseEntity.status(HttpStatus.OK).body("All transporters updated successfully.");
// } else {
// // Return partial success response if some transporters couldn't be updated
// return ResponseEntity.status(HttpStatus.PARTIAL_CONTENT).body("Some transporters could not be updated.");
// }
// } catch (Exception e) {
// // Return error response in case of any exception
// return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body("An unexpected error occurred while updating the transporters.");
// }
// }
}

View File

@ -0,0 +1,218 @@
package com.sahyog.app.inbound.user.controller;
import com.sahyog.app.inbound.user.dto.UserDTO;
import com.sahyog.app.inbound.user.dto.UserUpdateDTO;
import com.sahyog.app.inbound.user.exception.UserAlreadyExistsException;
import com.sahyog.app.inbound.user.exception.UserNotFoundException;
import com.sahyog.app.inbound.user.model.Response;
import com.sahyog.app.inbound.user.model.User;
import com.sahyog.app.inbound.user.service.UserService;
import org.springframework.data.domain.Sort;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
@RestController
@RequestMapping("/api/users")
public class UserController {
private static final Logger log = LoggerFactory.getLogger(UserController.class);
@Autowired
private UserService userService;
@PostMapping("/createUser")
public ResponseEntity<Response<List<Map<String, Object>>>> createInternalUsers(
@RequestBody List<UserDTO> userDTOs) {
log.info("Received request to create/update users: {}", userDTOs);
try {
Response<List<Map<String, Object>>> response = userService.createInternalUsers(userDTOs);
log.info("Users created/updated successfully. Response: {}", response);
return ResponseEntity.status(HttpStatus.CREATED).body(response);
} catch (UserAlreadyExistsException e) {
log.warn("UserAlreadyExistsException occurred: {}", e.getMessage());
return ResponseEntity.status(HttpStatus.CONFLICT)
.body(Response.error(409, "Error: " + e.getMessage()).withData(Collections.emptyList()));
} catch (RuntimeException e) {
log.error("RuntimeException occurred: {}", e.getMessage(), e);
return ResponseEntity.status(HttpStatus.BAD_REQUEST)
.body(Response.error(400, "Error: " + e.getMessage()).withData(Collections.emptyList()));
} catch (Exception e) {
log.error("Unexpected error occurred: {}", e.getMessage(), e);
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
.body(Response.error(500, "An unexpected error occurred").withData(Collections.emptyList()));
}
}
@PutMapping("/update")
public ResponseEntity<Response<Map<String, Object>>> updateUser(
@RequestParam(required = false) String userEmpTransCode, @RequestBody UserUpdateDTO userUpdateDTO) {
log.info("Received request to update user with employeeTransCode: {} or email: {}", userEmpTransCode,
userUpdateDTO.getEmailId());
// Validate input
if ((userEmpTransCode == null || userEmpTransCode.isEmpty())
&& (userUpdateDTO.getEmailId() == null || userUpdateDTO.getEmailId().isEmpty())) {
log.warn("Invalid request: Either employeeTransCode or email must be provided.");
return ResponseEntity.status(HttpStatus.BAD_REQUEST)
.body(Response.error(400, "Either employeeTransCode or email must be provided."));
}
try {
// Call the service to handle the update
Response<Map<String, Object>> response = userService.updateUser(userEmpTransCode, userUpdateDTO);
log.info("User updated successfully. Response: {}", response);
return ResponseEntity.status(HttpStatus.OK).body(response);
} catch (UserNotFoundException e) {
log.warn("User not found: {}", e.getMessage());
return ResponseEntity.status(HttpStatus.NOT_FOUND).body(Response.error(404, e.getMessage()));
} catch (IllegalArgumentException e) {
log.warn("Invalid input: {}", e.getMessage());
return ResponseEntity.status(HttpStatus.BAD_REQUEST).body(Response.error(400, e.getMessage()));
} catch (Exception e) {
log.error("Unexpected error occurred while updating user: {}", e.getMessage(), e);
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
.body(Response.error(500, "An unexpected error occurred: " + e.getMessage()));
}
}
// @PutMapping("/update")
// public ResponseEntity<String> updateUser(@RequestParam String userEmpTransCode,
// @RequestBody UserUpdateDTO userUpdateDTO) {
// log.info("Received request to update user with userEmpTransCode: {}", userEmpTransCode);
// if (userEmpTransCode == null || userEmpTransCode.isEmpty()) {
// log.warn("Invalid request: userEmpTransCode is null or empty");
// return ResponseEntity.status(HttpStatus.BAD_REQUEST)
// .body("userEmpTransCode must be provided.");
// }
// ResponseEntity<String> response = userService.updateUser(userEmpTransCode, userUpdateDTO);
// log.info("User updated successfully with userEmpTransCode: {}", userEmpTransCode);
// return response;
// }
@GetMapping("/getallUserWithPagination")
public ResponseEntity<Page<User>> getAllUsers(@RequestParam(defaultValue = "0") int pageNumber,
@RequestParam(defaultValue = "10") int pageSize) {
log.info("Fetching all users with page: {} and size: {}", pageNumber, pageSize);
Pageable pageable = PageRequest.of(pageNumber, pageSize, Sort.by(Sort.Direction.DESC, "lastUpdatedOn"));
Page<User> users = userService.getAllUsers(pageable);
log.info("Fetched {} users", users.getTotalElements());
return ResponseEntity.ok(users);
}
@GetMapping("/ActiveOrInactive")
public ResponseEntity<List<User>> getUsersByActive_Inactive(@RequestParam List<String> status) {
log.info("Fetching users by status: {}", status);
List<User> users = userService.getUsersByActive_Inactive(status);
log.info("Fetched {} users for statuses: {}", users.size(), status);
return ResponseEntity.ok(users);
}
@GetMapping("/getAllAndUserWithStatus")
public Response<List<UserDTO>> getUsersByStatus(
@RequestParam(value = "status", required = false) List<String> status) {
log.info("Fetching users with status filters: {}", status);
List<UserDTO> users;
if (status == null || status.isEmpty()) {
log.info("Fetching all users as no status filter was provided");
users = userService.getAllUsers(); // Fetch all users
} else {
log.info("Fetching users filtered by status: {}", status);
users = userService.getUsersByStatus(status); // Fetch users by status
}
log.info("Successfully fetched {} users", users.size());
return Response.success(users).withMessage("Fetched users successfully.");
}
@GetMapping("/getAllAndUserWithStatusPagination")
public Response<Page<UserDTO>> getUsersWithPagination(@RequestParam(defaultValue = "0") int pageNumber,
@RequestParam(defaultValue = "10") int pageSize,
@RequestParam(value = "status", required = false) String status) {
log.info("Fetching users with pagination. Page: {}, Size: {}, Status filter: {}", pageNumber, pageSize, status);
Pageable pageable = PageRequest.of(pageNumber, pageSize, Sort.by(Sort.Direction.DESC, "lastUpdatedOn"));
Page<UserDTO> users;
if (status == null || status.isEmpty()) {
log.info("Fetching all users with pagination");
users = userService.getAllUsersWithPagination(pageable);
} else {
log.info("Fetching users with status filter and pagination");
users = userService.getUsersByStatusWithPagination(status, pageable);
}
log.info("Successfully fetched {} users with pagination", users.getTotalElements());
return Response.success(users).withMessage("Fetched users successfully.");
}
@PostMapping("/userdetails")
public ResponseEntity<Page<List<Map<String, Object>>>> getUserDetails(@RequestBody Map<String, Object> req,
Pageable pageable) {
log.info("Received request to fetch user details with filters: {}", req);
return ResponseEntity.status(HttpStatus.MULTI_STATUS).body(userService.getUserDetails(req, pageable));
}
@GetMapping("/userdropdown")
public ResponseEntity<Response<Map<String, Object>>> getDropDownValues() {
try {
// Fetch dropdown values from the service
Map<String, Object> dropDownValues = userService.getDropDownValues();
// Check if an error occurred in the service layer
if (dropDownValues.containsKey("error")) {
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
.body(new Response<>(500, "Failed to fetch dropdown values.", null));
}
// Return successful response
return ResponseEntity.ok(new Response<>(200, "Dropdown values fetched successfully.", dropDownValues));
} catch (Exception e) {
// Log the exception and return a generic error response
log.error("Error while fetching dropdown values: {}", e.getMessage());
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
.body(new Response<>(500, "An error occurred while fetching dropdown values.", null));
}
}
@GetMapping("/getUserIDByUserName")
public ResponseEntity<UserDTO> getUserIDByUserName(@RequestParam String userName) {
try {
log.info("Received request to get Code by key: {}", userName);
UserDTO pmDTO = userService.getUserIDByUserName(userName);
log.info("User fetched successfully.");
return ResponseEntity.status(HttpStatus.CREATED).body(pmDTO);
} catch (Exception e) {
log.error("Unexpected error occurred: {}", e.getMessage(), e);
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(null);
}
}
}

View File

@ -0,0 +1,186 @@
package com.sahyog.app.inbound.user.controller;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.sahyog.app.inbound.user.dto.AssignPlantsRequestDTO;
import com.sahyog.app.inbound.user.dto.AssignRolesRequestDTO;
import com.sahyog.app.inbound.user.dto.PlantMasterDTO;
import com.sahyog.app.inbound.user.dto.RoleDTO;
import com.sahyog.app.inbound.user.dto.UserRequestDTO;
import com.sahyog.app.inbound.user.model.Response;
import com.sahyog.app.inbound.user.service.UserPlantService;
import com.sahyog.app.inbound.user.service.UserRoleService;
@RestController
@RequestMapping("/userplant")
public class UserPlantController {
private static final Logger log = LoggerFactory.getLogger(UserPlantController.class);
@Autowired
private UserPlantService userPlantService;
@PostMapping("/fetchPlants")
public ResponseEntity<Response<List<PlantMasterDTO>>> getAllPlantsAndAssignedPlants(@RequestBody UserRequestDTO userRequestDTO) {
String email = userRequestDTO.getEmail();
String employeeTransCode = userRequestDTO.getEmployeeTransCode();
try {
// Fetch all plants and assigned plants
List<PlantMasterDTO> plantsWithAssignmentInfo = userPlantService.getAllPlantsWithAssignmentInfo(email, employeeTransCode);
System.out.println("plantsWithAssignmentInfo => "+plantsWithAssignmentInfo);
if (plantsWithAssignmentInfo.isEmpty()) {
log.debug("No plants available or assigned for email: {} and employeeTransCode: {}", email, employeeTransCode);
return ResponseEntity.status(HttpStatus.NOT_FOUND)
.body(new Response<>(404, "No plants found for the given user.", Collections.emptyList()));
}
return ResponseEntity.ok(new Response<>(200, "Plants fetched successfully.", plantsWithAssignmentInfo));
} catch (Exception e) {
log.error("Error while fetching plants: {}", e.getMessage());
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
.body(new Response<>(500, "An error occurred while fetching plants.", null));
}
}
@PostMapping("/assignPlants")
public ResponseEntity<Response<String>> assignPlantsToUser(@RequestBody AssignPlantsRequestDTO requestDTO) {
String email = requestDTO.getEmail();
String employeeTransCode = requestDTO.getEmployeeTransCode();
List<Integer> selectedPlantIds = requestDTO.getSelectedPlantIds();
int createdBy = requestDTO.getCreatedBy();
int lastUpdatedBy = requestDTO.getLastUpdatedBy();
try {
// Call the service to assign selected plants
boolean isAssigned = userPlantService.assignSelectedPlantsToUser(
email,
employeeTransCode,
selectedPlantIds,
createdBy,
lastUpdatedBy
);
if (!isAssigned) {
log.debug("Failed to assign plants to user with email: {} and employeeTransCode: {}", email, employeeTransCode);
return ResponseEntity.status(HttpStatus.BAD_REQUEST)
.body(new Response<>(400, "Failed to assign plants.", "No changes were made."));
}
return ResponseEntity.ok(new Response<>(200, "Plants assigned successfully.", "Operation successful."));
} catch (Exception e) {
log.error("Error while assigning plants: {}", e.getMessage());
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
.body(new Response<>(500, "An error occurred while assigning plants.", null));
}
}
@GetMapping("/userplant_dropdown")
public ResponseEntity<Response<Map<String, Object>>> getDropDownValues() {
try {
// Fetch dropdown values from the service
Map<String, Object> dropDownValues = userPlantService.getDropDownValues();
if (dropDownValues.containsKey("error")) {
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
.body(new Response<>(500, "Failed to fetch dropdown values.", null));
}
return ResponseEntity.ok(new Response<>(200, "Dropdown values fetched successfully.", dropDownValues));
} catch (Exception e) {
log.error("Error while fetching dropdown values: {}", e.getMessage());
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
.body(new Response<>(500, "An error occurred while fetching dropdown values.", null));
}
}
}
//@RestController
//@RequestMapping("/userplant")
//public class UserPlantController {
//
//
// private static final Logger log = LoggerFactory.getLogger(UserPlantController.class);
//
// @Autowired
// private UserPlantService userPlantService;
//
// @PostMapping("/fetchPlants")
// public ResponseEntity<List<PlantMasterDTO>> getAllPlantsAndAssignedPlants(@RequestBody UserRequestDTO userRequestDTO) {
// String email = userRequestDTO.getEmail();
// String employeeTransCode = userRequestDTO.getEmployeeTransCode();
//
// // Fetch all plants and assigned plants
// List<PlantMasterDTO> plantsWithAssignmentInfo = userPlantService.getAllPlantsWithAssignmentInfo(email, employeeTransCode);
//
// if (plantsWithAssignmentInfo.isEmpty()) {
// log.debug("No plants available or assigned for email: {} and employeeTransCode: {}", email, employeeTransCode);
// return ResponseEntity.status(HttpStatus.NOT_FOUND).body(Collections.emptyList());
// }
//
// return ResponseEntity.ok(plantsWithAssignmentInfo);
// }
//
// @PostMapping("/assignPlants")
// public ResponseEntity<String> assignPlantsToUser(@RequestBody AssignPlantsRequestDTO requestDTO) {
// String email = requestDTO.getEmail();
// String employeeTransCode = requestDTO.getEmployeeTransCode();
// List<Integer> selectedPlantIds = requestDTO.getSelectedPlantIds();
// int createdBy = requestDTO.getCreatedBy();
// int lastUpdatedBy = requestDTO.getLastUpdatedBy();
// // Call the service to assign selected plants
// boolean isAssigned = userPlantService.assignSelectedPlantsToUser(
// email,
// employeeTransCode,
// selectedPlantIds,
// createdBy,
// lastUpdatedBy
// );
//
// if (!isAssigned) {
// log.debug("Failed to assign plants to user with email: {} and employeeTransCode: {}", email, employeeTransCode);
// return ResponseEntity.status(HttpStatus.BAD_REQUEST).body("Failed to assign plants.");
// }
//
// return ResponseEntity.ok("Plants assigned successfully.");
// }
//
//
// @GetMapping("userplant_dropdown")
// public ResponseEntity<Response<Map<String, Object>>> getDropDownValues() {
// try {
// // Fetch dropdown values from the service
// Map<String, Object> dropDownValues = userPlantService.getDropDownValues();
//
// // Check if an error occurred in the service layer
// if (dropDownValues.containsKey("error")) {
// return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
// .body(new Response<>(500, "Failed to fetch dropdown values.", null));
// }
//
// // Return successful response
// return ResponseEntity.ok(new Response<>(200, "Dropdown values fetched successfully.", dropDownValues));
//
// } catch (Exception e) {
// // Log the exception and return a generic error response
// log.error("Error while fetching dropdown values: {}", e.getMessage());
// return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
// .body(new Response<>(500, "An error occurred while fetching dropdown values.", null));
// }
// }
//}

View File

@ -0,0 +1,165 @@
package com.sahyog.app.inbound.user.controller;
import com.sahyog.app.inbound.user.dto.AssignRolesRequestDTO;
import com.sahyog.app.inbound.user.dto.RoleDTO;
import com.sahyog.app.inbound.user.dto.UserRequestDTO;
import com.sahyog.app.inbound.user.model.Response;
import com.sahyog.app.inbound.user.service.UserRoleService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import java.util.Collections;
import java.util.List;
import java.util.Map;
@RestController
@RequestMapping("/api/user-roles")
public class UserRoleController {
private static final Logger log = LoggerFactory.getLogger(UserRoleController.class);
@Autowired
private UserRoleService userRoleService;
@PostMapping("/fetchRoles")
public ResponseEntity<Response<List<RoleDTO>>> getAllRolesAndAssignedRoles(@RequestBody UserRequestDTO userRequestDTO) {
try {
String email = userRequestDTO.getEmail();
String employeeTransCode = userRequestDTO.getEmployeeTransCode();
List<RoleDTO> rolesWithAssignmentInfo = userRoleService.getAllRolesWithAssignmentInfo(email, employeeTransCode);
if (rolesWithAssignmentInfo.isEmpty()) {
log.debug("No roles available or assigned for email: {} and employeeTransCode: {}", email, employeeTransCode);
return ResponseEntity.status(HttpStatus.NOT_FOUND)
.body(new Response<>(404, "No roles found for the given user.", Collections.emptyList()));
}
return ResponseEntity.ok(new Response<>(200, "Roles fetched successfully.", rolesWithAssignmentInfo));
} catch (Exception e) {
log.error("Error while fetching roles: {}", e.getMessage());
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
.body(new Response<>(500, "An error occurred while fetching roles.", null));
}
}
@PostMapping("/assignRoles")
public ResponseEntity<Response<String>> assignRolesToUser(@RequestBody AssignRolesRequestDTO requestDTO) {
try {
String email = requestDTO.getEmail();
String employeeTransCode = requestDTO.getEmployeeTransCode();
List<Integer> selectedRoleIds = requestDTO.getSelectedRoleIds();
int createdBy = requestDTO.getCreatedBy();
int lastUpdatedBy = requestDTO.getLastUpdatedBy();
boolean success = userRoleService.assignSelectedRolesToUser(email, employeeTransCode, selectedRoleIds, createdBy, lastUpdatedBy);
if (success) {
return ResponseEntity.ok(new Response<>(200, "Roles assigned successfully.", "Success"));
} else {
log.debug("Roles assignment failed for email: {} and employeeTransCode: {}", email, employeeTransCode);
return ResponseEntity.status(HttpStatus.NOT_FOUND)
.body(new Response<>(404, "User not found or no changes were made to roles.", "Failure"));
}
} catch (Exception e) {
log.error("Error while assigning roles: {}", e.getMessage());
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
.body(new Response<>(500, "An error occurred while assigning roles.", null));
}
}
@GetMapping("/userrole_dropdown")
public ResponseEntity<Response<Map<String, Object>>> getDropDownValues() {
try {
// Fetch dropdown values from the service
Map<String, Object> dropDownValues = userRoleService.getDropDownValues();
// Check if an error occurred in the service layer
if (dropDownValues.containsKey("error")) {
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
.body(new Response<>(500, "Failed to fetch dropdown values.", null));
}
// Return successful response
return ResponseEntity.ok(new Response<>(200, "Dropdown values fetched successfully.", dropDownValues));
} catch (Exception e) {
log.error("Error while fetching dropdown values: {}", e.getMessage());
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
.body(new Response<>(500, "An error occurred while fetching dropdown values.", null));
}
}
}
//@RestController
//@RequestMapping("/api/user-roles")
//public class UserRoleController {
//
// private static final Logger log = LoggerFactory.getLogger(UserRoleController.class);
//
// @Autowired
// private UserRoleService userRoleService;
//
// @PostMapping("/fetchRoles")
// public ResponseEntity<List<RoleDTO>> getAllRolesAndAssignedRoles(@RequestBody UserRequestDTO userRequestDTO) {
// String email = userRequestDTO.getEmail();
// String employeeTransCode = userRequestDTO.getEmployeeTransCode();
//
// List<RoleDTO> rolesWithAssignmentInfo = userRoleService.getAllRolesWithAssignmentInfo(email, employeeTransCode);
//
// if (rolesWithAssignmentInfo.isEmpty()) {
// log.debug("No roles available or assigned for email: {} and employeeTransCode: {}", email, employeeTransCode);
// return ResponseEntity.status(HttpStatus.NOT_FOUND).body(Collections.emptyList());
// }
//
// return ResponseEntity.ok(rolesWithAssignmentInfo);
// }
//
// @PostMapping("/assignRoles")
// public ResponseEntity<String> assignRolesToUser(@RequestBody AssignRolesRequestDTO requestDTO) {
// String email = requestDTO.getEmail();
// String employeeTransCode = requestDTO.getEmployeeTransCode();
// List<Integer> selectedRoleIds = requestDTO.getSelectedRoleIds();
// int createdBy = requestDTO.getCreatedBy();
// int lastUpdatedBy = requestDTO.getLastUpdatedBy();
//
// boolean success = userRoleService.assignSelectedRolesToUser(email, employeeTransCode, selectedRoleIds, createdBy, lastUpdatedBy);
//
// if (success) {
// return ResponseEntity.ok("Roles assigned successfully.");
// } else {
// log.debug("Roles assignment failed for email: {} and employeeTransCode: {}", email, employeeTransCode);
// return ResponseEntity.status(HttpStatus.NOT_FOUND).body("User not found or roles could not be assigned.");
// }
// }
//
// @GetMapping("userrole_dropdown")
// public ResponseEntity<Response<Map<String, Object>>> getDropDownValues() {
// try {
// // Fetch dropdown values from the service
// Map<String, Object> dropDownValues = userRoleService.getDropDownValues();
//
// // Check if an error occurred in the service layer
// if (dropDownValues.containsKey("error")) {
// return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
// .body(new Response<>(500, "Failed to fetch dropdown values.", null));
// }
//
// // Return successful response
// return ResponseEntity.ok(new Response<>(200, "Dropdown values fetched successfully.", dropDownValues));
//
// } catch (Exception e) {
// // Log the exception and return a generic error response
// log.error("Error while fetching dropdown values: {}", e.getMessage());
// return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
// .body(new Response<>(500, "An error occurred while fetching dropdown values.", null));
// }
// }
//}

View File

@ -0,0 +1,168 @@
package com.sahyog.app.inbound.user.controller;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PatchMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.sahyog.app.inbound.user.dto.UserTypeDTO;
import com.sahyog.app.inbound.user.model.Response;
import com.sahyog.app.inbound.user.model.UserType;
import com.sahyog.app.inbound.user.model.UserType1;
import com.sahyog.app.inbound.user.service.UserTypeService;
@RestController
@RequestMapping("/api/user-types")
public class UserTypeController {
private static final Logger log = LoggerFactory.getLogger(UserTypeController.class);
@Autowired
private UserTypeService userTypeService;
@PostMapping("/createUserType")
public ResponseEntity<Response<List<Map<String, Object>>>> createUserType(@RequestBody UserTypeDTO userTypeDTO) {
log.info("Received request to create/update user type: {}", userTypeDTO);
try {
Response<List<Map<String, Object>>> response = userTypeService.createUserType(userTypeDTO);
log.info("User Type created/updated successfully. Response: {}", response);
return ResponseEntity.status(HttpStatus.CREATED).body(response);
} catch (Exception e) {
log.error("Error occurred while processing user type creation: {}", e.getMessage(), e);
return ResponseEntity.status(HttpStatus.BAD_REQUEST)
.body(Response.error(400, "Error: " + e.getMessage()).withData(Collections.emptyList()));
}
}
// public ResponseEntity<UserType> createUserType(@RequestBody @Valid UserTypeDTO userTypeDTO)
// @PostMapping("/create")
// public ResponseEntity<UserType> createUserType(@RequestBody UserType1 userTypeDTO) {
// log.info("123Received payload: {}", userTypeDTO);
// log.info("line 40");
// UserType createdUserType = userTypeService.createUserType(userTypeDTO);
// return ResponseEntity.status(HttpStatus.CREATED).body(createdUserType);
// }
// @PostMapping("/create")
// public String createUserType(@RequestBody Map<String, Object> req) {
// System.out.println("line 46");
// log.info("Received payload: {}", req);
// return "data found";
//// UserType createdUserType = userTypeService.createUserType(userTypeDTO);
//// return ResponseEntity.status(HttpStatus.CREATED).body(createdUserType);
// }
@PostMapping("/usertypedetails")
public ResponseEntity<Response<Page<Map<String, Object>>>> getUsertypeDetails(
@RequestBody Map<String, Object> req, Pageable pageable) {
log.info("Received request to fetch usertype details with filters: {} and pagination: {}", req, pageable);
// Handle the service call to fetch usertype details
try {
Page<Map<String, Object>> usertypeDetails = userTypeService.getUsertypeDetails(req, pageable);
if (usertypeDetails.isEmpty()) {
return ResponseEntity.ok(new Response<>(204, "No usertype details found", usertypeDetails));
}
return ResponseEntity.ok(new Response<>(200, "Usertype details fetched successfully", usertypeDetails));
} catch (Exception e) {
log.error("Error fetching usertype details.", e);
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(
new Response<>(500, "An error occurred while fetching usertype details.", null)
);
}
}
@GetMapping("/{userTypeId}")
public ResponseEntity<Response<UserType>> getUserTypeById(@PathVariable short userTypeId) {
log.info("Fetching user type with ID: {}", userTypeId);
try {
UserType userType = userTypeService.getUserTypeById(userTypeId);
return ResponseEntity.ok(Response.success(userType));
} catch (RuntimeException e) {
return ResponseEntity.status(HttpStatus.NOT_FOUND)
.body(Response.error(404, "Error: " + e.getMessage()));
}
}
@PatchMapping("/update-status/{userTypeId}")
public ResponseEntity<Response<Map<String, Object>>> updateUserTypeStatus(
@PathVariable short userTypeId,
@RequestBody Map<String, String> statusRequest) {
try {
String status = statusRequest.get("status");
Map<String, Object> res= userTypeService.updateUserTypeStatus(userTypeId, status);
return ResponseEntity.ok(Response.success(res));
} catch (RuntimeException e) {
return ResponseEntity.status(HttpStatus.NOT_FOUND)
.body(Response.error(404, "Error: " + e.getMessage()));
} catch (Exception e) {
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
.body(Response.error(500, "An unexpected error occurred: " + e.getMessage()));
}
}
// @PatchMapping("/update-status/{userTypeId}")
// public ResponseEntity<Response<String>> updateUserTypeStatus(@PathVariable short userTypeId) {
// try {
// userTypeService.updateUserTypeStatus(userTypeId);
// return ResponseEntity.ok(Response.success("UserType status updated successfully."));
// } catch (RuntimeException e) {
// return ResponseEntity.status(HttpStatus.NOT_FOUND)
// .body(Response.error(404, "Error: " + e.getMessage()));
// } catch (Exception e) {
// return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
// .body(Response.error(500, "An unexpected error occurred: " + e.getMessage()));
// }
// }
@GetMapping("usertype_dropdown")
public ResponseEntity<Response<Map<String, Object>>> getDropDownValues() {
try {
// Fetch dropdown values from the service
Map<String, Object> dropDownValues = userTypeService.getDropDownValues();
// Check if an error occurred in the service layer
if (dropDownValues.containsKey("error")) {
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
.body(new Response<>(500, "Failed to fetch dropdown values.", null));
}
// Return successful response
return ResponseEntity.ok(new Response<>(200, "Dropdown values fetched successfully.", dropDownValues));
} catch (Exception e) {
// Log the exception and return a generic error response
log.error("Error while fetching dropdown values: {}", e.getMessage());
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
.body(new Response<>(500, "An error occurred while fetching dropdown values.", null));
}
}
}

View File

@ -0,0 +1,23 @@
package com.sahyog.app.inbound.user.dto;
import java.util.List;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@ToString
public class AssignPlantsRequestDTO {
private String email;
private String employeeTransCode;
private List<Integer> selectedPlantIds; // List of role IDs selected by the user
private int createdBy;
private int lastUpdatedBy;
}

View File

@ -0,0 +1,25 @@
package com.sahyog.app.inbound.user.dto;
import java.util.List;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@ToString
public class AssignRolesRequestDTO {
private String email;
private String employeeTransCode;
private List<Integer> selectedRoleIds;
private int createdBy;
private int lastUpdatedBy; // List of role IDs selected by the user
}

View File

@ -0,0 +1,28 @@
package com.sahyog.app.inbound.user.dto;
import com.sahyog.app.inbound.user.enums.Status;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
@ToString
public class MaterialMasterDTO {
private Integer materialId;
private String materialCode;
private String materialDescription;
private String materialGroup;
private String materialGroupDesc;
private int plantId;
private Status status;
private int createdBy;
private int lastUpdatedBy;
}

View File

@ -0,0 +1,30 @@
package com.sahyog.app.inbound.user.dto;
import java.math.BigDecimal;
import com.sahyog.app.inbound.user.enums.Status;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
@ToString
public class PlantDTO {
private Short plantId;
private String plantCode;
private String plantDesc;
private String plantPan;
private String plantGst;
private BigDecimal plantGstRate;
private String addedChannel;
private Status status;
private int createdBy;
private int lastUpdatedBy;
}

View File

@ -0,0 +1,35 @@
package com.sahyog.app.inbound.user.dto;
import java.math.BigDecimal;
import com.sahyog.app.inbound.user.enums.Status;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@ToString
public class PlantMasterDTO {
private Short plantId;
private String plantCode;
private String plantDesc;
private String plantPan;
private String plantGst;
private BigDecimal plantGstRate;
private String addedChannel;
private Status status;
private Integer createdBy;
private Integer lastUpdatedBy;
// Field to indicate if the plant is assigned to the user
private boolean assigned;
// Getters and Setters
}

View File

@ -0,0 +1,33 @@
package com.sahyog.app.inbound.user.dto;
import com.sahyog.app.inbound.user.model.User;
import com.sahyog.app.inbound.user.model.UserType;
import jakarta.persistence.Column;
import jakarta.persistence.FetchType;
import jakarta.persistence.JoinColumn;
import jakarta.persistence.ManyToOne;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@ToString
@Data
public class RoleDTO {
private int roleId;
private String roleName;
private String roleDescription;
private short userTypeId;
private String status;
private int createdBy;
private int lastUpdatedBy;
private boolean assigned;
}

View File

@ -0,0 +1,52 @@
package com.sahyog.app.inbound.user.dto;
import java.time.LocalDate;
import java.time.LocalDateTime;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
@Getter
@Setter
@ToString
public class TransporterMasterDto {
private int transporterId;
private short plantId;
private String plantCode;
private int userId;
private String supplierCode;
private String bpGrouping;
private String transporterCode;
private String supplierAccountGroup;
private String transporterName;
private String transporterFirstName;
private String transporterMiddleName;
private String transporterLastName;
private String legalEntity;
private String permanentAccountNumber;
private String street;
private String houseNumber;
private String district;
private String differentCity;
private String postalCode;
private String city;
private String country;
private String state;
private String mobileNumber;
private String emailId;
private String gstn;
private String taxRegime;
private String shortCode;
private LocalDate createdDate;
private LocalDate updationDate;
private String taxCodeDesc;
private int taxRate;
private String status;
private int createdBy;
private int lastUpdatedBy;
private LocalDateTime lastUpdatedOn;
public TransporterMasterDto() {
}
}

View File

@ -0,0 +1,38 @@
package com.sahyog.app.inbound.user.dto;
import java.math.BigDecimal;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
@ToString
public class TransporterResponse {
private String supplierCode;
private String transporterName;
private String supplierAccountGroup;
private String state;
private String bpGrouping;
private String legalEntity;
private String permanentAccountNumber;
private String street;
private String houseNumber;
private String district;
private String differentCity;
private String postalCode;
private String city;
private String country;
private String mobileNumber;
private String emailId;
private String gstn;
private String taxRegime;
private String shortCode;
private String status;
private String taxCodeDesc;
private int taxRate;
}

View File

@ -0,0 +1,59 @@
package com.sahyog.app.inbound.user.dto;
import java.time.LocalDate;
import java.time.LocalDateTime;
import com.sahyog.app.inbound.user.model.User;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@ToString
public class TransporterUpdateDTO {
private int transporterId;
private short plantId;
private String plantCode;
private int userId;
private String supplierCode;
private String bpGrouping;
private String transporterCode;
private String supplierAccountGroup;
private String transporterName;
private String transporterFirstName;
private String transporterMiddleName;
private String transporterLastName;
private String legalEntity;
private String permanentAccountNumber;
private String street;
private String houseNumber;
private String district;
private String differentCity;
private String postalCode;
private String city;
private String country;
private String state;
private String mobileNumber;
private String emailId;
private String gstn;
private String taxRegime;
private String shortCode;
private LocalDate createdDate;
private LocalDate updationDate;
private String taxCodeDesc;
private int taxRate;
private String status;
private int createdBy;
private int lastUpdatedBy;
private LocalDateTime lastUpdatedOn;
}

View File

@ -0,0 +1,44 @@
package com.sahyog.app.inbound.user.dto;
import java.time.LocalDateTime;
import com.sahyog.app.inbound.user.enums.Status;
import com.sahyog.app.inbound.user.model.User;
import com.sahyog.app.inbound.user.model.UserType;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.EnumType;
import jakarta.persistence.Enumerated;
import jakarta.persistence.FetchType;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import jakarta.persistence.JoinColumn;
import jakarta.persistence.ManyToOne;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@ToString
public class UserDTO {
private int userId; //
private short userTypeId;
private String userName;
private String firstName;
private String lastName;
private String email;
private String mobile;
private String employeeTransCode;
private String addedChannel;
private Status status; // Typically a char field like 'A' or 'I'
private int createdBy; // Self-reference for the creator
private int lastUpdatedBy; // Self-reference for the last updater
// private LocalDateTime lastUpdatedOn;
}

View File

@ -0,0 +1,41 @@
package com.sahyog.app.inbound.user.dto;
import com.sahyog.app.inbound.user.enums.Status;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.EnumType;
import jakarta.persistence.Enumerated;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import jakarta.persistence.Table;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@ToString
public class UserPlantDTO {
private int userPlantId;
private int userId;
private int plantId;
private Status status;
private boolean assigned;
private int createdBy;
private int lastUpdatedBy;
}

View File

@ -0,0 +1,18 @@
package com.sahyog.app.inbound.user.dto;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
@ToString
public class UserRequestDTO {
private String email;
private String employeeTransCode;
}

View File

@ -0,0 +1,27 @@
package com.sahyog.app.inbound.user.dto;
import com.sahyog.app.inbound.user.enums.Status;
import com.sahyog.app.inbound.user.model.Role;
import com.sahyog.app.inbound.user.model.User;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@Data
public class UserRoleDTO {
private int userRoleId;
private int userId;
private int roleId;
private Status status;
private int createdBy;
private int lastUpdatedBy;
}

View File

@ -0,0 +1,20 @@
package com.sahyog.app.inbound.user.dto;
import com.sahyog.app.inbound.user.enums.Status;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
@ToString
public class UserTypeCreateDTO {
private String usertypeName;
private String status;
}

View File

@ -0,0 +1,29 @@
package com.sahyog.app.inbound.user.dto;
import com.sahyog.app.inbound.user.enums.Status;
import jakarta.persistence.Column;
import jakarta.persistence.FetchType;
import jakarta.persistence.JoinColumn;
import jakarta.persistence.ManyToOne;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@ToString
public class UserTypeDTO {
private String userTypeName;
private String status; // A or I
private int createdBy;
private int lastUpdatedBy;
}

View File

@ -0,0 +1,34 @@
package com.sahyog.app.inbound.user.dto;
import java.time.LocalDateTime;
import com.sahyog.app.inbound.user.enums.Status;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
@ToString
public class UserUpdateDTO {
private int userId;
private short userTypeId;
private String userName;
private String firstName;
private String middleName;
private String lastName;
private String emailId;
private String phoneNumber;
private String userEmpTransCode;
private String addedChannel;
private Status status;
private int createdBy;
private int lastUpdatedBy;
private LocalDateTime lastUpdatedOn;
}

View File

@ -0,0 +1,20 @@
package com.sahyog.app.inbound.user.enums;
public enum RoleType {
ADMIN("Admin"),
GUEST("Guest"),
USER("User"),
MANAGER("Manager");
private final String name;
RoleType(String name) {
this.name = name;
}
public String getName() {
return name;
}
}

View File

@ -0,0 +1,7 @@
package com.sahyog.app.inbound.user.enums;
public enum Status {
A,
I
}

View File

@ -0,0 +1,6 @@
package com.sahyog.app.inbound.user.enums;
public enum UserType {
INTERNAL,
TRANSPORTER
}

View File

@ -0,0 +1,27 @@
package com.sahyog.app.inbound.user.enums;
public enum UserTypeEnum {
TRANSPORTER("Transporter"),
MIS("MIS");
private final String userTypeName;
UserTypeEnum(String userTypeName) {
this.userTypeName = userTypeName;
}
public String getUserTypeName() {
return userTypeName;
}
// Method to get UserTypeEnum by userTypeName
public static UserTypeEnum fromString(String userTypeName) {
for (UserTypeEnum userType : values()) {
if (userType.getUserTypeName().equalsIgnoreCase(userTypeName)) {
return userType;
}
}
throw new IllegalArgumentException("No enum constant with name " + userTypeName);
}
}

View File

@ -0,0 +1,14 @@
package com.sahyog.app.inbound.user.exception;
public class CustomException extends RuntimeException {
public CustomException(String message) {
super(message);
}
public CustomException(String message, Throwable cause) {
super(message, cause);
}
}

View File

@ -0,0 +1,128 @@
package com.sahyog.app.inbound.user.exception;
import java.util.HashMap;
import java.util.Map;
import java.util.stream.Collectors;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import com.sahyog.app.inbound.user.model.Response;
import jakarta.validation.ConstraintViolation;
import jakarta.validation.ConstraintViolationException;
@ControllerAdvice
public class GlobalExceptionHandler {
private static final Logger log = LoggerFactory.getLogger(GlobalExceptionHandler.class);
@ExceptionHandler(RoleAlreadyExistsException.class)
public ResponseEntity<String> handleRoleAlreadyExistsException(RoleAlreadyExistsException ex) {
log.error("RoleAlreadyExistsException occurred: {}", ex.getMessage(), ex);
return new ResponseEntity<>(ex.getMessage(), HttpStatus.CONFLICT);
}
@ExceptionHandler(UserAlreadyExistsException.class)
public ResponseEntity<String> handleUserAlreadyExistsException(UserAlreadyExistsException ex) {
log.error("UserAlreadyExistsException occurred: {}", ex.getMessage(), ex);
return ResponseEntity.status(HttpStatus.CONFLICT).body(ex.getMessage());
}
@ExceptionHandler(IllegalArgumentException.class)
public ResponseEntity<String> handleIllegalArgumentException(IllegalArgumentException ex) {
log.warn("IllegalArgumentException occurred: {}", ex.getMessage(), ex);
return ResponseEntity.status(HttpStatus.BAD_REQUEST).body(ex.getMessage());
}
@ExceptionHandler(TransporterCreationException.class)
public ResponseEntity<Response<?>> handleTransporterCreationException(TransporterCreationException ex) {
log.error("Transporter creation error: {}", ex.getMessage());
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
.body(Response.error(500, ex.getMessage()));
}
@ExceptionHandler(TransporterUpdateException.class)
public ResponseEntity<Response<?>> handleTransporterUpdateException(TransporterUpdateException ex) {
log.error("Transporter update error: {}", ex.getMessage());
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
.body(Response.error(500, ex.getMessage()));
}
@ExceptionHandler(TransporterProcessingException.class)
public ResponseEntity<Response<?>> handleTransporterProcessingException(TransporterProcessingException ex) {
log.error("Transporter processing error: {}", ex.getMessage());
return ResponseEntity.status(HttpStatus.PARTIAL_CONTENT)
.body(Response.error(207, ex.getMessage()));
}
@ExceptionHandler(TransporterValidationException.class)
public ResponseEntity<Response<?>> handleTransporterValidationException(TransporterValidationException e) {
// Log the error and return a response
String errorMessage = e.getErrorMessage();
log.error("Transporter validation error occurred for supplier code: {}", e.getSupplierCode(), e);
return ResponseEntity.status(HttpStatus.BAD_REQUEST)
.body(Response.error(HttpStatus.BAD_REQUEST.value(), "Validation error")
.withMessage(errorMessage)
.withDetails("Please check the provided data."));
}
@ExceptionHandler(ConstraintViolationException.class)
public ResponseEntity<Response<?>> handleConstraintViolationException(ConstraintViolationException e) {
// Extracting only the violation message (e.g., "Invalid PAN format")
String violations = e.getConstraintViolations().stream()
.map(violation -> violation.getMessage()) // Getting the violation message
.collect(Collectors.joining("; ")); // Joining multiple violations with a semicolon
// Creating user-friendly error message and details
String errorMessage = "Validation failed: " + violations;
String errorDetails = "Please check the provided data. Violations: " + violations;
// Return the response with status 400 (Bad Request)
Response<String> response = Response.<String>error(HttpStatus.BAD_REQUEST.value(), errorMessage)
.withMessage(errorMessage)
.withDetails(errorDetails);
return ResponseEntity.status(HttpStatus.BAD_REQUEST)
.body(response);
}
@ExceptionHandler(Exception.class)
public ResponseEntity<Response<?>> handleGeneralException(Exception e) {
// Log the full exception
log.error("An unexpected error occurred: {}", e.getMessage(), e);
// Get the root cause of the exception
Throwable rootCause = getRootCause(e);
// Simplified error message based on the root cause
String errorMessage = "An unexpected error occurred: " + rootCause.getMessage();
// Simplified details (including root cause)
String errorDetails = "Please check the provided data or system configuration. Root cause: " + rootCause.getClass().getSimpleName() + ": " + rootCause.getMessage();
// Construct response with status 500
Response<String> response = Response.<String>error(HttpStatus.INTERNAL_SERVER_ERROR.value(), errorMessage)
.withMessage(errorMessage)
.withDetails(errorDetails);
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
.body(response);
}
private Throwable getRootCause(Throwable throwable) {
Throwable rootCause = throwable;
while (rootCause.getCause() != null && rootCause != rootCause.getCause()) {
rootCause = rootCause.getCause();
}
return rootCause;
}
}

View File

@ -0,0 +1,7 @@
package com.sahyog.app.inbound.user.exception;
public class RoleAlreadyExistsException extends RuntimeException {
public RoleAlreadyExistsException(String message) {
super(message);
}
}

View File

@ -0,0 +1,7 @@
package com.sahyog.app.inbound.user.exception;
public class RoleNotFoundException extends RuntimeException {
public RoleNotFoundException(String message) {
super(message);
}
}

View File

@ -0,0 +1,8 @@
package com.sahyog.app.inbound.user.exception;
public class TransporterCreationException extends TransporterProcessingException{
public TransporterCreationException(String message) {
super(message);
}
}

View File

@ -0,0 +1,12 @@
package com.sahyog.app.inbound.user.exception;
public class TransporterProcessingException extends RuntimeException {
public TransporterProcessingException(String message) {
super(message);
}
public TransporterProcessingException(String message, Throwable cause) {
super(message, cause);
}
}

View File

@ -0,0 +1,7 @@
package com.sahyog.app.inbound.user.exception;
public class TransporterUpdateException extends TransporterProcessingException {
public TransporterUpdateException(String message) {
super(message);
}
}

View File

@ -0,0 +1,21 @@
package com.sahyog.app.inbound.user.exception;
public class TransporterValidationException extends RuntimeException {
private String supplierCode;
private String errorMessage;
public TransporterValidationException(String supplierCode, String errorMessage) {
super(errorMessage);
this.supplierCode = supplierCode;
this.errorMessage = errorMessage;
}
public String getSupplierCode() {
return supplierCode;
}
public String getErrorMessage() {
return errorMessage;
}
}

View File

@ -0,0 +1,8 @@
package com.sahyog.app.inbound.user.exception;
public class UserAlreadyExistsException extends RuntimeException{
public UserAlreadyExistsException(String message) {
super(message);
}
}

View File

@ -0,0 +1,8 @@
package com.sahyog.app.inbound.user.exception;
public class UserNotFoundException extends RuntimeException {
public UserNotFoundException(String message) {
super(message);
}
}

View File

@ -0,0 +1,34 @@
package com.sahyog.app.inbound.user.filter;
import org.springframework.data.jpa.domain.Specification;
import com.sahyog.app.inbound.user.model.Transporter;
public class TransporterFilters {
public static Specification<Transporter> filterBySupplierCode(String supplierCode) {
return (root, query, criteriaBuilder) ->
criteriaBuilder.equal(root.get("supplierCode"), supplierCode);
}
public static Specification<Transporter> filterByTransporterName(String transporterName) {
return (root, query, criteriaBuilder) ->
criteriaBuilder.like(root.get("transporterName"), "%" + transporterName + "%");
}
public static Specification<Transporter> filterBySupplierAccountGroup(String supplierAccountGroup) {
return (root, query, criteriaBuilder) ->
criteriaBuilder.equal(root.get("supplierAccountGroup"), supplierAccountGroup);
}
public static Specification<Transporter> filterByState(String state) {
return (root, query, criteriaBuilder) ->
criteriaBuilder.equal(root.get("state"), state);
}
public static Specification<Transporter> filterByBpGrouping(String bpGrouping) {
return (root, query, criteriaBuilder) ->
criteriaBuilder.equal(root.get("bpGrouping"), bpGrouping);
}
}

View File

@ -0,0 +1,48 @@
package com.sahyog.app.inbound.user.mapper;
import org.springframework.stereotype.Component;
import com.sahyog.app.inbound.user.dto.MaterialMasterDTO;
import com.sahyog.app.inbound.user.enums.Status;
import com.sahyog.app.inbound.user.model.MaterialMaster;
import com.sahyog.app.inbound.user.model.User;
@Component
public class MaterialMapper {
public MaterialMaster toEntity(MaterialMasterDTO dto, User user) {
MaterialMaster material = new MaterialMaster();
// material.setMaterialId(dto.getMaterialId());
material.setMaterialCode(dto.getMaterialCode());
material.setMaterialDescription(dto.getMaterialDescription());
material.setMaterialGroup(dto.getMaterialGroup());
material.setMaterialGroupDesc(dto.getMaterialGroupDesc());
material.setPlantId(dto.getPlantId());
material.setStatus(Status.A);
material.setCreatedBy(user.getUserId());
material.setLastUpdatedBy(user.getUserId());
return material;
}
public void updateEntityFromDTO(MaterialMaster entity, MaterialMasterDTO dto, User user) {
entity.setMaterialCode(dto.getMaterialCode());
entity.setMaterialDescription(dto.getMaterialDescription());
entity.setMaterialGroup(dto.getMaterialGroup());
entity.setMaterialGroupDesc(dto.getMaterialGroupDesc());
entity.setPlantId(dto.getPlantId());
entity.setStatus(Status.A);
entity.setLastUpdatedBy(user.getUserId());
}
public MaterialMasterDTO toDTO(MaterialMaster entity) {
MaterialMasterDTO dto = new MaterialMasterDTO();
dto.setMaterialId(entity.getMaterialId());
dto.setMaterialCode(entity.getMaterialCode());
dto.setMaterialDescription(entity.getMaterialDescription());
dto.setMaterialGroup(entity.getMaterialGroup());
dto.setMaterialGroupDesc(entity.getMaterialGroupDesc());
dto.setPlantId(entity.getPlantId());
dto.setStatus(Status.A);
return dto;
}
}

View File

@ -0,0 +1,53 @@
package com.sahyog.app.inbound.user.mapper;
import org.springframework.stereotype.Component;
import com.sahyog.app.inbound.user.dto.PlantDTO;
import com.sahyog.app.inbound.user.dto.PlantMasterDTO;
import com.sahyog.app.inbound.user.enums.Status;
import com.sahyog.app.inbound.user.model.PlantMaster;
import com.sahyog.app.inbound.user.model.User;
@Component
public class PlantMapper {
public PlantMaster toEntity(PlantDTO dto, User user) {
PlantMaster plant = new PlantMaster();
plant.setPlantCode(dto.getPlantCode());
plant.setPlantDesc(dto.getPlantDesc());
plant.setPlantPan(dto.getPlantPan());
plant.setPlantGst(dto.getPlantGst());
plant.setPlantGstRate(dto.getPlantGstRate());
plant.setAddedChannel(dto.getAddedChannel());
plant.setStatus(Status.A);
plant.setCreatedBy(user.getUserId());
plant.setLastUpdatedBy(user.getUserId());
return plant;
}
public void updateEntityFromDTO(PlantMaster entity, PlantDTO dto, User user) {
entity.setPlantCode(dto.getPlantCode());
entity.setPlantDesc(dto.getPlantDesc());
entity.setPlantPan(dto.getPlantPan());
entity.setPlantGst(dto.getPlantGst());
entity.setPlantGstRate(dto.getPlantGstRate());
entity.setAddedChannel(dto.getAddedChannel());
entity.setStatus(Status.A);
entity.setLastUpdatedBy(user.getUserId());
}
public PlantDTO toDTO(PlantMaster plant) {
PlantDTO dto = new PlantDTO();
dto.setPlantId(plant.getPlantId());
dto.setPlantCode(plant.getPlantCode());
dto.setPlantDesc(plant.getPlantDesc());
dto.setPlantPan(plant.getPlantPan());
dto.setPlantGst(plant.getPlantGst());
dto.setPlantGstRate(plant.getPlantGstRate());
dto.setAddedChannel(plant.getAddedChannel());
dto.setStatus(plant.getStatus());
dto.setCreatedBy(plant.getCreatedBy());
dto.setLastUpdatedBy(plant.getLastUpdatedBy());
return dto;
}
}

View File

@ -0,0 +1,29 @@
package com.sahyog.app.inbound.user.mapper;
import java.time.LocalDateTime;
import java.util.List;
import java.util.stream.Collectors;
import org.springframework.stereotype.Component;
import com.sahyog.app.inbound.user.dto.RoleDTO;
import com.sahyog.app.inbound.user.model.Role;
import com.sahyog.app.inbound.user.model.User;
import com.sahyog.app.inbound.user.model.UserType;
@Component
public class RoleMapper {
// public Role toEntity(RoleDTO roleDTO, short userTypeId, int createdBy, int lastUpdatedBy) {
// Role role = new Role();
// role.setRoleName(roleDTO.getRoleName());
// role.setRoleDescription(roleDTO.getRoleDescription());
// role.setUserTypeId(roleDTO.getUserType());
// role.setStatus(roleDTO.getStatus());
// role.setCreatedBy(createdBy);
//// role.setLastUpdatedBy(lastUpdatedBy);
//// role.setCreatedOn(LocalDateTime.now());
//// role.setLastUpdatedOn(LocalDateTime.now());
// return role;
// }
}

View File

@ -0,0 +1,149 @@
package com.sahyog.app.inbound.user.mapper;
import java.time.LocalDateTime;
import java.util.Map;
import org.springframework.stereotype.Component;
import com.sahyog.app.inbound.user.dto.TransporterMasterDto;
import com.sahyog.app.inbound.user.dto.TransporterResponse;
import com.sahyog.app.inbound.user.dto.TransporterUpdateDTO;
import com.sahyog.app.inbound.user.model.Transporter;
import com.sahyog.app.inbound.user.model.User;
@Component
public class TransporterMapper {
public Transporter toEntity(TransporterMasterDto dto, User user) {
Transporter transporter = new Transporter();
transporter.setPlantId((short) 2); // Cast the integer to short
transporter.setSupplierCode(dto.getSupplierCode());
transporter.setPlantCode(dto.getPlantCode());
transporter.setTransporterCode(dto.getTransporterCode());
transporter.setBpGrouping(dto.getBpGrouping());
transporter.setSupplierAccountGroup(dto.getSupplierAccountGroup());
transporter.setTransporterName(dto.getTransporterName());
transporter.setTransporterFirstName(dto.getTransporterFirstName());
transporter.setTransporterMiddleName(dto.getTransporterMiddleName());
transporter.setTransporterLastName(dto.getTransporterLastName());
transporter.setLegalEntity(dto.getLegalEntity());
transporter.setPermanentAccountNumber(dto.getPermanentAccountNumber());
transporter.setStreet(dto.getStreet());
transporter.setHouseNumber(dto.getHouseNumber());
transporter.setDistrict(dto.getDistrict());
transporter.setDifferentCity(dto.getDifferentCity());
transporter.setPostalCode(dto.getPostalCode());
transporter.setCity(dto.getCity());
transporter.setState(dto.getState());
transporter.setCountry(dto.getCountry());
transporter.setMobileNumber(dto.getMobileNumber());
transporter.setEmailId(dto.getEmailId());
transporter.setGstn(dto.getGstn());
transporter.setTaxRegime(dto.getTaxRegime());
transporter.setStatus(dto.getStatus());
transporter.setShortCode(dto.getShortCode());
transporter.setCreatedDate(dto.getCreatedDate());
transporter.setUpdationDate(dto.getUpdationDate());
transporter.setTaxCodeDesc(dto.getTaxCodeDesc());
transporter.setTaxRate(dto.getTaxRate());
transporter.setCreatedBy(user.getUserId());
transporter.setLastUpdatedBy(user.getUserId());
return transporter;
}
public TransporterUpdateDTO toUpdateDTO(TransporterMasterDto dto, User user) {
TransporterUpdateDTO updateDTO = new TransporterUpdateDTO();
updateDTO.setSupplierCode(dto.getSupplierCode());
updateDTO.setPlantId((short) 2); // Cast the integer to short
updateDTO.setTransporterCode(dto.getTransporterCode());
updateDTO.setPlantCode(dto.getPlantCode());
updateDTO.setBpGrouping(dto.getBpGrouping());
updateDTO.setSupplierAccountGroup(dto.getSupplierAccountGroup());
updateDTO.setTransporterName(dto.getTransporterName());
updateDTO.setTransporterFirstName(dto.getTransporterFirstName());
updateDTO.setTransporterMiddleName(dto.getTransporterMiddleName());
updateDTO.setTransporterLastName(dto.getTransporterLastName());
updateDTO.setLegalEntity(dto.getLegalEntity());
updateDTO.setPermanentAccountNumber(dto.getPermanentAccountNumber());
updateDTO.setStreet(dto.getStreet());
updateDTO.setHouseNumber(dto.getHouseNumber());
updateDTO.setDistrict(dto.getDistrict());
updateDTO.setDifferentCity(dto.getDifferentCity());
updateDTO.setPostalCode(dto.getPostalCode());
updateDTO.setCity(dto.getCity());
updateDTO.setState(dto.getState());
updateDTO.setCountry(dto.getCountry());
updateDTO.setMobileNumber(dto.getMobileNumber());
updateDTO.setEmailId(dto.getEmailId());
updateDTO.setGstn(dto.getGstn());
updateDTO.setTaxRegime(dto.getTaxRegime());
updateDTO.setStatus(dto.getStatus());
updateDTO.setShortCode(dto.getShortCode());
updateDTO.setTaxCodeDesc(dto.getTaxCodeDesc());
updateDTO.setTaxRate(dto.getTaxRate());
updateDTO.setCreatedBy(user.getUserId());
updateDTO.setLastUpdatedBy(user.getUserId());
return updateDTO;
}
public void updateEntityFromDTO(Transporter transporter, TransporterUpdateDTO dto) {
transporter.setPlantCode(dto.getPlantCode());
transporter.setBpGrouping(dto.getBpGrouping());
transporter.setTransporterCode(dto.getTransporterCode());
transporter.setSupplierAccountGroup(dto.getSupplierAccountGroup());
transporter.setTransporterName(dto.getTransporterName());
transporter.setTransporterFirstName(dto.getTransporterFirstName());
transporter.setTransporterMiddleName(dto.getTransporterMiddleName());
transporter.setTransporterLastName(dto.getTransporterLastName());
transporter.setLegalEntity(dto.getLegalEntity());
transporter.setPermanentAccountNumber(dto.getPermanentAccountNumber());
transporter.setStreet(dto.getStreet());
transporter.setHouseNumber(dto.getHouseNumber());
transporter.setDistrict(dto.getDistrict());
transporter.setDifferentCity(dto.getDifferentCity());
transporter.setPostalCode(dto.getPostalCode());
transporter.setCity(dto.getCity());
transporter.setState(dto.getState());
transporter.setCountry(dto.getCountry());
transporter.setMobileNumber(dto.getMobileNumber());
transporter.setEmailId(dto.getEmailId());
transporter.setGstn(dto.getGstn());
transporter.setTaxRegime(dto.getTaxRegime());
transporter.setStatus(dto.getStatus());
transporter.setShortCode(dto.getShortCode());
transporter.setTaxCodeDesc(dto.getTaxCodeDesc());
transporter.setTaxRate(dto.getTaxRate());
transporter.setLastUpdatedBy(dto.getLastUpdatedBy());
transporter.setUpdationDate(dto.getUpdationDate());
}
public TransporterResponse toResponse(Transporter transporter) {
TransporterResponse response = new TransporterResponse();
response.setSupplierCode(transporter.getSupplierCode());
response.setTransporterName(transporter.getTransporterName());
response.setSupplierAccountGroup(transporter.getSupplierAccountGroup());
response.setState(transporter.getState());
response.setBpGrouping(transporter.getBpGrouping());
response.setLegalEntity(transporter.getLegalEntity());
response.setPermanentAccountNumber(transporter.getPermanentAccountNumber());
response.setStreet(transporter.getStreet());
response.setHouseNumber(transporter.getHouseNumber());
response.setDistrict(transporter.getDistrict());
response.setDifferentCity(transporter.getDifferentCity());
response.setPostalCode(transporter.getPostalCode());
response.setCity(transporter.getCity());
response.setCountry(transporter.getCountry());
response.setMobileNumber(transporter.getMobileNumber());
response.setEmailId(transporter.getEmailId());
response.setGstn(transporter.getGstn());
response.setTaxRegime(transporter.getTaxRegime());
response.setShortCode(transporter.getShortCode());
response.setStatus(transporter.getStatus());
response.setTaxCodeDesc(transporter.getTaxCodeDesc());
response.setTaxRate(transporter.getTaxRate());
return response;
}
}

View File

@ -0,0 +1,156 @@
package com.sahyog.app.inbound.user.mapper;
import java.time.LocalDateTime;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import com.sahyog.app.inbound.user.dto.TransporterMasterDto;
import com.sahyog.app.inbound.user.dto.UserDTO;
import com.sahyog.app.inbound.user.dto.UserUpdateDTO;
import com.sahyog.app.inbound.user.enums.Status;
import com.sahyog.app.inbound.user.model.User;
import com.sahyog.app.inbound.user.model.UserType;
import com.sahyog.app.inbound.user.repository.UserTypeRepository;
@Component
public class UserMapper {
@Autowired
private UserTypeRepository userTypeRepository;
public UserDTO toUserDTO(TransporterMasterDto dto) {
String usertypeName = "Transporter";
UserType userType = userTypeRepository.findByUsertypeName(usertypeName);
if (userType == null) {
throw new IllegalStateException("UserType 'Transporter' not found");
}
UserDTO userDTO = new UserDTO();
userDTO.setUserTypeId(userType.getUserTypeId());
userDTO.setUserName(dto.getTransporterName());
userDTO.setFirstName(dto.getTransporterFirstName());
userDTO.setLastName(dto.getTransporterLastName());
userDTO.setEmail(dto.getEmailId());
userDTO.setMobile(dto.getMobileNumber());
userDTO.setEmployeeTransCode(dto.getSupplierCode());
userDTO.setAddedChannel("B");
userDTO.setStatus(Status.A);
userDTO.setCreatedBy(dto.getCreatedBy());
userDTO.setLastUpdatedBy(dto.getLastUpdatedBy());
// userDTO.setLastUpdatedOn(LocalDateTime.now());
return userDTO;
}
// Helper method to concatenate first, middle, and last name to create the userName
private String createUserName(String firstName, String lastName) {
StringBuilder userNameBuilder = new StringBuilder();
if (firstName != null && !firstName.isEmpty()) {
userNameBuilder.append(firstName);
}
// if (middleName != null && !middleName.isEmpty()) {
// userNameBuilder.append(" ").append(middleName);
// }
if (lastName != null && !lastName.isEmpty()) {
userNameBuilder.append(" ").append(lastName);
}
return userNameBuilder.toString().trim();
}
// NEW: Method to map User entity to UserDTO
public UserDTO toDTO(User user) {
UserDTO userDTO = new UserDTO();
userDTO.setUserId(user.getUserId());
userDTO.setUserTypeId(user.getUserTypeId());
userDTO.setUserName(createUserName(user.getFirstName(), user.getLastName()));
userDTO.setFirstName(user.getFirstName());
// userDTO.setMiddleName(user.getMiddleName());
userDTO.setLastName(user.getLastName());
userDTO.setEmail(user.getEmail());
userDTO.setMobile(user.getMobile());
userDTO.setAddedChannel(user.getAddedChannel());
userDTO.setStatus(user.getStatus());
userDTO.setCreatedBy(user.getCreatedBy());
userDTO.setLastUpdatedBy(user.getLastUpdatedBy());
return userDTO;
}
// Method to update user details based on UserDTO
public void updateUserFromDTO(User existingUser, UserDTO userDTO) {
existingUser.setUserTypeId(userDTO.getUserTypeId());
existingUser.setUserName(createUserName(userDTO.getFirstName(), userDTO.getLastName())); // Automatically create userName
existingUser.setFirstName(userDTO.getFirstName());
// existingUser.setMiddleName(userDTO.getMiddleName());
existingUser.setLastName(userDTO.getLastName());
existingUser.setEmail(userDTO.getEmail());
existingUser.setMobile(userDTO.getMobile());
existingUser.setAddedChannel(userDTO.getAddedChannel());
existingUser.setStatus(userDTO.getStatus());
}
// Method to update user details based on UserUpdateDTO
public User updateUserFromUpdateDTO(User existingUser, UserUpdateDTO userUpdateDTO) {
System.out.println("userUpdateDTO => "+userUpdateDTO);
existingUser.setUserName(createUserName(userUpdateDTO.getFirstName(), userUpdateDTO.getLastName())); // Automatically create userName
existingUser.setFirstName(userUpdateDTO.getFirstName());
// existingUser.setMiddleName(userUpdateDTO.getMiddleName());
existingUser.setLastName(userUpdateDTO.getLastName());
existingUser.setEmail(userUpdateDTO.getEmailId());
existingUser.setMobile(userUpdateDTO.getPhoneNumber());
existingUser.setAddedChannel(userUpdateDTO.getAddedChannel());
existingUser.setStatus(userUpdateDTO.getStatus());
return existingUser;
}
//
// // NEW: Method to map User entity to UserDTO
// public UserDTO toDTO(User user) {
// UserDTO userDTO = new UserDTO();
// userDTO.setUserId(user.getUserId());
// userDTO.setUserTypeId(user.getUserTypeId());
// userDTO.setUserName(user.getUserName());
// userDTO.setFirstName(user.getFirstName());
// userDTO.setLastName(user.getLastName());
// userDTO.setEmail(user.getEmail());
// userDTO.setMobile(user.getMobile());
// userDTO.setAddedChannel(user.getAddedChannel());
// userDTO.setStatus(user.getStatus());
// userDTO.setCreatedBy(user.getCreatedBy());
// userDTO.setLastUpdatedBy(user.getLastUpdatedBy());
//// userDTO.setLastUpdatedOn(LocalDateTime.now());
//
// return userDTO;
// }
//
//
// public void updateUserFromDTO(User existingUser, UserDTO userDTO) {
// existingUser.setUserTypeId(userDTO.getUserTypeId());
// existingUser.setUserName(userDTO.getUserName());
// existingUser.setFirstName(userDTO.getFirstName());
// existingUser.setLastName(userDTO.getLastName());
// existingUser.setEmail(userDTO.getEmail());
// existingUser.setMobile(userDTO.getMobile());
// existingUser.setAddedChannel(userDTO.getAddedChannel());
// existingUser.setStatus(userDTO.getStatus());
// }
//
// public void updateUserFromUpdateDTO(User existingUser, UserUpdateDTO userUpdateDTO) {
// existingUser.setUserName(userUpdateDTO.getUserName());
// existingUser.setFirstName(userUpdateDTO.getFirstName());
// existingUser.setLastName(userUpdateDTO.getLastName());
// existingUser.setEmail(userUpdateDTO.getEmailId());
// existingUser.setMobile(userUpdateDTO.getPhoneNumber());
// existingUser.setAddedChannel(userUpdateDTO.getAddedChannel());
// existingUser.setStatus(userUpdateDTO.getStatus());
// }
}

View File

@ -0,0 +1,24 @@
package com.sahyog.app.inbound.user.mapper;
import java.time.LocalDateTime;
import org.springframework.stereotype.Component;
import com.sahyog.app.inbound.user.dto.UserTypeCreateDTO;
import com.sahyog.app.inbound.user.model.UserType;
@Component
public class UserTypeMapper {
public UserType toEntity(UserTypeCreateDTO userTypeCreateDTO, int createdBy) {
UserType userType = new UserType();
userType.setUsertypeName(userTypeCreateDTO.getUsertypeName());
userType.setStatus(userTypeCreateDTO.getStatus());
userType.setDescription(userType.getDescription());
// userType.setCreatedBy(createdBy);
// userType.setLastUpdatedBy(createdBy);
// userType.s(LocalDateTime.now());
// userType.setLastUpdatedOn(LocalDateTime.now());
return userType;
}
}

View File

@ -0,0 +1,59 @@
package com.sahyog.app.inbound.user.model;
import jakarta.persistence.*;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
import java.sql.Timestamp;
import com.sahyog.app.inbound.user.enums.Status;
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@ToString
@Entity
@Table(name = "MterialMaster")
public class MaterialMaster {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "material_id", nullable = false, updatable = false)
private int materialId;
@Column(name = "material_code", length = 40, nullable = false)
private String materialCode;
@Column(name = "material_description", length = 60, nullable = false)
private String materialDescription;
@Column(name = "material_group", length = 30)
private String materialGroup;
@Column(name = "material_group_desc", length = 40)
private String materialGroupDesc;
@Column(name = "plant_id", nullable = false)
private int plantId;
@Enumerated(EnumType.STRING)
@Column(name = "status", length = 1, nullable = false)
private Status status;
// @Column(name = "created_on", nullable = false, updatable = false)
// private Timestamp createdOn;
@Column(name = "created_by", nullable = false)
private int createdBy;
// @Column(name = "last_updated_on", nullable = false)
// private Timestamp lastUpdatedOn;
@Column(name = "last_updated_by", nullable = false)
private int lastUpdatedBy;
}

View File

@ -0,0 +1,83 @@
package com.sahyog.app.inbound.user.model;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import com.sahyog.app.inbound.user.enums.Status;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.EnumType;
import jakarta.persistence.Enumerated;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import jakarta.persistence.Table;
import jakarta.validation.constraints.DecimalMin;
import jakarta.validation.constraints.Digits;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Pattern;
import jakarta.validation.constraints.Size;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@ToString
@Entity
@Table(name="PlantMaster")
public class PlantMaster {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "plant_id", nullable = false, updatable = false)
private Short plantId;
@NotNull(message = "Plant code cannot be null")
@Size(min = 4, max = 4, message = "Plant code must be exactly 4 characters")
@Column(name = "plant_code", nullable = false, length = 4, unique = true)
private String plantCode;
@Size(max = 30, message = "Plant description cannot exceed 30 characters")
@Column(name = "plant_desc", length = 30)
private String plantDesc;
@Size(max = 30, message = "Plant PAN cannot exceed 30 characters")
@Column(name = "plant_pan", length = 30)
private String plantPan;
@Size(max = 30, message = "Plant GST cannot exceed 30 characters")
@Column(name = "plant_gst", length = 30)
private String plantGst;
@NotNull(message = "Plant GST rate cannot be null")
@DecimalMin(value = "0.00", inclusive = false, message = "Plant GST rate must be greater than 0")
@Digits(integer = 9, fraction = 2, message = "Plant GST rate must be a valid decimal with 2 decimal places")
@Column(name = "plant_gst_rate", nullable = false, precision = 11, scale = 2)
private BigDecimal plantGstRate;
@NotNull(message = "Added channel cannot be null")
@Pattern(regexp = "^[A-Za-z0-9]{1}$", message = "Added channel must be a single alphanumeric character")
@Column(name = "added_channel", nullable = false, length = 1)
private String addedChannel;
@NotNull(message = "Status cannot be null")
@Enumerated(EnumType.STRING)
@Column(name = "status", nullable = false, length = 1)
private Status status;
@NotNull(message = "Created by cannot be null")
@Column(name = "created_by", nullable = false)
private int createdBy;
@NotNull(message = "Last updated by cannot be null")
@Column(name = "last_updated_by", nullable = false)
private int lastUpdatedBy;
@Column(name="last_updated_on")
private LocalDateTime lastUpdatedOn = LocalDateTime.now();
}

View File

@ -0,0 +1,80 @@
package com.sahyog.app.inbound.user.model;
import java.time.Instant;
import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
import java.time.LocalDateTime;
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
@ToString
public class Response<T> {
private int status;
private String message;
// private String details; // Additional field for error details
private T data;
private String timestamp; // Use String for ISO 8601 format
// Custom constructor for success with data
public Response(int statusCode, String message, T data) {
this.status = statusCode;
this.message = message;
this.data = data;
this.timestamp = LocalDateTime.now().toString(); // ISO format timestamp
}
// Custom constructor for messages without data
public Response(int statusCode, String message) {
this(statusCode, message, null);
}
// Generic method to create success responses with data
public static <T> Response<T> success(T data) {
return new Response<>(200, "Success", data);
}
// Generic method to create error responses with details
public static <T> Response<T> error(int statusCode, String message) {
return new Response<>(statusCode, message, null);
}
// Method to update the message dynamically
public Response<T> withMessage(String message) {
this.message = message;
return this;
}
// Method to update the details dynamically
public Response<T> withDetails(String details) {
// this.details = details;
return this;
}
// Updated withData() method to accept List<Map<String, Object>> as data
public Response<List<Map<String, Object>>> withData(List<Map<String, Object>> data) {
this.data = (T) data; // Cast data to type T
return (Response<List<Map<String, Object>>>) this; // Ensure the return type matches
}
// Generic method to create error responses with default status code
public static <T> Response<T> error(String message) {
return new Response<>(500, message, null); // Default status code to 500
}
public static Response<List<Map<String, Object>>> failure(String message, List<Map<String, Object>> userResponseData) {
Response<List<Map<String, Object>>> response = new Response<>();
// response.setStatus("failure");
response.setMessage(message);
response.setData(userResponseData);
return response;
}
}

View File

@ -0,0 +1,74 @@
package com.sahyog.app.inbound.user.model;
import java.time.LocalDateTime;
import com.sahyog.app.inbound.user.enums.RoleType;
import com.sahyog.app.inbound.user.enums.Status;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.EnumType;
import jakarta.persistence.Enumerated;
import jakarta.persistence.FetchType;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import jakarta.persistence.JoinColumn;
import jakarta.persistence.ManyToOne;
import jakarta.persistence.Table;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@Entity
@Table(name = "RoleMaster", indexes = {
// @Index(name = "uk_role_name", columnList = "role_name", unique = true),
// @Index(name = "idx_role_status", columnList = "status")
})
public class Role {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "role_id", nullable = false, updatable = false)
private short roleId;
@NotNull(message = "Role name cannot be null")
@Size(min = 1, max = 30, message = "Role name must be between 1 and 30 characters")
@Column(name = "role_name", length = 30, nullable = false)
private String roleName;
@NotNull(message = "Role description cannot be null")
@Size(min = 1, max = 50, message = "Role description must be between 1 and 50 characters")
@Column(name = "rode_description", length = 50, nullable = false)
private String roleDescription;
@NotNull(message = "User type ID cannot be null")
@Min(value = 1, message = "User type ID must be a positive integer")
@Column(name = "usertype_id", nullable = false)
private short userTypeId;
@NotNull(message = "Status cannot be null")
@Enumerated(EnumType.STRING)
@Column(name = "status", length = 1, nullable = false)
private Status status;
@NotNull(message = "Created by cannot be null")
@Min(value = 1, message = "Created by must be a positive integer")
@Column(name = "created_by", nullable = false)
private int createdBy;
@NotNull(message = "Last updated by cannot be null")
@Min(value = 1, message = "Last updated by must be a positive integer")
@Column(name = "last_updated_by", nullable = false)
private int lastUpdatedBy;
}

View File

@ -0,0 +1,186 @@
package com.sahyog.app.inbound.user.model;
import jakarta.persistence.*;
import jakarta.validation.constraints.Email;
import jakarta.validation.constraints.Max;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Pattern;
import jakarta.validation.constraints.Positive;
import jakarta.validation.constraints.Size;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
import java.time.LocalDate;
import java.time.LocalDateTime;
@Setter
@Getter
@NoArgsConstructor
@AllArgsConstructor
@ToString
@Entity
@Table(name = "TransporterMaster", indexes = {
@Index(name = "idx_supplier_code", columnList = "supplier_code"),
@Index(name = "idx_transporter_status", columnList = "status"),
@Index(name = "idx_transporter_plant_code", columnList = "plant_code")
})
public class Transporter {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "transporter_id", nullable = false, updatable = false)
private int transporterId;
@Column(name = "plant_id", nullable = false)
@NotNull(message = "Plant ID cannot be null")
private short plantId;
@Column(name = "plant_code", length = 4, nullable = false)
@NotNull(message = "Plant code cannot be null")
@Size(min = 4, max = 4, message = "Plant code must be exactly 4 characters")
private String plantCode;
@Column(name="user_id")
@Positive(message = "User ID must be a positive number")
private int userId;
@Column(name = "BP_GROUPING")
@Size(max = 255, message = "BP Grouping cannot exceed 255 characters")
private String bpGrouping;
@Column(name = "transporter_code", length = 20)
@Size(max = 20, message = "Transporter code cannot exceed 20 characters")
private String transporterCode;
@Column(name = "supplier_code", length = 20)
@Size(max = 20, message = "Supplier code cannot exceed 20 characters")
private String supplierCode;
@Column(name = "supplier_account_group", length = 20)
@Size(max = 20, message = "Supplier account group cannot exceed 20 characters")
private String supplierAccountGroup;
@Column(name = "transporter_name", length = 100, nullable = false)
@NotNull(message = "Transporter name cannot be null")
@Size(max = 100, message = "Transporter name cannot exceed 100 characters")
private String transporterName;
@Column(name = "transporter_fname", length = 40, nullable = false)
@NotNull(message = "First name cannot be null")
@Size(max = 40, message = "First name cannot exceed 40 characters")
private String transporterFirstName;
@Column(name = "transporter_mname", length = 30, nullable = false)
@NotNull(message = "Middle name cannot be null")
@Size(max = 30, message = "Middle name cannot exceed 30 characters")
private String transporterMiddleName;
@Column(name = "transporter_lname", length = 30, nullable = false)
@NotNull(message = "Last name cannot be null")
@Size(max = 30, message = "Last name cannot exceed 30 characters")
private String transporterLastName;
@Column(name = "legal_entity", length = 100)
@Size(max = 100, message = "Legal entity cannot exceed 100 characters")
private String legalEntity;
@Column(name = "permanent_account_number", length = 10)
@Pattern(regexp = "[A-Z]{5}[0-9]{4}[A-Z]{1}", message = "Invalid PAN format")
private String permanentAccountNumber;
@Column(name = "street", length = 40)
@Size(max = 40, message = "Street cannot exceed 40 characters")
private String street;
@Column(name = "house_number", length = 10)
@Size(max = 10, message = "House number cannot exceed 10 characters")
private String houseNumber;
@Column(name = "district", length = 40)
@Size(max = 40, message = "District cannot exceed 40 characters")
private String district;
@Column(name = "different_city", length = 40)
@Size(max = 40, message = "City cannot exceed 40 characters")
private String differentCity;
@Column(name = "postal_code", length = 10)
@Pattern(regexp = "\\d{5,10}", message = "Postal code must be between 5 to 10 digits")
private String postalCode;
@Column(name = "city", length = 40)
@Size(max = 40, message = "City cannot exceed 40 characters")
private String city;
@Column(name = "country", length = 40)
@Size(max = 40, message = "Country cannot exceed 40 characters")
private String country;
@Column(name = "state", length = 40)
@Size(max = 40, message = "State cannot exceed 40 characters")
private String state;
@Column(name = "mobile_number", length = 10)
@Pattern(regexp = "\\d{10}", message = "Mobile number must be exactly 10 digits")
private String mobileNumber;
@Column(name = "email_id", length = 50)
@Email(message = "Invalid email format")
@Size(max = 50, message = "Email cannot exceed 50 characters")
private String emailId;
@Column(name = "gstn", length = 40)
@Size(max = 40, message = "GSTN cannot exceed 40 characters")
private String gstn;
@Column(name = "tax_regime", length = 10)
@Size(max = 10, message = "Tax regime cannot exceed 10 characters")
private String taxRegime;
@Column(name = "short_code", length = 40)
@Size(max = 40, message = "Short code cannot exceed 40 characters")
private String shortCode;
@Column(name = "created_date")
private LocalDate createdDate;
@Column(name = "updation_date")
private LocalDate updationDate;
@Column(name = "tax_code_desc")
@Size(max = 255, message = "Tax code description cannot exceed 255 characters")
private String taxCodeDesc;
@Column(name = "tax_rate")
@Min(value = 0, message = "Tax rate cannot be negative")
@Max(value = 100, message = "Tax rate cannot exceed 100")
private int taxRate;
@Column(name = "status", length = 1, nullable = false)
@NotNull(message = "Status cannot be null")
@Pattern(regexp = "[AI]", message = "Status must be 'A' (Active) or 'I' (Inactive)")
private String status;
@Column(name = "created_by", nullable = false)
@NotNull(message = "Created by cannot be null")
private int createdBy;
@Column(name = "last_updated_by", nullable = false)
@NotNull(message = "Last updated by cannot be null")
private int lastUpdatedBy;
@Column(name = "last_updated_on", nullable = false)
private LocalDateTime lastUpdatedOn = LocalDateTime.now();
}

View File

@ -0,0 +1,102 @@
package com.sahyog.app.inbound.user.model;
import jakarta.persistence.*;
import jakarta.validation.constraints.Email;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
import java.time.LocalDateTime;
import org.hibernate.annotations.CreationTimestamp;
import org.hibernate.annotations.UpdateTimestamp;
import com.sahyog.app.inbound.user.enums.Status;
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@ToString
@Entity
@Table(name = "UserMaster")
public class User {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "user_id", nullable = false, updatable = false)
private int userId;
@NotNull(message = "User type ID cannot be null")
@Min(value = 1, message = "User type ID must be a positive integer")
@Column(name = "usertype_id", nullable = false)
private short userTypeId;
@NotNull(message = "Username cannot be null")
@Size(min = 1, max = 80, message = "Username must be between 1 and 80 characters")
@Column(name = "user_name", length = 80, nullable = false)
private String userName;
@NotNull(message = "First name cannot be null")
@Size(min = 1, max = 40, message = "First name must be between 1 and 40 characters")
@Column(name = "user_fname", length = 40, nullable = false)
private String firstName;
@Size(max = 40, message = "Last name must not exceed 40 characters")
@Column(name = "user_lname", length = 40)
private String lastName;
@NotNull(message = "Email cannot be null")
@Email(message = "Email should be valid")
@Size(max = 40, message = "Email must not exceed 40 characters")
@Column(name = "user_email", length = 40, nullable = false, unique = true)
private String email;
@Size(max = 10, message = "Mobile number must not exceed 10 characters")
@Column(name = "user_mobile", length = 10)
private String mobile;
@Size(max = 20, message = "Employee transaction code must not exceed 20 characters")
@Column(name = "user_emp_trans_code", length = 20)
private String employeeTransCode;
@NotNull(message = "Added channel cannot be null")
@Size(min = 1, max = 1, message = "Added channel must be exactly 1 character")
@Column(name = "user_added_channel", length = 1, nullable = false)
private String addedChannel;
@NotNull(message = "Status cannot be null")
@Enumerated(EnumType.STRING)
@Column(name = "status", length = 1, nullable = false)
private Status status;
@NotNull(message = "Created by cannot be null")
@Min(value = 1, message = "Created by must be a positive integer")
@Column(name = "created_by", nullable = false)
private int createdBy;
// @Column(name="created_on")
// private LocalDateTime createdOn;
@NotNull(message = "Last updated by cannot be null")
@Min(value = 1, message = "Last updated by must be a positive integer")
@Column(name = "last_updated_by", nullable = false)
private int lastUpdatedBy;
@Column(name = "last_updated_on", nullable = false)
private LocalDateTime lastUpdatedOn = LocalDateTime.now();
}

View File

@ -0,0 +1,56 @@
package com.sahyog.app.inbound.user.model;
import com.sahyog.app.inbound.user.enums.Status;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.EnumType;
import jakarta.persistence.Enumerated;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import jakarta.persistence.Table;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotNull;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@Entity
@Table(name="UserPlant")
public class UserPlant {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "userplant_id", nullable = false, updatable = false)
private int userPlantId;
@NotNull(message = "User ID cannot be null")
@Min(value = 1, message = "User ID must be a positive integer")
@Column(name = "user_id", nullable = false)
private int userId;
@NotNull(message = "Plant ID cannot be null")
@Min(value = 1, message = "Plant ID must be a positive integer")
@Column(name = "plant_id", nullable = false)
private int plantId;
@NotNull(message = "Status cannot be null")
@Enumerated(EnumType.STRING)
@Column(name = "status", length = 1, nullable = false)
private Status status;
@NotNull(message = "Created by cannot be null")
@Min(value = 1, message = "Created by must be a positive integer")
@Column(name = "created_by", nullable = false)
private int createdBy;
@NotNull(message = "Last updated by cannot be null")
@Min(value = 1, message = "Last updated by must be a positive integer")
@Column(name = "last_updated_by", nullable = false)
private int lastUpdatedBy;
}

View File

@ -0,0 +1,45 @@
package com.sahyog.app.inbound.user.model;
import jakarta.persistence.*;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import java.time.LocalDateTime;
import com.sahyog.app.inbound.user.enums.Status;
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@Entity
@Table(name = "UserRole")
public class UserRole {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "userrole_id")
private int userRoleId;
@Column(name = "user_id")
private int userId;
@Column(name = "role_id")
private int roleId;
@Enumerated(EnumType.STRING)
@Column(name = "status", length = 1, nullable = false)
private Status status;
@Column(name = "created_by", nullable = false)
private int createdBy;
@Column(name = "last_updated_by", nullable = false)
private int lastUpdatedBy;
}

View File

@ -0,0 +1,62 @@
package com.sahyog.app.inbound.user.model;
import com.sahyog.app.inbound.user.enums.Status;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.EnumType;
import jakarta.persistence.Enumerated;
import jakarta.persistence.FetchType;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import jakarta.persistence.JoinColumn;
import jakarta.persistence.ManyToOne;
import jakarta.persistence.Table;
import jakarta.persistence.UniqueConstraint;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@Entity
@Table(name = "UserTypeMaster")
public class UserType {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "usertype_id", nullable = false, updatable = false)
private short userTypeId;
@NotNull(message = "User type name cannot be null")
@Size(max = 255, message = "User type name must be less than or equal to 255 characters")
@Column(name = "usertype_name", length = 255, unique = true, nullable = false)
private String usertypeName;
@Size(max = 255, message = "User type description must be less than or equal to 255 characters")
@Column(name = "usertype_description", length = 255)
private String description;
// @Enumerated(EnumType.STRING)
@Column(name = "status")
private String status;
@NotNull(message = "Created by cannot be null")
@Min(value = 1, message = "Created by must be a positive integer")
@Column(name = "created_by", nullable = false)
private int createdBy;
@NotNull(message = "Last updated by cannot be null")
@Min(value = 1, message = "Last updated by must be a positive integer")
@Column(name = "last_updated_by", nullable = false)
private int lastUpdatedBy;
}

Some files were not shown because too many files have changed in this diff Show More