Skip to content

Engineering Challenge • Kiki's Delivery Service CLI 📍

Notifications You must be signed in to change notification settings

chrismcdev/small-distance-courier-service

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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


About

Engineering Challenge • Kiki's Delivery Service CLI 📍

Topics

Resources

Stars

Watchers

Forks