Skip to content

Commit

Permalink
CCMSPUI-530 Added evidence allowed to NotificationInfo and Notificati…
Browse files Browse the repository at this point in the history
…onMapper

Signed-off-by: Jamie Briggs <jamie.briggs@digital.justice.gov.uk>
  • Loading branch information
Jamie Briggs committed Feb 14, 2025
1 parent 2a0a9d5 commit 2e568b4
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 7 deletions.
3 changes: 3 additions & 0 deletions data-api/open-api-specification.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1901,6 +1901,9 @@ components:
type: 'string'
notification_open_indicator:
type: 'boolean'
evidence_allowed:
type: 'boolean'

notification:
allOf:
- $ref: "#/components/schemas/notificationInfo"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ CREATE TABLE XXCCMS.XXCCMS_GET_NOTIF_INFO_V (
PERSON_LAST_NAME VARCHAR2(150),
FEE_EARNER_PARTY_ID NUMBER,
ACTION_NOTIFICATION_IND VARCHAR2(150),
IS_OPEN VARCHAR2(5));
IS_OPEN VARCHAR2(5),
EVIDENCE_ALLOWED_IND VARCHAR2(5));


INSERT INTO XXCCMS.XXCCMS_GET_NOTIF_INFO_V (NOTIFICATION_ID,
Expand All @@ -34,7 +35,8 @@ INSERT INTO XXCCMS.XXCCMS_GET_NOTIF_INFO_V (NOTIFICATION_ID,
PERSON_LAST_NAME,
FEE_EARNER_PARTY_ID,
ACTION_NOTIFICATION_IND,
IS_OPEN)
IS_OPEN,
EVIDENCE_ALLOWED_IND)
VALUES (1, -- NOTIFICATION_ID
'test_user', -- USER_ID
'test_login', -- USER_LOGIN_ID
Expand All @@ -51,7 +53,8 @@ VALUES (1, -- NOTIFICATION_ID
'Briggs', -- PERSON_LAST_NAME
3001, -- FEE_EARNER_PARTY_ID
'N', -- ACTION_NOTIFICATION_IND
'true' -- IS_OPEN
'true', -- IS_OPEN
'true' -- EVIDENCE_allowed_ind
);

INSERT INTO XXCCMS.XXCCMS_GET_NOTIF_INFO_V (NOTIFICATION_ID,
Expand All @@ -70,7 +73,8 @@ INSERT INTO XXCCMS.XXCCMS_GET_NOTIF_INFO_V (NOTIFICATION_ID,
PERSON_LAST_NAME,
FEE_EARNER_PARTY_ID,
ACTION_NOTIFICATION_IND,
IS_OPEN)
IS_OPEN,
EVIDENCE_ALLOWED_IND)
VALUES (2, -- NOTIFICATION_ID
'test_user', -- USER_ID
'test_login', -- USER_LOGIN_ID
Expand All @@ -87,5 +91,6 @@ VALUES (2, -- NOTIFICATION_ID
'Bri-Monday', -- PERSON_LAST_NAME
3002, -- FEE_EARNER_PARTY_ID
'O', -- ACTION_NOTIFICATION_IND
'false' -- IS_OPEN
'false', -- IS_OPEN
'false' -- EVIDENCE_allowed_ind
);
Original file line number Diff line number Diff line change
Expand Up @@ -115,4 +115,8 @@ public class NotificationInfo {
@OneToMany(mappedBy = "notificationId", fetch = FetchType.LAZY)
private List<NotificationAction> actions;

@Column(name = "EVIDENCE_ALLOWED_IND")
@Convert(converter = BooleanStringConverter.class)
private Boolean evidenceAllowedIndicator;

}
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ public interface NotificationMapper {
@Mapping(target = "uploadedDocuments", source = "documents")
@Mapping(target = "attachedDocuments", source = "attachments")
@Mapping(target = "availableResponses", source = "actions", qualifiedByName = "action")
@Mapping(target = "evidenceAllowed", source = "evidenceAllowedIndicator")
Notification mapToNotification(NotificationInfo notification);

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ public interface NotificationsMapper {
@Mapping(target = "caseReferenceNumber", source = "lscCaseRefReference")
@Mapping(target = "notificationType", source = "actionNotificationInd")
@Mapping(target = "notificationOpenIndicator", source = "isOpen")
@Mapping(target = "evidenceAllowed", source = "evidenceAllowedIndicator")
uk.gov.laa.ccms.data.model.NotificationInfo mapToNotification(NotificationInfo notificationInfo);


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ void shouldMapBasicDetails(){
.lscCaseRefReference("LSC Case Ref")
.providerCaseReference("Provider Case Ref")
.feeEarnerPartyId(4L)
.evidenceAllowedIndicator(true)
.build();

// When
Expand All @@ -72,6 +73,7 @@ void shouldMapBasicDetails(){
assertEquals(true, notificationResult.getNotificationOpenIndicator());
assertEquals("Provider Case Ref",notificationResult.getProviderCaseReferenceNumber());
assertEquals("LSC Case Ref", notificationResult.getCaseReferenceNumber());
assertEquals(true, notificationResult.getEvidenceAllowed());
}

@Test
Expand Down Expand Up @@ -129,7 +131,6 @@ void shouldMapDocuments(){
assertEquals("Status", resultTwo.getStatus());
}

// TODO Come back to this one
@Test
@DisplayName("Should map two attachments")
void shouldMapAttachments(){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import uk.gov.laa.ccms.data.model.Notifications;

@DisplayName("NotificationsMapperImpl Test")
public class NotificationsMapperImplTest {
class NotificationsMapperImplTest {

NotificationsMapperImpl mapper = new NotificationsMapperImpl();

Expand Down Expand Up @@ -54,6 +54,7 @@ void shouldMapSingleNotification(){
.lscCaseRefReference("LSC Case Ref")
.providerCaseReference("Provider Case Ref")
.feeEarnerPartyId(4L)
.evidenceAllowedIndicator(true)
.build();
Page<NotificationInfo> input = new PageImpl<>(Arrays.asList(notificationInfo),
PageRequest.of(0, 1), 1);
Expand All @@ -75,6 +76,7 @@ void shouldMapSingleNotification(){
assertEquals(true, notificationResult.getNotificationOpenIndicator());
assertEquals("Provider Case Ref",notificationResult.getProviderCaseReferenceNumber());
assertEquals("LSC Case Ref", notificationResult.getCaseReferenceNumber());
assertEquals(true, notificationResult.getEvidenceAllowed());
}

}

0 comments on commit 2e568b4

Please sign in to comment.