Giter Club home page Giter Club logo

rules-engine's Introduction

Rules Engine

This solution shall dynamically generate product pricing from a set of rules defined by the finance team at Visio Lending. We know the initial rules, but they could change at any time, could be represented in any way, and it may be necessary to extend the rules engine (i.e. adding new kinds of actions or triggers) without altering the codebase.

Does this project appear incomplete? You may be on the "master" branch - switch to the "development" branch to see the latest changes (committing directly to master without a code review is considered a coding "worst practice")

Acceptance Criteria

  1. Rules can be defined outside the code.

  2. A rule definition should define an action, any parameters / arguments as appropriate (if applicable), and the condition(s) which trigger the action.

  3. 100% test coverage as measured by NYC (or as close to it as is practical)

  4. The rules engine can be extended (perhaps by adding new kinds of actions, triggers, or other objects) without modifying the codebase, just the input

  5. Rules are loaded at runtime.

ย 

Usage

  1. Prerequisites: Nodejs version >= 12.x ("Latest Features"; however the 10.x LTS version should work fine with this project if that is preferred); NPM version >= 6.x.
  • Windows binaries available at http://nodejs.org
  • Mac OSX users can simply run brew install node (visit http://brew.sh if you do not already have Homebrew)
  • Linux users just need to add the NodeSource repository by running curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -, then simply sudo apt install nodejs

You can confirm that you have the prerequisites installed properly by running node -v and npm -v respectively in a new Terminal/(Git) Bash/Command Prompt.

  1. Clone this repository by running git clone https://github.com/DavidMallett/rules-engine.git, or navigating to the repository in Github and clicking the "Set up in Desktop" version (separate application GitHub Desktop required)

  2. In a new Terminal/Shell, navigate to where you cloned the repo (most likely the command cd ~/rules-engine will accomplish this) and run npm install.

Defined Rules

For convenience, a set of basic actions, conditions, and rules are included. These are for example only.

ACTION_LIST: [0] reduce interest rate [1] raise interest rate [2] disqualify product [3] set new price [4] change product name

CONDITION_LIST: [0] if person.creditScore >== 720 [1] if person.creditScore < 720 [2] if person.state === "FL" [3] if product.name === "7-1 ARM" [4] if Person.people.length > 10 [5] if Products.allProducts.length <== 5 [6] static (no condition) [7]

rules-engine's People

Contributors

davidmallett avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.