Skip to content

Commit

Permalink
return catalog products and plans in alphabetical order
Browse files Browse the repository at this point in the history
  • Loading branch information
pvighi committed Aug 14, 2018
1 parent e23756b commit ac6253a
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 63 deletions.
Expand Up @@ -102,16 +102,16 @@ object WireModel {
val voucherProduct = WireProduct(
label = "Voucher",
plans = List(
WirePlanInfo.fromPlan(catalog.voucherWeekend, "Weekend"),
WirePlanInfo.fromPlan(catalog.voucherWeekendPlus, "Weekend+"),
WirePlanInfo.fromPlan(catalog.voucherSunday, "Sunday"),
WirePlanInfo.fromPlan(catalog.voucherSundayPlus, "Sunday+"),
WirePlanInfo.fromPlan(catalog.voucherSaturday, "Saturday"),
WirePlanInfo.fromPlan(catalog.voucherSaturdayPlus, "Saturday+"),
WirePlanInfo.fromPlan(catalog.voucherEveryDay, "Every day"),
WirePlanInfo.fromPlan(catalog.voucherEveryDayPlus, "Every day+"),
WirePlanInfo.fromPlan(catalog.voucherSaturday, "Saturday"),
WirePlanInfo.fromPlan(catalog.voucherSaturdayPlus, "Saturday+"),
WirePlanInfo.fromPlan(catalog.voucherSixDay, "Six day"),
WirePlanInfo.fromPlan(catalog.voucherSixDayPlus, "Six day+")
WirePlanInfo.fromPlan(catalog.voucherSixDayPlus, "Six day+"),
WirePlanInfo.fromPlan(catalog.voucherSunday, "Sunday"),
WirePlanInfo.fromPlan(catalog.voucherSundayPlus, "Sunday+"),
WirePlanInfo.fromPlan(catalog.voucherWeekend, "Weekend"),
WirePlanInfo.fromPlan(catalog.voucherWeekendPlus, "Weekend+")
)
)
val contributionProduct = WireProduct(
Expand All @@ -120,7 +120,7 @@ object WireModel {
WirePlanInfo.fromPlan(catalog.monthlyContribution, "Monthly")
)
)
WireCatalog(List(voucherProduct, contributionProduct))
WireCatalog(List(contributionProduct, voucherProduct))
}
}

Expand Down
Expand Up @@ -10,171 +10,171 @@ class CatalogWireTest extends FlatSpec with Matchers {
|{
| "products": [
| {
| "label": "Contribution",
| "plans": [
| {
| "id": "monthly_contribution",
| "label": "Monthly",
| "startDateRules": {
| "selectableWindow": {
| "sizeInDays": 1
| }
| }
| }
| ]
| },
| {
| "label": "Voucher",
| "plans": [
| {
| "id": "voucher_weekend",
| "label": "Weekend",
| "id": "voucher_everyday",
| "label": "Every day",
| "startDateRules": {
| "daysOfWeek": [
| "Saturday"
| "Monday"
| ],
| "selectableWindow": {
| "cutOffDayInclusive": "Tuesday",
| "startDaysAfterCutOff": 20,
| "sizeInDays": 28
| }
| },
| "paymentPlan": "£20.76 every month"
| "paymentPlan": "£47.62 every month"
| },
| {
| "id": "voucher_weekend_plus",
| "label": "Weekend+",
| "id": "voucher_everyday_plus",
| "label": "Every day+",
| "startDateRules": {
| "daysOfWeek": [
| "Saturday"
| "Monday"
| ],
| "selectableWindow": {
| "cutOffDayInclusive": "Tuesday",
| "startDaysAfterCutOff": 20,
| "sizeInDays": 28
| }
| },
| "paymentPlan": "£29.42 every month"
| "paymentPlan": "£51.96 every month"
| },
| {
| "id": "voucher_sunday",
| "label": "Sunday",
| "id": "voucher_saturday",
| "label": "Saturday",
| "startDateRules": {
| "daysOfWeek": [
| "Sunday"
| "Saturday"
| ],
| "selectableWindow": {
| "cutOffDayInclusive": "Tuesday",
| "startDaysAfterCutOff": 20,
| "sizeInDays": 28
| }
| },
| "paymentPlan": "£10.79 every month"
| "paymentPlan": "£10.36 every month"
| },
| {
| "id": "voucher_sunday_plus",
| "label": "Sunday+",
| "id": "voucher_saturday_plus",
| "label": "Saturday+",
| "startDateRules": {
| "daysOfWeek": [
| "Sunday"
| "Saturday"
| ],
| "selectableWindow": {
| "cutOffDayInclusive": "Tuesday",
| "startDaysAfterCutOff": 20,
| "sizeInDays": 28
| }
| },
| "paymentPlan": "£22.06 every month"
| "paymentPlan": "£21.62 every month"
| },
| {
| "id": "voucher_saturday",
| "label": "Saturday",
| "id": "voucher_sixday",
| "label": "Six day",
| "startDateRules": {
| "daysOfWeek": [
| "Saturday"
| "Monday"
| ],
| "selectableWindow": {
| "cutOffDayInclusive": "Tuesday",
| "startDaysAfterCutOff": 20,
| "sizeInDays": 28
| }
| },
| "paymentPlan": "£10.36 every month"
| "paymentPlan": "£41.12 every month"
| },
| {
| "id": "voucher_saturday_plus",
| "label": "Saturday+",
| "id": "voucher_sixday_plus",
| "label": "Six day+",
| "startDateRules": {
| "daysOfWeek": [
| "Saturday"
| "Monday"
| ],
| "selectableWindow": {
| "cutOffDayInclusive": "Tuesday",
| "startDaysAfterCutOff": 20,
| "sizeInDays": 28
| }
| },
| "paymentPlan": "£21.62 every month"
| "paymentPlan": "£47.62 every month"
| },
| {
| "id": "voucher_everyday",
| "label": "Every day",
| "id": "voucher_sunday",
| "label": "Sunday",
| "startDateRules": {
| "daysOfWeek": [
| "Monday"
| "Sunday"
| ],
| "selectableWindow": {
| "cutOffDayInclusive": "Tuesday",
| "startDaysAfterCutOff": 20,
| "sizeInDays": 28
| }
| },
| "paymentPlan": "£47.62 every month"
| "paymentPlan": "£10.79 every month"
| },
| {
| "id": "voucher_everyday_plus",
| "label": "Every day+",
| "id": "voucher_sunday_plus",
| "label": "Sunday+",
| "startDateRules": {
| "daysOfWeek": [
| "Monday"
| "Sunday"
| ],
| "selectableWindow": {
| "cutOffDayInclusive": "Tuesday",
| "startDaysAfterCutOff": 20,
| "sizeInDays": 28
| }
| },
| "paymentPlan": "£51.96 every month"
| "paymentPlan": "£22.06 every month"
| },
| {
| "id": "voucher_sixday",
| "label": "Six day",
| "id": "voucher_weekend",
| "label": "Weekend",
| "startDateRules": {
| "daysOfWeek": [
| "Monday"
| "Saturday"
| ],
| "selectableWindow": {
| "cutOffDayInclusive": "Tuesday",
| "startDaysAfterCutOff": 20,
| "sizeInDays": 28
| }
| },
| "paymentPlan": "£41.12 every month"
| "paymentPlan": "£20.76 every month"
| },
| {
| "id": "voucher_sixday_plus",
| "label": "Six day+",
| "id": "voucher_weekend_plus",
| "label": "Weekend+",
| "startDateRules": {
| "daysOfWeek": [
| "Monday"
| "Saturday"
| ],
| "selectableWindow": {
| "cutOffDayInclusive": "Tuesday",
| "startDaysAfterCutOff": 20,
| "sizeInDays": 28
| }
| },
| "paymentPlan": "£47.62 every month"
| }
| ]
| },
| {
| "label": "Contribution",
| "plans": [
| {
| "id": "monthly_contribution",
| "label": "Monthly",
| "startDateRules": {
| "selectableWindow": {
| "sizeInDays": 1
| }
| }
| "paymentPlan": "£29.42 every month"
| }
| ]
| }
Expand All @@ -186,4 +186,3 @@ class CatalogWireTest extends FlatSpec with Matchers {
}
}


0 comments on commit ac6253a

Please sign in to comment.