iu-global-access-initiative
Advanced tools
Comparing version 1.0.0-1 to 1.0.0-2
@@ -0,4 +1,5 @@ | ||
import { CountryTier } from "./src/definitions/CountryTier"; | ||
import { DiscountCriteria } from "./src/interfaces/DiscountCriteria"; | ||
import { DiscountInformation } from "./src/interfaces/DiscountInformation"; | ||
import { DiscountCalculator } from "./src/DiscountCalculator"; | ||
export { DiscountCriteria, DiscountInformation, DiscountCalculator }; | ||
export { CountryTier, DiscountCriteria, DiscountInformation, DiscountCalculator }; |
@@ -0,2 +1,3 @@ | ||
import { CountryTier } from "./src/definitions/CountryTier"; | ||
import { DiscountCalculator } from "./src/DiscountCalculator"; | ||
export { DiscountCalculator }; | ||
export { CountryTier, DiscountCalculator }; |
{ | ||
"name": "iu-global-access-initiative", | ||
"version": "1.0.0-1", | ||
"version": "1.0.0-2", | ||
"description": "Holds logic to determine contextual presentation information given user country and some other conditions (i.e. study delivery method) for International University (IU) partnership", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -0,1 +1,2 @@ | ||
import { CountryTier } from "../definitions/CountryTier"; | ||
export class BaseDiscount { | ||
@@ -9,3 +10,3 @@ setNext(handler) { | ||
} | ||
return { percentage: 0 }; | ||
return { percentage: 0, countryTier: CountryTier.INELIGIBLE }; | ||
} | ||
@@ -12,0 +13,0 @@ getDiscountInformation(criteria) { |
@@ -0,1 +1,2 @@ | ||
import { CountryTier } from "../definitions/CountryTier"; | ||
import { BaseDiscount } from "./BaseDiscount"; | ||
@@ -8,4 +9,4 @@ import CountriesBlockedCriteria from "./policies/BlockedCountriesPolicy"; | ||
handle() { | ||
return { percentage: 0 }; | ||
return { percentage: 0, countryTier: CountryTier.INELIGIBLE }; | ||
} | ||
} |
@@ -0,1 +1,2 @@ | ||
import { CountryTier } from "../definitions/CountryTier"; | ||
import { BaseDiscount } from "./BaseDiscount"; | ||
@@ -10,4 +11,4 @@ import DeliveryMethodPolicy from "./policies/DeliveryMethodPolicy"; | ||
handle() { | ||
return { percentage: 75 }; | ||
return { percentage: 75, countryTier: CountryTier.EMERGING }; | ||
} | ||
} |
@@ -0,1 +1,2 @@ | ||
import { CountryTier } from "../definitions/CountryTier"; | ||
import { BaseDiscount } from "./BaseDiscount"; | ||
@@ -13,4 +14,4 @@ import DegreeTypeCriteria from "./policies/DegreeTypePolicy"; | ||
handle() { | ||
return { percentage: 30 }; | ||
return { percentage: 30, countryTier: CountryTier.MATURE }; | ||
} | ||
} |
@@ -0,1 +1,2 @@ | ||
import { CountryTier } from "../definitions/CountryTier"; | ||
import { BaseDiscount } from "./BaseDiscount"; | ||
@@ -12,4 +13,4 @@ import DeliveryMethodPolicy from "./policies/DeliveryMethodPolicy"; | ||
handle() { | ||
return { percentage: 35 }; | ||
return { percentage: 35, countryTier: CountryTier.MATURE }; | ||
} | ||
} |
@@ -0,1 +1,2 @@ | ||
import { CountryTier } from "../definitions/CountryTier"; | ||
import { BaseDiscount } from "./BaseDiscount"; | ||
@@ -12,4 +13,4 @@ import DeliveryMethodPolicy from "./policies/DeliveryMethodPolicy"; | ||
handle() { | ||
return { percentage: 50 }; | ||
return { percentage: 50, countryTier: CountryTier.MATURE }; | ||
} | ||
} |
@@ -0,1 +1,2 @@ | ||
import { CountryTier } from "../definitions/CountryTier"; | ||
import { BaseDiscount } from "./BaseDiscount"; | ||
@@ -7,4 +8,4 @@ export class NoDiscount extends BaseDiscount { | ||
handle() { | ||
return { percentage: 0 }; | ||
return { percentage: 0, countryTier: CountryTier.INELIGIBLE }; | ||
} | ||
} |
@@ -0,1 +1,2 @@ | ||
import { CountryTier } from "../definitions/CountryTier"; | ||
import { BaseDiscount } from "./BaseDiscount"; | ||
@@ -10,4 +11,4 @@ import DeliveryMethodCriteria from "./policies/DeliveryMethodPolicy"; | ||
handle() { | ||
return { percentage: 10, finalPrice: 1440 }; | ||
return { percentage: 10, finalPrice: 1440, countryTier: CountryTier.MATURE }; | ||
} | ||
} |
@@ -0,4 +1,6 @@ | ||
import { CountryTier } from "../definitions/CountryTier"; | ||
export interface DiscountInformation { | ||
percentage?: number; | ||
finalPrice?: number; | ||
countryTier: CountryTier; | ||
} |
@@ -8,2 +8,3 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { | ||
import { suite, test } from "@testdeck/jest"; | ||
import { CountryTier } from "../../src/definitions/CountryTier"; | ||
import { DiscountCalculator } from "../../src/DiscountCalculator"; | ||
@@ -19,2 +20,3 @@ let DiscountCalculatorTest = class DiscountCalculatorTest { | ||
expect(result.finalPrice).toBeUndefined(); | ||
expect(result.countryTier).toBe(CountryTier.INELIGIBLE); | ||
} | ||
@@ -29,2 +31,3 @@ getDiscountPercentage_blockedCountry_rightDiscountInformationReturned() { | ||
expect(result.finalPrice).toBeUndefined(); | ||
expect(result.countryTier).toBe(CountryTier.INELIGIBLE); | ||
} | ||
@@ -40,2 +43,3 @@ getDiscountPercentage_emergingCountry_online_rightDiscountInformationReturned() { | ||
expect(result.finalPrice).toBeUndefined(); | ||
expect(result.countryTier).toBe(CountryTier.EMERGING); | ||
} | ||
@@ -51,2 +55,3 @@ getDiscountPercentage_emergingCountry_blended_rightDiscountInformationReturned() { | ||
expect(result.finalPrice).toBeUndefined(); | ||
expect(result.countryTier).toBe(CountryTier.EMERGING); | ||
} | ||
@@ -63,2 +68,3 @@ getDiscountPercentage_matureCountryTierOne_online_master_rightDiscountInformationReturned() { | ||
expect(result.finalPrice).toBeUndefined(); | ||
expect(result.countryTier).toBe(CountryTier.MATURE); | ||
} | ||
@@ -75,2 +81,3 @@ getDiscountPercentage_matureCountryTierOne_blended_master_rightDiscountInformationReturned() { | ||
expect(result.finalPrice).toBeUndefined(); | ||
expect(result.countryTier).toBe(CountryTier.MATURE); | ||
} | ||
@@ -87,2 +94,3 @@ getDiscountPercentage_matureCountryTierOne_online_bachelors_rightDiscountInformationReturned() { | ||
expect(result.finalPrice).toBeUndefined(); | ||
expect(result.countryTier).toBe(CountryTier.MATURE); | ||
} | ||
@@ -99,2 +107,3 @@ getDiscountPercentage_matureCountryTierOne_blended_bachelors_rightDiscountInformationReturned() { | ||
expect(result.finalPrice).toBeUndefined(); | ||
expect(result.countryTier).toBe(CountryTier.MATURE); | ||
} | ||
@@ -111,2 +120,3 @@ getDiscountPercentage_matureCountryTierTwo_online_master_rightDiscountInformationReturned() { | ||
expect(result.finalPrice).toBeUndefined(); | ||
expect(result.countryTier).toBe(CountryTier.MATURE); | ||
} | ||
@@ -123,2 +133,3 @@ getDiscountPercentage_matureCountryTierTwo_blended_master_rightDiscountInformationReturned() { | ||
expect(result.finalPrice).toBeUndefined(); | ||
expect(result.countryTier).toBe(CountryTier.MATURE); | ||
} | ||
@@ -135,2 +146,3 @@ getDiscountPercentage_matureCountryTierTwo_online_bachelors_rightDiscountInformationReturned() { | ||
expect(result.finalPrice).toBeUndefined(); | ||
expect(result.countryTier).toBe(CountryTier.MATURE); | ||
} | ||
@@ -147,2 +159,3 @@ getDiscountPercentage_matureCountryTierTwo_blended_bachelors_rightDiscountInformationReturned() { | ||
expect(result.finalPrice).toBeUndefined(); | ||
expect(result.countryTier).toBe(CountryTier.MATURE); | ||
} | ||
@@ -159,2 +172,3 @@ getDiscountPercentage_matureCountryTierOne_online_mba_rightDiscountInformationReturned() { | ||
expect(result.finalPrice).toBeUndefined(); | ||
expect(result.countryTier).toBe(CountryTier.MATURE); | ||
} | ||
@@ -171,2 +185,3 @@ getDiscountPercentage_matureCountryTierOne_blended_mba_rightDiscountInformationReturned() { | ||
expect(result.finalPrice).toBeUndefined(); | ||
expect(result.countryTier).toBe(CountryTier.MATURE); | ||
} | ||
@@ -183,2 +198,3 @@ getDiscountPercentage_matureCountryTierTwo_online_mba_rightDiscountInformationReturned() { | ||
expect(result.finalPrice).toBeUndefined(); | ||
expect(result.countryTier).toBe(CountryTier.MATURE); | ||
} | ||
@@ -195,2 +211,3 @@ getDiscountPercentage_matureCountryTierTwo_blended_mba_rightDiscountInformationReturned() { | ||
expect(result.finalPrice).toBeUndefined(); | ||
expect(result.countryTier).toBe(CountryTier.MATURE); | ||
} | ||
@@ -206,2 +223,3 @@ getDiscountPercentage_unitedStates_online_rightDiscountInformationReturned() { | ||
expect(result.finalPrice).toBe(1440); | ||
expect(result.countryTier).toBe(CountryTier.MATURE); | ||
} | ||
@@ -217,2 +235,3 @@ getDiscountPercentage_canada_online_rightDiscountInformationReturned() { | ||
expect(result.finalPrice).toBe(1440); | ||
expect(result.countryTier).toBe(CountryTier.MATURE); | ||
} | ||
@@ -228,2 +247,3 @@ getDiscountPercentage_unitedStates_blended_rightDiscountInformationReturned() { | ||
expect(result.finalPrice).toBe(1440); | ||
expect(result.countryTier).toBe(CountryTier.MATURE); | ||
} | ||
@@ -239,2 +259,3 @@ getDiscountPercentage_canada_blended_rightDiscountInformationReturned() { | ||
expect(result.finalPrice).toBe(1440); | ||
expect(result.countryTier).toBe(CountryTier.MATURE); | ||
} | ||
@@ -241,0 +262,0 @@ }; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
58230
67
1255
0