Skip to content

Commit

Permalink
Revert "DIAC-546 new event to pull notification data given a notifica…
Browse files Browse the repository at this point in the history
…tion ID …" (#2420)

This reverts commit 679d365.
  • Loading branch information
alivenichoppa authored Nov 13, 2024
1 parent 679d365 commit bcad8ee
Show file tree
Hide file tree
Showing 20 changed files with 397 additions and 1,103 deletions.
2 changes: 0 additions & 2 deletions Jenkinsfile_CNP
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,6 @@ def secrets = [
secret('em-stitching-enabled', 'IA_EM_STITCHING_ENABLED'),
secret('submit-hearing-requirements-enabled', 'IA_SUBMIT_HEARING_REQUIREMENTS_ENABLED'),
secret('launch-darkly-sdk-key', 'LAUNCH_DARKLY_SDK_KEY'),
secret('ia-gov-notify-key', 'IA_GOV_NOTIFY_KEY'),
secret('ia-bail-gov-notify-key', 'IA_BAIL_GOV_NOTIFY_KEY'),
secret('app-insights-connection-string', 'app-insights-connection-string'),
secret('postgres-auth-values-password', 'PG_AUTH_VALUES_YAML_PASS'),
secret('generic-values-preview-password', 'GENERIC_VALUES_PREVIEW_YAML_PASS'),
Expand Down
2 changes: 0 additions & 2 deletions Jenkinsfile_nightly
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,6 @@ def secrets = [
secret('em-stitching-enabled', 'IA_EM_STITCHING_ENABLED'),
secret('submit-hearing-requirements-enabled', 'IA_SUBMIT_HEARING_REQUIREMENTS_ENABLED'),
secret('launch-darkly-sdk-key', 'LAUNCH_DARKLY_SDK_KEY'),
secret('ia-gov-notify-key', 'IA_GOV_NOTIFY_KEY'),
secret('ia-bail-gov-notify-key', 'IA_BAIL_GOV_NOTIFY_KEY'),
secret('app-insights-connection-string', 'app-insights-connection-string'),
secret('postgres-auth-values-password', 'PG_AUTH_VALUES_YAML_PASS'),
secret('generic-values-preview-password', 'GENERIC_VALUES_PREVIEW_YAML_PASS'),
Expand Down
2 changes: 0 additions & 2 deletions Jenkinsfile_parameterized
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,6 @@ def secrets = [
secret('s2s-microservice', 'IA_S2S_MICROSERVICE'),
secret('prof-ref-data-url', 'PROF_REF_DATA_URL'),
secret('launch-darkly-sdk-key', 'LAUNCH_DARKLY_SDK_KEY'),
secret('ia-gov-notify-key', 'IA_GOV_NOTIFY_KEY'),
secret('ia-bail-gov-notify-key', 'IA_BAIL_GOV_NOTIFY_KEY'),
secret('app-insights-connection-string', 'app-insights-connection-string'),
secret('postgres-auth-values-password', 'PG_AUTH_VALUES_YAML_PASS'),
secret('generic-values-preview-password', 'GENERIC_VALUES_PREVIEW_YAML_PASS'),
Expand Down
2 changes: 1 addition & 1 deletion charts/ia-case-api/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v2
name: ia-case-api
home: https://github.com/hmcts/ia-case-api
version: 0.0.56
version: 0.0.55
description: Immigration & Asylum Case API
maintainers:
- name: HMCTS Immigration & Asylum Team
Expand Down
12 changes: 3 additions & 9 deletions charts/ia-case-api/values.preview.template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,10 @@ java:
FEES_REGISTER_API_URL: "http://fees-register-api-{{ .Values.global.environment }}.service.core-compute-{{ .Values.global.environment }}.internal"
DUMMY: true
PAYMENT_REMINDER_DUE_IN_MINUTES: 1
IA_GOV_NOTIFY_KEY: ${IA_GOV_NOTIFY_KEY}
IA_BAIL_GOV_NOTIFY_KEY: ${IA_BAIL_GOV_NOTIFY_KEY}
keyVaults:
ia:
resourceGroup: ia
secrets:
- name: ia-gov-notify-key
alias: IA_GOV_NOTIFY_KEY
- name: ia-bail-gov-notify-key
alias: IA_BAIL_GOV_NOTIFY_KEY
- name: docmosis-enabled
alias: IA_DOCMOSIS_ENABLED
- name: em-stitching-enabled
Expand Down Expand Up @@ -215,8 +209,8 @@ ia-case-notifications-api:
devmemoryLimits: 4Gi
environment:
IA_HOME_OFFICE_GOV_NOTIFY_ENABLED: true
IA_GOV_NOTIFY_KEY: ${IA_GOV_NOTIFY_KEY}
IA_BAIL_GOV_NOTIFY_KEY: ${IA_BAIL_GOV_NOTIFY_KEY}
IA_GOV_NOTIFY_KEY: "test_key-7f72d0fb-2bc4-421b-bceb-1bf5bf350ff9-3df5a74b-f25b-4052-b00f-3f71d33cd0eb"
IA_BAIL_GOV_NOTIFY_KEY: "testkey-b9593914-99e1-484e-ad63-a51d7b4c164f-b817a2e5-7a30-4938-98f0-6099110c2879"
IA_EXUI_FRONTEND_URL: https://manage-case.{{ .Values.global.environment }}.platform.hmcts.net/
IA_AIP_FRONTEND_URL: https://immigration-appeal.{{ .Values.global.environment }}.platform.hmcts.net/
DM_URL: http://dm-store-aat.service.core-compute-aat.internal
Expand Down Expand Up @@ -457,6 +451,7 @@ ia-timed-event-service:
java:
imagePullPolicy: Always
image: hmctspublic.azurecr.io/ia/timed-event-service:latest
# image: hmctspublic.azurecr.io/ia/timed-event-service:pr-95
releaseNameOverride: ${SERVICE_NAME}-timed-event-service
ingressHost: ${SERVICE_NAME}-timed-event-service.preview.platform.hmcts.net
devcpuRequests: 500m
Expand Down Expand Up @@ -576,7 +571,6 @@ ia-aip-frontend:
nodejs:
imagePullPolicy: Always
image: hmctspublic.azurecr.io/ia/aip-frontend:latest
# image: hmctspublic.azurecr.io/ia/aip-frontend:pr-972
ingressHost: ${SERVICE_NAME}-aip-frontend.preview.platform.hmcts.net # override in public facing environments
applicationPort: 3000
devcpuRequests: 500m
Expand Down
6 changes: 0 additions & 6 deletions charts/ia-case-api/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@ java:
PAYMENT_EA_HU_NO_REMISSION_DUE_IN_MINUTES: 20160
ADA_CASE_LISTED_DIRECTION_DUE_IN_DAYS: 15
PAYMENT_REMINDER_DUE_IN_MINUTES: 10080
IA_GOV_NOTIFY_KEY: ${IA_GOV_NOTIFY_KEY}
IA_BAIL_GOV_NOTIFY_KEY: ${IA_BAIL_GOV_NOTIFY_KEY}
postgresql:
auth:
username: ia_case_api
Expand All @@ -59,10 +57,6 @@ java:
ia:
resourceGroup: ia
secrets:
- name: ia-gov-notify-key
alias: IA_GOV_NOTIFY_KEY
- name: ia-bail-gov-notify-key
alias: IA_BAIL_GOV_NOTIFY_KEY
- name: docmosis-enabled
alias: IA_DOCMOSIS_ENABLED
- name: em-stitching-enabled
Expand Down
2 changes: 0 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,6 @@ services:
IA_SUBMIT_HEARING_REQUIREMENTS_ENABLED:
CASE_DOCUMENT_AM_URL: http://ccd-case-document-am-api:4455
IA_HEARINGS_API_URL: http://ia-hearings-api:8100
IA_GOV_NOTIFY_KEY:
IA_BAIL_GOV_NOTIFY_KEY:
external_links:
- idam-api
- dm-store
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2735,9 +2735,6 @@ public enum AsylumCaseFieldDefinition {

IS_REMOTE_HEARING("isRemoteHearing", new TypeReference<YesOrNo>(){}),

NOTIFICATIONS("notifications", new TypeReference<List<IdValue<StoredNotification>>>(){}),
NOTIFICATIONS_SENT("notificationsSent", new TypeReference<List<IdValue<String>>>(){}),

REQUEST_FEE_REMISSION_DATE(
"requestFeeRemissionDate", new TypeReference<String>(){}),

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,6 @@ public enum Event {
LIST_ASSIST_INTEGRATION("listAssistIntegration"),
TRIGGER_CMR_LISTED("triggerCmrListed"),
DECISION_WITHOUT_HEARING_LISTED("decisionWithoutHearingListed"),
SAVE_NOTIFICATIONS_TO_DATA("saveNotificationsToData"),

@JsonEnumDefaultValue
UNKNOWN("unknown");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,7 @@ public boolean canHandle(
Event.REINSTATE_APPEAL,
Event.GENERATE_UPPER_TRIBUNAL_BUNDLE,
Event.MANAGE_FEE_UPDATE,
Event.UPDATE_TRIBUNAL_DECISION,
Event.SAVE_NOTIFICATIONS_TO_DATA);
Event.UPDATE_TRIBUNAL_DECISION);
if (isEmStitchingEnabled) {
allowedEvents.add(Event.SUBMIT_CASE);
if (!isSaveAndContinueEnabled) {
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,69 +2,34 @@

import static java.util.Objects.requireNonNull;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import uk.gov.hmcts.reform.iacaseapi.domain.DateProvider;
import uk.gov.hmcts.reform.iacaseapi.domain.entities.AsylumCase;
import uk.gov.hmcts.reform.iacaseapi.domain.entities.ccd.Event;
import uk.gov.hmcts.reform.iacaseapi.domain.entities.ccd.callback.Callback;
import uk.gov.hmcts.reform.iacaseapi.domain.service.NotificationSender;
import uk.gov.hmcts.reform.iacaseapi.domain.service.Scheduler;
import uk.gov.hmcts.reform.iacaseapi.infrastructure.clients.model.TimedEvent;

import java.time.ZoneId;
import java.time.ZonedDateTime;

@Slf4j
@Service
public class AsylumCaseNotificationApiSender implements NotificationSender<AsylumCase> {

private final AsylumCaseCallbackApiDelegator asylumCaseCallbackApiDelegator;
private final String notificationsApiEndpoint;
private final String aboutToSubmitPath;
private final boolean timedEventServiceEnabled;
private final DateProvider dateProvider;
private final Scheduler scheduler;

public AsylumCaseNotificationApiSender(
AsylumCaseCallbackApiDelegator asylumCaseCallbackApiDelegator,
@Value("${notificationsApi.endpoint}") String notificationsApiEndpoint,
@Value("${notificationsApi.aboutToSubmitPath}") String aboutToSubmitPath,
@Value("${featureFlag.timedEventServiceEnabled}") boolean timedEventServiceEnabled,
DateProvider dateProvider,
Scheduler scheduler
@Value("${notificationsApi.aboutToSubmitPath}") String aboutToSubmitPath
) {
this.asylumCaseCallbackApiDelegator = asylumCaseCallbackApiDelegator;
this.notificationsApiEndpoint = notificationsApiEndpoint;
this.aboutToSubmitPath = aboutToSubmitPath;
this.timedEventServiceEnabled = timedEventServiceEnabled;
this.dateProvider = dateProvider;
this.scheduler = scheduler;
}

public AsylumCase send(
Callback<AsylumCase> callback
) {
requireNonNull(callback, "callback must not be null");
if (timedEventServiceEnabled) {
ZonedDateTime scheduledTime = ZonedDateTime.of(dateProvider.nowWithTime(), ZoneId.systemDefault())
.plusSeconds(15);
try {
scheduler.schedule(
new TimedEvent(
"",
Event.SAVE_NOTIFICATIONS_TO_DATA,
scheduledTime,
"IA",
"Asylum",
callback.getCaseDetails().getId()
)
);
} catch (AsylumCaseServiceResponseException e) {
log.error("Scheduling SAVE_NOTIFICATIONS_TO_DATA event failed: ", e);
}
}

return asylumCaseCallbackApiDelegator.delegate(
callback,
notificationsApiEndpoint + aboutToSubmitPath
Expand Down
Loading

0 comments on commit bcad8ee

Please sign in to comment.