0.2.12 • Published 3 years ago

promotion-calculation-engine v0.2.12

Weekly downloads
71
License
MIT
Repository
-
Last release
3 years ago

Promotion Calculation Engine

Utility Promotion Calculation with TypeScript

Installation

Use the node package manager npm to install foobar.

npm install

recommended node version: 12

How Calculation Engine Works

Rules -> Calculate Engine -> Calculated Result

Usage

import { CalculationEngine } from 'promotion-calculation-engine'

const calculationEngine = new CalculationEngine()
const calculateOrder = await calculationEngine.process({
    rules,
    items,
    deliveryAddresses,
    customer: {
      uniqueId: customer.id,
      email: customer.email,
      msisdn: customer.mobileNo,
      isNewCustomer: customer.isNewCustomer,
    } || null,
    usageCounts: [{
       salesRuleId: rule.id,
       total: 10,
       byCustomer: 1
    }],
  }, {
  
})
  

Test and Development

See example rules in test folder

To run all test rules use command

npm run test or yarn test

0.2.12

3 years ago

0.2.11

3 years ago

0.2.10

3 years ago

0.2.9

3 years ago

0.2.7

3 years ago

0.2.6

3 years ago

0.2.8

3 years ago

0.2.5

3 years ago

0.2.4

3 years ago

0.2.3

3 years ago

0.2.2

3 years ago

0.2.1

3 years ago

0.2.0

3 years ago

0.1.2

3 years ago

0.1.1

3 years ago

0.1.0

4 years ago