kpatticha / taxi-website Goto Github PK
View Code? Open in Web Editor NEWBooking system for taxi
Booking system for taxi
var BookingSchema = new mongoose.Schema({
user: { type : Schema.ObjectId, ref : 'User' },
drivers: [{
driver: { type : Schema.ObjectId, ref : 'Driver' }
}],
uui: Number,
message: String,
flightNo: String,
passengers: Number,
oneWay: Boolean,
departure: String,
arrival: String,
departureTimestamp: { type: Date },
arrivalTimestamp: { type: Date },
returnTimestamp: { type: Date },
duration: Number,
distance: Number,
confirmationToken: String,
confirmedAt: { type: Date },
confirmationSentAt: { type: Date },
createdAt: { type: Date },
updatedAt: { type: Date, default: Date.now },
});
The user cannot
ACTUALLY
all he can is to access his profile, and his bookings NOTHING else
The admin will add only the address name.
Those values should be generated automatically in the backend based on the address either in the front the admin will have a integrated map to point the location and send those values though the form.
Having the map will help the admin visualise and verify the location.
The address names are not unique
var mongoose = require('mongoose');
var UserSchema = new mongoose.Schema({
uui: Number,
admin: { type: Boolean, default: false },
firstName: String,
lastName: String,
email: String,
encryptedPassword: String,
resetPasswordToken: String,
resetPasswordSentAt: String,
phone: Number,
countryCode: Number,
confirmationToken: String,
confirmedAt: { type: Date },
confirmationSentAt: { type: Date },
createdAt: { type: Date },
updatedAt: { type: Date, default: Date.now },
lastSignInAt: { type: Date },
});
module.exports = mongoose.model('User', UserSchema);
http://localhost:8080/users/5c1a9dfbf03e9f3a3309afbe/bookings
should return all the booking make by the user 5c1a9dfbf03e9f3a3309afbe
GET /users
GET /users/:id
POST /users
PUT /users/:id
TODO: define which params
do we want to track searches?
GET /locations
GET /locations/:id
POST /locations
PUT /locations/:id
TODO: define which params
Setup the basic infra to connect with express mongoose
review halkidiki tranfer database schema, evaluate the current one and decide to go with the same or another one
GET /bookings
GET /bookings/:id
POST /booking
params:
validations
PUT /booking/:id
:
User model and Driver models have a lot of similarities.
we have duplicate code, mongoose might support extend or populate.
explore this option or something else
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.