From de440201ed307b865a218f354e1a1dee6ae72ba9 Mon Sep 17 00:00:00 2001 From: halprin Date: Mon, 15 Jan 2024 14:48:03 -0700 Subject: [PATCH 1/8] 610: Add implementation to convert RS history API to our status --- .../metadata/PartnerMetadataOrchestrator.java | 44 +++++++++++++++++-- 1 file changed, 40 insertions(+), 4 deletions(-) diff --git a/etor/src/main/java/gov/hhs/cdc/trustedintermediary/etor/metadata/PartnerMetadataOrchestrator.java b/etor/src/main/java/gov/hhs/cdc/trustedintermediary/etor/metadata/PartnerMetadataOrchestrator.java index 2519557ec..b1e4fe9fa 100644 --- a/etor/src/main/java/gov/hhs/cdc/trustedintermediary/etor/metadata/PartnerMetadataOrchestrator.java +++ b/etor/src/main/java/gov/hhs/cdc/trustedintermediary/etor/metadata/PartnerMetadataOrchestrator.java @@ -118,24 +118,30 @@ public Optional getMetadata(String receivedSubmissionId) PartnerMetadata partnerMetadata = optionalPartnerMetadata.get(); var sentSubmissionId = partnerMetadata.sentSubmissionId(); - if (partnerMetadata.receiver() == null && sentSubmissionId != null) { + if ((partnerMetadata.receiver() == null + || partnerMetadata.deliveryStatus() == PartnerMetadataStatus.PENDING) + && sentSubmissionId != null) { logger.logInfo( - "Receiver name not found in metadata, looking up {} from RS history API", + "Receiver name not found in metadata or delivery status still pending, looking up {} from RS history API", sentSubmissionId); String receiver; + String rsStatus; try { String bearerToken = rsclient.getRsToken(); String responseBody = rsclient.requestHistoryEndpoint(sentSubmissionId, bearerToken); receiver = getReceiverName(responseBody); + rsStatus = getReportStreamStatus(responseBody); } catch (ReportStreamEndpointClientException | FormatterProcessingException e) { throw new PartnerMetadataException( "Unable to retrieve metadata from RS history API", e); } - logger.logInfo("Updating metadata with receiver: {}", receiver); - partnerMetadata = partnerMetadata.withReceiver(receiver); + var ourStatus = ourStatusFromReportStreamStatus(rsStatus); + + logger.logInfo("Updating metadata with receiver {} and status {}", receiver, ourStatus); + partnerMetadata = partnerMetadata.withReceiver(receiver).withDeliveryStatus(ourStatus); partnerMetadataStorage.saveMetadata(partnerMetadata); } @@ -201,4 +207,34 @@ String getReceiverName(String responseBody) throws FormatterProcessingException return organizationId + "." + service; } + + String getReportStreamStatus(String responseBody) throws FormatterProcessingException { + // the expected json structure for the response is: + // { + // ... + // "overallStatus": "Waiting to Deliver", + // ... + // } + + String overallStatus; + try { + Map responseObject = + formatter.convertJsonToObject(responseBody, new TypeReference<>() {}); + overallStatus = (String) responseObject.get("overallStatus"); + } catch (Exception e) { + throw new FormatterProcessingException( + "Unable to extract overallStatus from RS history response due to unexpected format", + e); + } + + return overallStatus; + } + + PartnerMetadataStatus ourStatusFromReportStreamStatus(String rsStatus) { + return switch (rsStatus) { + case "Error", "Not Delivering" -> PartnerMetadataStatus.FAILED; + case "Delivered" -> PartnerMetadataStatus.DELIVERED; + default -> PartnerMetadataStatus.PENDING; + }; + } } From e36de3a8e4d8264f4c16c1452a39c1144f1e0f43 Mon Sep 17 00:00:00 2001 From: halprin Date: Mon, 15 Jan 2024 14:55:44 -0700 Subject: [PATCH 2/8] 610: Fix failing unit test for calling RS history API when receiver is missing --- .../etor/metadata/PartnerMetadataOrchestratorTest.groovy | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/etor/src/test/groovy/gov/hhs/cdc/trustedintermediary/etor/metadata/PartnerMetadataOrchestratorTest.groovy b/etor/src/test/groovy/gov/hhs/cdc/trustedintermediary/etor/metadata/PartnerMetadataOrchestratorTest.groovy index 9b35d8632..85e229623 100644 --- a/etor/src/test/groovy/gov/hhs/cdc/trustedintermediary/etor/metadata/PartnerMetadataOrchestratorTest.groovy +++ b/etor/src/test/groovy/gov/hhs/cdc/trustedintermediary/etor/metadata/PartnerMetadataOrchestratorTest.groovy @@ -251,7 +251,9 @@ class PartnerMetadataOrchestratorTest extends Specification { mockClient.getRsToken() >> bearerToken mockClient.requestHistoryEndpoint(sentSubmissionId, bearerToken) >> rsHistoryApiResponse - mockFormatter.convertJsonToObject(rsHistoryApiResponse, _ as TypeReference) >> [destinations: [ + mockFormatter.convertJsonToObject(rsHistoryApiResponse, _ as TypeReference) >> [ + overallStatus: "Delivered", + destinations: [ [organization_id: "org", service: "service"] ]] From 17f10ce915c80558cce886d8ceba6ffad2477e27 Mon Sep 17 00:00:00 2001 From: halprin Date: Mon, 15 Jan 2024 14:59:08 -0700 Subject: [PATCH 3/8] 610: Test that we call the RS history API when just the metadata is still pending --- .../PartnerMetadataOrchestratorTest.groovy | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/etor/src/test/groovy/gov/hhs/cdc/trustedintermediary/etor/metadata/PartnerMetadataOrchestratorTest.groovy b/etor/src/test/groovy/gov/hhs/cdc/trustedintermediary/etor/metadata/PartnerMetadataOrchestratorTest.groovy index 85e229623..28dcc52a2 100644 --- a/etor/src/test/groovy/gov/hhs/cdc/trustedintermediary/etor/metadata/PartnerMetadataOrchestratorTest.groovy +++ b/etor/src/test/groovy/gov/hhs/cdc/trustedintermediary/etor/metadata/PartnerMetadataOrchestratorTest.groovy @@ -267,6 +267,37 @@ class PartnerMetadataOrchestratorTest extends Specification { 1 * mockPartnerMetadataStorage.saveMetadata(expectedMetadata) } + def "getMetadata gets status if still pending in metadata"() { + given: + def receivedSubmissionId = "receivedSubmissionId" + def sentSubmissionId = "sentSubmissionId" + def sender = "senderName" + def receiver = "org.service" + def timestamp = Instant.now() + def hashCode = "123" + def bearerToken = "token" + def rsHistoryApiResponse = "{\"destinations\": [{\"organization_id\": \"org\", \"service\": \"service\"}]}" + def missingReceiverMetadata = new PartnerMetadata(receivedSubmissionId, sentSubmissionId, sender, receiver, timestamp, hashCode, PartnerMetadataStatus.PENDING) + def expectedMetadata = new PartnerMetadata(receivedSubmissionId, sentSubmissionId, sender, receiver, timestamp, hashCode, PartnerMetadataStatus.FAILED) + + mockClient.getRsToken() >> bearerToken + mockClient.requestHistoryEndpoint(sentSubmissionId, bearerToken) >> rsHistoryApiResponse + mockFormatter.convertJsonToObject(rsHistoryApiResponse, _ as TypeReference) >> [ + overallStatus: "Not Delivering", + destinations: [ + [organization_id: "org", service: "service"] + ]] + + when: + Optional result = PartnerMetadataOrchestrator.getInstance().getMetadata(receivedSubmissionId) + + then: + result.isPresent() + result.get() == expectedMetadata + 1 * mockPartnerMetadataStorage.readMetadata(receivedSubmissionId) >> Optional.of(missingReceiverMetadata) + 1 * mockPartnerMetadataStorage.saveMetadata(expectedMetadata) + } + def "setMetadataStatus sets status to Pending"(){ given: def submissionId = "13425" From 2365f49b082f944814ed689d4a16c95a2434d856 Mon Sep 17 00:00:00 2001 From: halprin Date: Mon, 15 Jan 2024 15:17:24 -0700 Subject: [PATCH 4/8] 610: test positive case of parsing out status and receiver name --- .../metadata/PartnerMetadataOrchestrator.java | 35 +++++-------------- .../PartnerMetadataOrchestratorTest.groovy | 24 +++++++------ 2 files changed, 23 insertions(+), 36 deletions(-) diff --git a/etor/src/main/java/gov/hhs/cdc/trustedintermediary/etor/metadata/PartnerMetadataOrchestrator.java b/etor/src/main/java/gov/hhs/cdc/trustedintermediary/etor/metadata/PartnerMetadataOrchestrator.java index b1e4fe9fa..a30158ca3 100644 --- a/etor/src/main/java/gov/hhs/cdc/trustedintermediary/etor/metadata/PartnerMetadataOrchestrator.java +++ b/etor/src/main/java/gov/hhs/cdc/trustedintermediary/etor/metadata/PartnerMetadataOrchestrator.java @@ -131,8 +131,9 @@ public Optional getMetadata(String receivedSubmissionId) String bearerToken = rsclient.getRsToken(); String responseBody = rsclient.requestHistoryEndpoint(sentSubmissionId, bearerToken); - receiver = getReceiverName(responseBody); - rsStatus = getReportStreamStatus(responseBody); + var parsedResponseBody = getReceiverAndStatus(responseBody); + receiver = parsedResponseBody[0]; + rsStatus = parsedResponseBody[1]; } catch (ReportStreamEndpointClientException | FormatterProcessingException e) { throw new PartnerMetadataException( "Unable to retrieve metadata from RS history API", e); @@ -175,10 +176,12 @@ public void setMetadataStatus(String submissionId, PartnerMetadataStatus metadat partnerMetadataStorage.saveMetadata(partnerMetadata); } - String getReceiverName(String responseBody) throws FormatterProcessingException { + String[] getReceiverAndStatus(String responseBody) throws FormatterProcessingException { // the expected json structure for the response is: // { // ... + // "overallStatus": "Waiting to Deliver", + // ... // "destinations" : [ { // ... // "organization_id" : "flexion", @@ -190,6 +193,7 @@ String getReceiverName(String responseBody) throws FormatterProcessingException String organizationId; String service; + String overallStatus; try { Map responseObject = formatter.convertJsonToObject(responseBody, new TypeReference<>() {}); @@ -197,6 +201,7 @@ String getReceiverName(String responseBody) throws FormatterProcessingException Map destination = (Map) destinations.get(0); organizationId = destination.get("organization_id").toString(); service = destination.get("service").toString(); + overallStatus = (String) responseObject.get("overallStatus"); } catch (IndexOutOfBoundsException e) { // the destinations have not been determined yet by RS return null; @@ -205,29 +210,7 @@ String getReceiverName(String responseBody) throws FormatterProcessingException "Unable to extract receiver name from response due to unexpected format", e); } - return organizationId + "." + service; - } - - String getReportStreamStatus(String responseBody) throws FormatterProcessingException { - // the expected json structure for the response is: - // { - // ... - // "overallStatus": "Waiting to Deliver", - // ... - // } - - String overallStatus; - try { - Map responseObject = - formatter.convertJsonToObject(responseBody, new TypeReference<>() {}); - overallStatus = (String) responseObject.get("overallStatus"); - } catch (Exception e) { - throw new FormatterProcessingException( - "Unable to extract overallStatus from RS history response due to unexpected format", - e); - } - - return overallStatus; + return new String[] {organizationId + "." + service, overallStatus}; } PartnerMetadataStatus ourStatusFromReportStreamStatus(String rsStatus) { diff --git a/etor/src/test/groovy/gov/hhs/cdc/trustedintermediary/etor/metadata/PartnerMetadataOrchestratorTest.groovy b/etor/src/test/groovy/gov/hhs/cdc/trustedintermediary/etor/metadata/PartnerMetadataOrchestratorTest.groovy index 28dcc52a2..5b2349042 100644 --- a/etor/src/test/groovy/gov/hhs/cdc/trustedintermediary/etor/metadata/PartnerMetadataOrchestratorTest.groovy +++ b/etor/src/test/groovy/gov/hhs/cdc/trustedintermediary/etor/metadata/PartnerMetadataOrchestratorTest.groovy @@ -353,18 +353,22 @@ class PartnerMetadataOrchestratorTest extends Specification { } } - def "getReceiverName returns correct receiver name from valid JSON response"() { + def "getReceiverAndStatus returns correct status name and receiver name from valid JSON response"() { given: - def validJson = "{\"destinations\": [{\"organization_id\": \"org_id\", \"service\": \"service_name\"}]}" + def organization = "org_id" + def sender = "service_name" + def status = "Not Delivering" + def validJson = """{"overallStatus": "${status}", "destinations": [{"organization_id": "${organization}", "service": "${sender}"}]}""" TestApplicationContext.register(Formatter, Jackson.getInstance()) TestApplicationContext.injectRegisteredImplementations() when: - def receiverName = PartnerMetadataOrchestrator.getInstance().getReceiverName(validJson) + def parsedResponse = PartnerMetadataOrchestrator.getInstance().getReceiverAndStatus(validJson) then: - receiverName == "org_id.service_name" + parsedResponse[0] == "${organization}.${sender}" + parsedResponse[1] == status } def "getReceiverName throws FormatterProcessingException or returns null for unexpected format response"() { @@ -374,21 +378,21 @@ class PartnerMetadataOrchestratorTest extends Specification { when: def invalidJson = "invalid JSON" - PartnerMetadataOrchestrator.getInstance().getReceiverName(invalidJson) + PartnerMetadataOrchestrator.getInstance().getReceiverAndStatus(invalidJson) then: thrown(FormatterProcessingException) when: def emptyJson = "{}" - PartnerMetadataOrchestrator.getInstance().getReceiverName(emptyJson) + PartnerMetadataOrchestrator.getInstance().getReceiverAndStatus(emptyJson) then: thrown(FormatterProcessingException) when: def jsonWithoutDestinations = "{\"someotherkey\": \"value\"}" - PartnerMetadataOrchestrator.getInstance().getReceiverName(jsonWithoutDestinations) + PartnerMetadataOrchestrator.getInstance().getReceiverAndStatus(jsonWithoutDestinations) then: thrown(FormatterProcessingException) @@ -396,21 +400,21 @@ class PartnerMetadataOrchestratorTest extends Specification { when: def jsonWithEmptyDestinations = "{\"destinations\": []}" - def receiverName = PartnerMetadataOrchestrator.getInstance().getReceiverName(jsonWithEmptyDestinations) + def receiverName = PartnerMetadataOrchestrator.getInstance().getReceiverAndStatus(jsonWithEmptyDestinations) then: receiverName == null when: def jsonWithoutOrgId = "{\"destinations\":[{\"service\":\"service\"}]}" - PartnerMetadataOrchestrator.getInstance().getReceiverName(jsonWithoutOrgId) + PartnerMetadataOrchestrator.getInstance().getReceiverAndStatus(jsonWithoutOrgId) then: thrown(FormatterProcessingException) when: def jsonWithoutService = "{\"destinations\":[{\"organization_id\":\"org_id\"}]}" - PartnerMetadataOrchestrator.getInstance().getReceiverName(jsonWithoutService) + PartnerMetadataOrchestrator.getInstance().getReceiverAndStatus(jsonWithoutService) then: thrown(FormatterProcessingException) From 2a05973f6a139d38835d811e5cfdc20b20e50730 Mon Sep 17 00:00:00 2001 From: halprin Date: Mon, 15 Jan 2024 15:28:34 -0700 Subject: [PATCH 5/8] 610: test negative tests for getReceiverAndStatus --- .../metadata/PartnerMetadataOrchestrator.java | 27 ++++++++++++------- .../PartnerMetadataOrchestratorTest.groovy | 14 +++++++--- 2 files changed, 28 insertions(+), 13 deletions(-) diff --git a/etor/src/main/java/gov/hhs/cdc/trustedintermediary/etor/metadata/PartnerMetadataOrchestrator.java b/etor/src/main/java/gov/hhs/cdc/trustedintermediary/etor/metadata/PartnerMetadataOrchestrator.java index a30158ca3..cb2331cbf 100644 --- a/etor/src/main/java/gov/hhs/cdc/trustedintermediary/etor/metadata/PartnerMetadataOrchestrator.java +++ b/etor/src/main/java/gov/hhs/cdc/trustedintermediary/etor/metadata/PartnerMetadataOrchestrator.java @@ -191,26 +191,33 @@ String[] getReceiverAndStatus(String responseBody) throws FormatterProcessingExc // ... // } - String organizationId; - String service; - String overallStatus; + Map responseObject = + formatter.convertJsonToObject(responseBody, new TypeReference<>() {}); + + String receiver; try { - Map responseObject = - formatter.convertJsonToObject(responseBody, new TypeReference<>() {}); ArrayList destinations = (ArrayList) responseObject.get("destinations"); Map destination = (Map) destinations.get(0); - organizationId = destination.get("organization_id").toString(); - service = destination.get("service").toString(); - overallStatus = (String) responseObject.get("overallStatus"); + String organizationId = destination.get("organization_id").toString(); + String service = destination.get("service").toString(); + receiver = organizationId + "." + service; } catch (IndexOutOfBoundsException e) { // the destinations have not been determined yet by RS - return null; + receiver = null; } catch (Exception e) { throw new FormatterProcessingException( "Unable to extract receiver name from response due to unexpected format", e); } - return new String[] {organizationId + "." + service, overallStatus}; + String overallStatus; + try { + overallStatus = (String) responseObject.get("overallStatus"); + } catch (Exception e) { + throw new FormatterProcessingException( + "Unable to extract overallStatus from response due to unexpected format", e); + } + + return new String[] {receiver, overallStatus}; } PartnerMetadataStatus ourStatusFromReportStreamStatus(String rsStatus) { diff --git a/etor/src/test/groovy/gov/hhs/cdc/trustedintermediary/etor/metadata/PartnerMetadataOrchestratorTest.groovy b/etor/src/test/groovy/gov/hhs/cdc/trustedintermediary/etor/metadata/PartnerMetadataOrchestratorTest.groovy index 5b2349042..ff0216968 100644 --- a/etor/src/test/groovy/gov/hhs/cdc/trustedintermediary/etor/metadata/PartnerMetadataOrchestratorTest.groovy +++ b/etor/src/test/groovy/gov/hhs/cdc/trustedintermediary/etor/metadata/PartnerMetadataOrchestratorTest.groovy @@ -371,7 +371,7 @@ class PartnerMetadataOrchestratorTest extends Specification { parsedResponse[1] == status } - def "getReceiverName throws FormatterProcessingException or returns null for unexpected format response"() { + def "getReceiverAndStatus throws FormatterProcessingException or returns null for unexpected format response"() { given: TestApplicationContext.register(Formatter, Jackson.getInstance()) TestApplicationContext.injectRegisteredImplementations() @@ -400,10 +400,18 @@ class PartnerMetadataOrchestratorTest extends Specification { when: def jsonWithEmptyDestinations = "{\"destinations\": []}" - def receiverName = PartnerMetadataOrchestrator.getInstance().getReceiverAndStatus(jsonWithEmptyDestinations) + def parsedData = PartnerMetadataOrchestrator.getInstance().getReceiverAndStatus(jsonWithEmptyDestinations) then: - receiverName == null + parsedData[0] == null + + when: + + def jsonWithNoStatus = "{\"destinations\": []}" + parsedData = PartnerMetadataOrchestrator.getInstance().getReceiverAndStatus(jsonWithNoStatus) + + then: + parsedData[1] == null when: def jsonWithoutOrgId = "{\"destinations\":[{\"service\":\"service\"}]}" From 7cdd1228f772dbc849d4dbe3366dc55a46f6a2a7 Mon Sep 17 00:00:00 2001 From: halprin Date: Mon, 15 Jan 2024 15:32:56 -0700 Subject: [PATCH 6/8] 610: unit test ourStatusFromReportStreamStatus --- .../PartnerMetadataOrchestratorTest.groovy | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/etor/src/test/groovy/gov/hhs/cdc/trustedintermediary/etor/metadata/PartnerMetadataOrchestratorTest.groovy b/etor/src/test/groovy/gov/hhs/cdc/trustedintermediary/etor/metadata/PartnerMetadataOrchestratorTest.groovy index ff0216968..b400fd3ac 100644 --- a/etor/src/test/groovy/gov/hhs/cdc/trustedintermediary/etor/metadata/PartnerMetadataOrchestratorTest.groovy +++ b/etor/src/test/groovy/gov/hhs/cdc/trustedintermediary/etor/metadata/PartnerMetadataOrchestratorTest.groovy @@ -427,4 +427,40 @@ class PartnerMetadataOrchestratorTest extends Specification { then: thrown(FormatterProcessingException) } + + def "ourStatusFromReportStreamStatus returns FAILED"() { + when: + def ourStatus = PartnerMetadataOrchestrator.getInstance().ourStatusFromReportStreamStatus("Error") + + then: + ourStatus == PartnerMetadataStatus.FAILED + + when: + ourStatus = PartnerMetadataOrchestrator.getInstance().ourStatusFromReportStreamStatus("Not Delivering") + + then: + ourStatus == PartnerMetadataStatus.FAILED + } + + def "ourStatusFromReportStreamStatus returns DELIVERED"() { + when: + def ourStatus = PartnerMetadataOrchestrator.getInstance().ourStatusFromReportStreamStatus("Delivered") + + then: + ourStatus == PartnerMetadataStatus.DELIVERED + } + + def "ourStatusFromReportStreamStatus returns PENDING"() { + when: + def ourStatus = PartnerMetadataOrchestrator.getInstance().ourStatusFromReportStreamStatus("Waiting to Deliver") + + then: + ourStatus == PartnerMetadataStatus.PENDING + + when: + ourStatus = PartnerMetadataOrchestrator.getInstance().ourStatusFromReportStreamStatus("DogCow") + + then: + ourStatus == PartnerMetadataStatus.PENDING + } } From daec3ea92ea98bc177c1972393f1bd2f1f4958e1 Mon Sep 17 00:00:00 2001 From: halprin Date: Mon, 15 Jan 2024 15:46:50 -0700 Subject: [PATCH 7/8] 610: Handle when a null status comes back from the RS history API --- .../etor/metadata/PartnerMetadataOrchestrator.java | 4 ++++ .../etor/metadata/PartnerMetadataOrchestratorTest.groovy | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/etor/src/main/java/gov/hhs/cdc/trustedintermediary/etor/metadata/PartnerMetadataOrchestrator.java b/etor/src/main/java/gov/hhs/cdc/trustedintermediary/etor/metadata/PartnerMetadataOrchestrator.java index cb2331cbf..4878fd304 100644 --- a/etor/src/main/java/gov/hhs/cdc/trustedintermediary/etor/metadata/PartnerMetadataOrchestrator.java +++ b/etor/src/main/java/gov/hhs/cdc/trustedintermediary/etor/metadata/PartnerMetadataOrchestrator.java @@ -221,6 +221,10 @@ String[] getReceiverAndStatus(String responseBody) throws FormatterProcessingExc } PartnerMetadataStatus ourStatusFromReportStreamStatus(String rsStatus) { + if (rsStatus == null) { + return PartnerMetadataStatus.PENDING; + } + return switch (rsStatus) { case "Error", "Not Delivering" -> PartnerMetadataStatus.FAILED; case "Delivered" -> PartnerMetadataStatus.DELIVERED; diff --git a/etor/src/test/groovy/gov/hhs/cdc/trustedintermediary/etor/metadata/PartnerMetadataOrchestratorTest.groovy b/etor/src/test/groovy/gov/hhs/cdc/trustedintermediary/etor/metadata/PartnerMetadataOrchestratorTest.groovy index b400fd3ac..5c0af8931 100644 --- a/etor/src/test/groovy/gov/hhs/cdc/trustedintermediary/etor/metadata/PartnerMetadataOrchestratorTest.groovy +++ b/etor/src/test/groovy/gov/hhs/cdc/trustedintermediary/etor/metadata/PartnerMetadataOrchestratorTest.groovy @@ -462,5 +462,11 @@ class PartnerMetadataOrchestratorTest extends Specification { then: ourStatus == PartnerMetadataStatus.PENDING + + when: + ourStatus = PartnerMetadataOrchestrator.getInstance().ourStatusFromReportStreamStatus(null) + + then: + ourStatus == PartnerMetadataStatus.PENDING } } From 6fb41f5ac1aa16caed1f796c5d83f722af7386a1 Mon Sep 17 00:00:00 2001 From: halprin Date: Mon, 15 Jan 2024 15:51:03 -0700 Subject: [PATCH 8/8] 610: add some comments on where I base the mapping from --- .../etor/metadata/PartnerMetadataOrchestrator.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/etor/src/main/java/gov/hhs/cdc/trustedintermediary/etor/metadata/PartnerMetadataOrchestrator.java b/etor/src/main/java/gov/hhs/cdc/trustedintermediary/etor/metadata/PartnerMetadataOrchestrator.java index 4878fd304..8de48f715 100644 --- a/etor/src/main/java/gov/hhs/cdc/trustedintermediary/etor/metadata/PartnerMetadataOrchestrator.java +++ b/etor/src/main/java/gov/hhs/cdc/trustedintermediary/etor/metadata/PartnerMetadataOrchestrator.java @@ -225,6 +225,8 @@ PartnerMetadataStatus ourStatusFromReportStreamStatus(String rsStatus) { return PartnerMetadataStatus.PENDING; } + // based off of the Status enum in the SubmissionHistory.kt code in RS + // https://github.com/CDCgov/prime-reportstream/blob/master/prime-router/src/main/kotlin/history/SubmissionHistory.kt return switch (rsStatus) { case "Error", "Not Delivering" -> PartnerMetadataStatus.FAILED; case "Delivered" -> PartnerMetadataStatus.DELIVERED;