hoadam / market_money Goto Github PK
View Code? Open in Web Editor NEWpair project mod 3
pair project mod 3
As a valid user
When I visit the login page '/login',
I fill in my email address,
I fill in my password,
When I click login,
I'm redirected to my dashboard '/dashboard',
This endpoint should follow the pattern of GET /api/v0/markets and should return ALL markets in the database.
In addition to the market’s main attributes, the market resource should also list an attribute for vendor_count, which is the number of vendors that are associated with that market.
As a user
when I visit '/',
I see a link to create an account,
When I click the link I'm redirected to the sign up page '/signup',
I see a form to input my name, email, password, and location,
and I see an option to login using Google account.
As a valid user that signed up not using Google account,
when I visit the login page '/login',
and click the link to login using Google account,
I fill in my google account info,
and click continue,
I'll see a flash message indicating that I've not authorized access,
and I'm redirected to '/login'.
This endpoint should follow the pattern of GET /api/v0/markets/:id/vendors
If a valid market id is passed in, a JSON object is sent back with a top-level data key that points to a collection of that market’s vendors. Each vendor contains all of it’s attributes.
If an invalid market id is passed in, a 404 status as well as a descriptive error message should be sent back in the response.
As a valid user
When I visit the login page '/login',
I fill in my email address with the wrong address,
I fill in my password,
When I click login,
I'll be redirected to the login page,
And I see a flash message indicating that my credentials are invalid.
This endpoint should follow the pattern of GET /api/v0/markets/:id.
If a valid market id is passed in, all market attributes, as well as a vendor_count should be returned.
If an invalid market id is passed in, a 404 status as well as a descriptive error message should be sent back in the response.
As a user,
When I visit the sign up page '/signup',
And fill up my information with valid data,
I'm redirected to my dashboard '/dashboard'
This endpoint should follow the pattern of DELETE /api/v0/market_vendors, and it should destroy an existing association between a market and a vendor (so that a vendor no longer is listed at a certain market).
The market_id and the vendor_id should be passed in via the body.
When a MarketVendor resource can be found with the passed in vendor_id and market_id, that resource should be destroyed, and a response will be sent back with a 204 status, with nothing returned in the body of the request.
After implementing the happy path for this endpoint, run it, and check that when you call GET /api/v0/vendors/:id/markets for the vendor in which you just deleted an association to a market, that you don’t see the recently removed market listed.
If a MarketVendor resource can NOT be found with the passed in vendor_id and market_id, a 404 status code as well as a descriptive message should be sent back with the response.
As a user, When I visit the sign up page '/signup',
and click on login with google,
I'm redirected (or a pop up will show?) to the google login page,
Once I enter my valid google credentials,
And authorize access to my google account,
I'm redirected to my dashboard
As a user,
When I visit the sign up page '/signup',
If I enter an invalid email, or leave blank fields,
I'm redirected to the sign up page,
And I see an flash message indicating the information that is wrong/missing.
As a user
When I visit the root path '/',
I see a link to longin,
When I click the link I'm redirected to the login page '/login',
I see a field to input my email and password,
And I see an option to login using Google account.
This endpoint should follow the pattern of POST /api/v0/market_vendors, and it should create a new association between a market and a vendor (so then, the vendor has a new market that they sell at).
When valid ids for vendor and market are passed in, a MarketVendor will be created, and a response will be sent back with a 201 status, detailing that a Vendor was added to a Market.
After implementing the happy path for this endpoint, run it, and check that when you call GET /api/v0/markets/:id/vendors for the vendor in which you just added to a market, that you see the newly associated market listed.
If an invalid vendor id or and invalid market id is passed in, a 404 status code as well as a descriptive message should be sent back with the response.
If a vendor id and/or a market id are not passed in, a 400 status code as well as a descriptive message should be sent back with the response.
If there already exists a MarketVendor with that market_id and that vendor_id, a response with a 422 status code and a message informing the client that that association already exists, should be sent back. Looking at custom validation might help to implement a validation for uniqueness of the attributes for this resource.
The endpoint should be in the pattern of GET /api/v0/markets/:id/nearest_atms
You will need to utilize the TomTom API for this. Specifically, the category search endpoint. Find a category that would work for ATM’s, and use the API to find ATM’s near the location of the Farmer’s Market.
The atms that are returned should be in the order of closest to furthest away.
If an invalid market id is passed in, a 404 status as well as a descriptive error message should be sent back in the response.
The data top level key should always point to an array even if one or zero atms were located near the market location.
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.