Skip to content

Commit

Permalink
Merge pull request #1102 from guardian/ph-20241209-0944-decommission-…
Browse files Browse the repository at this point in the history
…ds2023

Decommission DigiSubs2023
  • Loading branch information
shtukas authored Dec 9, 2024
2 parents 46b6487 + 4cdaba9 commit b76d10c
Show file tree
Hide file tree
Showing 25 changed files with 5 additions and 57,979 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package pricemigrationengine.handlers

import pricemigrationengine.migrations.DigiSubs2023Migration
import pricemigrationengine.model.CohortTableFilter.NotificationSendDateWrittenToSalesforce
import pricemigrationengine.model._
import pricemigrationengine.migrations._
Expand Down Expand Up @@ -97,7 +96,6 @@ object AmendmentHandler extends CohortHandler {
// estimated price (which wasn't including the extra contribution).

MigrationType(cohortSpec) match {
case DigiSubs2023 => true
case Newspaper2024 => true
case GW2024 => true
case SupporterPlus2024 => false
Expand Down Expand Up @@ -204,13 +202,6 @@ object AmendmentHandler extends CohortHandler {
Zuora.fetchInvoicePreview(subscriptionBeforeUpdate.accountId, invoicePreviewTargetDate)

update <- MigrationType(cohortSpec) match {
case DigiSubs2023 =>
ZIO.fromEither(
DigiSubs2023Migration.zuoraUpdate(
subscriptionBeforeUpdate,
startDate,
)
)
case Newspaper2024 =>
ZIO.fromEither(
newspaper2024Migration.Amendment.zuoraUpdate(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,7 @@ import pricemigrationengine.model.membershipworkflow._
import pricemigrationengine.services._
import zio.{Clock, ZIO}
import com.gu.i18n
import pricemigrationengine.migrations.{
DigiSubs2023Migration,
GW2024Migration,
newspaper2024Migration,
SupporterPlus2024Migration,
}
import pricemigrationengine.migrations.{GW2024Migration, newspaper2024Migration, SupporterPlus2024Migration}
import pricemigrationengine.model.RateplansProbe

import java.time.{LocalDate, ZoneId}
Expand Down Expand Up @@ -150,7 +145,6 @@ object NotificationHandler extends CohortHandler {

priceWithOptionalCappingWithCurrencySymbol = MigrationType(cohortSpec) match {
case Default => s"${currencySymbol}${PriceCap.priceCapLegacy(oldPrice, estimatedNewPrice)}"
case DigiSubs2023 => s"${currencySymbol}${estimatedNewPrice}"
case Newspaper2024 => s"${currencySymbol}${estimatedNewPrice}"
case GW2024 =>
s"${currencySymbol}${PriceCap.priceCapForNotification(oldPrice, estimatedNewPrice, GW2024Migration.priceCap)}"
Expand Down Expand Up @@ -290,7 +284,6 @@ object NotificationHandler extends CohortHandler {

def maxLeadTime(cohortSpec: CohortSpec): Int = {
MigrationType(cohortSpec) match {
case DigiSubs2023 => DigiSubs2023Migration.maxLeadTime
case Newspaper2024 => newspaper2024Migration.StaticData.maxLeadTime
case GW2024 => GW2024Migration.maxLeadTime
case SupporterPlus2024 => SupporterPlus2024Migration.maxLeadTime
Expand All @@ -300,7 +293,6 @@ object NotificationHandler extends CohortHandler {

def minLeadTime(cohortSpec: CohortSpec): Int = {
MigrationType(cohortSpec) match {
case DigiSubs2023 => DigiSubs2023Migration.minLeadTime
case Newspaper2024 => newspaper2024Migration.StaticData.minLeadTime
case GW2024 => GW2024Migration.minLeadTime
case SupporterPlus2024 => SupporterPlus2024Migration.minLeadTime
Expand Down Expand Up @@ -363,7 +355,6 @@ object NotificationHandler extends CohortHandler {
}

MigrationType(cohortSpec) match {
case DigiSubs2023 => testCompatibleEmptySalesforceAddress(contact)
case SupporterPlus2024 => testCompatibleEmptySalesforceAddress(contact)
case _ =>
(for {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ object SalesforcePriceRiseCreationHandler extends CohortHandler {
.orElseFail(SalesforcePriceRiseWriteFailure(s"$cohortItem does not have a startDate"))
} yield {
val estimatedPriceWithOptionalCapping = MigrationType(cohortSpec) match {
case DigiSubs2023 => estimatedNewPrice
case Newspaper2024 => estimatedNewPrice
case GW2024 => PriceCap.priceCapForNotification(oldPrice, estimatedNewPrice, GW2024Migration.priceCap)
case SupporterPlus2024 => estimatedNewPrice // [1]
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package pricemigrationengine.model

import pricemigrationengine.migrations.{
DigiSubs2023Migration,
GuardianWeeklyMigration,
GW2024Migration,
newspaper2024Migration,
Expand Down Expand Up @@ -289,7 +288,6 @@ object AmendmentData {
): Either[Failure, PriceData] = {

MigrationType(cohortSpec) match {
case DigiSubs2023 => DigiSubs2023Migration.priceData(subscription)
case Newspaper2024 => newspaper2024Migration.Estimation.priceData(subscription)
case GW2024 => GW2024Migration.priceData(subscription, account)
case SupporterPlus2024 => SupporterPlus2024Migration.priceData(subscription)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,15 @@ package pricemigrationengine.model

sealed trait MigrationType
object Default extends MigrationType
object DigiSubs2023 extends MigrationType
object Newspaper2024 extends MigrationType
object GW2024 extends MigrationType
object SupporterPlus2024 extends MigrationType

object MigrationType {
def apply(cohortSpec: CohortSpec): MigrationType = cohortSpec.cohortName match {
case "DigiSubs2023_Batch1" => DigiSubs2023
case "DigiSubs2023_Batch2" => DigiSubs2023
case "Newspaper2024" => Newspaper2024
case "GW2024" => GW2024
case "SupporterPlus2024" => SupporterPlus2024
case _ => Default
case "Newspaper2024" => Newspaper2024
case "GW2024" => GW2024
case "SupporterPlus2024" => SupporterPlus2024
case _ => Default
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ object StartDates {
def lastPriceRiseDate(cohortSpec: CohortSpec, subscription: ZuoraSubscription): Option[LocalDate] = {
MigrationType(cohortSpec) match {
case GW2024 => GW2024Migration.subscriptionToLastPriceMigrationDate(subscription)
case DigiSubs2023 => None
case Newspaper2024 => None
case SupporterPlus2024 => None
case Default => None
Expand Down Expand Up @@ -87,7 +86,6 @@ object StartDates {
if (isMonthlySubscription(subscription, invoicePreview)) {
MigrationType(cohortSpec) match {
case Newspaper2024 => newspaper2024Migration.Estimation.startDateSpreadPeriod(subscription)
case DigiSubs2023 => 3
case GW2024 => 3
case SupporterPlus2024 => 1 // no spread for S+2024 monthlies
case Default => 3
Expand All @@ -106,7 +104,6 @@ object StartDates {
val startDateLowerBound1 = MigrationType(cohortSpec) match {
case Newspaper2024 =>
newspaper2024Migration.Estimation.startDateLowerbound(today, subscription)
case DigiSubs2023 => cohortSpecLowerBound(cohortSpec, today)
case GW2024 => cohortSpecLowerBound(cohortSpec, today)
case SupporterPlus2024 => cohortSpecLowerBound(cohortSpec, today)
case Default => cohortSpecLowerBound(cohortSpec, today)
Expand Down
Loading

0 comments on commit b76d10c

Please sign in to comment.