Skip to content
MS Keys Gate
Concept / DemoCustom module

Quote engine — custom module

Shows a self-contained module with its own config, tests and a small admin UI.

A concept by MS Keys Gate, built to demonstrate capability. It is not a client project and was never commissioned.

Screens

quote-engine.example

Quote form. The customer-facing calculator with a live running total.

What it sets out to prove

  • Drop into an existing app without touching its core
  • Keep pricing rules in data, editable by a non-developer
  • Ship with tests that pin the rules, so changes are safe

Built with

  • TypeScript
  • Rules as data
  • Unit tests
  • Adapter interface

Rules are configuration

Base rates, modifiers and discounts live in a validated config object, not in branching code.

One integration seam

The host app talks to a single adapter interface, so the module can be swapped or upgraded in isolation.

A look at the code

Pricing as a pure function over config

export function priceQuote(input: QuoteInput, rules: PricingRules): Quote {
  const base = rules.baseRates[input.tier];

  const lines = rules.modifiers
    .filter((m) => m.applies(input))
    .map((m) => ({ label: m.label, amount: m.amount(base, input) }));

  const subtotal = lines.reduce((sum, l) => sum + l.amount, base);
  const discount = rules.discountFor(input, subtotal);

  return { base, lines, discount, total: subtotal - discount };
}

Illustrative snippet from the concept (typescript).

Take this further

The thinking here carries straight into a real project. See the Plugin development service, or tell us what you have in mind.