Coder Social home page Coder Social logo

cnodland / little_shop_v2 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from turingschool-projects/little_shop_v2

0.0 1.0 3.0 1.05 MB

BE Mod 2 Week 4/5 Group Project, an e-commerce platform

Ruby 83.10% JavaScript 0.68% CSS 3.73% HTML 12.48%

little_shop_v2's Introduction

Little Shop of Horrors

This is a student project from the Turing School of Software & Design as part of the Module 2 backend Software Development Program. This project tasked us with creating a fictional E-Commerce website. This website would be able to facilitate Sessions of users. Allow the management of orders and items placed and created by users as well as preventing the deletion of information through the use of enabling and disabling items/orders.

-Take a look at the live website here -Take a look at the project here -Team Members: William Peterson - GitHub Jon Peterson - GitHub Trevor Nodland - GitHub Vincent Provenzano - GitHub

Tools

  • Ruby on Rails 5.1.6
  • ActiveRecord - PostgreSQL

Gems

  • FactoryBot
  • RSpec-rails
  • Shoulda-Matchers
  • Capybara
  • simplecov

Testing

RSpec was used as the primary testing suite

SimpleCov was used to ensure proper coverage of our tests

Shoulda-Matchers was used to aid in validation of our models

Tests were completed in a hybrid of top down and bottom up development. We started with feature tests that would then break into model tests as needed for core functionality.

Setup

You will need to have PostgreSQL installed and ready for this app to work correctly

Clone down the repo and run bundle install

then run rails db:{drop,create,migrate,seed} this will populate the database for testing a viewing live.

From here you can run rspec in the root to run our tests or visit the spec folder to view individual tests.

running rails s then visiting localhost:3000 will allow to you view the website live from the code itself.

Database Layout

Homepage

little_shop_v2's People

Contributors

wipegup avatar joequincy avatar vjp888 avatar cnodland avatar iandouglas avatar dionew1 avatar

Watchers

 avatar

little_shop_v2's Issues

User Story 2, Visitor Navigation

As a visitor
I see a navigation bar
This navigation bar includes links for the following:
- a link to return to the welcome / home page of the application ("/")
- a link to browse all items for sale ("/items")
- a link to see all merchants ("/merchants")
- a link to my shopping cart ("/cart")
- a link to log in ("/login")
- a link to the user registration page ("/register")

Next to the shopping cart link I see a count of the items in my cart

Checklist:

  • base tests are written
  • base code is written to pass tests
  • edge case ("sad path") tests written (if required)
  • edge case code written (if required)
  • code is reviewed
  • branch is merged
  • all tests still pass

child of turingschool-projects#272

child of turingschool-projects#274

User Story 15, Items Index Page Statistics

As any kind of user on the system
When I visit the items index page ("/items")
I see an area with statistics:
- the top 5 most popular items by quantity purchased, plus the quantity bought
- the bottom 5 least popular items, plus the quantity bought

"Popularity" is determined by total quantity of that item fulfilled

DO THESE STORIES FIRST:

  • User Story 14, Items Index Page

Checklist:

  • base tests are written
  • base code is written to pass tests
  • edge case ("sad path") tests written (if required)
  • edge case code written (if required)
  • code is reviewed
  • branch is merged
  • all tests still pass

child of turingschool-projects#257

child of turingschool-projects#274

depends on turingschool-projects#256

User Story 28, User Profile displays Orders

As a registered user
When I visit my Profile Orders page, "/profile/orders"
I see every order I've made, which includes the following information:
- the ID of the order, which is a link to the order show page
- the date the order was made
- the date the order was last updated
- the current status of the order
- the total quantity of items in the order
- the grand total of all items for that order

DO THESE STORIES FIRST:

  • User Story 17, User Profile Show Page

Checklist:

  • base tests are written
  • base code is written to pass tests
  • edge case ("sad path") tests written (if required)
  • edge case code written (if required)
  • code is reviewed
  • branch is merged
  • all tests still pass

child of turingschool-projects#241

child of turingschool-projects#274

depends on turingschool-projects#252

Epic: User Order Show Page

User Order Show Page

The show page template for an order can be shared between users, merchants and admins to DRY up our presentation logic. They will operate through separate controllers, though.

User Control

  • Users can cancel an order if an admin has not "shipped" that order
  • When an order is cancelled, any fulfilled items have their inventory returned to their respective merchants

Merchant Control

  • Merchants only see items in the order that are sold by that merchant
  • Items from other merchants are hidden

Admin Control

  • Admins can cancel an order on behalf of a user
  • Admins can fulfill items on order on behalf of a merchant

Epic: User Profile Show Page

User Profile Page

When a user who is not a merchant nor an admin logs into the system, they are taken to a profile page under a route of "/profile".

Admins can act on behalf of users

Admin users can access a namespaced route of "/admin/users" to see an index page of all non-merchant/non-admin users, and from there see each user. This will allow the admin to perform every action on a user's account that the user themselves can perform. Admin users can also "upgrade" a user account to become a merchant account.

Epic: User Management by Admins

User Management by Admins

Admins will need a way to view a list of all regular users and view their profile and order data.

Admins can also change a user's role between being a regular user and a merchant user.

User Story 22, User views their cart show page but it's empty

As a visitor or registered user
When I add NO items to my cart yet
And I visit my cart ("/cart")
I see a message that my cart is empty
I do NOT see the link to empty my cart

DO THESE STORIES FIRST:

  • User Story 2, Visitor Navigation

Checklist:

  • base tests are written
  • base code is written to pass tests
  • edge case ("sad path") tests written (if required)
  • edge case code written (if required)
  • code is reviewed
  • branch is merged
  • all tests still pass

child of turingschool-projects#249

child of turingschool-projects#274

depends on turingschool-projects#271

User Story 24, User can manipulate quantities in their cart

As a visitor or registered user
When I have items in my cart
And I visit my cart
Next to each item in my cart
I see a button or link to remove that item from my cart
- clicking this button will remove the item but not other items

I see a button or link to increment the count of items I want to purchase
- I cannot increment the count beyond the merchant's inventory size

I see a button or link to decrement the count of items I want to purchase
- If I decrement the count to 0 the item is immediately removed from my cart

DO THESE STORIES FIRST:

  • User Story 21, User views their cart show page with items in the cart

Checklist:

  • base tests are written
  • base code is written to pass tests
  • edge case ("sad path") tests written (if required)
  • edge case code written (if required)
  • code is reviewed
  • branch is merged
  • all tests still pass

child of turingschool-projects#249

child of turingschool-projects#274

depends on turingschool-projects#247

User Story 18, User Can Edit their Profile Data

As a registered user
When I visit my profile page
I see a link to edit my profile data
When I click on the link to edit my profile data
Then my current URI route is "/profile/edit"
I see a form like the registration page
The form contains all of my user information
The password fields are blank and can be left blank
I can change any or all of the information
When I submit the form
Then I am returned to my profile page
And I see a flash message telling me that my data is updated
And I see my updated information

DO THESE STORIES FIRST:

  • User Story 17, User Profile Show Page

Checklist:

  • base tests are written
  • base code is written to pass tests
  • edge case ("sad path") tests written (if required)
  • edge case code written (if required)
  • code is reviewed
  • branch is merged
  • all tests still pass

child of turingschool-projects#253

child of turingschool-projects#274

depends on turingschool-projects#252

User Story 64, EXTENSION: Admin can edit a user's profile data

As an admin user
When I visit a user's profile page ("/admin/users/5")
And I click the link to edit the user's profile data
The same behaviors exist as if I were that user trying to change their own data
Except I am returned to the show page path of
"/admin/users/5" when I am finished

DO THESE STORIES FIRST:

  • User Story 5, Admin Navigation
  • User Story 56, Admin User Profile Page

Checklist:

  • base tests are written
  • base code is written to pass tests
  • edge case ("sad path") tests written (if required)
  • edge case code written (if required)
  • code is reviewed
  • branch is merged
  • all tests still pass

child of #52

child of #125

depends on #119

depends on #57

User Story 11, User cannot log in with bad credentials

As a visitor
When I visit the login page ("/login")
And I submit valid information
Then I am redirected to the login page
And I see a flash message that tells me that my credentials were incorrect
I am NOT told whether it was my email or password that was incorrect

DO THESE STORIES FIRST:

  • User Story 10, User can Login

Checklist:

  • base tests are written
  • base code is written to pass tests
  • edge case ("sad path") tests written (if required)
  • edge case code written (if required)
  • code is reviewed
  • branch is merged
  • all tests still pass

child of turingschool-projects#262

child of turingschool-projects#274

depends on turingschool-projects#261

User Story 21, User views their cart show page with items in the cart

As a visitor or registered user
When I have added items to my cart
And I visit my cart ("/cart")
I see all items I've added to my cart
And I see a link to empty my cart
Each item in my cart shows the following information:
- the name of the item
- a very small thumbnail image of the item
- the merchant I'm buying this item from
- the price of the item
- my desired quantity of the item
- a subtotal (price multiplied by quantity)

I also see a grand total of what everything in my cart will cost

DO THESE STORIES FIRST:

  • User Story 2, Visitor Navigation

Checklist:

  • base tests are written
  • base code is written to pass tests
  • edge case ("sad path") tests written (if required)
  • edge case code written (if required)
  • code is reviewed
  • branch is merged
  • all tests still pass

child of turingschool-projects#249

child of turingschool-projects#274

depends on turingschool-projects#271

User Story 66, EXTENSION: Admin enables a user account

As an admin user
When I visit the user index page
And I click on a "enable" button for a disabled user
I am returned to the admin's user index page
And I see a flash message that the user's account is now enabled
And I see that the user's account is now enabled
This user can now log in
This user's city/state and orders should be included in all statistics.

DO THESE STORIES FIRST:

  • User Story 55, Admin User Index Page

Checklist:

  • base tests are written
  • base code is written to pass tests
  • edge case ("sad path") tests written (if required)
  • edge case code written (if required)
  • code is reviewed
  • branch is merged
  • all tests still pass

child of #52

child of #125

depends on #58

Epic: Login, Logout

Login / Logout

Our application wouldn't be much use if users could not log in to use it.

User Story 10, User can Login

As a visitor
When I visit the login path
I see a field to enter my email address and password
When I submit valid information
If I am a regular user, I am redirected to my profile page
If I am a merchant user, I am redirected to my merchant dashboard page
If I am an admin user, I am redirected to the home page of the site
And I see a flash message that I am logged in

DO THESE STORIES FIRST:

  • User Story 7, User Registration
  • User Story 2, Visitor Navigation

Checklist:

  • base tests are written
  • base code is written to pass tests
  • edge case ("sad path") tests written (if required)
  • edge case code written (if required)
  • code is reviewed
  • branch is merged
  • all tests still pass

child of turingschool-projects#262

child of turingschool-projects#274

depends on turingschool-projects#265

depends on turingschool-projects#271

User Story 65, EXTENSION: Admin disables a user account

As an admin user
When I visit the user index page
I see a "disable" button next to any users who are not yet disabled
I see an "enable" button next to any users whose accounts are disabled.
If I click on a "disable" button for an enabled user
I am returned to the admin's user index page
And I see a flash message that the user's account is now disabled
And I see that the user's account is now disabled
This user cannot log in
This user's city/state and orders should not be part of any statistics.

DO THESE STORIES FIRST:

  • User Story 55, Admin User Index Page

Checklist:

  • base tests are written
  • base code is written to pass tests
  • edge case ("sad path") tests written (if required)
  • edge case code written (if required)
  • code is reviewed
  • branch is merged
  • all tests still pass

child of #52

child of #125

depends on #58

User Story 3, User Navigation

As a registered user
I see the same links as a visitor
Plus the following links
- a link to my profile page ("/profile")
- a link to log out ("/logout")

Minus the following links
- I do not see a link to log in or register

I also see text that says "Logged in as Ian Douglas" (or whatever my name is)

DO THESE STORIES FIRST:

  • User Story 2, Visitor Navigation

Checklist:

  • base tests are written
  • base code is written to pass tests
  • edge case ("sad path") tests written (if required)
  • edge case code written (if required)
  • code is reviewed
  • branch is merged
  • all tests still pass

child of turingschool-projects#272

child of turingschool-projects#274

depends on turingschool-projects#271

Epic: Merchant Order Fulfillment

Merchant Order Fulfillment

Merchants must "fulfill" each ordered item for users. They will visit an order show page which will allow them to mark each item as fulfilled. Once every merchant marks their items for an order as "fulfilled" then the whole order switches its status to "shipped". Merchants cannot fulfill items in an order if they do not have enough inventory in stock. If a user cancels an order after a merchant has fulfilled an item, the quantity of that item is returned to the merchant.

Admin functionality

Admins can fulfill items in an order on behalf of a merchant.

User Story 17, User Profile Show Page

As a registered user
When I visit my own profile page
Then I see all of my profile data on the page except my password
And I see a link to edit my profile data

Checklist:

  • base tests are written
  • base code is written to pass tests
  • edge case ("sad path") tests written (if required)
  • edge case code written (if required)
  • code is reviewed
  • branch is merged
  • all tests still pass

child of turingschool-projects#253

child of turingschool-projects#274

User Story 13, User can log out

As a registered user, merchant, or admin
When I visit the logout path
I am redirected to the welcome / home page of the site
And I see a flash message that indicates I am logged out
Any items I had in my shopping cart are deleted

Checklist:

  • base tests are written
  • base code is written to pass tests
  • edge case ("sad path") tests written (if required)
  • edge case code written (if required)
  • code is reviewed
  • branch is merged
  • all tests still pass

child of turingschool-projects#262

child of turingschool-projects#274

User Story 23, User can empty a cart that has items

As a visitor or registered user
When I have items in my cart
And I visit my cart ("/cart")
And I click the link to empty my cart
Then I am returned to my cart
All items have been completely removed from my cart
The navigation bar shows 0 items in my cart

DO THESE STORIES FIRST:

  • User Story 21, User views their cart show page with items in the cart

Checklist:

  • base tests are written
  • base code is written to pass tests
  • edge case ("sad path") tests written (if required)
  • edge case code written (if required)
  • code is reviewed
  • branch is merged
  • all tests still pass

child of turingschool-projects#249

child of turingschool-projects#274

depends on turingschool-projects#247

User Story 12, Users who are logged in already are redirected

As a registered user, merchant, or admin
When I visit the login path
If I am a regular user, I am redirected to my profile page
If I am a merchant user, I am redirected to my merchant dashboard page
If I am an admin user, I am redirected to the home page of the site
And I see a flash message that tells me I am already logged in

Checklist:

  • base tests are written
  • base code is written to pass tests
  • edge case ("sad path") tests written (if required)
  • edge case code written (if required)
  • code is reviewed
  • branch is merged
  • all tests still pass

child of turingschool-projects#262

child of turingschool-projects#274

User Story 16, Item Show Page

As any kind of user on the system
When I visit an item's show page from the items catalog
My URI route is something like "/items/18"
I see all information for this item, including:
- the name of the item
- the description of the item
- a larger image of the item
- the merchant name who sells the item
- how many of the item the merchant has in stock
- the merchant's current price for the item
- an average amount of time it takes this merchant to fulfill this item

If I am a visitor or regular user, I also see a link to add this item to my cart

DO THESE STORIES FIRST:

  • User Story 14, Items Index Page

Checklist:

  • base tests are written
  • base code is written to pass tests
  • edge case ("sad path") tests written (if required)
  • edge case code written (if required)
  • code is reviewed
  • branch is merged
  • all tests still pass

child of turingschool-projects#257

child of turingschool-projects#274

depends on turingschool-projects#256

Epic: Extensions

Extensions

If your team finished all other user stories, it is expected that you will begin work on the following additional stories.

The index page indicated in these stories should be namespaced under a route "/admin". This route should only be accessible to admin users of your application. Any functionality mentioned in this epic should be performed by admin users only, and respective routes should all be namespaced under "/admin"

User Story 68, EXTENSION: Admin can fulfill order items on behalf of a merchant

As a merchant
When I visit an order show page from my dashboard
For each item of mine in the order
If the user's desired quantity is greater than my current inventory quantity for that item
Then I do not see a "fulfill" button or link
Instead I see a big red notice next to the item indicating I cannot fulfill this item

DO THESE STORIES FIRST:

  • User Story 53, Merchant fulfills part of an order
  • User Story 54, Merchant cannot fulfill an order due to lack of inventory
  • User Story 31, All Merchants fulfill items on an order

Checklist:

  • base tests are written
  • base code is written to pass tests
  • edge case ("sad path") tests written (if required)
  • edge case code written (if required)
  • code is reviewed
  • branch is merged
  • all tests still pass

child of #52

child of #125

depends on #61

depends on #60

depends on #87

Epic: Navigation

Navigation

This series of stories will set up a navigation bar at the top of the screen and present links and information to users of your site.

There is no requirement that the nav bar be "locked" to the top of the screen.

Completion of these stories will encompass the following ideas:

  • the navigation is built into app/views/layouts/application.html.erb or loaded into that file as a partial
  • you write a single set of tests that simply click on a link and expect that your current path is what you expect to see
  • your nav tests don't need to check any content on the pages, just that current_path is what you expect

You will need to set up some basic routing and empty controller actions and empty action view files.

User Story 5, Admin Navigation

As an admin user
I see the same links as a visitor
Plus the following links
- a link to my admin dashboard ("/admin/dashboard")
- a link to log out ("/logout")

Minus the following links/info:
- I do not see a link to log in or register
- a link to my shopping cart ("/cart") or count of cart items

DO THESE STORIES FIRST:

  • User Story 3, User Navigation

Checklist:

  • base tests are written
  • base code is written to pass tests
  • edge case ("sad path") tests written (if required)
  • edge case code written (if required)
  • code is reviewed
  • branch is merged
  • all tests still pass

child of turingschool-projects#272

child of turingschool-projects#274

depends on turingschool-projects#270

User Story 67, EXTENSION: Admin can manage items on behalf of a merchant

As an admin user
When I visit a merchant's profile page
I can click on the merchant's items link
And have access to all functionality the merchant does, including
- adding new items
- editing existing items
- enabling/disabling/deleting items

All content rules still apply (eg, item name cannot be blank, etc)

DO THESE STORIES FIRST:

  • User Story 44, Merchant Items Index Page
  • User Story 48, Merchant adds an item
  • User Story 50, Merchant edits an item

Checklist:

  • base tests are written
  • base code is written to pass tests
  • edge case ("sad path") tests written (if required)
  • edge case code written (if required)
  • code is reviewed
  • branch is merged
  • all tests still pass

child of #52

child of #125

depends on #71

depends on #67

depends on #65

User Story 4, Merchant Navigation

As a merchant user
I see the same links as a visitor
Plus the following links:
- a link to my merchant dashboard ("/dashboard")
- a link to log out ("/logout")

Minus the following links/info:
- I do not see a link to log in or register
- a link to my shopping cart ("/cart") or count of cart items

DO THESE STORIES FIRST:

  • User Story 3, User Navigation

Checklist:

  • base tests are written
  • base code is written to pass tests
  • edge case ("sad path") tests written (if required)
  • edge case code written (if required)
  • code is reviewed
  • branch is merged
  • all tests still pass

child of turingschool-projects#272

child of turingschool-projects#274

depends on turingschool-projects#270

User Story 62, EXTENSION: Admin views a User's Order Show Page

As an admin user
When I visit a user's profile
And I click on a link for order's show page
My URL route is now something like "/admin/users/5/orders/15"
I see all information about the order, including the following information:
- the ID of the order
- the date the order was made
- the date the order was last updated
- the current status of the order
- each item the user ordered, including name, description, thumbnail, quantity, price and subtotal
- the total quantity of items in the whole order
- the grand total of all items for that order

DO THESE STORIES FIRST:

  • User Story 56, Admin User Profile Page

Checklist:

  • base tests are written
  • base code is written to pass tests
  • edge case ("sad path") tests written (if required)
  • edge case code written (if required)
  • code is reviewed
  • branch is merged
  • all tests still pass

child of #52

child of #125

depends on #57

Epic: Merchant Items

Merchant Items

Merchants need CRUD functionality for items in the database. These stories will work through the management of items. These routes should be namespaced like "/dashboard/items" and "/dashboard/items/6" and so on. Merchants can disable items so they are no longer for sale but stay in the database so orders are still handled properly. Merchants can fully delete items if nobody has ever ordered it.

Admin functionality

Admin users share all management functionality, but the routes will be much longer, like "/admin/merchants/8/items" and "/admin/merchants/8/items/6" and so on.

User Story 26, Registered users can check out

As a registered user
When I add items to my cart
And I visit my cart
I see a button or link indicating that I can check out
And I click the button or link to check out
An order is created in the system, which has a status of "pending"
I am taken to my orders page ("/profile/orders")
I see a flash message telling me my order was created
I see my new order listed on my profile orders page
My cart is now empty

DO THESE STORIES FIRST:

  • User Story 21, User views their cart show page with items in the cart

Checklist:

  • base tests are written
  • base code is written to pass tests
  • edge case ("sad path") tests written (if required)
  • edge case code written (if required)
  • code is reviewed
  • branch is merged
  • all tests still pass

child of turingschool-projects#249

child of turingschool-projects#274

depends on turingschool-projects#247

User Story 7, User Registration

As a visitor
When I click on the 'register' link in the nav bar
Then I am on the user registration page
And I see a form where I input the following data:
- my name
- my street address
- my city
- my state
- my zip code
- my email address
- my preferred password
- a confirmation field for my password

When I fill in this form completely,
And with a unique email address not already in the system
My details are saved in the database
Then I am logged in as a registered user
I am taken to my profile page ("/profile")
I see a flash message indicating that I am now registered and logged in

DO THESE STORIES FIRST:

  • User Story 2, Visitor Navigation

Checklist:

  • base tests are written
  • base code is written to pass tests
  • edge case ("sad path") tests written (if required)
  • edge case code written (if required)
  • code is reviewed
  • branch is merged
  • all tests still pass

child of turingschool-projects#266

child of turingschool-projects#274

depends on turingschool-projects#271

User Story 19, User Editing Profile Data must have unique Email address

As a registered user
When I attempt to edit my profile data
If I try to change my email address to one that belongs to another user
When I submit the form
Then I am returned to the profile edit page
And I see a flash message telling me that email address is already in use

DO THESE STORIES FIRST:

  • User Story 17, User Profile Show Page
  • User Story 18, User Can Edit their Profile Data

Checklist:

  • base tests are written
  • base code is written to pass tests
  • edge case ("sad path") tests written (if required)
  • edge case code written (if required)
  • code is reviewed
  • branch is merged
  • all tests still pass

child of turingschool-projects#253

child of turingschool-projects#274

depends on turingschool-projects#252

depends on turingschool-projects#251

User Story 1, Deploy your application to Heroku

As a visitor or user of the site
I will perform all user stories
By visiting the application on Heroku.
Localhost is fine for development, but
the application must be hosted on Heroku.

Checklist:

  • base tests are written
  • base code is written to pass tests
  • edge case ("sad path") tests written (if required)
  • edge case code written (if required)
  • code is reviewed
  • branch is merged
  • all tests still pass

child of turingschool-projects#272

child of turingschool-projects#274

Epic: Merchant Index Page

Merchant Index Page

All users can see a merchant index page at "/merchants" which will list some basic information about each merchant. When admins visit this page, however, more functionality is found.

Epic: Items Catalog

Items

This is the main "catalog" page of the entire site where users will start their e-commerce experience. Visitors to the site, and regular users, will be able to view an index page of all items available for purchase and some basic statistics. Each item will also have a "show" page where more information is shown.

User Story 9, Registration Email must be unique

As a visitor
When I visit the user registration page
If I fill out the registration form
But include an email address already in the system
Then I am returned to the registration page
My details are not saved and I am not logged in
The form is filled in with all previous data except the email field and password fields
I see a flash message telling me the email address is already in use

DO THESE STORIES FIRST:

  • User Story 7, User Registration

Checklist:

  • base tests are written
  • base code is written to pass tests
  • edge case ("sad path") tests written (if required)
  • edge case code written (if required)
  • code is reviewed
  • branch is merged
  • all tests still pass

child of turingschool-projects#266

child of turingschool-projects#274

depends on turingschool-projects#265

User Story 63, EXTENSION: Admin cancels a user's order

As an admin user
When I visit a user's order show page
If the order is still "pending", I see a button or link to cancel the order
When I click the cancel button for an order
The same behaviors happen as if the user canceled the order themselves

DO THESE STORIES FIRST:

  • User Story 17, User Profile Show Page
  • User Story 29, User views an Order Show Page

Checklist:

  • base tests are written
  • base code is written to pass tests
  • edge case ("sad path") tests written (if required)
  • edge case code written (if required)
  • code is reviewed
  • branch is merged
  • all tests still pass

child of #52

child of #125

depends on #103

depends on #89

User Story 29, User views an Order Show Page

As a registered user
When I visit my Profile Orders page
And I click on a link for order's show page
My URL route is now something like "/profile/orders/15"
I see all information about the order, including the following information:
- the ID of the order
- the date the order was made
- the date the order was last updated
- the current status of the order
- each item I ordered, including name, description, thumbnail, quantity, price and subtotal
- the total quantity of items in the whole order
- the grand total of all items for that order

DO THESE STORIES FIRST:

  • User Story 28, User Profile displays Orders

Checklist:

  • base tests are written
  • base code is written to pass tests
  • edge case ("sad path") tests written (if required)
  • edge case code written (if required)
  • code is reviewed
  • branch is merged
  • all tests still pass

child of turingschool-projects#241

child of turingschool-projects#274

depends on turingschool-projects#239

User Story 6, Users cannot navigate to certain paths

Users should see a 404 error under the following conditions:
- if visitors try to navigate to any /profile path
- if visitors try to navigate to any /dashboard path
- if visitors try to navigate to any /admin path
- if registered users try to navigate to any /dashboard path
- if registered users try to navigate to any /admin path
- if merchants try to navigate to any /profile path
- if merchants try to navigate to any /admin path
- if merchants try to navigate to any /cart path
- if admin users try to navigate to any /profile path
- if admin users try to navigate to any /dashboard path
- if admin users try to navigate to any /cart path

If you think of any additional pages to block, please do so.

DO THESE STORIES FIRST:

  • User Story 2, Visitor Navigation
  • User Story 3, User Navigation
  • User Story 4, Merchant Navigation

Checklist:

  • base tests are written
  • base code is written to pass tests
  • edge case ("sad path") tests written (if required)
  • edge case code written (if required)
  • code is reviewed
  • branch is merged
  • all tests still pass

depends on turingschool-projects#271

depends on turingschool-projects#270

depends on turingschool-projects#269

Epic: Shopping Cart and Checkout

Shopping Cart and Checkout

This is what this app is all about: how a user can put things in a shopping cart and check out, creating an order in the process.

Visitors and Regular Users only

Merchants and Admin users cannot order items. This will cause a conflict in the project if an admin upgrades a user to a merchant and that user had previous orders of their own. We're not going to worry about this conflict.

User Story 27, User Profile displays Orders link

As a registered user
When I visit my Profile page
And I have orders placed in the system
Then I see a link on my profile page called "My Orders"
When I click this link my URI path is "/profile/orders"

DO THESE STORIES FIRST:

  • User Story 17, User Profile Show Page

Checklist:

  • base tests are written
  • base code is written to pass tests
  • edge case ("sad path") tests written (if required)
  • edge case code written (if required)
  • code is reviewed
  • branch is merged
  • all tests still pass

child of turingschool-projects#241

child of turingschool-projects#274

depends on turingschool-projects#252

User Story 25, Visitors must register or log in to check out

As a visitor
When I have items in my cart
And I visit my cart
I see information telling me I must register or log in to finish the checkout process
The word "register" is a link to the registration page
The words "log in" is a link to the login page

DO THESE STORIES FIRST:

  • User Story 21, User views their cart show page with items in the cart
  • User Story 2, Visitor Navigation
  • User Story 7, User Registration
  • User Story 10, User can Login

Checklist:

  • base tests are written
  • base code is written to pass tests
  • edge case ("sad path") tests written (if required)
  • edge case code written (if required)
  • code is reviewed
  • branch is merged
  • all tests still pass

child of turingschool-projects#249

child of turingschool-projects#274

depends on turingschool-projects#247

depends on turingschool-projects#271

depends on turingschool-projects#265

depends on turingschool-projects#261

User Story 8, User Registration Missing Details

As a visitor
When I visit the user registration page
And I do not fill in this form completely,
I am returned to the registration page
And I see a flash message indicating that I am missing required fields

DO THESE STORIES FIRST:

  • User Story 7, User Registration

Checklist:

  • base tests are written
  • base code is written to pass tests
  • edge case ("sad path") tests written (if required)
  • edge case code written (if required)
  • code is reviewed
  • branch is merged
  • all tests still pass

child of turingschool-projects#266

child of turingschool-projects#274

depends on turingschool-projects#265

Epic: Core Application

Little Shop of Orders, v2

BE Mod 2 Week 4/5 Group Project

Background and Description

"Little Shop of Orders" is a fictitious e-commerce platform where users can register to place items into a shopping cart and 'check out'. Merchant users can mark their items as 'fulfilled'; the last merchant to mark items in an order as 'fulfilled' will automatically set the order status to "shipped". Each user role will have access to some or all CRUD functionality for application models.

Students will be put into 3 or 4 person groups to complete the project.\n

Learning Goals

  • Advanced Rails routing (nested resources and namespacing)
  • Advanced ActiveRecord for calculating statistics
  • Average HTML/CSS layout and design for UX/UI
  • Session management and use of POROs for shopping cart
  • Authentication, Authorization, separation of user roles and permissions

Requirements

  • must use Rails 5.1.x
  • must use PostgreSQL
  • must use 'bcrypt' for authentication
  • all controller and model code must be tested via feature tests and model tests, respectively
  • must use good GitHub branching, team code reviews via GitHub comments, and use of a project planning tool like waffle.io
  • must include a thorough README to describe their project

Permitted

  • use FactoryBot to speed up your test development
  • use "rails generators" to speed up your app development

Not Permitted

  • do not use JavaScript for pagination or sorting controls

Permission

  • if there is a specific gem you'd like to use in the project, please get permission from your instructors first

User Roles

  1. Visitor - this type of user is anonymously browsing our site and is not logged in
  2. Registered User - this user is registered and logged in to the application while performing their work; can place items in a cart and create an order
  3. Merchant User - a registered user who is also has access to merchant data and operations; user is logged in to perform their work
  4. Admin User - a registered user (but cannot also be a merchant) who has "superuser" access to all areas of the application; user is logged in to perform their work

Order Status

  1. 'pending' means a user has placed items in a cart and "checked out" to create an order, merchants may or may not have fulfilled any items yet
  2. 'packaged' means all merchants have fulfilled their items for the order, and has been packaged and ready to ship
  3. 'shipped' means an admin has 'shipped' a package and can no longer be cancelled by a user
  4. 'cancelled' only 'pending' and 'packaged' orders can be cancelled

Not Everything can be FULLY Deleted

In the user stories, we talk about "CRUD" functionality. However, it's rare in a real production system to ever truly delete content, and instead we typically just 'enable' or 'disable' content. Users, items and orders can be 'enabled' or 'disabled' which blocks functionality (users whose accounts are disabled should not be allowed to log in, items which are disabled cannot be ordered, orders which are disabled cannot be processed, and so on).

Disabled content should also be restricted from showing up in the statistics pages. For example: if an item is disabled, it should not appear in a list of "popular items".

Be careful to watch out for which stories allow full deletion of content, and restrictions on when they apply.

Epic: Merchant Dashboard

Merchant Dashboard

This is the landing page when a merchant logs in. Here, they will see their contact information (but cannot change it), some statistics, and a list of pending orders that require the merchant's attention.

Admins can act on behalf of merchants

Admin users will see more information on the "/merchants" route that all users see. For example, on this page, an admin user can navigate to each merchant's dashboard under a route like "/admin/merchants/7". This will allow the admin to perform every action that the merchant themselves can perform. Admin users can also "downgrade" a merchant account to become a user account.

User Story 20, User adds an item to the cart

As a visitor or registered user
When I visit an item's show page from the items catalog
I see a link or button to add this item to my cart
And I click its link or button
I am returned to the item index page
I see a flash message indicating the item has been added to my cart
The navigation bar increments my cart counter

DO THESE STORIES FIRST:

  • User Story 16, Item Show Page

Checklist:

  • base tests are written
  • base code is written to pass tests
  • edge case ("sad path") tests written (if required)
  • edge case code written (if required)
  • code is reviewed
  • branch is merged
  • all tests still pass

child of turingschool-projects#249

child of turingschool-projects#274

depends on turingschool-projects#254

User Story 14, Items Index Page

As any kind of user on the system
I can visit the items catalog ("/items")
I see all items in the system except disabled items
Each item will display the following information:
- the name of the item
- a small thumbnail image for the item
- the merchant name who sells the item
- how many of the item the merchant has in stock
- the merchant's current price for the item

The item name is a link to that item's show page
The item thumbnail is a link to that item's show page

DO THESE STORIES FIRST:

  • User Story 2, Visitor Navigation

Checklist:

  • base tests are written
  • base code is written to pass tests
  • edge case ("sad path") tests written (if required)
  • edge case code written (if required)
  • code is reviewed
  • branch is merged
  • all tests still pass

child of turingschool-projects#257

child of turingschool-projects#274

depends on turingschool-projects#271

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.