Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Weekend Voucher holiday stop model #426

Merged
merged 4 commits into from Sep 26, 2019

Conversation

mariogalic
Copy link
Contributor

@mariogalic mariogalic commented Sep 26, 2019

It satisfies

stoppedPublicationDateFallsOnWeekend(stoppedPublicationDate),
ratePlanIsWeekendVoucher(ratePlan, weekendVoucherProductRatePlanId),
ratePlanHasBeenInvoicedForAllCharges(ratePlan),
weekendVoucherRatePlanHasExactlyTwoCharges(ratePlan),
billingPeriodIsAnnualOrMonthOrQuarterOrSemiAnnual(ratePlan)

and is represented as

case class CurrentWeekendVoucherSubscription(
  subscriptionNumber: String,
  billingPeriod: String,
  price: Double,
  invoicedPeriod: CurrentInvoicedPeriod,
  ratePlanId: String,
  productRatePlanId: String,
  dayOfWeek: DayOfWeek
)

Billing periods per voucher product:
https://docs.google.com/spreadsheets/d/1gfVse_wcRPXRPeQBV3sVvJgmWKNzaBf6m0kbWKeihqY/edit?pli=1#gid=0

@mariogalic
Copy link
Contributor Author

@mariogalic mariogalic force-pushed the holiday-stop-weekend-voucher-model branch from e9c0737 to 664fe3c Compare September 26, 2019 10:54
@mariogalic mariogalic requested a review from a team September 26, 2019 10:54
subscription: Subscription,
weekendVoucherProductRatePlanId: String,
stoppedPublicationDate: StoppedPublicationDate
): Either[ZuoraHolidayWriteError, CurrentWeekendVoucherSubscription] = {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method doesn't seem to attempt to write to Zuora

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe separate refactoring PR as it would have to be hanged everywhere.

@@ -52,7 +52,9 @@ object SalesforceHolidayStopRequestsDetail extends Logging {
case class HolidayStopRequestsDetailChargePrice(value: Double) extends AnyVal
implicit val formatHolidayStopRequestsDetailChargePrice = Jsonx.formatInline[HolidayStopRequestsDetailChargePrice]

case class StoppedPublicationDate(value: LocalDate) extends AnyVal
case class StoppedPublicationDate(value: LocalDate) extends AnyVal {
def getDayOfWeek: String = value.getDayOfWeek.toString.toLowerCase.capitalize
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could be val (or lazy val)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

vals are not allowed in value classes

@coveralls
Copy link

Coverage Status

Coverage increased (+0.3%) to 63.945% when pulling fe9f8fd on holiday-stop-weekend-voucher-model into 4193063 on master.

@frj
Copy link
Contributor

frj commented Sep 26, 2019

👍 Looks good pending Kelvins points

@mariogalic mariogalic merged commit 463f0ab into master Sep 26, 2019
@mariogalic mariogalic deleted the holiday-stop-weekend-voucher-model branch September 26, 2019 12:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants