Giter VIP home page Giter VIP logo

kata09's Introduction

Kata09: Back to the Checkout

Project Overview

This Java project is an implementation of the coding challenge described at Kata09: Back to the Checkout.

Features

  • Flexible Pricing Rules: Easily configure pricing rules for each product in the database.
  • Scalable Design: Add new products and pricing schemes without altering existing code.
  • Robust Testing: Ensures the reliability of the checkout system through test coverage.

Getting Started

Prerequisites

  • Java 8 or later.
  • Gradle for building and running the project.

Installation

  1. Clone the repository:

    git clone https://github.com/mpgallage/Kata09.git
  2. Navigate to the project directory:

    cd Kata09
  3. Build the project using Gradle:

    .gradlew clean build
  4. Run tests using Gradle:

    .gradlew test

Database Schema and Data - checkout.sqlite

Schema

The database contains a single table named PricingRules. This table is designed to store pricing information for various products, identified by their Stock Keeping Unit (SKU).

Table: PricingRules

Column Data Type Description
SKU CHAR(1) Primary key. A unique identifier for each product.
UnitPrice DECIMAL(10, 2) The standard unit price of the product.
DiscountUnits INTEGER(3) The quantity of items required for a discount.
DiscountPrice DECIMAL(10, 2) The total price for the discounted quantity.

Data

Initial data is populated into the PricingRules table as follows:

  • SKU 'A': Priced at $50 each, with a special deal of 3 for $130.
  • SKU 'B': Priced at $30 each, with a special deal of 2 for $45.
  • SKU 'C': Priced at $20 each, with no special discount.
  • SKU 'D': Priced at $15 each, with no special discount.

Database File

The database is stored in a SQLite file named checkout.sqlite inside the project directory.

License

Distributed under the MIT License. See LICENSE for more information.

Contact

Malaka Gallage - [email protected]

Project Link: https://github.com/mpgallage/Kata09

kata09's People

Contributors

mpgallage 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.