Skip to content

Commit 89f468d

Browse files
committed
Membership2025: prevent accidental run of the Notification handler
1 parent 72a6566 commit 89f468d

1 file changed

Lines changed: 17 additions & 13 deletions

File tree

lambda/src/main/scala/pricemigrationengine/handlers/NotificationHandler.scala

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -29,19 +29,23 @@ object NotificationHandler extends CohortHandler {
2929
val Cancelled_Status = "Cancelled"
3030

3131
def handle(input: CohortSpec): ZIO[Logging, Failure, HandlerOutput] = {
32-
main(input).provideSome[Logging](
33-
EnvConfig.salesforce.layer,
34-
EnvConfig.cohortTable.layer,
35-
EnvConfig.emailSender.layer,
36-
EnvConfig.zuora.layer,
37-
EnvConfig.stage.layer,
38-
DynamoDBClientLive.impl,
39-
DynamoDBZIOLive.impl,
40-
CohortTableLive.impl(input),
41-
SalesforceClientLive.impl,
42-
EmailSenderLive.impl,
43-
ZuoraLive.impl
44-
)
32+
MigrationType(input) match {
33+
case Membership2025 => ZIO.succeed(HandlerOutput(isComplete = true))
34+
case _ =>
35+
main(input).provideSome[Logging](
36+
EnvConfig.salesforce.layer,
37+
EnvConfig.cohortTable.layer,
38+
EnvConfig.emailSender.layer,
39+
EnvConfig.zuora.layer,
40+
EnvConfig.stage.layer,
41+
DynamoDBClientLive.impl,
42+
DynamoDBZIOLive.impl,
43+
CohortTableLive.impl(input),
44+
SalesforceClientLive.impl,
45+
EmailSenderLive.impl,
46+
ZuoraLive.impl
47+
)
48+
}
4549
}
4650

4751
def main(

0 commit comments

Comments
 (0)