wachunga / car-share-fare Goto Github PK
View Code? Open in Web Editor NEWHow much will that car share trip cost? Limited to car shares Evo and Modo for now
Home Page: https://carshare.vercel.app
License: MIT License
How much will that car share trip cost? Limited to car shares Evo and Modo for now
Home Page: https://carshare.vercel.app
License: MIT License
Conditions: 1 passenger, going within the mobi zone (once map support is added)
Maybe it's time to change the name if including ride hailing and a bike share ๐ค
There are floating point issues with handling currency just as numbers in javascript. Better deal with this sooner rather than later.
I've used big.js in the past but this looks promising: https://github.com/sarahdayan/dinero.js (comes with formatting, currencies, etc)
Should be similar to Lyft support in #28
Should be able to figure out prices from estimate here: https://www.uber.com/global/en/cities/vancouver/
More tweaks to the pricing schema. ๐
something like this:
const car2go = {
key: "car2go-yvr",
url: "https://www.car2go.com/CA/en/vancouver/rates/",
lastUpdate: "2019-06-15",
currency: "CAD",
fees: {
trip: 1, // first 200 trips per calendar year
registration: 5,
annual: 2,
daily: 1.5 // tax on trips lasting 8 hours or more
},
packages: [
{
name: "minute rate - smart",
vehicle: "smart fortwo",
maxPassengers: 2,
time: [{ per: 1, cost: 0.32 }],
distance: {
unit: "km",
steps: [{ start: 0, end: 200, cost: 0 }, { start: 200, cost: 0.45 }]
}
},
{
name: "minute rate - mercedes",
vehicle: "Mercedes Benz CLA/GLA",
maxPassengers: 5,
time: [{ per: 1, cost: 0.45 }],
distance: {
unit: "km",
steps: [{ start: 0, end: 200, cost: 0 }, { start: 200, cost: 0.45 }]
}
},
// TODO: 3 hours - smart
{
name: "3 hours - mercedes",
vehicle: "Mercedes Benz CLA/GLA",
maxPassengers: 5,
time: [
{ start: 0, cost: 45 }, // 3 hours
{ start: 60 * 3, per: 1, cost: 0.32 }
],
distance: {
unit: "km",
steps: [{ start: 0, end: 200, cost: 0 }, { start: 200, cost: 0.45 }]
}
},
// TODO: 6 hours
// TODO: 1 day (200)
// TODO: 2 days (400)
// TODO: 3 days - smart
{
name: "3 days - mercedes",
vehicle: "Mercedes Benz CLA/GLA",
maxPassengers: 5,
time: [
{ start: 0, cost: 249 }, // 3 days
{ start: 60 * 24 * 3, per: 1, cost: 0.32 }
],
distance: {
unit: "km",
steps: [{ start: 0, end: 600, cost: 0 }, { start: 600, cost: 0.45 }]
}
}
]
};
Draw inspiration from tsdx or react or another site:
https://www.opengraph.xyz/url/https:%2F%2Ftsdx.io/
https://www.opengraph.xyz/url/https:%2F%2Freactjs.org/
Bonus points if you create an image. Something simple like the favicon would do.
Just an MVP. Can polish later.
computeCosts
and presents the results in a tableLater, we can integrate with google maps (or similar) to calculate the distance for you
So the distance and time are detected automatically. Return trips should also be supported.
I looked into a few distance api options but google with place autocomplete is hard to beat. $200 credit / month should be sufficient for now
https://developers.google.com/maps/documentation/distance-matrix/intro
Showing a map is useful to confirm the location.
They have some variability but their standard pricing seems pretty stable
Prices are going up slightly effective July 29 according to an email I received Jun 29:
The long distance fee will be increasing from $0.45/kilometer to $0.49/kilometer. This fee only applies if you go over your allotted mileage in a Trip Package or surpass 200 km of driving when you select the Per Minute Rate.
For later: I suppose this will be a common use case. Probably we should include the notion of "effective date" so this config can be added in advance.
Use maxPassengers
in the packages to filter out or de-emphasize options that won't work.
Will probably have to show as a range, unfortunately, unless the variables are predictable. I've emailed car2go asking if that will be the case.
eg 30 min, 10km trip, smart fortwo
They're also changing the included km etc.
Specifying eg 1 minute returns invalid results for some packages.
Effective July 15 - Sep 30, but I suspect they'll extend it.
Details: https://www.modo.coop/day-tripper/
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.