@comparaonline/promotion-engine
TypeScript icon, indicating that this package has built-in type declarations

3.0.1 • Public • Published

promotion-engine

Group common behavior and functions for compara promotions

Apply promotion to offer product

VERSION 2.0

import PromotionEngine from '@comparaonline/promotion-engine';

const promotion = getSomePromotion();
const offer = getSomeOffer();
const engine = PromotionEngine.initialize(promotion);
const newProduct = engine.applyToProduct(offer.product);

The code snippet above will return a modified version of the offer product, in order to match a marketplace promotional offer.

promotion and offer object must implement Promotion and Offer interfaces, specified at @comparaonline/offers-models

Package Sidebar

Install

npm i @comparaonline/promotion-engine

Weekly Downloads

3

Version

3.0.1

License

MIT

Unpacked Size

64.2 kB

Total Files

65

Last publish

Collaborators

  • gnavarro
  • dsuarez_compa
  • pfariaz
  • ricardo.sosa
  • suarezcumare
  • fverag
  • comparaonline-dev
  • comparaonlineprivate
  • matotias
  • javierlara1989
  • smurua
  • eseceve
  • pablocompara