Skip to content

92bondstreet/privateaser

Repository files navigation

PRIVATEASER

JavaScript workshop based on the french startuphttps://www.privateaser.com

privateaser

Table of Contentsgenerated withDocToc

🐣 Introduction

Privateaseris a marketplace that digitizes the world of event planning for bars, restaurants and venues (+3,000 locations), via a web application.

The Event management is a key sector of the Europe economy:

  • 100 billion euros in Europe
  • 20 billion euros in France
  • historically complex
  • not much digitized: you have to pick up your phone, wait to be called back, go to visit

Privateaseris a trusted third party between the bars and the bookers. The marketplace allows them to:

  • the bookers to find, to compare or to contact a place
  • the bookers to book with an one-click a place for an event
  • the bookers to manage all their events expenses
  • the managers to maximize the occupancy rate and therefore the revenue of their business

🎯 Objectives

We focus on this marketplace feature:to book with an one-click a place for an event.

The workshop goals are to

  1. compute the booking price of thebooker
  2. compute the profit of thebar
  3. compute the profit ofprivateaser

👩‍💻 Just tell me what to do

  1. Fork the project viagithub

fork

  1. Clone your forked repository projecthttps://github.com/YOUR_USERNAME/privateaser
cd/path/to/workspace
❯ git clone [email protected]:YOUR_USERNAME/privateaser.git
  1. Open the entry point/public/index.htmlin your browser (that loads theindex.jsfile)
#macos cli
❯ open public/index.html
#linux cli
❯ xdg-open public/index.html

#or by double-clicking in your browser files
  1. Check the ouput in your browser console (UseCtrl + Shift + JorCmd + Opt + Jto focus to your console devtools)
  2. Solve each steps inside./public/index.jsfile with JavaScript
  3. Once a step is solved, commit your modification:
cd/path/to/workspace/privateaser
❯ git add -A&&git commit -m"feat(price): decrease pricing according people"

(why following a commit message convention?

  1. 5 steps, so ideally 5 commits
  2. Don't forget to push before the end of the workshop
❯ git push origin master

Note:if you catch an error about authentication,add your ssh to your github profile.

  1. Check that your codebase works by checking the console output
  2. If you need some helps on git commands, readgit - the simple guide

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!).

Useconsole.logto display results (for the moment)

🏃‍♀️ Steps to do

⌚ Step 1 - Euro-People

Booking price

Thebookerbooks a place for an specific time range and a set of persons.

The booking price is the sum of the time component and the people component with

  • time component:the number of booked time multiplied by thebarprice per hour
  • people component:the number of persons multiplied by thebarprice per person
booking price = time + people

Just tell me what to do

Write JS code that generates the booking price for eachbookerfromindex.jsfile:

//example output from console.log
[
{
"id":"bba9500c-fd9e-453f-abf1-4cd8f52af377",
...
"price":?
},
{
"id":"65203b0a-a864-4dea-81e2-e389515752a8",
...
"price":?
},
{
"id":"94dab739-bd93-44c0-9be1-52dd07baa9f6",
...
"price":?
}
]

🍺 Step 2 - Send more, pay less

Decreasing pricing for people

To be as competitive as possible,Privateaserdecide to have a decreasing pricing for groups of important people

New price rules

price per people

  • decreases by10% after 10 persons
  • decreases by30% after 20 persons
  • decreases by50% after 60 persons

Just tell me what to do

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

//example output from console.log
[
{
"id":"bba9500c-fd9e-453f-abf1-4cd8f52af377",
...
"price":?
},
{
"id":"65203b0a-a864-4dea-81e2-e389515752a8",
...
"price":?
},
{
"id":"94dab739-bd93-44c0-9be1-52dd07baa9f6",
...
"price":?
}
]

💰 Step 3 - Give me all your money

Now, it's time to pay thebar

There is a 30% commission on the booking price to cover the costs.

Commission

The commission is split like this:

  • insurance:half of commission
  • the Treasury:1€ by person
  • Privateaser:the rest

Just tell me what to do

Compute the amount that belongs to theinsurance,to theTreasuryand toPrivateaser.

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

💸 Step 4 - The famous deductible

In case of an accident/theft,Privateaserapplies a 5000€ deductible.

The booker can reduce the deductible amount from 5000€ to 200€ with adeductible optionfor a few more euros per person.

The deductible

The booker is charged an additional 1€/person when he chooses thedeductible reductionoption.

The additional charge goes toPrivateaser,not to the bar.

Just tell me what to do

Compute the new amount price if the booker subscribed todeductible option.

//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 bookermust pay thebooking priceand the(optional) deductible reduction
  • the barreceives thebooking priceminus thecommission
  • the insurancereceives its part of thecommission
  • the Treasuryreceives its part of the taxcommission
  • Privateaser receivesits part of thecommission,plus thedeductible reduction

Just tell me what to do

  • Compute the debit for thebooker
  • Compute the credit of thebar,insurance,TreasuryandPrivateaser.
//example output from console.log
[
{
"deliveryId":"bba9500c-fd9e-453f-abf1-4cd8f52af377",
"payment":[
{
"who":"booker",
"type":"debit",
"amount":?
},
{
"who":"bar",
"type":"credit",
"amount":?
},
{
"who":"insurance",
"type":"credit",
"amount":?
},
{
"who":"treasury",
"type":"credit",
"amount":?
},
{
"who":"privateaser",
"type":"credit",
"amount":?
}
]
},
...
]

Source and inspiration

Licence

Uncopyrighted