@moneylion/react-native-offer-carousel 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +44 -0
- package/lib/commonjs/capabilities/configuration/src/brands/checkVisualEligibility.js +30 -0
- package/lib/commonjs/capabilities/configuration/src/brands/checkVisualEligibility.js.map +1 -0
- package/lib/commonjs/capabilities/configuration/src/brands/createDerivedBrands.js +40 -0
- package/lib/commonjs/capabilities/configuration/src/brands/createDerivedBrands.js.map +1 -0
- package/lib/commonjs/capabilities/configuration/src/brands/index.js +20 -0
- package/lib/commonjs/capabilities/configuration/src/brands/index.js.map +1 -0
- package/lib/commonjs/capabilities/configuration/src/brands/types.js +13 -0
- package/lib/commonjs/capabilities/configuration/src/brands/types.js.map +1 -0
- package/lib/commonjs/capabilities/core/src/domain/third-party-search/index.js +17 -0
- package/lib/commonjs/capabilities/core/src/domain/third-party-search/index.js.map +1 -0
- package/lib/commonjs/capabilities/core/src/domain/third-party-search/orderProductTypesByRankUtils.js +33 -0
- package/lib/commonjs/capabilities/core/src/domain/third-party-search/orderProductTypesByRankUtils.js.map +1 -0
- package/lib/commonjs/capabilities/core/src/index.js +17 -0
- package/lib/commonjs/capabilities/core/src/index.js.map +1 -0
- package/lib/commonjs/capabilities/core/src/system/cnfContext/CnfContext.js +18 -0
- package/lib/commonjs/capabilities/core/src/system/cnfContext/CnfContext.js.map +1 -0
- package/lib/commonjs/capabilities/core/src/system/cnfContext/schemas/App.js +18 -0
- package/lib/commonjs/capabilities/core/src/system/cnfContext/schemas/App.js.map +1 -0
- package/lib/commonjs/capabilities/core/src/system/cnfContext/schemas/Brand.js +87 -0
- package/lib/commonjs/capabilities/core/src/system/cnfContext/schemas/Brand.js.map +1 -0
- package/lib/commonjs/capabilities/core/src/system/cnfContext/schemas/Configuration.js +41 -0
- package/lib/commonjs/capabilities/core/src/system/cnfContext/schemas/Configuration.js.map +1 -0
- package/lib/commonjs/capabilities/core/src/system/cnfContext/schemas/Request.js +21 -0
- package/lib/commonjs/capabilities/core/src/system/cnfContext/schemas/Request.js.map +1 -0
- package/lib/commonjs/capabilities/core/src/system/cnfContext/schemas/Session.js +12 -0
- package/lib/commonjs/capabilities/core/src/system/cnfContext/schemas/Session.js.map +1 -0
- package/lib/commonjs/capabilities/core/src/system/cnfContext/schemas/Signals.js +41 -0
- package/lib/commonjs/capabilities/core/src/system/cnfContext/schemas/Signals.js.map +1 -0
- package/lib/commonjs/capabilities/core/src/system/cnfContext/schemas/Subaccount.js +26 -0
- package/lib/commonjs/capabilities/core/src/system/cnfContext/schemas/Subaccount.js.map +1 -0
- package/lib/commonjs/capabilities/core/src/system/cnfContext/schemas/index.js +83 -0
- package/lib/commonjs/capabilities/core/src/system/cnfContext/schemas/index.js.map +1 -0
- package/lib/commonjs/capabilities/offer-catalog/src/api/offerCatalogApi.js +131 -0
- package/lib/commonjs/capabilities/offer-catalog/src/api/offerCatalogApi.js.map +1 -0
- package/lib/commonjs/capabilities/offer-catalog/src/index.js +65 -0
- package/lib/commonjs/capabilities/offer-catalog/src/index.js.map +1 -0
- package/lib/commonjs/capabilities/offer-catalog/src/types/offerCatalogSchema.js +2 -0
- package/lib/commonjs/capabilities/offer-catalog/src/types/offerCatalogSchema.js.map +1 -0
- package/lib/commonjs/capabilities/offer-catalog/src/utils/arrayToMarkdownList.js +11 -0
- package/lib/commonjs/capabilities/offer-catalog/src/utils/arrayToMarkdownList.js.map +1 -0
- package/lib/commonjs/capabilities/offer-catalog/src/utils/contextUtil.js +70 -0
- package/lib/commonjs/capabilities/offer-catalog/src/utils/contextUtil.js.map +1 -0
- package/lib/commonjs/capabilities/offer-catalog/src/utils/errorUtil.js +21 -0
- package/lib/commonjs/capabilities/offer-catalog/src/utils/errorUtil.js.map +1 -0
- package/lib/commonjs/capabilities/offer-catalog/src/utils/formatUtils.js +161 -0
- package/lib/commonjs/capabilities/offer-catalog/src/utils/formatUtils.js.map +1 -0
- package/lib/commonjs/capabilities/offer-catalog/src/utils/getOfferUrl.js +44 -0
- package/lib/commonjs/capabilities/offer-catalog/src/utils/getOfferUrl.js.map +1 -0
- package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/formatters/annualFee.js +78 -0
- package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/formatters/annualFee.js.map +1 -0
- package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/formatters/boolean.js +22 -0
- package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/formatters/boolean.js.map +1 -0
- package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/formatters/boolean.spec.js +60 -0
- package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/formatters/boolean.spec.js.map +1 -0
- package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/formatters/common.js +20 -0
- package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/formatters/common.js.map +1 -0
- package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/formatters/common.spec.js +62 -0
- package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/formatters/common.spec.js.map +1 -0
- package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/formatters/creditBureaus.js +32 -0
- package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/formatters/creditBureaus.js.map +1 -0
- package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/formatters/creditBureaus.spec.js +31 -0
- package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/formatters/creditBureaus.spec.js.map +1 -0
- package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/formatters/currency.js +22 -0
- package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/formatters/currency.js.map +1 -0
- package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/formatters/currencyOrBasis.js +46 -0
- package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/formatters/currencyOrBasis.js.map +1 -0
- package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/formatters/currencyOrBasis.spec.js +208 -0
- package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/formatters/currencyOrBasis.spec.js.map +1 -0
- package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/formatters/freeTrialDays.js +20 -0
- package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/formatters/freeTrialDays.js.map +1 -0
- package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/formatters/freeTrialDays.spec.js +24 -0
- package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/formatters/freeTrialDays.spec.js.map +1 -0
- package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/formatters/fromListStringWithAnd.js +21 -0
- package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/formatters/fromListStringWithAnd.js.map +1 -0
- package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/formatters/fromListStringWithAnd.spec.js +40 -0
- package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/formatters/fromListStringWithAnd.spec.js.map +1 -0
- package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/formatters/index.js +204 -0
- package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/formatters/index.js.map +1 -0
- package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/formatters/monthlyOrAnnualCurrency.js +35 -0
- package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/formatters/monthlyOrAnnualCurrency.js.map +1 -0
- package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/formatters/monthlyOrAnnualCurrency.spec.js +43 -0
- package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/formatters/monthlyOrAnnualCurrency.spec.js.map +1 -0
- package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/formatters/percentage.js +21 -0
- package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/formatters/percentage.js.map +1 -0
- package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/formatters/percentage.spec.js +32 -0
- package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/formatters/percentage.spec.js.map +1 -0
- package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/formatters/purchaseApr.js +76 -0
- package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/formatters/purchaseApr.js.map +1 -0
- package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/formatters/purchaseApr.spec.js +69 -0
- package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/formatters/purchaseApr.spec.js.map +1 -0
- package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/formatters/rangeCurrency.js +23 -0
- package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/formatters/rangeCurrency.js.map +1 -0
- package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/formatters/rangeCurrencyByTime.js +47 -0
- package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/formatters/rangeCurrencyByTime.js.map +1 -0
- package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/formatters/rangeCurrencyByTime.spec.js +72 -0
- package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/formatters/rangeCurrencyByTime.spec.js.map +1 -0
- package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/formatters/rangeCurrencyUnabbreviated.js +23 -0
- package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/formatters/rangeCurrencyUnabbreviated.js.map +1 -0
- package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/formatters/rangeCurrencyUnabbreviated.spec.js +29 -0
- package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/formatters/rangeCurrencyUnabbreviated.spec.js.map +1 -0
- package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/formatters/rangeMonths.js +53 -0
- package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/formatters/rangeMonths.js.map +1 -0
- package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/formatters/rangeMonths.spec.js +46 -0
- package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/formatters/rangeMonths.spec.js.map +1 -0
- package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/formatters/rangePercent.js +26 -0
- package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/formatters/rangePercent.js.map +1 -0
- package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/formatters/rangePercent.spec.js +83 -0
- package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/formatters/rangePercent.spec.js.map +1 -0
- package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/formatters/recommendedCredit.js +28 -0
- package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/formatters/recommendedCredit.js.map +1 -0
- package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/formatters/recommendedCredit.spec.js +28 -0
- package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/formatters/recommendedCredit.spec.js.map +1 -0
- package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/formatters/rewardsDisplay.js +21 -0
- package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/formatters/rewardsDisplay.js.map +1 -0
- package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/formatters/rewardsDisplay.spec.js +30 -0
- package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/formatters/rewardsDisplay.spec.js.map +1 -0
- package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/index.js +48 -0
- package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/index.js.map +1 -0
- package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/types.js +6 -0
- package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/types.js.map +1 -0
- package/lib/commonjs/capabilities/offers/pipeline/src/sources/ratetables/offer-catalog/types/index.js +6 -0
- package/lib/commonjs/capabilities/offers/pipeline/src/sources/ratetables/offer-catalog/types/index.js.map +1 -0
- package/lib/commonjs/capabilities/offers/pipeline/src/sources/ratetables/offer-catalog/types/oas/offer-catalog.js +2 -0
- package/lib/commonjs/capabilities/offers/pipeline/src/sources/ratetables/offer-catalog/types/oas/offer-catalog.js.map +1 -0
- package/lib/commonjs/capabilities/offers/pipeline/src/sources/ratetables/types/PublicApi.d.js +2 -0
- package/lib/commonjs/capabilities/offers/pipeline/src/sources/ratetables/types/PublicApi.d.js.map +1 -0
- package/lib/commonjs/capabilities/offers/pipeline/src/sources/ratetables/types/index.js +6 -0
- package/lib/commonjs/capabilities/offers/pipeline/src/sources/ratetables/types/index.js.map +1 -0
- package/lib/commonjs/capabilities/offers/pipeline/src/sources/ratetables/withDeviceSignals.js +74 -0
- package/lib/commonjs/capabilities/offers/pipeline/src/sources/ratetables/withDeviceSignals.js.map +1 -0
- package/lib/commonjs/capabilities/ui/elements/src/components/MarkdownText/Abbreviation.js +61 -0
- package/lib/commonjs/capabilities/ui/elements/src/components/MarkdownText/Abbreviation.js.map +1 -0
- package/lib/commonjs/capabilities/ui/elements/src/components/MarkdownText/components.js +143 -0
- package/lib/commonjs/capabilities/ui/elements/src/components/MarkdownText/components.js.map +1 -0
- package/lib/commonjs/capabilities/ui/elements/src/components/MarkdownText/index.js +54 -0
- package/lib/commonjs/capabilities/ui/elements/src/components/MarkdownText/index.js.map +1 -0
- package/lib/commonjs/capabilities/ui/elements/src/components/MarkdownText/markdownPreprocessor.js +122 -0
- package/lib/commonjs/capabilities/ui/elements/src/components/MarkdownText/markdownPreprocessor.js.map +1 -0
- package/lib/commonjs/capabilities/ui/elements/src/components/index.js +13 -0
- package/lib/commonjs/capabilities/ui/elements/src/components/index.js.map +1 -0
- package/lib/commonjs/capabilities/ui/elements/src/components/thumbor/index.js +110 -0
- package/lib/commonjs/capabilities/ui/elements/src/components/thumbor/index.js.map +1 -0
- package/lib/commonjs/capabilities/ui/elements/src/components/thumbor/useSvgUriViewBox.js +91 -0
- package/lib/commonjs/capabilities/ui/elements/src/components/thumbor/useSvgUriViewBox.js.map +1 -0
- package/lib/commonjs/capabilities/ui/elements/src/components/thumbor/useSvgUriViewBox.test.js +44 -0
- package/lib/commonjs/capabilities/ui/elements/src/components/thumbor/useSvgUriViewBox.test.js.map +1 -0
- package/lib/commonjs/capabilities/ui/elements/src/index.js +28 -0
- package/lib/commonjs/capabilities/ui/elements/src/index.js.map +1 -0
- package/lib/commonjs/capabilities/ui/elements/src/offerCardAttributes.js +23 -0
- package/lib/commonjs/capabilities/ui/elements/src/offerCardAttributes.js.map +1 -0
- package/lib/commonjs/components/Cards/VideosCard/VideosCard.js +1 -1
- package/lib/commonjs/components/Common/BaseOfferCard/Stat/Stat.js +1 -1
- package/lib/commonjs/components/Common/BaseOfferCard/Stat/Stat.js.map +1 -1
- package/lib/commonjs/components/Common/BaseOfferCard/index.js +4 -4
- package/lib/commonjs/components/Common/BaseOfferCard/index.js.map +1 -1
- package/lib/commonjs/components/Layouts/CreditCardOfferCard/statsBuilder.js +1 -1
- package/lib/commonjs/components/Layouts/DefaultOfferCard/statsBuilder.js +1 -1
- package/lib/commonjs/components/Modal/DescriptionPoints.js +3 -3
- package/lib/commonjs/components/Modal/DescriptionPoints.js.map +1 -1
- package/lib/commonjs/components/Modal/Disclaimer.js +1 -1
- package/lib/commonjs/components/Modal/Disclaimer.js.map +1 -1
- package/lib/commonjs/components/MoneyLionOfferCarousel.js +1 -1
- package/lib/commonjs/config/mocks/cnfContext.js +143 -0
- package/lib/commonjs/config/mocks/cnfContext.js.map +1 -0
- package/lib/commonjs/pageData.js +1 -1
- package/lib/commonjs/services/getProductTypesByQuery.js +1 -1
- package/lib/commonjs/utils/formatOfferUrl.js +1 -1
- package/lib/commonjs/utils/getOffersByProductTypes.js +2 -2
- package/lib/module/capabilities/configuration/src/brands/checkVisualEligibility.js +24 -0
- package/lib/module/capabilities/configuration/src/brands/checkVisualEligibility.js.map +1 -0
- package/lib/module/capabilities/configuration/src/brands/createDerivedBrands.js +34 -0
- package/lib/module/capabilities/configuration/src/brands/createDerivedBrands.js.map +1 -0
- package/lib/module/capabilities/configuration/src/brands/index.js +3 -0
- package/lib/module/capabilities/configuration/src/brands/index.js.map +1 -0
- package/lib/module/capabilities/configuration/src/brands/types.js +6 -0
- package/lib/module/capabilities/configuration/src/brands/types.js.map +1 -0
- package/lib/module/capabilities/core/src/domain/third-party-search/index.js +2 -0
- package/lib/module/capabilities/core/src/domain/third-party-search/index.js.map +1 -0
- package/lib/module/capabilities/core/src/domain/third-party-search/orderProductTypesByRankUtils.js +26 -0
- package/lib/module/capabilities/core/src/domain/third-party-search/orderProductTypesByRankUtils.js.map +1 -0
- package/lib/module/capabilities/core/src/index.js +2 -0
- package/lib/module/capabilities/core/src/index.js.map +1 -0
- package/lib/module/capabilities/core/src/system/cnfContext/CnfContext.js +12 -0
- package/lib/module/capabilities/core/src/system/cnfContext/CnfContext.js.map +1 -0
- package/lib/module/capabilities/core/src/system/cnfContext/schemas/App.js +12 -0
- package/lib/module/capabilities/core/src/system/cnfContext/schemas/App.js.map +1 -0
- package/lib/module/capabilities/core/src/system/cnfContext/schemas/Brand.js +81 -0
- package/lib/module/capabilities/core/src/system/cnfContext/schemas/Brand.js.map +1 -0
- package/lib/module/capabilities/core/src/system/cnfContext/schemas/Configuration.js +35 -0
- package/lib/module/capabilities/core/src/system/cnfContext/schemas/Configuration.js.map +1 -0
- package/lib/module/capabilities/core/src/system/cnfContext/schemas/Request.js +15 -0
- package/lib/module/capabilities/core/src/system/cnfContext/schemas/Request.js.map +1 -0
- package/lib/module/capabilities/core/src/system/cnfContext/schemas/Session.js +6 -0
- package/lib/module/capabilities/core/src/system/cnfContext/schemas/Session.js.map +1 -0
- package/lib/module/capabilities/core/src/system/cnfContext/schemas/Signals.js +35 -0
- package/lib/module/capabilities/core/src/system/cnfContext/schemas/Signals.js.map +1 -0
- package/lib/module/capabilities/core/src/system/cnfContext/schemas/Subaccount.js +20 -0
- package/lib/module/capabilities/core/src/system/cnfContext/schemas/Subaccount.js.map +1 -0
- package/lib/module/capabilities/core/src/system/cnfContext/schemas/index.js +8 -0
- package/lib/module/capabilities/core/src/system/cnfContext/schemas/index.js.map +1 -0
- package/lib/module/capabilities/offer-catalog/src/api/offerCatalogApi.js +122 -0
- package/lib/module/capabilities/offer-catalog/src/api/offerCatalogApi.js.map +1 -0
- package/lib/module/capabilities/offer-catalog/src/index.js +5 -0
- package/lib/module/capabilities/offer-catalog/src/index.js.map +1 -0
- package/lib/module/capabilities/offer-catalog/src/types/offerCatalogSchema.js +2 -0
- package/lib/module/capabilities/offer-catalog/src/types/offerCatalogSchema.js.map +1 -0
- package/lib/module/capabilities/offer-catalog/src/utils/arrayToMarkdownList.js +4 -0
- package/lib/module/capabilities/offer-catalog/src/utils/arrayToMarkdownList.js.map +1 -0
- package/lib/module/capabilities/offer-catalog/src/utils/contextUtil.js +58 -0
- package/lib/module/capabilities/offer-catalog/src/utils/contextUtil.js.map +1 -0
- package/lib/module/capabilities/offer-catalog/src/utils/errorUtil.js +15 -0
- package/lib/module/capabilities/offer-catalog/src/utils/errorUtil.js.map +1 -0
- package/lib/module/capabilities/offer-catalog/src/utils/formatUtils.js +151 -0
- package/lib/module/capabilities/offer-catalog/src/utils/formatUtils.js.map +1 -0
- package/lib/module/capabilities/offer-catalog/src/utils/getOfferUrl.js +37 -0
- package/lib/module/capabilities/offer-catalog/src/utils/getOfferUrl.js.map +1 -0
- package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/annualFee.js +71 -0
- package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/annualFee.js.map +1 -0
- package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/boolean.js +15 -0
- package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/boolean.js.map +1 -0
- package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/boolean.spec.js +59 -0
- package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/boolean.spec.js.map +1 -0
- package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/common.js +13 -0
- package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/common.js.map +1 -0
- package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/common.spec.js +61 -0
- package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/common.spec.js.map +1 -0
- package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/creditBureaus.js +25 -0
- package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/creditBureaus.js.map +1 -0
- package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/creditBureaus.spec.js +30 -0
- package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/creditBureaus.spec.js.map +1 -0
- package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/currency.js +15 -0
- package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/currency.js.map +1 -0
- package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/currencyOrBasis.js +39 -0
- package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/currencyOrBasis.js.map +1 -0
- package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/currencyOrBasis.spec.js +207 -0
- package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/currencyOrBasis.spec.js.map +1 -0
- package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/freeTrialDays.js +13 -0
- package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/freeTrialDays.js.map +1 -0
- package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/freeTrialDays.spec.js +23 -0
- package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/freeTrialDays.spec.js.map +1 -0
- package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/fromListStringWithAnd.js +14 -0
- package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/fromListStringWithAnd.js.map +1 -0
- package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/fromListStringWithAnd.spec.js +39 -0
- package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/fromListStringWithAnd.spec.js.map +1 -0
- package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/index.js +20 -0
- package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/index.js.map +1 -0
- package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/monthlyOrAnnualCurrency.js +28 -0
- package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/monthlyOrAnnualCurrency.js.map +1 -0
- package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/monthlyOrAnnualCurrency.spec.js +42 -0
- package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/monthlyOrAnnualCurrency.spec.js.map +1 -0
- package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/percentage.js +14 -0
- package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/percentage.js.map +1 -0
- package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/percentage.spec.js +31 -0
- package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/percentage.spec.js.map +1 -0
- package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/purchaseApr.js +69 -0
- package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/purchaseApr.js.map +1 -0
- package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/purchaseApr.spec.js +68 -0
- package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/purchaseApr.spec.js.map +1 -0
- package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/rangeCurrency.js +16 -0
- package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/rangeCurrency.js.map +1 -0
- package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/rangeCurrencyByTime.js +40 -0
- package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/rangeCurrencyByTime.js.map +1 -0
- package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/rangeCurrencyByTime.spec.js +71 -0
- package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/rangeCurrencyByTime.spec.js.map +1 -0
- package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/rangeCurrencyUnabbreviated.js +16 -0
- package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/rangeCurrencyUnabbreviated.js.map +1 -0
- package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/rangeCurrencyUnabbreviated.spec.js +28 -0
- package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/rangeCurrencyUnabbreviated.spec.js.map +1 -0
- package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/rangeMonths.js +46 -0
- package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/rangeMonths.js.map +1 -0
- package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/rangeMonths.spec.js +45 -0
- package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/rangeMonths.spec.js.map +1 -0
- package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/rangePercent.js +19 -0
- package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/rangePercent.js.map +1 -0
- package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/rangePercent.spec.js +82 -0
- package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/rangePercent.spec.js.map +1 -0
- package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/recommendedCredit.js +21 -0
- package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/recommendedCredit.js.map +1 -0
- package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/recommendedCredit.spec.js +27 -0
- package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/recommendedCredit.spec.js.map +1 -0
- package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/rewardsDisplay.js +14 -0
- package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/rewardsDisplay.js.map +1 -0
- package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/rewardsDisplay.spec.js +29 -0
- package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/rewardsDisplay.spec.js.map +1 -0
- package/lib/module/capabilities/offer-catalog/src/utils/stats/index.js +41 -0
- package/lib/module/capabilities/offer-catalog/src/utils/stats/index.js.map +1 -0
- package/lib/module/capabilities/offer-catalog/src/utils/stats/types.js +2 -0
- package/lib/module/capabilities/offer-catalog/src/utils/stats/types.js.map +1 -0
- package/lib/module/capabilities/offers/pipeline/src/sources/ratetables/offer-catalog/types/index.js +2 -0
- package/lib/module/capabilities/offers/pipeline/src/sources/ratetables/offer-catalog/types/index.js.map +1 -0
- package/lib/module/capabilities/offers/pipeline/src/sources/ratetables/offer-catalog/types/oas/offer-catalog.js +2 -0
- package/lib/module/capabilities/offers/pipeline/src/sources/ratetables/offer-catalog/types/oas/offer-catalog.js.map +1 -0
- package/lib/module/capabilities/offers/pipeline/src/sources/ratetables/types/PublicApi.d.js +2 -0
- package/lib/module/capabilities/offers/pipeline/src/sources/ratetables/types/PublicApi.d.js.map +1 -0
- package/lib/module/capabilities/offers/pipeline/src/sources/ratetables/types/index.js +2 -0
- package/lib/module/capabilities/offers/pipeline/src/sources/ratetables/types/index.js.map +1 -0
- package/lib/module/capabilities/offers/pipeline/src/sources/ratetables/withDeviceSignals.js +65 -0
- package/lib/module/capabilities/offers/pipeline/src/sources/ratetables/withDeviceSignals.js.map +1 -0
- package/lib/module/capabilities/ui/elements/src/components/MarkdownText/Abbreviation.js +50 -0
- package/lib/module/capabilities/ui/elements/src/components/MarkdownText/Abbreviation.js.map +1 -0
- package/lib/module/capabilities/ui/elements/src/components/MarkdownText/components.js +134 -0
- package/lib/module/capabilities/ui/elements/src/components/MarkdownText/components.js.map +1 -0
- package/lib/module/capabilities/ui/elements/src/components/MarkdownText/index.js +46 -0
- package/lib/module/capabilities/ui/elements/src/components/MarkdownText/index.js.map +1 -0
- package/lib/module/capabilities/ui/elements/src/components/MarkdownText/markdownPreprocessor.js +115 -0
- package/lib/module/capabilities/ui/elements/src/components/MarkdownText/markdownPreprocessor.js.map +1 -0
- package/lib/module/capabilities/ui/elements/src/components/index.js +2 -0
- package/lib/module/capabilities/ui/elements/src/components/index.js.map +1 -0
- package/lib/module/capabilities/ui/elements/src/components/thumbor/index.js +103 -0
- package/lib/module/capabilities/ui/elements/src/components/thumbor/index.js.map +1 -0
- package/lib/module/capabilities/ui/elements/src/components/thumbor/useSvgUriViewBox.js +86 -0
- package/lib/module/capabilities/ui/elements/src/components/thumbor/useSvgUriViewBox.js.map +1 -0
- package/lib/module/capabilities/ui/elements/src/components/thumbor/useSvgUriViewBox.test.js +43 -0
- package/lib/module/capabilities/ui/elements/src/components/thumbor/useSvgUriViewBox.test.js.map +1 -0
- package/lib/module/capabilities/ui/elements/src/index.js +3 -0
- package/lib/module/capabilities/ui/elements/src/index.js.map +1 -0
- package/lib/module/capabilities/ui/elements/src/offerCardAttributes.js +16 -0
- package/lib/module/capabilities/ui/elements/src/offerCardAttributes.js.map +1 -0
- package/lib/module/components/Cards/VideosCard/VideosCard.js +1 -1
- package/lib/module/components/Common/BaseOfferCard/Stat/Stat.js +1 -2
- package/lib/module/components/Common/BaseOfferCard/Stat/Stat.js.map +1 -1
- package/lib/module/components/Common/BaseOfferCard/index.js +3 -4
- package/lib/module/components/Common/BaseOfferCard/index.js.map +1 -1
- package/lib/module/components/Layouts/CreditCardOfferCard/statsBuilder.js +1 -1
- package/lib/module/components/Layouts/CreditCardOfferCard/statsBuilder.js.map +1 -1
- package/lib/module/components/Layouts/DefaultOfferCard/statsBuilder.js +1 -1
- package/lib/module/components/Layouts/DefaultOfferCard/statsBuilder.js.map +1 -1
- package/lib/module/components/Modal/DescriptionPoints.js +2 -2
- package/lib/module/components/Modal/DescriptionPoints.js.map +1 -1
- package/lib/module/components/Modal/Disclaimer.js +1 -1
- package/lib/module/components/Modal/Disclaimer.js.map +1 -1
- package/lib/module/components/MoneyLionOfferCarousel.js +1 -1
- package/lib/module/components/MoneyLionOfferCarousel.js.map +1 -1
- package/lib/module/config/mocks/cnfContext.js +137 -0
- package/lib/module/config/mocks/cnfContext.js.map +1 -0
- package/lib/module/pageData.js +1 -1
- package/lib/module/pageData.js.map +1 -1
- package/lib/module/services/getProductTypesByQuery.js +1 -1
- package/lib/module/services/getProductTypesByQuery.js.map +1 -1
- package/lib/module/utils/formatOfferUrl.js +1 -1
- package/lib/module/utils/formatOfferUrl.js.map +1 -1
- package/lib/module/utils/getOffersByProductTypes.js +2 -2
- package/lib/module/utils/getOffersByProductTypes.js.map +1 -1
- package/lib/typescript/builder/builder.d.ts +2 -2
- package/lib/typescript/builder/builder.d.ts.map +1 -1
- package/lib/typescript/src/capabilities/configuration/src/brands/checkVisualEligibility.d.ts.map +1 -0
- package/lib/typescript/{capabilities → src/capabilities}/configuration/src/brands/createDerivedBrands.d.ts +1 -1
- package/lib/typescript/src/capabilities/configuration/src/brands/createDerivedBrands.d.ts.map +1 -0
- package/lib/typescript/src/capabilities/configuration/src/brands/index.d.ts.map +1 -0
- package/lib/typescript/{capabilities → src/capabilities}/configuration/src/brands/types.d.ts +1 -1
- package/lib/typescript/src/capabilities/configuration/src/brands/types.d.ts.map +1 -0
- package/lib/typescript/src/capabilities/core/src/domain/third-party-search/index.d.ts.map +1 -0
- package/lib/typescript/src/capabilities/core/src/domain/third-party-search/orderProductTypesByRankUtils.d.ts.map +1 -0
- package/lib/typescript/src/capabilities/core/src/index.d.ts.map +1 -0
- package/lib/typescript/src/capabilities/core/src/system/cnfContext/CnfContext.d.ts.map +1 -0
- package/lib/typescript/src/capabilities/core/src/system/cnfContext/schemas/App.d.ts.map +1 -0
- package/lib/typescript/src/capabilities/core/src/system/cnfContext/schemas/Brand.d.ts.map +1 -0
- package/lib/typescript/src/capabilities/core/src/system/cnfContext/schemas/Configuration.d.ts.map +1 -0
- package/lib/typescript/src/capabilities/core/src/system/cnfContext/schemas/Request.d.ts.map +1 -0
- package/lib/typescript/src/capabilities/core/src/system/cnfContext/schemas/Session.d.ts.map +1 -0
- package/lib/typescript/src/capabilities/core/src/system/cnfContext/schemas/Signals.d.ts.map +1 -0
- package/lib/typescript/src/capabilities/core/src/system/cnfContext/schemas/Subaccount.d.ts.map +1 -0
- package/lib/typescript/src/capabilities/core/src/system/cnfContext/schemas/index.d.ts.map +1 -0
- package/lib/typescript/src/capabilities/offer-catalog/src/api/offerCatalogApi.d.ts.map +1 -0
- package/lib/typescript/src/capabilities/offer-catalog/src/index.d.ts.map +1 -0
- package/lib/typescript/src/capabilities/offer-catalog/src/types/offerCatalogSchema.d.ts.map +1 -0
- package/lib/typescript/src/capabilities/offer-catalog/src/utils/arrayToMarkdownList.d.ts.map +1 -0
- package/lib/typescript/src/capabilities/offer-catalog/src/utils/contextUtil.d.ts.map +1 -0
- package/lib/typescript/src/capabilities/offer-catalog/src/utils/errorUtil.d.ts.map +1 -0
- package/lib/typescript/src/capabilities/offer-catalog/src/utils/formatUtils.d.ts.map +1 -0
- package/lib/typescript/src/capabilities/offer-catalog/src/utils/getOfferUrl.d.ts.map +1 -0
- package/lib/typescript/src/capabilities/offer-catalog/src/utils/stats/formatters/annualFee.d.ts.map +1 -0
- package/lib/typescript/src/capabilities/offer-catalog/src/utils/stats/formatters/boolean.d.ts.map +1 -0
- package/lib/typescript/src/capabilities/offer-catalog/src/utils/stats/formatters/boolean.spec.d.ts.map +1 -0
- package/lib/typescript/src/capabilities/offer-catalog/src/utils/stats/formatters/common.d.ts.map +1 -0
- package/lib/typescript/src/capabilities/offer-catalog/src/utils/stats/formatters/common.spec.d.ts.map +1 -0
- package/lib/typescript/src/capabilities/offer-catalog/src/utils/stats/formatters/creditBureaus.d.ts.map +1 -0
- package/lib/typescript/src/capabilities/offer-catalog/src/utils/stats/formatters/creditBureaus.spec.d.ts.map +1 -0
- package/lib/typescript/src/capabilities/offer-catalog/src/utils/stats/formatters/currency.d.ts.map +1 -0
- package/lib/typescript/src/capabilities/offer-catalog/src/utils/stats/formatters/currencyOrBasis.d.ts.map +1 -0
- package/lib/typescript/src/capabilities/offer-catalog/src/utils/stats/formatters/currencyOrBasis.spec.d.ts.map +1 -0
- package/lib/typescript/src/capabilities/offer-catalog/src/utils/stats/formatters/freeTrialDays.d.ts.map +1 -0
- package/lib/typescript/src/capabilities/offer-catalog/src/utils/stats/formatters/freeTrialDays.spec.d.ts.map +1 -0
- package/lib/typescript/src/capabilities/offer-catalog/src/utils/stats/formatters/fromListStringWithAnd.d.ts.map +1 -0
- package/lib/typescript/src/capabilities/offer-catalog/src/utils/stats/formatters/fromListStringWithAnd.spec.d.ts.map +1 -0
- package/lib/typescript/src/capabilities/offer-catalog/src/utils/stats/formatters/index.d.ts.map +1 -0
- package/lib/typescript/src/capabilities/offer-catalog/src/utils/stats/formatters/monthlyOrAnnualCurrency.d.ts.map +1 -0
- package/lib/typescript/src/capabilities/offer-catalog/src/utils/stats/formatters/monthlyOrAnnualCurrency.spec.d.ts.map +1 -0
- package/lib/typescript/src/capabilities/offer-catalog/src/utils/stats/formatters/percentage.d.ts.map +1 -0
- package/lib/typescript/src/capabilities/offer-catalog/src/utils/stats/formatters/percentage.spec.d.ts.map +1 -0
- package/lib/typescript/src/capabilities/offer-catalog/src/utils/stats/formatters/purchaseApr.d.ts.map +1 -0
- package/lib/typescript/src/capabilities/offer-catalog/src/utils/stats/formatters/purchaseApr.spec.d.ts.map +1 -0
- package/lib/typescript/src/capabilities/offer-catalog/src/utils/stats/formatters/rangeCurrency.d.ts.map +1 -0
- package/lib/typescript/src/capabilities/offer-catalog/src/utils/stats/formatters/rangeCurrencyByTime.d.ts.map +1 -0
- package/lib/typescript/src/capabilities/offer-catalog/src/utils/stats/formatters/rangeCurrencyByTime.spec.d.ts.map +1 -0
- package/lib/typescript/src/capabilities/offer-catalog/src/utils/stats/formatters/rangeCurrencyUnabbreviated.d.ts.map +1 -0
- package/lib/typescript/src/capabilities/offer-catalog/src/utils/stats/formatters/rangeCurrencyUnabbreviated.spec.d.ts.map +1 -0
- package/lib/typescript/src/capabilities/offer-catalog/src/utils/stats/formatters/rangeMonths.d.ts.map +1 -0
- package/lib/typescript/src/capabilities/offer-catalog/src/utils/stats/formatters/rangeMonths.spec.d.ts.map +1 -0
- package/lib/typescript/src/capabilities/offer-catalog/src/utils/stats/formatters/rangePercent.d.ts.map +1 -0
- package/lib/typescript/src/capabilities/offer-catalog/src/utils/stats/formatters/rangePercent.spec.d.ts.map +1 -0
- package/lib/typescript/src/capabilities/offer-catalog/src/utils/stats/formatters/recommendedCredit.d.ts.map +1 -0
- package/lib/typescript/src/capabilities/offer-catalog/src/utils/stats/formatters/recommendedCredit.spec.d.ts.map +1 -0
- package/lib/typescript/src/capabilities/offer-catalog/src/utils/stats/formatters/rewardsDisplay.d.ts.map +1 -0
- package/lib/typescript/src/capabilities/offer-catalog/src/utils/stats/formatters/rewardsDisplay.spec.d.ts.map +1 -0
- package/lib/typescript/src/capabilities/offer-catalog/src/utils/stats/index.d.ts.map +1 -0
- package/lib/typescript/src/capabilities/offer-catalog/src/utils/stats/types.d.ts.map +1 -0
- package/lib/typescript/src/capabilities/offers/pipeline/src/sources/ratetables/offer-catalog/types/index.d.ts.map +1 -0
- package/lib/typescript/src/capabilities/offers/pipeline/src/sources/ratetables/offer-catalog/types/oas/offer-catalog.d.ts.map +1 -0
- package/lib/typescript/src/capabilities/offers/pipeline/src/sources/ratetables/types/index.d.ts.map +1 -0
- package/lib/typescript/{capabilities → src/capabilities}/offers/pipeline/src/sources/ratetables/withDeviceSignals.d.ts +9 -9
- package/lib/typescript/src/capabilities/offers/pipeline/src/sources/ratetables/withDeviceSignals.d.ts.map +1 -0
- package/lib/typescript/src/capabilities/ui/elements/src/components/MarkdownText/Abbreviation.d.ts.map +1 -0
- package/lib/typescript/{capabilities → src/capabilities}/ui/elements/src/components/MarkdownText/components.d.ts +1 -1
- package/lib/typescript/src/capabilities/ui/elements/src/components/MarkdownText/components.d.ts.map +1 -0
- package/lib/typescript/{capabilities → src/capabilities}/ui/elements/src/components/MarkdownText/index.d.ts +1 -1
- package/lib/typescript/src/capabilities/ui/elements/src/components/MarkdownText/index.d.ts.map +1 -0
- package/lib/typescript/src/capabilities/ui/elements/src/components/MarkdownText/markdownPreprocessor.d.ts.map +1 -0
- package/lib/typescript/src/capabilities/ui/elements/src/components/index.d.ts.map +1 -0
- package/lib/typescript/src/capabilities/ui/elements/src/components/thumbor/index.d.ts.map +1 -0
- package/lib/typescript/src/capabilities/ui/elements/src/components/thumbor/useSvgUriViewBox.d.ts.map +1 -0
- package/lib/typescript/src/capabilities/ui/elements/src/components/thumbor/useSvgUriViewBox.test.d.ts.map +1 -0
- package/lib/typescript/src/capabilities/ui/elements/src/index.d.ts.map +1 -0
- package/lib/typescript/src/capabilities/ui/elements/src/offerCardAttributes.d.ts.map +1 -0
- package/lib/typescript/src/components/Common/BaseOfferCard/Stat/Stat.d.ts +5 -1
- package/lib/typescript/src/components/Common/BaseOfferCard/Stat/Stat.d.ts.map +1 -1
- package/lib/typescript/src/components/Common/BaseOfferCard/index.d.ts +2 -2
- package/lib/typescript/src/components/Common/BaseOfferCard/index.d.ts.map +1 -1
- package/lib/typescript/src/components/Common/DynamicOfferCard/CallToAction.d.ts +1 -1
- package/lib/typescript/src/components/Common/DynamicOfferCard/CallToAction.d.ts.map +1 -1
- package/lib/typescript/src/components/Common/DynamicOfferCard/SeeMore.d.ts +1 -1
- package/lib/typescript/src/components/Common/DynamicOfferCard/SeeMore.d.ts.map +1 -1
- package/lib/typescript/src/components/Common/DynamicOfferCard/index.d.ts +1 -1
- package/lib/typescript/src/components/Common/DynamicOfferCard/index.d.ts.map +1 -1
- package/lib/typescript/src/components/DynamicOffers/Render/DynamicOffersRender.d.ts +1 -1
- package/lib/typescript/src/components/DynamicOffers/Render/DynamicOffersRender.d.ts.map +1 -1
- package/lib/typescript/src/components/DynamicOffers/Render/FallbackOfferTemplate.d.ts +1 -1
- package/lib/typescript/src/components/DynamicOffers/Render/FallbackOfferTemplate.d.ts.map +1 -1
- package/lib/typescript/src/components/DynamicOffers/Render/Offer.d.ts +1 -1
- package/lib/typescript/src/components/DynamicOffers/Render/Offer.d.ts.map +1 -1
- package/lib/typescript/src/components/Layouts/CreditCardOfferCard/index.d.ts +1 -1
- package/lib/typescript/src/components/Layouts/CreditCardOfferCard/index.d.ts.map +1 -1
- package/lib/typescript/src/components/Layouts/CreditCardOfferCard/statsBuilder.d.ts +2 -2
- package/lib/typescript/src/components/Layouts/CreditCardOfferCard/statsBuilder.d.ts.map +1 -1
- package/lib/typescript/src/components/Layouts/DefaultOfferCard/index.d.ts +1 -1
- package/lib/typescript/src/components/Layouts/DefaultOfferCard/index.d.ts.map +1 -1
- package/lib/typescript/src/components/Layouts/DefaultOfferCard/statsBuilder.d.ts +3 -3
- package/lib/typescript/src/components/Layouts/DefaultOfferCard/statsBuilder.d.ts.map +1 -1
- package/lib/typescript/src/components/Layouts/HeadlineWithDescriptionCard/index.d.ts +1 -1
- package/lib/typescript/src/components/Layouts/HeadlineWithDescriptionCard/index.d.ts.map +1 -1
- package/lib/typescript/src/components/Modal/OfferDetailsModal.d.ts +1 -1
- package/lib/typescript/src/components/Modal/OfferDetailsModal.d.ts.map +1 -1
- package/lib/typescript/src/config/mocks/cnfContext.d.ts.map +1 -0
- package/lib/typescript/src/context/EventHandlerProvider.d.ts +1 -1
- package/lib/typescript/src/context/EventHandlerProvider.d.ts.map +1 -1
- package/lib/typescript/src/pageData.d.ts +2 -2
- package/lib/typescript/src/pageData.d.ts.map +1 -1
- package/lib/typescript/src/services/getDynamicOffers.d.ts +3 -3
- package/lib/typescript/src/services/getDynamicOffers.d.ts.map +1 -1
- package/lib/typescript/src/utils/addClientTagsToOfferLinks.d.ts +1 -1
- package/lib/typescript/src/utils/addClientTagsToOfferLinks.d.ts.map +1 -1
- package/lib/typescript/src/utils/formatOfferUrl.d.ts +1 -1
- package/lib/typescript/src/utils/formatOfferUrl.d.ts.map +1 -1
- package/lib/typescript/src/utils/getDefaultProductType.d.ts +1 -1
- package/lib/typescript/src/utils/getDefaultProductType.d.ts.map +1 -1
- package/lib/typescript/src/utils/getEnableUseCachedOffers.d.ts +1 -1
- package/lib/typescript/src/utils/getEnableUseCachedOffers.d.ts.map +1 -1
- package/lib/typescript/src/utils/getOffersBasedOnLayout.d.ts +1 -1
- package/lib/typescript/src/utils/getOffersBasedOnLayout.d.ts.map +1 -1
- package/lib/typescript/src/utils/getOffersByProductTypes.d.ts +2 -2
- package/lib/typescript/src/utils/getOffersByProductTypes.d.ts.map +1 -1
- package/lib/typescript/src/utils/getProductTypesDefinition.d.ts +1 -1
- package/lib/typescript/src/utils/getProductTypesDefinition.d.ts.map +1 -1
- package/lib/typescript/src/utils/selectDynamicOffers.d.ts +1 -1
- package/lib/typescript/src/utils/selectDynamicOffers.d.ts.map +1 -1
- package/lib/typescript/src/utils/sortOffersByRecommendationScore.d.ts +1 -1
- package/lib/typescript/src/utils/sortOffersByRecommendationScore.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/capabilities/configuration/src/brands/checkVisualEligibility.ts +29 -0
- package/src/capabilities/configuration/src/brands/createDerivedBrands.ts +39 -0
- package/src/capabilities/configuration/src/brands/index.ts +2 -0
- package/src/capabilities/configuration/src/brands/types.ts +8 -0
- package/src/capabilities/core/src/domain/third-party-search/index.ts +1 -0
- package/src/capabilities/core/src/domain/third-party-search/orderProductTypesByRankUtils.ts +33 -0
- package/src/capabilities/core/src/index.ts +1 -0
- package/src/capabilities/core/src/system/cnfContext/CnfContext.ts +21 -0
- package/src/capabilities/core/src/system/cnfContext/schemas/App.ts +13 -0
- package/src/capabilities/core/src/system/cnfContext/schemas/Brand.ts +119 -0
- package/src/capabilities/core/src/system/cnfContext/schemas/Configuration.ts +49 -0
- package/src/capabilities/core/src/system/cnfContext/schemas/Request.ts +16 -0
- package/src/capabilities/core/src/system/cnfContext/schemas/Session.ts +9 -0
- package/src/capabilities/core/src/system/cnfContext/schemas/Signals.ts +47 -0
- package/src/capabilities/core/src/system/cnfContext/schemas/Subaccount.ts +25 -0
- package/src/capabilities/core/src/system/cnfContext/schemas/index.ts +7 -0
- package/src/capabilities/offer-catalog/src/api/offerCatalogApi.ts +171 -0
- package/src/capabilities/offer-catalog/src/index.ts +10 -0
- package/src/capabilities/offer-catalog/src/types/offerCatalogSchema.ts +119 -0
- package/src/capabilities/offer-catalog/src/utils/arrayToMarkdownList.ts +3 -0
- package/src/capabilities/offer-catalog/src/utils/contextUtil.ts +73 -0
- package/src/capabilities/offer-catalog/src/utils/errorUtil.ts +18 -0
- package/src/capabilities/offer-catalog/src/utils/formatUtils.ts +168 -0
- package/src/capabilities/offer-catalog/src/utils/getOfferUrl.ts +61 -0
- package/src/capabilities/offer-catalog/src/utils/stats/formatters/annualFee.ts +103 -0
- package/src/capabilities/offer-catalog/src/utils/stats/formatters/boolean.spec.ts +58 -0
- package/src/capabilities/offer-catalog/src/utils/stats/formatters/boolean.ts +31 -0
- package/src/capabilities/offer-catalog/src/utils/stats/formatters/common.spec.ts +60 -0
- package/src/capabilities/offer-catalog/src/utils/stats/formatters/common.ts +31 -0
- package/src/capabilities/offer-catalog/src/utils/stats/formatters/creditBureaus.spec.ts +29 -0
- package/src/capabilities/offer-catalog/src/utils/stats/formatters/creditBureaus.ts +36 -0
- package/src/capabilities/offer-catalog/src/utils/stats/formatters/currency.ts +24 -0
- package/src/capabilities/offer-catalog/src/utils/stats/formatters/currencyOrBasis.spec.ts +206 -0
- package/src/capabilities/offer-catalog/src/utils/stats/formatters/currencyOrBasis.ts +83 -0
- package/src/capabilities/offer-catalog/src/utils/stats/formatters/freeTrialDays.spec.ts +22 -0
- package/src/capabilities/offer-catalog/src/utils/stats/formatters/freeTrialDays.ts +25 -0
- package/src/capabilities/offer-catalog/src/utils/stats/formatters/fromListStringWithAnd.spec.ts +38 -0
- package/src/capabilities/offer-catalog/src/utils/stats/formatters/fromListStringWithAnd.ts +24 -0
- package/src/capabilities/offer-catalog/src/utils/stats/formatters/index.ts +19 -0
- package/src/capabilities/offer-catalog/src/utils/stats/formatters/monthlyOrAnnualCurrency.spec.ts +41 -0
- package/src/capabilities/offer-catalog/src/utils/stats/formatters/monthlyOrAnnualCurrency.ts +52 -0
- package/src/capabilities/offer-catalog/src/utils/stats/formatters/percentage.spec.ts +30 -0
- package/src/capabilities/offer-catalog/src/utils/stats/formatters/percentage.ts +23 -0
- package/src/capabilities/offer-catalog/src/utils/stats/formatters/purchaseApr.spec.ts +67 -0
- package/src/capabilities/offer-catalog/src/utils/stats/formatters/purchaseApr.ts +92 -0
- package/src/capabilities/offer-catalog/src/utils/stats/formatters/rangeCurrency.ts +34 -0
- package/src/capabilities/offer-catalog/src/utils/stats/formatters/rangeCurrencyByTime.spec.ts +70 -0
- package/src/capabilities/offer-catalog/src/utils/stats/formatters/rangeCurrencyByTime.ts +71 -0
- package/src/capabilities/offer-catalog/src/utils/stats/formatters/rangeCurrencyUnabbreviated.spec.ts +27 -0
- package/src/capabilities/offer-catalog/src/utils/stats/formatters/rangeCurrencyUnabbreviated.ts +38 -0
- package/src/capabilities/offer-catalog/src/utils/stats/formatters/rangeMonths.spec.ts +44 -0
- package/src/capabilities/offer-catalog/src/utils/stats/formatters/rangeMonths.ts +68 -0
- package/src/capabilities/offer-catalog/src/utils/stats/formatters/rangePercent.spec.ts +81 -0
- package/src/capabilities/offer-catalog/src/utils/stats/formatters/rangePercent.ts +38 -0
- package/src/capabilities/offer-catalog/src/utils/stats/formatters/recommendedCredit.spec.ts +26 -0
- package/src/capabilities/offer-catalog/src/utils/stats/formatters/recommendedCredit.ts +45 -0
- package/src/capabilities/offer-catalog/src/utils/stats/formatters/rewardsDisplay.spec.ts +28 -0
- package/src/capabilities/offer-catalog/src/utils/stats/formatters/rewardsDisplay.ts +23 -0
- package/src/capabilities/offer-catalog/src/utils/stats/index.ts +141 -0
- package/src/capabilities/offer-catalog/src/utils/stats/types.ts +47 -0
- package/src/capabilities/offers/pipeline/src/sources/ratetables/offer-catalog/types/index.ts +6 -0
- package/src/capabilities/offers/pipeline/src/sources/ratetables/offer-catalog/types/oas/offer-catalog.ts +2272 -0
- package/src/capabilities/offers/pipeline/src/sources/ratetables/types/PublicApi.d.ts +1924 -0
- package/src/capabilities/offers/pipeline/src/sources/ratetables/types/index.ts +5 -0
- package/src/capabilities/offers/pipeline/src/sources/ratetables/withDeviceSignals.ts +83 -0
- package/src/capabilities/ui/elements/src/components/MarkdownText/Abbreviation.tsx +66 -0
- package/src/capabilities/ui/elements/src/components/MarkdownText/components.tsx +175 -0
- package/src/capabilities/ui/elements/src/components/MarkdownText/index.tsx +52 -0
- package/src/capabilities/ui/elements/src/components/MarkdownText/markdownPreprocessor.ts +124 -0
- package/src/capabilities/ui/elements/src/components/index.ts +1 -0
- package/src/capabilities/ui/elements/src/components/thumbor/index.tsx +115 -0
- package/src/capabilities/ui/elements/src/components/thumbor/useSvgUriViewBox.test.ts +42 -0
- package/src/capabilities/ui/elements/src/components/thumbor/useSvgUriViewBox.ts +110 -0
- package/src/capabilities/ui/elements/src/index.ts +3 -0
- package/src/capabilities/ui/elements/src/offerCardAttributes.ts +28 -0
- package/src/components/Cards/VideosCard/VideosCard.tsx +1 -1
- package/src/components/Common/BaseOfferCard/Stat/Stat.tsx +7 -2
- package/src/components/Common/BaseOfferCard/index.tsx +3 -4
- package/src/components/Common/DynamicOfferCard/CallToAction.tsx +1 -1
- package/src/components/Common/DynamicOfferCard/SeeMore.tsx +1 -1
- package/src/components/Common/DynamicOfferCard/index.tsx +1 -1
- package/src/components/DynamicOffers/Render/DynamicOffersRender.tsx +1 -1
- package/src/components/DynamicOffers/Render/FallbackOfferTemplate.tsx +1 -1
- package/src/components/DynamicOffers/Render/Offer.tsx +1 -1
- package/src/components/Layouts/CreditCardOfferCard/index.tsx +1 -1
- package/src/components/Layouts/CreditCardOfferCard/statsBuilder.tsx +2 -2
- package/src/components/Layouts/DefaultOfferCard/index.tsx +1 -1
- package/src/components/Layouts/DefaultOfferCard/statsBuilder.tsx +2 -2
- package/src/components/Layouts/HeadlineWithDescriptionCard/index.tsx +1 -1
- package/src/components/Modal/DescriptionPoints.tsx +2 -2
- package/src/components/Modal/Disclaimer.tsx +1 -1
- package/src/components/Modal/OfferDetailsModal.tsx +1 -1
- package/src/components/MoneyLionOfferCarousel.tsx +2 -2
- package/src/config/mocks/cnfContext.ts +136 -0
- package/src/context/EventHandlerProvider.tsx +1 -1
- package/src/pageData.ts +2 -2
- package/src/services/getDynamicOffers.ts +2 -2
- package/src/services/getProductTypesByQuery.ts +1 -1
- package/src/utils/addClientTagsToOfferLinks.ts +1 -1
- package/src/utils/formatOfferUrl.ts +1 -1
- package/src/utils/getDefaultProductType.ts +1 -1
- package/src/utils/getEnableUseCachedOffers.ts +1 -1
- package/src/utils/getOffersBasedOnLayout.ts +1 -1
- package/src/utils/getOffersByProductTypes.ts +3 -3
- package/src/utils/getProductTypesDefinition.ts +1 -1
- package/src/utils/selectDynamicOffers.ts +1 -1
- package/src/utils/sortOffersByRecommendationScore.ts +1 -1
- package/lib/typescript/capabilities/configuration/src/brands/checkVisualEligibility.d.ts.map +0 -1
- package/lib/typescript/capabilities/configuration/src/brands/createDerivedBrands.d.ts.map +0 -1
- package/lib/typescript/capabilities/configuration/src/brands/index.d.ts.map +0 -1
- package/lib/typescript/capabilities/configuration/src/brands/types.d.ts.map +0 -1
- package/lib/typescript/capabilities/core/src/domain/third-party-search/index.d.ts.map +0 -1
- package/lib/typescript/capabilities/core/src/domain/third-party-search/orderProductTypesByRankUtils.d.ts.map +0 -1
- package/lib/typescript/capabilities/core/src/index.d.ts.map +0 -1
- package/lib/typescript/capabilities/core/src/system/cnfContext/CnfContext.d.ts.map +0 -1
- package/lib/typescript/capabilities/core/src/system/cnfContext/schemas/App.d.ts.map +0 -1
- package/lib/typescript/capabilities/core/src/system/cnfContext/schemas/Brand.d.ts.map +0 -1
- package/lib/typescript/capabilities/core/src/system/cnfContext/schemas/Configuration.d.ts.map +0 -1
- package/lib/typescript/capabilities/core/src/system/cnfContext/schemas/Request.d.ts.map +0 -1
- package/lib/typescript/capabilities/core/src/system/cnfContext/schemas/Session.d.ts.map +0 -1
- package/lib/typescript/capabilities/core/src/system/cnfContext/schemas/Signals.d.ts.map +0 -1
- package/lib/typescript/capabilities/core/src/system/cnfContext/schemas/Subaccount.d.ts.map +0 -1
- package/lib/typescript/capabilities/core/src/system/cnfContext/schemas/index.d.ts.map +0 -1
- package/lib/typescript/capabilities/offer-catalog/src/api/offerCatalogApi.d.ts.map +0 -1
- package/lib/typescript/capabilities/offer-catalog/src/index.d.ts.map +0 -1
- package/lib/typescript/capabilities/offer-catalog/src/types/offerCatalogSchema.d.ts.map +0 -1
- package/lib/typescript/capabilities/offer-catalog/src/utils/arrayToMarkdownList.d.ts.map +0 -1
- package/lib/typescript/capabilities/offer-catalog/src/utils/contextUtil.d.ts.map +0 -1
- package/lib/typescript/capabilities/offer-catalog/src/utils/errorUtil.d.ts.map +0 -1
- package/lib/typescript/capabilities/offer-catalog/src/utils/formatUtils.d.ts.map +0 -1
- package/lib/typescript/capabilities/offer-catalog/src/utils/getOfferUrl.d.ts.map +0 -1
- package/lib/typescript/capabilities/offer-catalog/src/utils/stats/formatters/annualFee.d.ts.map +0 -1
- package/lib/typescript/capabilities/offer-catalog/src/utils/stats/formatters/boolean.d.ts.map +0 -1
- package/lib/typescript/capabilities/offer-catalog/src/utils/stats/formatters/boolean.spec.d.ts.map +0 -1
- package/lib/typescript/capabilities/offer-catalog/src/utils/stats/formatters/common.d.ts.map +0 -1
- package/lib/typescript/capabilities/offer-catalog/src/utils/stats/formatters/common.spec.d.ts.map +0 -1
- package/lib/typescript/capabilities/offer-catalog/src/utils/stats/formatters/creditBureaus.d.ts.map +0 -1
- package/lib/typescript/capabilities/offer-catalog/src/utils/stats/formatters/creditBureaus.spec.d.ts.map +0 -1
- package/lib/typescript/capabilities/offer-catalog/src/utils/stats/formatters/currency.d.ts.map +0 -1
- package/lib/typescript/capabilities/offer-catalog/src/utils/stats/formatters/currencyOrBasis.d.ts.map +0 -1
- package/lib/typescript/capabilities/offer-catalog/src/utils/stats/formatters/currencyOrBasis.spec.d.ts.map +0 -1
- package/lib/typescript/capabilities/offer-catalog/src/utils/stats/formatters/freeTrialDays.d.ts.map +0 -1
- package/lib/typescript/capabilities/offer-catalog/src/utils/stats/formatters/freeTrialDays.spec.d.ts.map +0 -1
- package/lib/typescript/capabilities/offer-catalog/src/utils/stats/formatters/fromListStringWithAnd.d.ts.map +0 -1
- package/lib/typescript/capabilities/offer-catalog/src/utils/stats/formatters/fromListStringWithAnd.spec.d.ts.map +0 -1
- package/lib/typescript/capabilities/offer-catalog/src/utils/stats/formatters/index.d.ts.map +0 -1
- package/lib/typescript/capabilities/offer-catalog/src/utils/stats/formatters/monthlyOrAnnualCurrency.d.ts.map +0 -1
- package/lib/typescript/capabilities/offer-catalog/src/utils/stats/formatters/monthlyOrAnnualCurrency.spec.d.ts.map +0 -1
- package/lib/typescript/capabilities/offer-catalog/src/utils/stats/formatters/percentage.d.ts.map +0 -1
- package/lib/typescript/capabilities/offer-catalog/src/utils/stats/formatters/percentage.spec.d.ts.map +0 -1
- package/lib/typescript/capabilities/offer-catalog/src/utils/stats/formatters/purchaseApr.d.ts.map +0 -1
- package/lib/typescript/capabilities/offer-catalog/src/utils/stats/formatters/purchaseApr.spec.d.ts.map +0 -1
- package/lib/typescript/capabilities/offer-catalog/src/utils/stats/formatters/rangeCurrency.d.ts.map +0 -1
- package/lib/typescript/capabilities/offer-catalog/src/utils/stats/formatters/rangeCurrencyByTime.d.ts.map +0 -1
- package/lib/typescript/capabilities/offer-catalog/src/utils/stats/formatters/rangeCurrencyByTime.spec.d.ts.map +0 -1
- package/lib/typescript/capabilities/offer-catalog/src/utils/stats/formatters/rangeCurrencyUnabbreviated.d.ts.map +0 -1
- package/lib/typescript/capabilities/offer-catalog/src/utils/stats/formatters/rangeCurrencyUnabbreviated.spec.d.ts.map +0 -1
- package/lib/typescript/capabilities/offer-catalog/src/utils/stats/formatters/rangeMonths.d.ts.map +0 -1
- package/lib/typescript/capabilities/offer-catalog/src/utils/stats/formatters/rangeMonths.spec.d.ts.map +0 -1
- package/lib/typescript/capabilities/offer-catalog/src/utils/stats/formatters/rangePercent.d.ts.map +0 -1
- package/lib/typescript/capabilities/offer-catalog/src/utils/stats/formatters/rangePercent.spec.d.ts.map +0 -1
- package/lib/typescript/capabilities/offer-catalog/src/utils/stats/formatters/recommendedCredit.d.ts.map +0 -1
- package/lib/typescript/capabilities/offer-catalog/src/utils/stats/formatters/recommendedCredit.spec.d.ts.map +0 -1
- package/lib/typescript/capabilities/offer-catalog/src/utils/stats/formatters/rewardsDisplay.d.ts.map +0 -1
- package/lib/typescript/capabilities/offer-catalog/src/utils/stats/formatters/rewardsDisplay.spec.d.ts.map +0 -1
- package/lib/typescript/capabilities/offer-catalog/src/utils/stats/index.d.ts.map +0 -1
- package/lib/typescript/capabilities/offer-catalog/src/utils/stats/types.d.ts.map +0 -1
- package/lib/typescript/capabilities/offers/pipeline/src/sources/ratetables/offer-catalog/types/index.d.ts.map +0 -1
- package/lib/typescript/capabilities/offers/pipeline/src/sources/ratetables/offer-catalog/types/oas/offer-catalog.d.ts.map +0 -1
- package/lib/typescript/capabilities/offers/pipeline/src/sources/ratetables/types/index.d.ts.map +0 -1
- package/lib/typescript/capabilities/offers/pipeline/src/sources/ratetables/withDeviceSignals.d.ts.map +0 -1
- package/lib/typescript/capabilities/offers/ux/src/elements/Stat/HyphenIcon.d.ts +0 -7
- package/lib/typescript/capabilities/offers/ux/src/elements/Stat/HyphenIcon.d.ts.map +0 -1
- package/lib/typescript/capabilities/offers/ux/src/elements/Stat/Stat.d.ts +0 -12
- package/lib/typescript/capabilities/offers/ux/src/elements/Stat/Stat.d.ts.map +0 -1
- package/lib/typescript/capabilities/offers/ux/src/elements/Stat/index.d.ts +0 -2
- package/lib/typescript/capabilities/offers/ux/src/elements/Stat/index.d.ts.map +0 -1
- package/lib/typescript/capabilities/ui/elements/src/components/MarkdownText/Abbreviation.d.ts.map +0 -1
- package/lib/typescript/capabilities/ui/elements/src/components/MarkdownText/components.d.ts.map +0 -1
- package/lib/typescript/capabilities/ui/elements/src/components/MarkdownText/index.d.ts.map +0 -1
- package/lib/typescript/capabilities/ui/elements/src/components/MarkdownText/markdownPreprocessor.d.ts.map +0 -1
- package/lib/typescript/capabilities/ui/elements/src/components/index.d.ts.map +0 -1
- package/lib/typescript/capabilities/ui/elements/src/components/thumbor/index.d.ts.map +0 -1
- package/lib/typescript/capabilities/ui/elements/src/components/thumbor/useSvgUriViewBox.d.ts.map +0 -1
- package/lib/typescript/capabilities/ui/elements/src/components/thumbor/useSvgUriViewBox.test.d.ts.map +0 -1
- package/lib/typescript/capabilities/ui/elements/src/index.d.ts.map +0 -1
- package/lib/typescript/capabilities/ui/elements/src/offerCardAttributes.d.ts.map +0 -1
- package/lib/typescript/config/mocks/cnfContext.d.ts.map +0 -1
- /package/lib/typescript/{capabilities → src/capabilities}/configuration/src/brands/checkVisualEligibility.d.ts +0 -0
- /package/lib/typescript/{capabilities → src/capabilities}/configuration/src/brands/index.d.ts +0 -0
- /package/lib/typescript/{capabilities → src/capabilities}/core/src/domain/third-party-search/index.d.ts +0 -0
- /package/lib/typescript/{capabilities → src/capabilities}/core/src/domain/third-party-search/orderProductTypesByRankUtils.d.ts +0 -0
- /package/lib/typescript/{capabilities → src/capabilities}/core/src/index.d.ts +0 -0
- /package/lib/typescript/{capabilities → src/capabilities}/core/src/system/cnfContext/CnfContext.d.ts +0 -0
- /package/lib/typescript/{capabilities → src/capabilities}/core/src/system/cnfContext/schemas/App.d.ts +0 -0
- /package/lib/typescript/{capabilities → src/capabilities}/core/src/system/cnfContext/schemas/Brand.d.ts +0 -0
- /package/lib/typescript/{capabilities → src/capabilities}/core/src/system/cnfContext/schemas/Configuration.d.ts +0 -0
- /package/lib/typescript/{capabilities → src/capabilities}/core/src/system/cnfContext/schemas/Request.d.ts +0 -0
- /package/lib/typescript/{capabilities → src/capabilities}/core/src/system/cnfContext/schemas/Session.d.ts +0 -0
- /package/lib/typescript/{capabilities → src/capabilities}/core/src/system/cnfContext/schemas/Signals.d.ts +0 -0
- /package/lib/typescript/{capabilities → src/capabilities}/core/src/system/cnfContext/schemas/Subaccount.d.ts +0 -0
- /package/lib/typescript/{capabilities → src/capabilities}/core/src/system/cnfContext/schemas/index.d.ts +0 -0
- /package/lib/typescript/{capabilities → src/capabilities}/offer-catalog/src/api/offerCatalogApi.d.ts +0 -0
- /package/lib/typescript/{capabilities → src/capabilities}/offer-catalog/src/index.d.ts +0 -0
- /package/lib/typescript/{capabilities → src/capabilities}/offer-catalog/src/types/offerCatalogSchema.d.ts +0 -0
- /package/lib/typescript/{capabilities → src/capabilities}/offer-catalog/src/utils/arrayToMarkdownList.d.ts +0 -0
- /package/lib/typescript/{capabilities → src/capabilities}/offer-catalog/src/utils/contextUtil.d.ts +0 -0
- /package/lib/typescript/{capabilities → src/capabilities}/offer-catalog/src/utils/errorUtil.d.ts +0 -0
- /package/lib/typescript/{capabilities → src/capabilities}/offer-catalog/src/utils/formatUtils.d.ts +0 -0
- /package/lib/typescript/{capabilities → src/capabilities}/offer-catalog/src/utils/getOfferUrl.d.ts +0 -0
- /package/lib/typescript/{capabilities → src/capabilities}/offer-catalog/src/utils/stats/formatters/annualFee.d.ts +0 -0
- /package/lib/typescript/{capabilities → src/capabilities}/offer-catalog/src/utils/stats/formatters/boolean.d.ts +0 -0
- /package/lib/typescript/{capabilities → src/capabilities}/offer-catalog/src/utils/stats/formatters/boolean.spec.d.ts +0 -0
- /package/lib/typescript/{capabilities → src/capabilities}/offer-catalog/src/utils/stats/formatters/common.d.ts +0 -0
- /package/lib/typescript/{capabilities → src/capabilities}/offer-catalog/src/utils/stats/formatters/common.spec.d.ts +0 -0
- /package/lib/typescript/{capabilities → src/capabilities}/offer-catalog/src/utils/stats/formatters/creditBureaus.d.ts +0 -0
- /package/lib/typescript/{capabilities → src/capabilities}/offer-catalog/src/utils/stats/formatters/creditBureaus.spec.d.ts +0 -0
- /package/lib/typescript/{capabilities → src/capabilities}/offer-catalog/src/utils/stats/formatters/currency.d.ts +0 -0
- /package/lib/typescript/{capabilities → src/capabilities}/offer-catalog/src/utils/stats/formatters/currencyOrBasis.d.ts +0 -0
- /package/lib/typescript/{capabilities → src/capabilities}/offer-catalog/src/utils/stats/formatters/currencyOrBasis.spec.d.ts +0 -0
- /package/lib/typescript/{capabilities → src/capabilities}/offer-catalog/src/utils/stats/formatters/freeTrialDays.d.ts +0 -0
- /package/lib/typescript/{capabilities → src/capabilities}/offer-catalog/src/utils/stats/formatters/freeTrialDays.spec.d.ts +0 -0
- /package/lib/typescript/{capabilities → src/capabilities}/offer-catalog/src/utils/stats/formatters/fromListStringWithAnd.d.ts +0 -0
- /package/lib/typescript/{capabilities → src/capabilities}/offer-catalog/src/utils/stats/formatters/fromListStringWithAnd.spec.d.ts +0 -0
- /package/lib/typescript/{capabilities → src/capabilities}/offer-catalog/src/utils/stats/formatters/index.d.ts +0 -0
- /package/lib/typescript/{capabilities → src/capabilities}/offer-catalog/src/utils/stats/formatters/monthlyOrAnnualCurrency.d.ts +0 -0
- /package/lib/typescript/{capabilities → src/capabilities}/offer-catalog/src/utils/stats/formatters/monthlyOrAnnualCurrency.spec.d.ts +0 -0
- /package/lib/typescript/{capabilities → src/capabilities}/offer-catalog/src/utils/stats/formatters/percentage.d.ts +0 -0
- /package/lib/typescript/{capabilities → src/capabilities}/offer-catalog/src/utils/stats/formatters/percentage.spec.d.ts +0 -0
- /package/lib/typescript/{capabilities → src/capabilities}/offer-catalog/src/utils/stats/formatters/purchaseApr.d.ts +0 -0
- /package/lib/typescript/{capabilities → src/capabilities}/offer-catalog/src/utils/stats/formatters/purchaseApr.spec.d.ts +0 -0
- /package/lib/typescript/{capabilities → src/capabilities}/offer-catalog/src/utils/stats/formatters/rangeCurrency.d.ts +0 -0
- /package/lib/typescript/{capabilities → src/capabilities}/offer-catalog/src/utils/stats/formatters/rangeCurrencyByTime.d.ts +0 -0
- /package/lib/typescript/{capabilities → src/capabilities}/offer-catalog/src/utils/stats/formatters/rangeCurrencyByTime.spec.d.ts +0 -0
- /package/lib/typescript/{capabilities → src/capabilities}/offer-catalog/src/utils/stats/formatters/rangeCurrencyUnabbreviated.d.ts +0 -0
- /package/lib/typescript/{capabilities → src/capabilities}/offer-catalog/src/utils/stats/formatters/rangeCurrencyUnabbreviated.spec.d.ts +0 -0
- /package/lib/typescript/{capabilities → src/capabilities}/offer-catalog/src/utils/stats/formatters/rangeMonths.d.ts +0 -0
- /package/lib/typescript/{capabilities → src/capabilities}/offer-catalog/src/utils/stats/formatters/rangeMonths.spec.d.ts +0 -0
- /package/lib/typescript/{capabilities → src/capabilities}/offer-catalog/src/utils/stats/formatters/rangePercent.d.ts +0 -0
- /package/lib/typescript/{capabilities → src/capabilities}/offer-catalog/src/utils/stats/formatters/rangePercent.spec.d.ts +0 -0
- /package/lib/typescript/{capabilities → src/capabilities}/offer-catalog/src/utils/stats/formatters/recommendedCredit.d.ts +0 -0
- /package/lib/typescript/{capabilities → src/capabilities}/offer-catalog/src/utils/stats/formatters/recommendedCredit.spec.d.ts +0 -0
- /package/lib/typescript/{capabilities → src/capabilities}/offer-catalog/src/utils/stats/formatters/rewardsDisplay.d.ts +0 -0
- /package/lib/typescript/{capabilities → src/capabilities}/offer-catalog/src/utils/stats/formatters/rewardsDisplay.spec.d.ts +0 -0
- /package/lib/typescript/{capabilities → src/capabilities}/offer-catalog/src/utils/stats/index.d.ts +0 -0
- /package/lib/typescript/{capabilities → src/capabilities}/offer-catalog/src/utils/stats/types.d.ts +0 -0
- /package/lib/typescript/{capabilities → src/capabilities}/offers/pipeline/src/sources/ratetables/offer-catalog/types/index.d.ts +0 -0
- /package/lib/typescript/{capabilities → src/capabilities}/offers/pipeline/src/sources/ratetables/offer-catalog/types/oas/offer-catalog.d.ts +0 -0
- /package/lib/typescript/{capabilities → src/capabilities}/offers/pipeline/src/sources/ratetables/types/index.d.ts +0 -0
- /package/lib/typescript/{capabilities → src/capabilities}/ui/elements/src/components/MarkdownText/Abbreviation.d.ts +0 -0
- /package/lib/typescript/{capabilities → src/capabilities}/ui/elements/src/components/MarkdownText/markdownPreprocessor.d.ts +0 -0
- /package/lib/typescript/{capabilities → src/capabilities}/ui/elements/src/components/index.d.ts +0 -0
- /package/lib/typescript/{capabilities → src/capabilities}/ui/elements/src/components/thumbor/index.d.ts +0 -0
- /package/lib/typescript/{capabilities → src/capabilities}/ui/elements/src/components/thumbor/useSvgUriViewBox.d.ts +0 -0
- /package/lib/typescript/{capabilities → src/capabilities}/ui/elements/src/components/thumbor/useSvgUriViewBox.test.d.ts +0 -0
- /package/lib/typescript/{capabilities → src/capabilities}/ui/elements/src/index.d.ts +0 -0
- /package/lib/typescript/{capabilities → src/capabilities}/ui/elements/src/offerCardAttributes.d.ts +0 -0
- /package/lib/typescript/{config → src/config}/mocks/cnfContext.d.ts +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["get","formatPercentage","fromPercentageStat","offer","label","fieldName","value","undefined","content"],"sourceRoot":"../../../../../../../../src","sources":["capabilities/offer-catalog/src/utils/stats/formatters/percentage.ts"],"mappings":"AACA,SAASA,GAAG,QAAQ,QAAQ;AAG5B,SAASC,gBAAgB,QAAQ,mBAAmB;AAQpD,OAAO,MAAMC,kBAAkB,GAC7BC,KAAgB,IACjB,CAAC;EAAEC,KAAK;EAAEC;AAA0B,CAAC,KAAuB;EAC3D,MAAMC,KAAK,GAAGN,GAAG,CAAqBG,KAAK,EAAEE,SAAS,EAAEE,SAAS,CAAC;EAClE,MAAMC,OAAO,GAAGP,gBAAgB,CAACK,KAAK,CAAC;EAEvC,OAAO;IACNF,KAAK;IACLI;EACD,CAAC;AACF,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
// import type { BaseOffer } from '@capabilities/offer-catalog'
|
|
2
|
+
// import { describe, expect, it } from 'vitest'
|
|
3
|
+
// import { fromPercentageStat } from './percentage'
|
|
4
|
+
|
|
5
|
+
// describe('fromPercentageStat function', () => {
|
|
6
|
+
// it.each([
|
|
7
|
+
// [{}, 'Interest Rate', 'N/A'],
|
|
8
|
+
// [{ interestRate: undefined }, 'Interest Rate', 'N/A'],
|
|
9
|
+
// [{ interestRate: null }, 'Interest Rate', 'N/A'],
|
|
10
|
+
// [{ interestRate: 0 }, 'Interest Rate', '0%'],
|
|
11
|
+
// [{ interestRate: 50 }, 'Interest Rate', '0.5%'],
|
|
12
|
+
// [{ interestRate: 100 }, 'Interest Rate', '1%'],
|
|
13
|
+
// [{ interestRate: 123 }, 'Interest Rate', '1.23%'],
|
|
14
|
+
// [{ interestRate: 500 }, 'Interest Rate', '5%'],
|
|
15
|
+
// [{ interestRate: 750 }, 'Interest Rate', '7.5%'],
|
|
16
|
+
// [{ interestRate: 1000 }, 'Interest Rate', '10%'],
|
|
17
|
+
// [{ interestRate: 1234 }, 'Interest Rate', '12.34%'],
|
|
18
|
+
// [{ interestRate: 10000 }, 'Interest Rate', '100%'],
|
|
19
|
+
// ])('should return correct content for offer %j', (offer, label, expectedContent) => {
|
|
20
|
+
// const result = fromPercentageStat(offer as BaseOffer)({
|
|
21
|
+
// format: 'percentage',
|
|
22
|
+
// label,
|
|
23
|
+
// fieldName: 'interestRate',
|
|
24
|
+
// })
|
|
25
|
+
// expect(result).toEqual({
|
|
26
|
+
// label,
|
|
27
|
+
// content: expectedContent,
|
|
28
|
+
// })
|
|
29
|
+
// })
|
|
30
|
+
// })
|
|
31
|
+
//# sourceMappingURL=percentage.spec.js.map
|
package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/percentage.spec.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../../../../../../src","sources":["capabilities/offer-catalog/src/utils/stats/formatters/percentage.spec.ts"],"mappings":"AAAA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","ignoreList":[]}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { get } from "radash";
|
|
2
|
+
import { P, match } from "ts-pattern";
|
|
3
|
+
import { formatRange } from "../../formatUtils";
|
|
4
|
+
/**
|
|
5
|
+
* Determine the content of the purchaseApr stat
|
|
6
|
+
* @param params {purchaseAprValue, minPurchaseAprValue, maxPurchaseAprValue}
|
|
7
|
+
* @returns {string}
|
|
8
|
+
* @example
|
|
9
|
+
* determineContent({ purchaseAprValue: '10%', minPurchaseAprValue: null, maxPurchaseAprValue: null })
|
|
10
|
+
* // returns '10%'
|
|
11
|
+
* determineContent({ purchaseAprValue: null, minPurchaseAprValue: 5, maxPurchaseAprValue: 10 })
|
|
12
|
+
* // returns '5% - 10%'
|
|
13
|
+
* determineContent({ purchaseAprValue: null, minPurchaseAprValue: null, maxPurchaseAprValue: null })
|
|
14
|
+
* // returns 'See Terms'
|
|
15
|
+
*/
|
|
16
|
+
const determineContent = ({
|
|
17
|
+
purchaseAprValue,
|
|
18
|
+
minPurchaseAprValue,
|
|
19
|
+
maxPurchaseAprValue
|
|
20
|
+
}) => {
|
|
21
|
+
return match({
|
|
22
|
+
purchaseAprValue,
|
|
23
|
+
minPurchaseAprValue,
|
|
24
|
+
maxPurchaseAprValue
|
|
25
|
+
}).with({
|
|
26
|
+
purchaseAprValue: P.not(undefined)
|
|
27
|
+
}, ({
|
|
28
|
+
purchaseAprValue
|
|
29
|
+
}) => purchaseAprValue).with({
|
|
30
|
+
minPurchaseAprValue: P.not(undefined),
|
|
31
|
+
maxPurchaseAprValue: P.not(undefined)
|
|
32
|
+
}, ({
|
|
33
|
+
minPurchaseAprValue,
|
|
34
|
+
maxPurchaseAprValue
|
|
35
|
+
}) => formatRange(minPurchaseAprValue, maxPurchaseAprValue, "percentage")).otherwise(() => "See Terms");
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Determine the label of the purchaseApr stat
|
|
40
|
+
* @param aprType {string}
|
|
41
|
+
* @param label {string}
|
|
42
|
+
* @returns {string}
|
|
43
|
+
*/
|
|
44
|
+
const determineLabel = (aprType, label) => {
|
|
45
|
+
return match(aprType).with("variable", () => "Variable APR:").with("fixed", () => "Fixed APR:").otherwise(() => label);
|
|
46
|
+
};
|
|
47
|
+
export const purchaseApr = offer => ({
|
|
48
|
+
label: defaultLabel,
|
|
49
|
+
purchaseAprTextField,
|
|
50
|
+
minPurchaseAprField,
|
|
51
|
+
maxPurchaseAprField,
|
|
52
|
+
aprTypeField
|
|
53
|
+
}) => {
|
|
54
|
+
const purchaseAprValue = get(offer, purchaseAprTextField);
|
|
55
|
+
const minPurchaseAprValue = get(offer, minPurchaseAprField);
|
|
56
|
+
const maxPurchaseAprValue = get(offer, maxPurchaseAprField);
|
|
57
|
+
const aprTypeValue = get(offer, aprTypeField);
|
|
58
|
+
const content = determineContent({
|
|
59
|
+
purchaseAprValue,
|
|
60
|
+
minPurchaseAprValue,
|
|
61
|
+
maxPurchaseAprValue
|
|
62
|
+
}).replace(/ Variable APR| Fixed APR/g, "");
|
|
63
|
+
const label = determineLabel(aprTypeValue, defaultLabel);
|
|
64
|
+
return {
|
|
65
|
+
label,
|
|
66
|
+
content
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
//# sourceMappingURL=purchaseApr.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["get","P","match","formatRange","determineContent","purchaseAprValue","minPurchaseAprValue","maxPurchaseAprValue","with","not","undefined","otherwise","determineLabel","aprType","label","purchaseApr","offer","defaultLabel","purchaseAprTextField","minPurchaseAprField","maxPurchaseAprField","aprTypeField","aprTypeValue","content","replace"],"sourceRoot":"../../../../../../../../src","sources":["capabilities/offer-catalog/src/utils/stats/formatters/purchaseApr.ts"],"mappings":"AAAA,SAASA,GAAG,QAAQ,QAAQ;AAC5B,SAASC,CAAC,EAAEC,KAAK,QAAQ,YAAY;AAErC,SAASC,WAAW,QAAQ,mBAAmB;AAY/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,gBAAgB,GAAGA,CAAC;EACzBC,gBAAgB;EAChBC,mBAAmB;EACnBC;AAKD,CAAC,KAAK;EACL,OAAOL,KAAK,CAAC;IAAEG,gBAAgB;IAAEC,mBAAmB;IAAEC;EAAoB,CAAC,CAAC,CAC1EC,IAAI,CACJ;IAAEH,gBAAgB,EAAEJ,CAAC,CAACQ,GAAG,CAACC,SAAS;EAAE,CAAC,EACtC,CAAC;IAAEL;EAAiB,CAAC,KAAKA,gBAC3B,CAAC,CACAG,IAAI,CACJ;IACCF,mBAAmB,EAAEL,CAAC,CAACQ,GAAG,CAACC,SAAS,CAAC;IACrCH,mBAAmB,EAAEN,CAAC,CAACQ,GAAG,CAACC,SAAS;EACrC,CAAC,EACD,CAAC;IAAEJ,mBAAmB;IAAEC;EAAoB,CAAC,KAC5CJ,WAAW,CAACG,mBAAmB,EAAEC,mBAAmB,EAAE,YAAY,CACpE,CAAC,CACAI,SAAS,CAAC,MAAM,WAAW,CAAC;AAC/B,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,cAAc,GAAGA,CAACC,OAAe,EAAEC,KAAa,KAAK;EAC1D,OAAOZ,KAAK,CAACW,OAAO,CAAC,CACnBL,IAAI,CAAC,UAAU,EAAE,MAAM,eAAe,CAAC,CACvCA,IAAI,CAAC,OAAO,EAAE,MAAM,YAAY,CAAC,CACjCG,SAAS,CAAC,MAAMG,KAAK,CAAC;AACzB,CAAC;AAED,OAAO,MAAMC,WAAW,GACtBC,KAAgB,IACjB,CAAC;EACAF,KAAK,EAAEG,YAAY;EACnBC,oBAAoB;EACpBC,mBAAmB;EACnBC,mBAAmB;EACnBC;AACgB,CAAC,KAAuB;EACxC,MAAMhB,gBAAgB,GAAGL,GAAG,CAASgB,KAAK,EAAEE,oBAAoB,CAAC;EACjE,MAAMZ,mBAAmB,GAAGN,GAAG,CAASgB,KAAK,EAAEG,mBAAmB,CAAC;EACnE,MAAMZ,mBAAmB,GAAGP,GAAG,CAASgB,KAAK,EAAEI,mBAAmB,CAAC;EACnE,MAAME,YAAY,GAAGtB,GAAG,CAASgB,KAAK,EAAEK,YAAY,CAAC;EAErD,MAAME,OAAO,GAAGnB,gBAAgB,CAAC;IAChCC,gBAAgB;IAChBC,mBAAmB;IACnBC;EACD,CAAC,CAAC,CAACiB,OAAO,CAAC,2BAA2B,EAAE,EAAE,CAAC;EAE3C,MAAMV,KAAK,GAAGF,cAAc,CAACU,YAAY,EAAEL,YAAY,CAAC;EAExD,OAAO;IACNH,KAAK;IACLS;EACD,CAAC;AACF,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
// import type { BaseOffer } from '@capabilities/offer-catalog'
|
|
2
|
+
// import { describe, expect, it } from 'vitest'
|
|
3
|
+
// import { purchaseApr } from './purchaseApr'
|
|
4
|
+
|
|
5
|
+
// describe('purchaseApr', () => {
|
|
6
|
+
// it.each([
|
|
7
|
+
// [
|
|
8
|
+
// {
|
|
9
|
+
// purchaseApr: '10%',
|
|
10
|
+
// minPurchaseApr: null,
|
|
11
|
+
// maxPurchaseApr: null,
|
|
12
|
+
// aprType: 'fixed',
|
|
13
|
+
// },
|
|
14
|
+
// 'Fixed APR:',
|
|
15
|
+
// '10%',
|
|
16
|
+
// ],
|
|
17
|
+
// [
|
|
18
|
+
// {
|
|
19
|
+
// purchaseApr: '10%',
|
|
20
|
+
// minPurchaseApr: null,
|
|
21
|
+
// maxPurchaseApr: null,
|
|
22
|
+
// aprType: 'variable',
|
|
23
|
+
// },
|
|
24
|
+
// 'Variable APR:',
|
|
25
|
+
// '10%',
|
|
26
|
+
// ],
|
|
27
|
+
// [
|
|
28
|
+
// {
|
|
29
|
+
// purchaseApr: null,
|
|
30
|
+
// minPurchaseApr: 500,
|
|
31
|
+
// maxPurchaseApr: 1000,
|
|
32
|
+
// aprType: 'fixed',
|
|
33
|
+
// },
|
|
34
|
+
// 'Fixed APR:',
|
|
35
|
+
// '5% - 10%',
|
|
36
|
+
// ],
|
|
37
|
+
// [
|
|
38
|
+
// {
|
|
39
|
+
// purchaseApr: null,
|
|
40
|
+
// minPurchaseApr: null,
|
|
41
|
+
// maxPurchaseApr: null,
|
|
42
|
+
// aprType: 'variable',
|
|
43
|
+
// },
|
|
44
|
+
// 'Variable APR:',
|
|
45
|
+
// 'See Terms',
|
|
46
|
+
// ],
|
|
47
|
+
// ])('returns %s when purchaseApr is %s', (offer, expected, content) => {
|
|
48
|
+
// const result = purchaseApr({
|
|
49
|
+
// ...offer,
|
|
50
|
+
// purchaseApr: offer.purchaseApr ?? undefined,
|
|
51
|
+
// minPurchaseApr: offer.minPurchaseApr ?? undefined,
|
|
52
|
+
// maxPurchaseApr: offer.maxPurchaseApr ?? undefined,
|
|
53
|
+
// } as unknown as BaseOffer)({
|
|
54
|
+
// format: 'purchaseApr',
|
|
55
|
+
// label: 'Purchase APR',
|
|
56
|
+
// purchaseAprTextField: 'purchaseApr',
|
|
57
|
+
// minPurchaseAprField: 'minPurchaseApr',
|
|
58
|
+
// maxPurchaseAprField: 'maxPurchaseApr',
|
|
59
|
+
// aprTypeField: 'aprType',
|
|
60
|
+
// })
|
|
61
|
+
|
|
62
|
+
// expect(result).toEqual({
|
|
63
|
+
// label: expected,
|
|
64
|
+
// content: content,
|
|
65
|
+
// })
|
|
66
|
+
// })
|
|
67
|
+
// })
|
|
68
|
+
//# sourceMappingURL=purchaseApr.spec.js.map
|
package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/purchaseApr.spec.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../../../../../../src","sources":["capabilities/offer-catalog/src/utils/stats/formatters/purchaseApr.spec.ts"],"mappings":"AAAA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA","ignoreList":[]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { get } from "radash";
|
|
2
|
+
import { formatRange } from "../../formatUtils";
|
|
3
|
+
export const fromRangeCurrencyStat = offer => ({
|
|
4
|
+
label,
|
|
5
|
+
initialFieldName,
|
|
6
|
+
endFieldName
|
|
7
|
+
}) => {
|
|
8
|
+
const initialValue = get(offer, initialFieldName, undefined);
|
|
9
|
+
const endValue = get(offer, endFieldName, undefined);
|
|
10
|
+
const content = formatRange(initialValue, endValue, "amount");
|
|
11
|
+
return {
|
|
12
|
+
label,
|
|
13
|
+
content
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=rangeCurrency.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["get","formatRange","fromRangeCurrencyStat","offer","label","initialFieldName","endFieldName","initialValue","undefined","endValue","content"],"sourceRoot":"../../../../../../../../src","sources":["capabilities/offer-catalog/src/utils/stats/formatters/rangeCurrency.ts"],"mappings":"AACA,SAASA,GAAG,QAAQ,QAAQ;AAG5B,SAASC,WAAW,QAAQ,mBAAmB;AAS/C,OAAO,MAAMC,qBAAqB,GAChCC,KAAgB,IACjB,CAAC;EACAC,KAAK;EACLC,gBAAgB;EAChBC;AACkB,CAAC,KAAuB;EAC1C,MAAMC,YAAY,GAAGP,GAAG,CACvBG,KAAK,EACLE,gBAAgB,EAChBG,SACD,CAAC;EACD,MAAMC,QAAQ,GAAGT,GAAG,CAAqBG,KAAK,EAAEG,YAAY,EAAEE,SAAS,CAAC;EAExE,MAAME,OAAO,GAAGT,WAAW,CAACM,YAAY,EAAEE,QAAQ,EAAE,QAAQ,CAAC;EAE7D,OAAO;IACNL,KAAK;IACLM;EACD,CAAC;AACF,CAAC","ignoreList":[]}
|
package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/rangeCurrencyByTime.js
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { get } from "radash";
|
|
2
|
+
import { formatRange } from "../../formatUtils";
|
|
3
|
+
export const fromRangeCurrencyByTimeStat = offer => ({
|
|
4
|
+
label,
|
|
5
|
+
initialFieldNameByMonths,
|
|
6
|
+
endFieldNameByMonths,
|
|
7
|
+
initialFieldNameByYears,
|
|
8
|
+
endFieldNameByYears
|
|
9
|
+
}) => {
|
|
10
|
+
const initialValueByMonths = get(offer, initialFieldNameByMonths);
|
|
11
|
+
const endValueByMonths = get(offer, endFieldNameByMonths);
|
|
12
|
+
const initialValueByYears = get(offer, initialFieldNameByYears);
|
|
13
|
+
const endValueByYears = get(offer, endFieldNameByYears);
|
|
14
|
+
const values = [initialValueByMonths, endValueByMonths, initialValueByYears, endValueByYears];
|
|
15
|
+
const definedValues = values.filter(value => value !== undefined);
|
|
16
|
+
const definedValuesCount = definedValues.length;
|
|
17
|
+
if (definedValuesCount < 2) {
|
|
18
|
+
return {
|
|
19
|
+
label,
|
|
20
|
+
content: "N/A"
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
if (definedValues.every(value => value === 0)) {
|
|
24
|
+
return {
|
|
25
|
+
label,
|
|
26
|
+
content: "FREE"
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
const hasMonthlyValues = initialValueByMonths || endValueByMonths;
|
|
30
|
+
const initialValue = hasMonthlyValues ? initialValueByMonths : initialValueByYears;
|
|
31
|
+
const endValue = hasMonthlyValues ? endValueByMonths : endValueByYears;
|
|
32
|
+
const timeUnit = hasMonthlyValues ? "/ Month" : "/ Year";
|
|
33
|
+
const formatType = hasMonthlyValues ? "amount" : "percentage";
|
|
34
|
+
const content = formatRange(initialValue, endValue, formatType);
|
|
35
|
+
return {
|
|
36
|
+
label,
|
|
37
|
+
content: `${content} ${timeUnit}`
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
//# sourceMappingURL=rangeCurrencyByTime.js.map
|
package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/rangeCurrencyByTime.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["get","formatRange","fromRangeCurrencyByTimeStat","offer","label","initialFieldNameByMonths","endFieldNameByMonths","initialFieldNameByYears","endFieldNameByYears","initialValueByMonths","endValueByMonths","initialValueByYears","endValueByYears","values","definedValues","filter","value","undefined","definedValuesCount","length","content","every","hasMonthlyValues","initialValue","endValue","timeUnit","formatType"],"sourceRoot":"../../../../../../../../src","sources":["capabilities/offer-catalog/src/utils/stats/formatters/rangeCurrencyByTime.ts"],"mappings":"AAAA,SAASA,GAAG,QAAQ,QAAQ;AAG5B,SAASC,WAAW,QAAQ,mBAAmB;AAW/C,OAAO,MAAMC,2BAA2B,GACtCC,KAAgB,IACjB,CAAC;EACAC,KAAK;EACLC,wBAAwB;EACxBC,oBAAoB;EACpBC,uBAAuB;EACvBC;AACwB,CAAC,KAAuB;EAChD,MAAMC,oBAAoB,GAAGT,GAAG,CAC/BG,KAAK,EACLE,wBACD,CAAC;EACD,MAAMK,gBAAgB,GAAGV,GAAG,CAC3BG,KAAK,EACLG,oBACD,CAAC;EACD,MAAMK,mBAAmB,GAAGX,GAAG,CAC9BG,KAAK,EACLI,uBACD,CAAC;EACD,MAAMK,eAAe,GAAGZ,GAAG,CAAqBG,KAAK,EAAEK,mBAAmB,CAAC;EAE3E,MAAMK,MAAM,GAAG,CACdJ,oBAAoB,EACpBC,gBAAgB,EAChBC,mBAAmB,EACnBC,eAAe,CACf;EAED,MAAME,aAAa,GAAGD,MAAM,CAACE,MAAM,CAAEC,KAAK,IAAKA,KAAK,KAAKC,SAAS,CAAC;EACnE,MAAMC,kBAAkB,GAAGJ,aAAa,CAACK,MAAM;EAE/C,IAAID,kBAAkB,GAAG,CAAC,EAAE;IAC3B,OAAO;MAAEd,KAAK;MAAEgB,OAAO,EAAE;IAAM,CAAC;EACjC;EAEA,IAAIN,aAAa,CAACO,KAAK,CAAEL,KAAK,IAAKA,KAAK,KAAK,CAAC,CAAC,EAAE;IAChD,OAAO;MAAEZ,KAAK;MAAEgB,OAAO,EAAE;IAAO,CAAC;EAClC;EAEA,MAAME,gBAAgB,GAAGb,oBAAoB,IAAIC,gBAAgB;EAEjE,MAAMa,YAAY,GAAGD,gBAAgB,GAClCb,oBAAoB,GACpBE,mBAAmB;EACtB,MAAMa,QAAQ,GAAGF,gBAAgB,GAAGZ,gBAAgB,GAAGE,eAAe;EACtE,MAAMa,QAAQ,GAAGH,gBAAgB,GAAG,SAAS,GAAG,QAAQ;EACxD,MAAMI,UAAU,GAAGJ,gBAAgB,GAAG,QAAQ,GAAG,YAAY;EAE7D,MAAMF,OAAO,GAAGnB,WAAW,CAACsB,YAAY,EAAEC,QAAQ,EAAEE,UAAU,CAAC;EAE/D,OAAO;IACNtB,KAAK;IACLgB,OAAO,EAAE,GAAGA,OAAO,IAAIK,QAAQ;EAChC,CAAC;AACF,CAAC","ignoreList":[]}
|
package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/rangeCurrencyByTime.spec.js
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
// import type { BaseOffer } from '@capabilities/offer-catalog'
|
|
2
|
+
// import { fromRangeCurrencyByTimeStat } from './rangeCurrencyByTime'
|
|
3
|
+
|
|
4
|
+
// describe('fromRangeCurrencyByTimeStat', () => {
|
|
5
|
+
// it.each([
|
|
6
|
+
// // Test case: All values undefined
|
|
7
|
+
// [{}, 'Price Range', 'N/A'],
|
|
8
|
+
// // Test case: All values zero
|
|
9
|
+
// [
|
|
10
|
+
// {
|
|
11
|
+
// initialPriceByMonth: 0,
|
|
12
|
+
// endPriceByMonth: 0,
|
|
13
|
+
// initialPriceByYear: 0,
|
|
14
|
+
// endPriceByYear: 0,
|
|
15
|
+
// },
|
|
16
|
+
// 'Price Range',
|
|
17
|
+
// 'FREE',
|
|
18
|
+
// ],
|
|
19
|
+
// [
|
|
20
|
+
// {
|
|
21
|
+
// initialPriceByYear: 0,
|
|
22
|
+
// endPriceByYear: 0,
|
|
23
|
+
// },
|
|
24
|
+
// 'Price Range',
|
|
25
|
+
// 'FREE',
|
|
26
|
+
// ],
|
|
27
|
+
// [{ initialPriceByMonth: 1000 }, 'Price Range', 'N/A'],
|
|
28
|
+
// [{ endPriceByMonth: 2000 }, 'Price Range', 'N/A'],
|
|
29
|
+
// [
|
|
30
|
+
// { initialPriceByMonth: 1000, endPriceByMonth: 2000 },
|
|
31
|
+
// 'Price Range',
|
|
32
|
+
// '$10 - $20 / Month',
|
|
33
|
+
// ],
|
|
34
|
+
// [{ initialPriceByYear: 500 }, 'Discount Range', 'N/A'],
|
|
35
|
+
// [{ endPriceByYear: 1500 }, 'Discount Range', 'N/A'],
|
|
36
|
+
// [
|
|
37
|
+
// { initialPriceByYear: 500, endPriceByYear: 1500 },
|
|
38
|
+
// 'Discount Range',
|
|
39
|
+
// '5% - 15% / Year',
|
|
40
|
+
// ],
|
|
41
|
+
// [
|
|
42
|
+
// {
|
|
43
|
+
// initialPriceByMonth: 1000,
|
|
44
|
+
// endPriceByMonth: 2000,
|
|
45
|
+
// initialPriceByYear: 500,
|
|
46
|
+
// endPriceByYear: 1500,
|
|
47
|
+
// },
|
|
48
|
+
// 'Price Range',
|
|
49
|
+
// '$10 - $20 / Month',
|
|
50
|
+
// ],
|
|
51
|
+
// [{ initialPriceByMonth: 0 }, 'Price Range', 'N/A'],
|
|
52
|
+
// [{ initialPriceByYear: 0 }, 'Price Range', 'N/A'],
|
|
53
|
+
// ])(
|
|
54
|
+
// 'should return the correct content for offer %j',
|
|
55
|
+
// (offer, label, expectedContent) => {
|
|
56
|
+
// const result = fromRangeCurrencyByTimeStat(offer as BaseOffer)({
|
|
57
|
+
// format: 'rangeCurrencyByTime',
|
|
58
|
+
// label,
|
|
59
|
+
// initialFieldNameByMonths: 'initialPriceByMonth',
|
|
60
|
+
// endFieldNameByMonths: 'endPriceByMonth',
|
|
61
|
+
// initialFieldNameByYears: 'initialPriceByYear',
|
|
62
|
+
// endFieldNameByYears: 'endPriceByYear',
|
|
63
|
+
// })
|
|
64
|
+
// expect(result).toEqual({
|
|
65
|
+
// label,
|
|
66
|
+
// content: expectedContent,
|
|
67
|
+
// })
|
|
68
|
+
// },
|
|
69
|
+
// )
|
|
70
|
+
// })
|
|
71
|
+
//# sourceMappingURL=rangeCurrencyByTime.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../../../../../../src","sources":["capabilities/offer-catalog/src/utils/stats/formatters/rangeCurrencyByTime.spec.ts"],"mappings":"AAAA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","ignoreList":[]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { get } from "radash";
|
|
2
|
+
import { formatRange } from "../../formatUtils";
|
|
3
|
+
export const fromRangeCurrencyUnabbreviatedStat = offer => ({
|
|
4
|
+
label,
|
|
5
|
+
initialFieldName,
|
|
6
|
+
endFieldName
|
|
7
|
+
}) => {
|
|
8
|
+
const initialValue = get(offer, initialFieldName, undefined);
|
|
9
|
+
const endValue = get(offer, endFieldName, undefined);
|
|
10
|
+
const content = formatRange(initialValue, endValue, "amount", "unabbreviated");
|
|
11
|
+
return {
|
|
12
|
+
label,
|
|
13
|
+
content
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=rangeCurrencyUnabbreviated.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["get","formatRange","fromRangeCurrencyUnabbreviatedStat","offer","label","initialFieldName","endFieldName","initialValue","undefined","endValue","content"],"sourceRoot":"../../../../../../../../src","sources":["capabilities/offer-catalog/src/utils/stats/formatters/rangeCurrencyUnabbreviated.ts"],"mappings":"AAAA,SAASA,GAAG,QAAQ,QAAQ;AAE5B,SAASC,WAAW,QAAQ,mBAAmB;AAU/C,OAAO,MAAMC,kCAAkC,GAC7CC,KAAgB,IACjB,CAAC;EACAC,KAAK;EACLC,gBAAgB;EAChBC;AAC+B,CAAC,KAAuB;EACvD,MAAMC,YAAY,GAAGP,GAAG,CACvBG,KAAK,EACLE,gBAAgB,EAChBG,SACD,CAAC;EACD,MAAMC,QAAQ,GAAGT,GAAG,CAAqBG,KAAK,EAAEG,YAAY,EAAEE,SAAS,CAAC;EAExE,MAAME,OAAO,GAAGT,WAAW,CAC1BM,YAAY,EACZE,QAAQ,EACR,QAAQ,EACR,eACD,CAAC;EAED,OAAO;IACNL,KAAK;IACLM;EACD,CAAC;AACF,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// import type { BaseOffer } from '@capabilities/offer-catalog'
|
|
2
|
+
// import { describe, expect, it } from 'vitest'
|
|
3
|
+
// import { fromRangeCurrencyUnabbreviatedStat } from './rangeCurrencyUnabbreviated'
|
|
4
|
+
|
|
5
|
+
// describe('fromRangeCurrencyUnabbreviatedStat', () => {
|
|
6
|
+
// it.each([
|
|
7
|
+
// [{ amountCentsMin: 500, amountCentsMax: 500000 }, 'Amount', '$5 - $5,000'],
|
|
8
|
+
// [{ amountCentsMin: 0, amountCentsMax: 500000 }, 'Amount', 'Up to $5,000'],
|
|
9
|
+
// [{ amountCentsMin: 1, amountCentsMax: 500000 }, 'Amount', 'Up to $5,000'],
|
|
10
|
+
// [{ amountCentsMax: 500000 }, 'Amount', 'N/A'],
|
|
11
|
+
// [{ amountCentsMin: 5000 }, 'Amount', 'N/A'],
|
|
12
|
+
// ])(
|
|
13
|
+
// 'should return correct label and content for offer %j',
|
|
14
|
+
// (offer: unknown, label: string, expectedContent: string) => {
|
|
15
|
+
// const result = fromRangeCurrencyUnabbreviatedStat(offer as BaseOffer)({
|
|
16
|
+
// format: 'rangeCurrencyUnabbreviated',
|
|
17
|
+
// label,
|
|
18
|
+
// initialFieldName: 'amountCentsMin',
|
|
19
|
+
// endFieldName: 'amountCentsMax',
|
|
20
|
+
// })
|
|
21
|
+
// expect(result).toEqual({
|
|
22
|
+
// label: 'Amount',
|
|
23
|
+
// content: expectedContent,
|
|
24
|
+
// })
|
|
25
|
+
// },
|
|
26
|
+
// )
|
|
27
|
+
// })
|
|
28
|
+
//# sourceMappingURL=rangeCurrencyUnabbreviated.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../../../../../../src","sources":["capabilities/offer-catalog/src/utils/stats/formatters/rangeCurrencyUnabbreviated.spec.ts"],"mappings":"AAAA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","ignoreList":[]}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { get } from "radash";
|
|
2
|
+
const formatTermDuration = (months, unit) => {
|
|
3
|
+
if (unit === "years") {
|
|
4
|
+
return (months / 12).toString();
|
|
5
|
+
}
|
|
6
|
+
return months.toString();
|
|
7
|
+
};
|
|
8
|
+
const determineUnit = (startMonths, endMonths) => {
|
|
9
|
+
const isNonZeroDivisibleBy12 = months => months > 0 && months % 12 === 0;
|
|
10
|
+
return isNonZeroDivisibleBy12(startMonths) && isNonZeroDivisibleBy12(endMonths) ? "years" : "months";
|
|
11
|
+
};
|
|
12
|
+
export const fromRangeMonthsStat = offer => ({
|
|
13
|
+
label,
|
|
14
|
+
initialFieldName,
|
|
15
|
+
endFieldName
|
|
16
|
+
}) => {
|
|
17
|
+
const startTermDuration = get(offer, initialFieldName);
|
|
18
|
+
const endTermDuration = get(offer, endFieldName);
|
|
19
|
+
if (typeof startTermDuration === "undefined" || typeof endTermDuration === "undefined" || startTermDuration === 0 && endTermDuration === 0) {
|
|
20
|
+
return {
|
|
21
|
+
label,
|
|
22
|
+
content: "OPEN"
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
if (startTermDuration > endTermDuration) {
|
|
26
|
+
return {
|
|
27
|
+
label,
|
|
28
|
+
content: "Invalid case"
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
const unit = determineUnit(startTermDuration, endTermDuration);
|
|
32
|
+
const startFormatted = formatTermDuration(startTermDuration, unit);
|
|
33
|
+
const endFormatted = formatTermDuration(endTermDuration, unit);
|
|
34
|
+
if (startTermDuration === endTermDuration) {
|
|
35
|
+
const unitLabel = unit === "years" && startFormatted === "1" ? "year" : unit;
|
|
36
|
+
return {
|
|
37
|
+
label,
|
|
38
|
+
content: `${startFormatted} ${unitLabel}`
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
return {
|
|
42
|
+
label,
|
|
43
|
+
content: `${startFormatted} - ${endFormatted} ${unit}`
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
//# sourceMappingURL=rangeMonths.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["get","formatTermDuration","months","unit","toString","determineUnit","startMonths","endMonths","isNonZeroDivisibleBy12","fromRangeMonthsStat","offer","label","initialFieldName","endFieldName","startTermDuration","endTermDuration","content","startFormatted","endFormatted","unitLabel"],"sourceRoot":"../../../../../../../../src","sources":["capabilities/offer-catalog/src/utils/stats/formatters/rangeMonths.ts"],"mappings":"AAAA,SAASA,GAAG,QAAQ,QAAQ;AAW5B,MAAMC,kBAAkB,GAAGA,CAC1BC,MAAc,EACdC,IAAwB,KACZ;EACZ,IAAIA,IAAI,KAAK,OAAO,EAAE;IACrB,OAAO,CAACD,MAAM,GAAG,EAAE,EAAEE,QAAQ,CAAC,CAAC;EAChC;EACA,OAAOF,MAAM,CAACE,QAAQ,CAAC,CAAC;AACzB,CAAC;AAED,MAAMC,aAAa,GAAGA,CACrBC,WAAmB,EACnBC,SAAiB,KACO;EACxB,MAAMC,sBAAsB,GAAIN,MAAc,IAC7CA,MAAM,GAAG,CAAC,IAAIA,MAAM,GAAG,EAAE,KAAK,CAAC;EAChC,OAAOM,sBAAsB,CAACF,WAAW,CAAC,IACzCE,sBAAsB,CAACD,SAAS,CAAC,GAC/B,OAAO,GACP,QAAQ;AACZ,CAAC;AAED,OAAO,MAAME,mBAAmB,GAC9BC,KAAgB,IACjB,CAAC;EACAC,KAAK;EACLC,gBAAgB;EAChBC;AACgB,CAAC,KAAuB;EACxC,MAAMC,iBAAiB,GAAGd,GAAG,CAAqBU,KAAK,EAAEE,gBAAgB,CAAC;EAC1E,MAAMG,eAAe,GAAGf,GAAG,CAAqBU,KAAK,EAAEG,YAAY,CAAC;EAEpE,IACC,OAAOC,iBAAiB,KAAK,WAAW,IACxC,OAAOC,eAAe,KAAK,WAAW,IACrCD,iBAAiB,KAAK,CAAC,IAAIC,eAAe,KAAK,CAAE,EACjD;IACD,OAAO;MAAEJ,KAAK;MAAEK,OAAO,EAAE;IAAO,CAAC;EAClC;EAEA,IAAIF,iBAAiB,GAAGC,eAAe,EAAE;IACxC,OAAO;MAAEJ,KAAK;MAAEK,OAAO,EAAE;IAAe,CAAC;EAC1C;EAEA,MAAMb,IAAI,GAAGE,aAAa,CAACS,iBAAiB,EAAEC,eAAe,CAAC;EAE9D,MAAME,cAAc,GAAGhB,kBAAkB,CAACa,iBAAiB,EAAEX,IAAI,CAAC;EAClE,MAAMe,YAAY,GAAGjB,kBAAkB,CAACc,eAAe,EAAEZ,IAAI,CAAC;EAE9D,IAAIW,iBAAiB,KAAKC,eAAe,EAAE;IAC1C,MAAMI,SAAS,GACdhB,IAAI,KAAK,OAAO,IAAIc,cAAc,KAAK,GAAG,GAAG,MAAM,GAAGd,IAAI;IAC3D,OAAO;MAAEQ,KAAK;MAAEK,OAAO,EAAE,GAAGC,cAAc,IAAIE,SAAS;IAAG,CAAC;EAC5D;EAEA,OAAO;IAAER,KAAK;IAAEK,OAAO,EAAE,GAAGC,cAAc,MAAMC,YAAY,IAAIf,IAAI;EAAG,CAAC;AACzE,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
// import type { BaseOffer } from '@capabilities/offer-catalog'
|
|
2
|
+
// import { describe, expect, it } from 'vitest'
|
|
3
|
+
// import { fromRangeMonthsStat } from './rangeMonths'
|
|
4
|
+
|
|
5
|
+
// describe('fromRangeMonthsStat util', () => {
|
|
6
|
+
// it.each([
|
|
7
|
+
// [{ initialTerm: 0, endTerm: 0 }, 'Term Length', 'OPEN'],
|
|
8
|
+
// [{ initialTerm: 12, endTerm: 12 }, 'Term Length', '1 year'],
|
|
9
|
+
// [{ initialTerm: 18, endTerm: 18 }, 'Term Length', '18 months'],
|
|
10
|
+
// [{ initialTerm: 1, endTerm: 12 }, 'Term Length', '1 - 12 months'],
|
|
11
|
+
// [{ initialTerm: 24, endTerm: 36 }, 'Term Length', '2 - 3 years'],
|
|
12
|
+
// [{ initialTerm: 0, endTerm: 12 }, 'Term Length', '0 - 12 months'],
|
|
13
|
+
// [{ initialTerm: 24, endTerm: 12 }, 'Term Length', 'Invalid case'],
|
|
14
|
+
// ])(
|
|
15
|
+
// 'when initialFieldName is %p and endFieldName is %p, should return %s',
|
|
16
|
+
// (offer: unknown, label: string, expectedContent: string) => {
|
|
17
|
+
// const result = fromRangeMonthsStat(offer as BaseOffer)({
|
|
18
|
+
// label,
|
|
19
|
+
// initialFieldName: 'initialTerm',
|
|
20
|
+
// endFieldName: 'endTerm',
|
|
21
|
+
// format: 'rangeMonths',
|
|
22
|
+
// })
|
|
23
|
+
|
|
24
|
+
// expect(result).toEqual({ label, content: expectedContent })
|
|
25
|
+
// },
|
|
26
|
+
// )
|
|
27
|
+
|
|
28
|
+
// it.each([
|
|
29
|
+
// [{ initialTerm: undefined, endTerm: undefined }, 'Test Label', 'OPEN'],
|
|
30
|
+
// [{ initialTerm: 0, endTerm: undefined }, 'Test Label', 'OPEN'],
|
|
31
|
+
// [{ initialTerm: undefined, endTerm: 12 }, 'Test Label', 'OPEN'],
|
|
32
|
+
// ])(
|
|
33
|
+
// 'should return "-" when initialFieldName or endFieldName is undefined',
|
|
34
|
+
// (offer, label, expectedContent) => {
|
|
35
|
+
// const result = fromRangeMonthsStat(offer as unknown as BaseOffer)({
|
|
36
|
+
// label,
|
|
37
|
+
// initialFieldName: 'initialTerm',
|
|
38
|
+
// endFieldName: 'endTerm',
|
|
39
|
+
// format: 'rangeMonths',
|
|
40
|
+
// })
|
|
41
|
+
// expect(result).toEqual({ label, content: expectedContent })
|
|
42
|
+
// },
|
|
43
|
+
// )
|
|
44
|
+
// })
|
|
45
|
+
//# sourceMappingURL=rangeMonths.spec.js.map
|
package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/rangeMonths.spec.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../../../../../../src","sources":["capabilities/offer-catalog/src/utils/stats/formatters/rangeMonths.spec.ts"],"mappings":"AAAA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","ignoreList":[]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { capitalize, get } from "radash";
|
|
2
|
+
import { formatRange } from "../../formatUtils";
|
|
3
|
+
export const fromRangePercentStat = offer => ({
|
|
4
|
+
label,
|
|
5
|
+
initialFieldName,
|
|
6
|
+
endFieldName,
|
|
7
|
+
dynamicLabelValue
|
|
8
|
+
}) => {
|
|
9
|
+
const initialValue = get(offer, initialFieldName);
|
|
10
|
+
const endValue = get(offer, endFieldName);
|
|
11
|
+
const dynamicValue = get(offer, dynamicLabelValue || "");
|
|
12
|
+
const content = formatRange(initialValue, endValue, "percentage");
|
|
13
|
+
const processedLabel = label.replace(/\$\{(\w+)\}/g, capitalize(`${dynamicValue}`));
|
|
14
|
+
return {
|
|
15
|
+
label: processedLabel,
|
|
16
|
+
content
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=rangePercent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["capitalize","get","formatRange","fromRangePercentStat","offer","label","initialFieldName","endFieldName","dynamicLabelValue","initialValue","endValue","dynamicValue","content","processedLabel","replace"],"sourceRoot":"../../../../../../../../src","sources":["capabilities/offer-catalog/src/utils/stats/formatters/rangePercent.ts"],"mappings":"AACA,SAASA,UAAU,EAAEC,GAAG,QAAQ,QAAQ;AAGxC,SAASC,WAAW,QAAQ,mBAAmB;AAU/C,OAAO,MAAMC,oBAAoB,GAC/BC,KAAgB,IACjB,CAAC;EACAC,KAAK;EACLC,gBAAgB;EAChBC,YAAY;EACZC;AACiB,CAAC,KAAuB;EACzC,MAAMC,YAAY,GAAGR,GAAG,CAASG,KAAK,EAAEE,gBAAgB,CAAC;EACzD,MAAMI,QAAQ,GAAGT,GAAG,CAASG,KAAK,EAAEG,YAAY,CAAC;EACjD,MAAMI,YAAY,GAAGV,GAAG,CAASG,KAAK,EAAEI,iBAAiB,IAAI,EAAE,CAAC;EAEhE,MAAMI,OAAO,GAAGV,WAAW,CAACO,YAAY,EAAEC,QAAQ,EAAE,YAAY,CAAC;EAEjE,MAAMG,cAAc,GAAGR,KAAK,CAACS,OAAO,CACnC,cAAc,EACdd,UAAU,CAAC,GAAGW,YAAY,EAAE,CAC7B,CAAC;EAED,OAAO;IACNN,KAAK,EAAEQ,cAAc;IACrBD;EACD,CAAC;AACF,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
// import type { BaseOffer } from '@capabilities/offer-catalog'
|
|
2
|
+
// import { describe, expect, it } from 'vitest'
|
|
3
|
+
// import { fromRangePercentStat } from './rangePercent'
|
|
4
|
+
|
|
5
|
+
// describe('fromRangePercentStat function', () => {
|
|
6
|
+
// it.each([
|
|
7
|
+
// [{}, 'Interest Rate', 'Interest Rate', 'N/A', undefined],
|
|
8
|
+
// [
|
|
9
|
+
// { minRate: 100, maxRate: 500 },
|
|
10
|
+
// 'Interest Rate',
|
|
11
|
+
// 'Interest Rate',
|
|
12
|
+
// '1% - 5%',
|
|
13
|
+
// undefined,
|
|
14
|
+
// ],
|
|
15
|
+
// [{ minRate: 0, maxRate: 0 }, 'Interest Rate', 'Interest Rate', '0%', undefined],
|
|
16
|
+
// [{ minRate: 150 }, 'Interest Rate', 'Interest Rate', 'N/A', undefined],
|
|
17
|
+
// [{ maxRate: 450 }, 'Interest Rate', 'Interest Rate', 'N/A', undefined],
|
|
18
|
+
// // Test case with dynamic label value
|
|
19
|
+
// [
|
|
20
|
+
// { minRate: 100, maxRate: 500, duration: '12 months' },
|
|
21
|
+
// 'Interest over ${duration}',
|
|
22
|
+
// 'Interest over 12 months',
|
|
23
|
+
// '1% - 5%',
|
|
24
|
+
// 'duration',
|
|
25
|
+
// ],
|
|
26
|
+
// [
|
|
27
|
+
// { minRate: 200, maxRate: 800, term: '6 months' },
|
|
28
|
+
// 'Interest over ${term}',
|
|
29
|
+
// 'Interest over 6 months',
|
|
30
|
+
// '2% - 8%',
|
|
31
|
+
// 'term',
|
|
32
|
+
// ],
|
|
33
|
+
// // Edge case: dynamicValue is not provided in offer
|
|
34
|
+
// [
|
|
35
|
+
// { minRate: 100, maxRate: 500 },
|
|
36
|
+
// 'Interest over ${duration}',
|
|
37
|
+
// 'Interest over Undefined',
|
|
38
|
+
// '1% - 5%',
|
|
39
|
+
// 'duration',
|
|
40
|
+
// ],
|
|
41
|
+
// // Edge case: dynamicValue is a number
|
|
42
|
+
// [
|
|
43
|
+
// { minRate: 100, maxRate: 500, months: 12 },
|
|
44
|
+
// 'Interest over ${months} months',
|
|
45
|
+
// 'Interest over 12 months',
|
|
46
|
+
// '1% - 5%',
|
|
47
|
+
// 'months',
|
|
48
|
+
// ],
|
|
49
|
+
// // Edge case: Both initial and end values undefined
|
|
50
|
+
// [{}, 'Interest Rate', 'Interest Rate', 'N/A', undefined],
|
|
51
|
+
// // Edge case: Both initial and end values null
|
|
52
|
+
// [
|
|
53
|
+
// { minRate: null, maxRate: null },
|
|
54
|
+
// 'Interest Rate',
|
|
55
|
+
// 'Interest Rate',
|
|
56
|
+
// 'N/A',
|
|
57
|
+
// undefined,
|
|
58
|
+
// ],
|
|
59
|
+
// ])(
|
|
60
|
+
// 'should return correct label and content for offer %j',
|
|
61
|
+
// (
|
|
62
|
+
// offer: unknown,
|
|
63
|
+
// label: string,
|
|
64
|
+
// expectedLabel: string,
|
|
65
|
+
// expectedContent: string,
|
|
66
|
+
// dynamicLabelValue?: string,
|
|
67
|
+
// ) => {
|
|
68
|
+
// const result = fromRangePercentStat(offer as BaseOffer)({
|
|
69
|
+
// format: 'rangePercent',
|
|
70
|
+
// label,
|
|
71
|
+
// initialFieldName: 'minRate',
|
|
72
|
+
// endFieldName: 'maxRate',
|
|
73
|
+
// dynamicLabelValue,
|
|
74
|
+
// })
|
|
75
|
+
// expect(result).toEqual({
|
|
76
|
+
// label: expectedLabel,
|
|
77
|
+
// content: expectedContent,
|
|
78
|
+
// })
|
|
79
|
+
// },
|
|
80
|
+
// )
|
|
81
|
+
// })
|
|
82
|
+
//# sourceMappingURL=rangePercent.spec.js.map
|
package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/rangePercent.spec.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../../../../../../src","sources":["capabilities/offer-catalog/src/utils/stats/formatters/rangePercent.spec.ts"],"mappings":"AAAA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","ignoreList":[]}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { get } from "radash";
|
|
2
|
+
import { P, match } from "ts-pattern";
|
|
3
|
+
import { formatStringListWithAnd } from "../../formatUtils";
|
|
4
|
+
const RECOMMENDED_RATINGS = ["limited", "poor", "fair", "good", "excellent"];
|
|
5
|
+
const orderRecommendedRatings = recommendedCreditValue => {
|
|
6
|
+
return recommendedCreditValue.sort((a, b) => RECOMMENDED_RATINGS.indexOf(a) - RECOMMENDED_RATINGS.indexOf(b));
|
|
7
|
+
};
|
|
8
|
+
const hasAllRecommendedRatings = recommendedCreditValue => RECOMMENDED_RATINGS.every(rating => recommendedCreditValue.includes(rating));
|
|
9
|
+
export const recommendedCredit = offer => ({
|
|
10
|
+
label,
|
|
11
|
+
fieldName
|
|
12
|
+
}) => {
|
|
13
|
+
const recommendedCreditValue = get(offer, fieldName);
|
|
14
|
+
const content = match(recommendedCreditValue).with(P.array(), value => hasAllRecommendedRatings(value) ? "Any" : formatStringListWithAnd(orderRecommendedRatings(value))).otherwise(() => "See Terms");
|
|
15
|
+
return {
|
|
16
|
+
label,
|
|
17
|
+
content,
|
|
18
|
+
isHighlighted: true
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=recommendedCredit.js.map
|
package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/recommendedCredit.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["get","P","match","formatStringListWithAnd","RECOMMENDED_RATINGS","orderRecommendedRatings","recommendedCreditValue","sort","a","b","indexOf","hasAllRecommendedRatings","every","rating","includes","recommendedCredit","offer","label","fieldName","content","with","array","value","otherwise","isHighlighted"],"sourceRoot":"../../../../../../../../src","sources":["capabilities/offer-catalog/src/utils/stats/formatters/recommendedCredit.ts"],"mappings":"AACA,SAASA,GAAG,QAAQ,QAAQ;AAC5B,SAASC,CAAC,EAAEC,KAAK,QAAQ,YAAY;AAErC,SAASC,uBAAuB,QAAQ,mBAAmB;AAS3D,MAAMC,mBAAmB,GAAG,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,CAAC;AAE5E,MAAMC,uBAAuB,GAAIC,sBAAgC,IAAK;EACrE,OAAOA,sBAAsB,CAACC,IAAI,CACjC,CAACC,CAAC,EAAEC,CAAC,KAAKL,mBAAmB,CAACM,OAAO,CAACF,CAAC,CAAC,GAAGJ,mBAAmB,CAACM,OAAO,CAACD,CAAC,CACzE,CAAC;AACF,CAAC;AAED,MAAME,wBAAwB,GAAIL,sBAAgC,IACjEF,mBAAmB,CAACQ,KAAK,CAAEC,MAAM,IAChCP,sBAAsB,CAACQ,QAAQ,CAACD,MAAM,CACvC,CAAC;AAEF,OAAO,MAAME,iBAAiB,GAC5BC,KAAgB,IACjB,CAAC;EAAEC,KAAK;EAAEC;AAAiC,CAAC,KAAuB;EAClE,MAAMZ,sBAAsB,GAAGN,GAAG,CAAWgB,KAAK,EAAEE,SAAS,CAAC;EAE9D,MAAMC,OAAO,GAAGjB,KAAK,CAACI,sBAAsB,CAAC,CAC3Cc,IAAI,CAACnB,CAAC,CAACoB,KAAK,CAAC,CAAC,EAAGC,KAAK,IACtBX,wBAAwB,CAACW,KAAK,CAAC,GAC5B,KAAK,GACLnB,uBAAuB,CAACE,uBAAuB,CAACiB,KAAK,CAAC,CAC1D,CAAC,CACAC,SAAS,CAAC,MAAM,WAAW,CAAC;EAE9B,OAAO;IACNN,KAAK;IACLE,OAAO;IACPK,aAAa,EAAE;EAChB,CAAC;AACF,CAAC","ignoreList":[]}
|