From ec328596dd160b8c62e1cc0817ed2250d45009fb Mon Sep 17 00:00:00 2001
From: ruksanasemeir <ruksana.semeir@tarento.com>
Date: Thu, 8 Feb 2024 12:42:47 +0530
Subject: [PATCH] Added the userRole field in comment Data

---
 pom.xml                                        |  2 +-
 src/main/resources/application.properties      | 18 ++++++------------
 .../payloadValidation/firstComment.json        |  5 ++++-
 .../payloadValidation/newComment.json          |  5 ++++-
 .../payloadValidation/updateComment.json       |  5 ++++-
 5 files changed, 19 insertions(+), 16 deletions(-)

diff --git a/pom.xml b/pom.xml
index 9b6f14f..3a5bb8f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -97,7 +97,7 @@
 				</configuration>
 			</plugin>
 		</plugins>
-		<finalName>kubernetes</finalName>
+		<finalName>comment-hub</finalName>
 	</build>
 
 </project>
diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties
index 761cf6e..d125833 100644
--- a/src/main/resources/application.properties
+++ b/src/main/resources/application.properties
@@ -1,19 +1,13 @@
 server.port=8099
 
-management.endpoints.web.exposure.include=health
-
 # PostgreSQL configuration
-spring.datasource.url=jdbc:postgresql://localhost:5432/commentdb
+spring.datasource.url=jdbc:postgresql://localhost:5433/frac_tool
 spring.datasource.username=postgres
-spring.datasource.password=password
-spring.datasource.driver-class-name=org.postgresql.Driver
-
-## Hibernate Properties
-# The SQL dialect makes Hibernate generate better SQL for the chosen database
+spring.datasource.password=yoursupersecret
 spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.PostgreSQLDialect
-
-# Hibernate ddl auto (create, create-drop, validate, update)
-spring.jpa.hibernate.ddl-auto = update
+spring.jpa.properties.hibernate.format_sql=true
+spring.jpa.show-sql=false
+spring.jpa.hibernate.ddl-auto=update
 
 #------------------secretes------------#
 jwt.secret.key=comment-hub
@@ -23,7 +17,7 @@ spring.redis.host=127.0.0.1
 spring.redis.port=6379
 #spring.redis.password=KZ9u%Z&mki4&p35
 # 14 days in second  14 * 24 * 60 * 60
-redis.ttl=1209600
+redis.ttl=86400
 
 #----------------------------Configure Logback pattern -----------------------
 logging.pattern.console=%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n
diff --git a/src/main/resources/payloadValidation/firstComment.json b/src/main/resources/payloadValidation/firstComment.json
index bd6ff6b..9f0e445 100644
--- a/src/main/resources/payloadValidation/firstComment.json
+++ b/src/main/resources/payloadValidation/firstComment.json
@@ -48,9 +48,12 @@
             },
             "userName": {
               "type": "string"
+            },
+            "userRole": {
+              "type": "string"
             }
           },
-          "required": ["userId", "userPic"],
+          "required": ["userId", "userPic", "userRole"],
           "additionalProperties": false
         }
       },
diff --git a/src/main/resources/payloadValidation/newComment.json b/src/main/resources/payloadValidation/newComment.json
index 0e6d0c3..1c0042f 100644
--- a/src/main/resources/payloadValidation/newComment.json
+++ b/src/main/resources/payloadValidation/newComment.json
@@ -38,9 +38,12 @@
             },
             "userName": {
               "type": "string"
+            },
+            "userRole": {
+              "type": "string"
             }
           },
-          "required": ["userId", "userPic"],
+          "required": ["userId", "userPic", "userRole"],
           "additionalProperties": false
         }
       },
diff --git a/src/main/resources/payloadValidation/updateComment.json b/src/main/resources/payloadValidation/updateComment.json
index 90cac47..0b60958 100644
--- a/src/main/resources/payloadValidation/updateComment.json
+++ b/src/main/resources/payloadValidation/updateComment.json
@@ -35,9 +35,12 @@
             },
             "userName": {
               "type": "string"
+            },
+            "userRole": {
+              "type": "string"
             }
           },
-          "required": ["userId", "userPic"],
+          "required": ["userId", "userPic", "userRole"],
           "additionalProperties": false
         },
         "commentResolved": {
-- 
GitLab