Skip to content

Commit 0550884

Browse files
Sahil-tarentotarentomaheshvakkundshankaragoudab
authored
4.8.26 dev v4 (#50)
* Network Hub Enhancements. (#47) * KB-10186 | Learner Portal | If user has Primary details, in the Service history default data is not calculating for Profile page percentage. (#45) 1. If user has Professional details and the Service history data is not there then we need to add the profile completion percentage based on the professiona details * Network Hub Enhancments 1. Implemented the Redis with the jedispool as per current functionality that is available in the cb-ext service. * Redis client dependency added * Test cases added for profile service * 4.8.26 dev v2 (#48) * KB-10186 | Learner Portal | If user has Primary details, in the Service history default data is not calculating for Profile page percentage. (#45) 1. If user has Professional details and the Service history data is not there then we need to add the profile completion percentage based on the professiona details * added the update additional fields and get additional field api * removed un-used code --------- Co-authored-by: tarentomaheshvakkund <139739142+tarentomaheshvakkund@users.noreply.github.com> * Null Pointer Exception in Profile Service (#49) --------- Co-authored-by: tarentomaheshvakkund <139739142+tarentomaheshvakkund@users.noreply.github.com> Co-authored-by: shankaragoudab <140387294+shankaragoudab@users.noreply.github.com>
1 parent 49c4cc9 commit 0550884

14 files changed

Lines changed: 1066 additions & 479 deletions

File tree

pom.xml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@
4848
<groupId>org.springframework.boot</groupId>
4949
<artifactId>spring-boot-starter-log4j2</artifactId>
5050
</dependency>
51+
<dependency>
52+
<groupId>org.postgresql</groupId>
53+
<artifactId>postgresql</artifactId>
54+
</dependency>
5155
<dependency>
5256
<groupId>org.springframework.boot</groupId>
5357
<artifactId>spring-boot-starter-test</artifactId>
@@ -65,6 +69,10 @@
6569
<groupId>org.hibernate.orm</groupId>
6670
<artifactId>hibernate-core</artifactId>
6771
</dependency>
72+
<dependency>
73+
<groupId>org.springframework.boot</groupId>
74+
<artifactId>spring-boot-starter-data-jpa</artifactId>
75+
</dependency>
6876
<dependency>
6977
<groupId>org.projectlombok</groupId>
7078
<artifactId>lombok</artifactId>
@@ -196,6 +204,11 @@
196204
<version>5.9.2</version>
197205
<scope>test</scope>
198206
</dependency>
207+
<dependency>
208+
<groupId>redis.clients</groupId>
209+
<artifactId>jedis</artifactId>
210+
<version>4.4.3</version>
211+
</dependency>
199212
</dependencies>
200213

201214
<build>

src/main/java/com/igot/cb/profile/controller/ProfileController.java

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,4 +91,21 @@ public ResponseEntity<Object> getCompetencies(@PathVariable(Constants.USER_ID_RQ
9191
ApiResponse response = profileService.listCompetencies(userId, authToken);
9292
return new ResponseEntity<>(response, HttpStatus.valueOf(response.getResponseCode().value()));
9393
}
94+
95+
@PostMapping(value = "/update/additionalFields")
96+
public ResponseEntity<ApiResponse> updateAdditionalFields(
97+
@RequestHeader(Constants.X_AUTH_TOKEN) String authToken,
98+
@RequestBody Map<String, Object> requestBody) {
99+
ApiResponse response = profileService.updateAdditionalFields(requestBody, authToken);
100+
return new ResponseEntity<>(response, response.getResponseCode());
101+
}
102+
103+
@GetMapping("/getAdditionalFields/{userId}/{orgId}")
104+
public ResponseEntity<Object> getAdditionalFieldsByOrg(
105+
@PathVariable String userId,
106+
@PathVariable String orgId,
107+
@RequestHeader(value = Constants.X_AUTH_TOKEN) String authToken) {
108+
ApiResponse response = profileService.getAdditionalFieldsByOrg(userId, orgId, authToken);
109+
return new ResponseEntity<>(response, response.getResponseCode());
110+
}
94111
}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
package com.igot.cb.profile.entity;
2+
3+
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
4+
import com.fasterxml.jackson.databind.JsonNode;
5+
import com.vladmihalcea.hibernate.type.json.JsonType;
6+
import jakarta.persistence.Column;
7+
import jakarta.persistence.Entity;
8+
import jakarta.persistence.Id;
9+
import jakarta.persistence.Table;
10+
import lombok.AllArgsConstructor;
11+
import lombok.Getter;
12+
import lombok.NoArgsConstructor;
13+
import lombok.Setter;
14+
import org.hibernate.annotations.Type;
15+
16+
import java.sql.Timestamp;
17+
18+
@Getter
19+
@Setter
20+
@NoArgsConstructor
21+
@AllArgsConstructor
22+
@Table(name = "custom_fields")
23+
@JsonIgnoreProperties(ignoreUnknown = true)
24+
@Entity
25+
public class CustomFieldEntity {
26+
@Id
27+
private String customFiledId;
28+
29+
@Type(JsonType.class)
30+
@Column(columnDefinition = "jsonb")
31+
private JsonNode customFieldData;
32+
33+
private Boolean isMandatory;
34+
35+
private Boolean isActive;
36+
37+
private Timestamp createdOn;
38+
39+
private Timestamp updatedOn;
40+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package com.igot.cb.profile.repository;
2+
3+
4+
import com.igot.cb.profile.entity.CustomFieldEntity;
5+
import org.springframework.data.jpa.repository.JpaRepository;
6+
import org.springframework.stereotype.Repository;
7+
8+
import java.util.Optional;
9+
10+
@Repository
11+
public interface CustomFieldRepository extends JpaRepository<CustomFieldEntity, String> {
12+
Optional<CustomFieldEntity> findByCustomFiledIdAndIsActiveTrue(String customFiledId);
13+
}

src/main/java/com/igot/cb/profile/service/ProfileService.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,8 @@ public interface ProfileService {
1919
ApiResponse getBasicProfile(String userId, String userToken);
2020

2121
ApiResponse listCompetencies(String userId, String userToken);
22+
23+
ApiResponse updateAdditionalFields(Map<String, Object> request, String userToken);
24+
25+
ApiResponse getAdditionalFieldsByOrg(String userId, String orgId, String authToken);
2226
}

0 commit comments

Comments
 (0)