Giter Site home page Giter Site logo

little_shop_v2's Introduction

Schema

Image description

Little Shop (Version 2)

Little shop is a replication of an e-commerce site. On this site, users can be visitors, consumers, merchants, and admins. Users are required to register in order to shop at this online store. They are able to shop via an item list, add items to a cart, and checkout. Merchants are then able to log in, and fulfill their orders. Admin have complete control over Merchants and their items. Admin are able to enable and disable merchants and their items, whereas Merchants are just able to control their items. Admin are also the only ones that are able to upgrade/downgrade a registered user to a merchant, and vice versa. All users have access to most, if not all aspects of CRUD.

The user experience should be dull, but every user will be thoroughly impressed with the logic that was implemented by four 10-week-old coders.

Contributors: Kate, Quinn,Tim,Meghan

Getting Started

To run this application locally, clone this repo and follow the steps below:

$ bundle

$ rake db:create db:migrate db:seed

Start up your rails server with rails s and open localhost:3000 in your browser.

Prerequisites

Rails Version 5.1 Ruby Version: 2.4

Running Tests

Run rspec to run the test suite

More Information

User Stories- https://github.com/turingschool-projects/little_shop_v2

little_shop_v2's People

Contributors

kate-v2 avatar megstang avatar q-win avatar timothyfell avatar iandouglas avatar dionew1 avatar

Watchers

James Cloos avatar  avatar  avatar

Forkers

megstang

little_shop_v2's Issues

UserStory - "MerchantUsers" CRUD - Story 2

As an admin user
When I visit a merchant's profile page ("/merchants/6")
I see a link to "downgrade" the user's account to become a regular user
When I click on that link
I am redirected to ("/users/6") because the merchant is now a regular user
And I see a flash message indicating the user has been upgradeded
The next time this user logs in they are now a merchant

UserStory - "Order" CRUD - Story 5

As a merchant
When I visit an order show page
I see the customer's name an address, but only the items in the order that are being purchased from me
I do not see any items in the order being purchased from other merchants
For each item, I see the following information:

  • the name of the item, which is a link to my item's show page
  • a small thumbnail of the item
  • my price for the item
  • the quantity the user wants to purchase

If the user's desired quantity is equal to or less than my current inventory quantity for that item
And I have not already "fulfilled" that item:

  • Then I see a button or link to "fulfill" that item
  • When i click on that link or button I am returned to the order show page
  • I see the item is now fulfilled
  • I also see a flash message indicating that I have fulfilled that item
  • My inventory quantity is permanently reduced by the user's desired quantity

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
css:
#cannot-fulfill { BE RED }

UserStory-"Items"CRUD-Story 9

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 items
    All content rules still apply (eg, item name cannot be blank, etc)

UserStory - "MerchantUsers" CRUD - Story 3

As an admin user
If I visit a profile page for a user, but that user is a merchant
Then I am redirected to the appropriate merchant dashboard page.

eg, if I visit "/users/7" but that user is a merchant
then I am redirected to "/merchants/7" and see their merchant dashboard page

UserStory - "User" CRUD - Story 8

As an admin user
When I visit the user index page
And I click on an "enable" button for a user
I am returned to the 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

UserStory - "MerchantUsers" CRUD - Story 4

As an admin user
If I visit a profile page for a merchant, but that merchant is a regular user
Then I am redirected to the appropriate user profile page.

eg, if I visit "/merchants/8" but that account is just a regular user
then I am redirected to "/users/8" and see their user profile page

UserStory - Nav - Story 1

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")

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

UserStory - "User" CRUD - Story 4

As a registered user, merchant, or admin
When I visit my profile page
And 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
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

UserStory - "User" CRUD - Story 11

As an admin user
When I visit a user's profile page
And I click the link to see a user's orders
Then my URI route should be something like "/users/5/orders"
And I only see that user's orders

UserStory-"Items"CRUD-Story 8

As a merchant
When I try to edit an existing item
If any of my data is incorrect
Then I am returned to the form
I see one or more flash messages indicating each error I caused
All fields are re-populated with my previous data

UserStory - "User" CRUD - Story 9

As an admin user
When I visit the user index page
And I click on any user's name
I am taken to that user's profile page
My current URI route is something like "/users/5"
(only admin users can use this route)
And I see their profile page
And I see a link to edit their profile data

UserStory - "Session" CRUD - Story 4

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

UserStory - "User" CRUD - Story 3

As a registered user, merchant, or admin
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
I also see statistics about my user account
If my account has ordered items
Then I also see a link to my orders page ("/orders")

UserStory - Nav - Story 3

As a merchant user
I see the same links as a registered user
Plus the following links

  • a link to my merchant dashboard ("/dashboard")

UserStory - "Session" CRUD - Story 3

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

UserStory-"Items"CRUD-Story 3

As a merchant
When I visit my items page
And I click on a "disable" button or link for an item
I am returned to my items page
I see a flash message indicating this item is no longer for sale
I see the item is now disabled

UserStory - "Merchant" CRUD - Story 4

As an admin user
When I visit the merchant index page
And I click on an "enable" button for a merchant
I am returned to the merchant index page
And I see a flash message that the merchant's account is now enabled
And I see that the merchant's account is now enabled
This merchant can now log in

UserStory - "Items" CRUD - Story 2

As a merchant
When I visit my items page
I see a link to add a new item to the system
I see each item I have already added to the system, including:

  • the ID of the item
  • the name of the item
  • a thumbnail image for that item
  • the price of that item
  • my current inventory count for that item
  • a link or button to edit the item
    If the item is enabled, I see a button or link to disable the item
    If the item is disabled, I see a button or link to enable the item

UserStory - "User" CRUD - Story 6

As an admin user
When I visit the user index page ("/users")
I see all users in the system
Each user's full name is a link to their respective show 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

DTR

Add a DTR as markdown on Tuesday 10/23

UserStory- "Items" CRUD - Story 4

As a merchant
When I visit my items page
And I click on an "enable" button or link for an item
I am returned to my items page
I see a flash message indicating this item is now available for sale
I see the item is now enabled

UserStory - Nav - Story 2

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 see my orders ("/profile/orders")
  • 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)

UserStory - Nav - Story 4

As an admin user
I see the same links as a registered user
Plus the following links

  • a link to the admin dashboard ("/dashboard")
  • a link to see all users ("/users")

UserStory - "Merchant" CRUD - Story 3

As an admin user
When I visit the merchant index page
And I click on a "disable" button for a merchant
I am returned to the merchant index page
And I see a flash message that the merchant's account is now disabled
And I see that the merchant's account is now disabled
This merchant cannot log in

UserStory-"Items"CRUD-Story 7

As a merchant
When I visit my items page
And I click the edit button or link next to any item
Then I am taken to a form similar to the 'new item' form
My URI route will be something like "/items/15/edit" (if the item's ID was 15)
The form is re-populated with all of this item's information
I can change any information, but all of the rules for adding a new item still apply:

  • name and description cannot be blank
  • price cannot be less than $0.00
  • inventory must be 0 or greater
    When I submit the form
    I am taken back to my items page
    I see a flash message indicating my item is updated
    I see the item's new information on the page, and it maintains its previous enabled/disabled state
    If I left the image field blank, I see a placeholder image for the thumbnail

UserStory - "Items" CRUD - Story 1

As a merchant
When I visit my dashboard page ("/dashboard")
I see a link to view my own items
When I click that link
My URI route should be "/dashboard/items"

UserStory - "Merchant" CRUD - Story 7

As an admin user
When I visit a merchant's dashboard page
And I click the link to see that merchant's orders
Then my URI route should be something like "/merchants/6/orders"
And I only see the orders containing items from this merchant

UserStory - "User" CRUD - Story 5

As a registered user, merchant, or admin
When I attempt to edit my profile data
I see a form like the registration page
The form contains all of my user information
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

UserStory - "User" CRUD - Story 2

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

UserStory - "Merchant" CRUD - Story 2

As an admin user
When I visit the merchants index page ("/merchants")
I see all merchants in the system
Each merchant's name is a link to their respective show page
I see a "disable" button next to any merchants who are not yet disabled
I see an "enable" button next to any merchants whose accounts are disabled

UserStory-"Items"CRUD-Story 5

As a merchant
When I visit my items page
And I click on the link to add a new item
My URI route should be "/dashboard/items/new"
I see a form where I can add new information about an item, including:

  • the name of the item, which cannot be blank
  • a description for the item, which cannot be blank
  • a thumbnail image URL string, which CAN be left blank
  • a price which must be greater than $0.00
  • my current inventory count of this item which is 0 or greater
    When I submit valid information and save the form
    I am taken back to my items page
    I see a flash message indicating my new item is saved
    I see the new item on the page, and it is enabled and available for sale
    If I left the image field blank, I see a placeholder image for the thumbnail

UserStory - "Order" CRUD - Story 7

As an admin
When I visit the orders index page ("/orders")
I see a "cancel" button next to each order which has not yet "complete"
If I click on the "cancel" button
Each row in the "order items" table is given a status of "canceled"
The order itself is given a status of "canceled"
Merchants and users can no longer take any additional action on this order
Admins cannot reset an order back to pending or completed states

UserStory - "Merchant" CRUD - Story 6

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

UserStory - "Session" CRUD - Story 1

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
I am directed to my profile page
And I see a flash message that I am logged in

UserStory - "User" CRUD - Story 10

As an admin user
When I visit a user's profile page ("/users/5")
And I click the link to edit a 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 "/users/5" when I am finished

UserStory - "User" CRUD - Story 7

As an admin user
When I visit the user index page
And I click on a "disable" button for a user
I am returned to the 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

UserStory - "User" CRUD - Story 1

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

UserStory-"Items"CRUD-Story 6

As a merchant
When I try to add a new item
If any of my data is incorrect
Then I am returned to the form
I see one or more flash messages indicating each error I caused
All fields are re-populated with my previous data

UserStory - "Merchant" CRUD - Story 5

As an admin user
When I visit the merchant index page
And I click on any merchant's name
I am taken to that merchant's profile page
My current URI route is something like "/merchants/6"
Only admin users can use this route
And I see their profile page
And I see a link to edit their profile data

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.