Skip to content

Commit

Permalink
Enable SalesforceNotificationDateUpdateHandler
Browse files Browse the repository at this point in the history
  • Loading branch information
shtukas committed Sep 10, 2024
1 parent 78532b3 commit 8a8ab7b
Showing 1 changed file with 11 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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
)
}
}

0 comments on commit 8a8ab7b

Please sign in to comment.