From 8a8ab7bff93b7e500933de57600ca6b5f0d835eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pascal=20Honor=C3=A9?= Date: Tue, 10 Sep 2024 15:26:21 +0100 Subject: [PATCH] Enable SalesforceNotificationDateUpdateHandler --- ...esforceNotificationDateUpdateHandler.scala | 26 ++++++++----------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/lambda/src/main/scala/pricemigrationengine/handlers/SalesforceNotificationDateUpdateHandler.scala b/lambda/src/main/scala/pricemigrationengine/handlers/SalesforceNotificationDateUpdateHandler.scala index 93dc56c5..c7dbd897 100644 --- a/lambda/src/main/scala/pricemigrationengine/handlers/SalesforceNotificationDateUpdateHandler.scala +++ b/lambda/src/main/scala/pricemigrationengine/handlers/SalesforceNotificationDateUpdateHandler.scala @@ -25,14 +25,14 @@ object SalesforceNotificationDateUpdateHandler extends CohortHandler { result => Logging.info(s"SalesforcePriceRise result: $result") ) now <- Clock.instant - salesforcePriceRiseDetails = CohortItem( + newCohortItem = CohortItem( subscriptionName = item.subscriptionName, processingStage = NotificationSendDateWrittenToSalesforce, whenNotificationSentWrittenToSalesforce = Some(now) ) _ <- CohortTable - .update(salesforcePriceRiseDetails) + .update(newCohortItem) } yield () private def updateSalesforce( @@ -74,18 +74,14 @@ object SalesforceNotificationDateUpdateHandler extends CohortHandler { } def handle(input: CohortSpec): ZIO[Logging, Failure, HandlerOutput] = { - MigrationType(input) match { - case SupporterPlus2024 => ZIO.succeed(HandlerOutput(isComplete = true)) - case _ => - main(input).provideSome[Logging]( - EnvConfig.cohortTable.layer, - EnvConfig.salesforce.layer, - EnvConfig.stage.layer, - DynamoDBZIOLive.impl, - DynamoDBClientLive.impl, - CohortTableLive.impl(input), - SalesforceClientLive.impl - ) - } + main(input).provideSome[Logging]( + EnvConfig.cohortTable.layer, + EnvConfig.salesforce.layer, + EnvConfig.stage.layer, + DynamoDBZIOLive.impl, + DynamoDBClientLive.impl, + CohortTableLive.impl(input), + SalesforceClientLive.impl + ) } }