GithubHelp home page GithubHelp logo

antoinedmc / convargo Goto Github PK

View Code? Open in Web Editor NEW

This project forked from 92bondstreet/convargo

0.0 0.0 0.0 1.77 MB

Javascript workshop based on french startup https://www.convargo.com

Home Page: https://92bondstreet.github.io/convargo/#/

Makefile 11.70% HTML 2.34% JavaScript 84.58% CSS 1.38%

convargo's Introduction

CONVARGO

javascript workshop based on french startup https://www.convargo.com

convargo

Table of Contents generated with DocToc

Introduction

Convargo wants to revolutionise the freight industry, by connecting shippers with truckers in real time via a web application.

The Goods freight transport sector is a key sector of the Europe (even worldwilde) economy:

  • 300 billion euros in Europe
  • 43 billion euros in France
  • highly fragmented with more than 40,000 road transport companies in France
  • under efficient: ⅓ trucks drive empty on Fance roads!

The Convargo platform allows shippers to:

  • access directy to a wide range of road transport companies with available loading capacity
  • compute and display the transport price calculated according to the best opportunities on the market at a time T
  • track in real-time the goods delivery
  • access to proof of transport and dematerialized invoices

Objectives

We focus on this platform feature: compute and display the transport price calculated according to the best opportunities on the market at a time T.

The next exercises goals are to

  1. compute the ship price for the shippers
  2. compute the profit of the road transport company, the truckers
  3. compute the commission of convargo

Just tell me what to do

  1. Fork the project via github
  2. Clone the project git clone https://github.com/YOUR_USERNAME/convargo
  3. Solve each exercises inside ./public/index.js file with JavaScript
  4. Once the exercise is solved, commit something like git add -A && git commit -m "feat(price): decrease pricing for higher volume" (why following a convention?)
  5. 5 exercises, so ideally 5 commits
  6. Don't forget to push before the end of the workshop
  7. Check that your codebase works by opening /public/index.html in your browser
  8. Check the ouput in your browser console

Don't forget:

  • DRY - Don't repeat yourself
  • DOT - Do One Thing
  • KISS - Keep It Simple Stupid
  • LIM - Less Is More
  • English only: codebase, variables, comments...

**Focus only on coding, forgot the browser display (next workshop!).

Use console.log to display results (for the moment)**

Steps to do

Step 1 - Euro-Volume

Shipping prices

The shipper books the trucker for an itinerary and volume.

The shipping price is the sum of the distance component and the volume component with

  • distance component: the number of kilometers multiplied by the trucker price per km
  • volume component: the used volume multiplied by the trucker price per m3
shipping price = distance + volume

Just tell me what to do

Write JS code that generates the shpping price for each shipper from index.js file:

const deliveries = ...;
...
console.log(deliveries);

//example output from console.log
[
  {
    "id": "bba9500c-fd9e-453f-abf1-4cd8f52af377",
    ...
    "price": ?
  },
  {
    "id": "65203b0a-a864-4dea-81e2-e389515752a8",
    ...
    "price": ?
  },
  {
    "id": "165d65ec-5e3f-488e-b371-d56ee100aa58",
    ...
    "price": ?
  }
]

Step 2 - Send more, pay less

Decreasing pricing for high volumes

To be as competitive as possible, convargo decide to have a decreasing pricing for high volumes.

New price rules

price per m3

  • decreases by 10% after 5 m3
  • decreases by 30% after 10 m3
  • decreases by 50% after 25 m3

Just tell me what to do

Adapt the shipping price computation to take these new rules into account.

const deliveries = ...;
...
console.log(deliveries);

//example output from console.log
[
  {
    "id": "bba9500c-fd9e-453f-abf1-4cd8f52af377",
    ...
    "price": ?
  },
  {
    "id": "65203b0a-a864-4dea-81e2-e389515752a8",
    ...
    "price": ?
  },
  {
    "id": "165d65ec-5e3f-488e-b371-d56ee100aa58",
    ...
    "price": ?
  }
]

Step 3 - Give me all your money

Now, it's time to pay the truckers

Convargo take a 30% commission on the shipping price to cover their costs.

Commission

The commission is split like this:

  • insurance: half of commission
  • the Treasury: 1€ by 500km range
  • convargo: the rest

Just tell me what to do

Compute the amount that belongs to the insurance, to the assistance and to convargo.

const deliveries = ...;
...
console.log(deliveries);


//example output from console.log
[
  {
    "id": "bba9500c-fd9e-453f-abf1-4cd8f52af377",
    ...
    "commission": {
      "insurance": ?,
      "treasury": ?
      "convargo": ?
    }
  },
  ...
]

Step 4 - The famous deductible

In case of an accident/theft, convargo applies a 1000€ deductible.

The shipper can reduce the deductible amount from 1000€ to 200€ with a deductible option for a few more euros per volume.

The deductible

The driver is charged an additional 1€/m3 when he chooses the deductible reduction option.

The additional charge goes to convargo, not to the trucker.

Just tell me what to do

Compute the new amount price if the shipper subscribed to deductible option.

const deliveries = ...;
...
console.log(deliveries);

//example output from console.log
[
  {
    "id": "bba9500c-fd9e-453f-abf1-4cd8f52af377",
    'options': {
      'deductibleReduction': true
    },
    ...
    "price": ?
  },
  ...
]

Step 5 - Pay the actors

The actors

It's time to debit/credit each actor!

  • the shipper must pay the shipping price and the (optional) deductible reduction
  • the trucker receives the shipping price minus the commission
  • the insurance receives its part of the commission
  • the Treasury receives its part of the tax commission
  • convargo receives its part of the commission, plus the deductible reduction

Just tell me what to do

  • Compute the debit for the shipper
  • Compute the credit of the car trucker, insurance, and convargo.
const actors = ...;
...
console.log(actors);

//example output from console.log
[
  {
    "deliveryId": "bba9500c-fd9e-453f-abf1-4cd8f52af377",
    "payment": [
      {
        "who": "shipper",
        "type": "debit",
        "amount": ?
      },
      {
        "who": "owner",
        "type": "credit",
        "amount": ?
      },
      {
        "who": "insurance",
        "type": "credit",
        "amount": ?
      },
      {
        "who": "treasury",
        "type": "credit",
        "amount": ?
      },
      {
        "who": "convargo",
        "type": "credit",
        "amount": ?
      }
    ]
  },
  ...
]

Source and inspiration

Convargo Drivy Challenges

Licence

Uncopyrighted

convargo's People

Contributors

92bondstreet avatar antoinedmc 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.