Skip to content

Commit

Permalink
PR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
rupertbates committed Nov 13, 2023
1 parent fe34754 commit 06a0c62
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,26 +83,14 @@ object GetAccount {

given JsonDecoder[BasicInfo] = DeriveJsonDecoder.gen[BasicInfoWire].map {
case BasicInfoWire(id, defaultPaymentMethod, identityId, sfContactId__c, balance, currency) =>
identityId match {
case Some(someIdentityId) if someIdentityId == "" =>
BasicInfo(
id = id,
defaultPaymentMethod = defaultPaymentMethod,
IdentityId__c = None,
sfContactId__c = sfContactId__c,
balance = (balance.toDouble * 100).toInt,
currency = currencyCodetoObject(currency),
)
case _ =>
BasicInfo(
id = id,
defaultPaymentMethod = defaultPaymentMethod,
IdentityId__c = identityId,
sfContactId__c = sfContactId__c,
balance = (balance.toDouble * 100).toInt,
currency = currencyCodetoObject(currency),
)
}
BasicInfo(
id = id,
defaultPaymentMethod = defaultPaymentMethod,
IdentityId__c = identityId.filter(_ != ""),
sfContactId__c = sfContactId__c,
balance = (balance.toDouble * 100).toInt,
currency = currencyCodetoObject(currency),
)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,11 @@ private class TermRenewalLive(zuoraGet: ZuoraGet) extends TermRenewal:
): ZIO[Stage with GetSubscription, ErrorResponse, RenewalResponse] = for {
_ <- ZIO.log(s"Attempting to renew subscription $subscriptionName")
today <- Clock.currentDateTime.map(_.toLocalDate)
response <- renewSubscription(subscriptionName, today, runBilling)
response <- renewSubscriptionFromDate(subscriptionName, today, runBilling)
_ <- ZIO.log(s"Successfully renewed subscription $subscriptionName")
} yield response

private def renewSubscription(
private def renewSubscriptionFromDate(
subscriptionName: SubscriptionName,
contractEffectiveDate: LocalDate,
runBilling: Boolean,
Expand Down

0 comments on commit 06a0c62

Please sign in to comment.