Skip to content

Latest commit

 

History

History
60 lines (36 loc) · 2.07 KB

README.md

File metadata and controls

60 lines (36 loc) · 2.07 KB

✨ Kiki's Delivery Service CLI ✨

Below you will find some information on how to setup and perform common tasks.

Installation

Download this repository and install from source.

git clone https://github.com/chrismcdev/small-distance-courier-service.git
cd small-distance-courier-service
yarn install
yarn link

CLI Usage

Usage: kiki <action> <file>

Features

Delivery Cost Estimation with Offers

Estimate the total delivery cost of each package with an offer code (if applicable).

Example:

kiki delivery-cost ./src/__mocks__/fetch-delivery-cost-input.json

Delivery Time Estimation

Calculates the estimated delivery time for every package by maximizing number of packages in every shipment.

Example:

kiki delivery-time ./src/__mocks__/fetch-delivery-time-input.json

Decisions

JSON Schema Validation

The input file is validated with JSON Schema specific to each feature, schemas can be found here.

Facade Structural Design Pattern

The facade SmallDistanceCourierService has two sub-systems Parcel and Coupon that are instantiated within the facade. This facade manages the full lifecycle of the objects it uses.

First-fit-decreasing Bin Packing Algorithm

The FFD algorithm is used to decide how many shipments are needed and what parcels to load in each shipment based on weight.