Skip to content

Commit

Permalink
Fix implicit widening warning
Browse files Browse the repository at this point in the history
  • Loading branch information
Mario Galic committed Sep 27, 2019
1 parent 4e02652 commit b82d37a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,19 @@ import com.gu.salesforce.holiday_stops.SalesforceHolidayStopRequestsDetail
import com.gu.salesforce.holiday_stops.SalesforceHolidayStopRequestsDetail.{ProductRatePlanKey, _}
import com.gu.util.resthttp.JsonHttp
import scalaz.{-\/, \/-}
import com.gu.holiday_stops.SalesforceHolidayError
import com.gu.holiday_stops.{SalesforceHolidayError, SalesforceHolidayResponse}

object Salesforce {
def calculateProcessDate(product: Product, processDateOverride: Option[LocalDate]) = {
processDateOverride.getOrElse(LocalDate.now.plusDays {
product match {
case SundayVoucher => SundayVoucherIssueSuspensionConstants.processorRunLeadTimeDays
case GuardianWeekly => GuardianWeeklyIssueSuspensionConstants.processorRunLeadTimeDays
case SundayVoucher => SundayVoucherIssueSuspensionConstants.processorRunLeadTimeDays.toLong
case GuardianWeekly => GuardianWeeklyIssueSuspensionConstants.processorRunLeadTimeDays.toLong
}
})
}

def holidayStopRequests(sfCredentials: SFAuthConfig)(product: Product, processDateOverride: Option[LocalDate]): Either[SalesforceHolidayError, List[HolidayStopRequestsDetail]] = {
def holidayStopRequests(sfCredentials: SFAuthConfig)(product: Product, processDateOverride: Option[LocalDate]): SalesforceHolidayResponse[List[HolidayStopRequestsDetail]] = {
val processDate = calculateProcessDate(product, processDateOverride)
SalesforceClient(RawEffects.response, sfCredentials).value.flatMap { sfAuth =>
val sfGet = sfAuth.wrapWith(JsonHttp.getWithParams)
Expand All @@ -41,7 +41,7 @@ object Salesforce {
}
}

def holidayStopUpdateResponse(sfCredentials: SFAuthConfig)(responses: List[ZuoraHolidayWriteResult]): Either[SalesforceHolidayError, Unit] =
def holidayStopUpdateResponse(sfCredentials: SFAuthConfig)(responses: List[ZuoraHolidayWriteResult]): SalesforceHolidayResponse[Unit] =
SalesforceClient(RawEffects.response, sfCredentials).value.map { sfAuth =>
val patch = sfAuth.wrapWith(JsonHttp.patch)
val sendOp = ActionSalesforceHolidayStopRequestsDetail(patch) _
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ object Zuora {
.joinRight
}

def subscriptionGetResponse(config: Config, accessToken: AccessToken, backend: SttpBackend[Id, Nothing])(subscriptionName: SubscriptionName): Either[ZuoraHolidayError, Subscription] = {
def subscriptionGetResponse(config: Config, accessToken: AccessToken, backend: SttpBackend[Id, Nothing])(subscriptionName: SubscriptionName): ZuoraHolidayResponse[Subscription] = {
implicit val b = backend
sttp.get(uri"${config.zuoraConfig.baseUrl}/subscriptions/${subscriptionName.value}")
.header("Authorization", s"Bearer ${accessToken.access_token}")
Expand All @@ -36,7 +36,7 @@ object Zuora {
.joinRight
}

def subscriptionUpdateResponse(config: Config, accessToken: AccessToken, backend: SttpBackend[Id, Nothing])(subscription: Subscription, update: HolidayCreditUpdate): Either[ZuoraHolidayError, Unit] = {
def subscriptionUpdateResponse(config: Config, accessToken: AccessToken, backend: SttpBackend[Id, Nothing])(subscription: Subscription, update: HolidayCreditUpdate): ZuoraHolidayResponse[Unit] = {
implicit val b = backend
val errMsg = (reason: String) => s"Failed to update subscription '${subscription.subscriptionNumber}' with $update. Reason: $reason"
sttp.put(uri"${config.zuoraConfig.baseUrl}/subscriptions/${subscription.subscriptionNumber}")
Expand Down

0 comments on commit b82d37a

Please sign in to comment.