/mdbilling

basket with discount implemented using "Rules Design Pattern"

Primary LanguageJava

mdbilling

Java 8 dojo TDD task

Medical centre provide following services:

  1. Diagnosis

  2. X-Ray

  3. Blood Test

  4. ECG

  5. Vaccine

Each of the services has an associated default cost

  1. Diagnosis £60

  2. X-Ray £150

  3. Blood Test £78

  4. ECG £200.40

  5. Vaccine £27.50 (service) + £15 (for each vaccine)

Discounts are applied for services based on the following criteria:

  1. Senior citizens (between 65 and 70) receive a 60% discount

  2. Senior citizens (over 70) receive a 90% discount

  3. Children under 5 receive 40% discount

  4. Patients with "MediHealth Health insurance" get additional 15% discount on Blood test when they are diagnosed by a MediHealth practitioner

Exercise:

The medical centre requires you to implement the basis of a new billing engine using the rules detailed above. Solution to be written in a TDD.