LarrySul / shopping-cart-discount-app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Shopping Cart Discount App

This CLI program is built on the LARAVEL FRAMEWORK. The program is built to implement list of REST API endpoints that create customers, product, and calculate discounts on orders prior to creating the orders.

The program has three (3) endpoints

  • Create customer - Create customer endpoint

  • Screenshot for Create customer endpoint

  • Create product - Create product endpoint

  • Screenshot for Create product endpoint

  • Create order - The endpoint calculate discount, create order and update customer revenue column on customer table

  • Screenshot for calculating discount, create order endpoint

    Repository Overview

    The repository contains source code on how to setup the application

    Specifications in the clone include

  • Endpoints that creates customers, products and customer orders
  • Core logic of the application reside within the Product, Customer and Order Controllers respectively
  • Writing of errors to logfile
  • The project has a total of 3 test cases (3 Unit)

  • Screenshot of test cases

    Requirements

  • Download PHP V8.1 and above.
  • Install Composer
  • Explanation

    The application covers the following use case

  • A customer who has already bought for over € 1000, gets a discount of 10% on the whole order.
  • For every product of category "Switches" (id 2), when you buy five, you get a sixth for free.
  • If you buy two or more products of category "Tools" (id 1), you get a 20% discount on the cheapest product.
  • Steps to run locally

  • Clone this repository:
  •  git clone https://github.com/LarrySul/shopping-cart-discount-app 
  • Install dependencies:
  •  composer install 

    About


    Languages

    Language:PHP 83.6%Language:Blade 16.0%Language:JavaScript 0.2%Language:Shell 0.2%