# A2: Actors and User Stories
As an agile description of the project's requirements, this artifact includes the specification of the actors and their user stories.
## 1. Actors

<center> Figure 1: Actors Diagram </center><p></p>
| Identifier | Description |
| -------------------- | -------------------------------------------------------------------------------------------------------------------- |
| User | Generic User that can view, search for and add items to the shopping cart |
| Unauthenticated User | Can login/register in the system |
| Authenticated User | Can checkout products and mark them as favorites |
| Buyer | Autheticated User that can review produts, track and cancel orders |
| Administrator | Authenticated User that can add/remove products, check state of deliverys, delete offensive reviews and manage users |
| Email API | External API that allows the system to send an email to a user |
| Paypal API | External API that allows the user to pay their order with paypal |
<center> Table 1: Actors' descriptions </center>
## 2. User Stories
### 2.1 User
| Identifier | Name | Priority | Description |
| ---------- | -------------------------------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| US01 | See Homepage | high | As a _User_, I want to see the Homepage, so that I get an introduction of the website |
| US02 | View products list | high | As a _User_, I want to view the list of products, so that I have a general notion of the products being sold |
| US03 | View product details | high | As a _User_, I want to view a a single products details, so that I can check if the item fits my requirements |
| US04 | Search products | high | As a _User_, I want to use a search bar to search for products by name/keywords, so that I can find products that meet my requirements easily |
| US05 | View shopping cart | high | As a _User_, I want to view the products in my cart, so that I can see the products I already added |
| US06 | Manage shopping cart | high | As a _User_, I want to add and remove products from my cart, so that, when I checkout, I only buy products I'm interested in |
| US07 | Contact page | medium | As a _User_, I want to access the Contact page, so that I can contact the website owners via the email/phone/form provided and ask for help with their service |
| US08 | FAQ page | medium | As a _User_, I want to access the FAQ page, so that I can easily clarify some of my doubts about the website and how it functions |
| US09 | About page | medium | As a _User_, I want have access to the About page, so that I can learn more about the website, its owners and their goals for the website |
| US10 | See product reviews | medium | As a _User_, I want to see a product's reviews, so that I get a better idea of the quality of the real product |
| US11 | Browse product categories | medium | As a _User_, I want to browse products according to the site's categories, so that I can only see products from the categories I choose |
| US12 | Filter search results | medium | As a _User_, I want to filter search results by certain categories, so that I my search results are even more accurate to what I want |
| US13 | Sort products | low | As a _User_, I want to sort the products by price and review score, so that I can choose according to my price limit and standards |
| US14 | Manage quantity of items shopping cart | low | As a _User_, I want to alter the quantity of a product in my cart, so that I don't need to visit the proucts' page to ad more |
<center> Table 2: User user stories </center>
### 2.2 Unauthenticated User
| Identifier | Name | Priority | Description |
| ---------- | ---------------------- | -------- | -------------------------------------------------------------------------------------------------- |
| US15 | Log in | high | As an _Unauthenticated User_, I want to authenticate in the system to have access to other features|
| US16 | Create account | high | As an _Unauthenticated User_, I want to sign up to the system so that I can sign in after |
<center> Table 3: Unauthenticated User user stories </center>
### 2.3 Authenticated User
| Identifier | Name | Priority | Description |
| ---------- | ---------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| US17 | See profile | high | As an _Authenticated User_, I want to see my profile, so that I have easy access to all my information |
| US18 | Edit profile | high | As an _Authenticated User_, I want to edit my profile, so that my information is up to date |
| US19 | Delete account | high | As an _Authenticated User_, I want to delete my profile, so that my account and information is erased |
| US20 | Sign out | high | As an _Authenticated User_, I want to sign out, so that can close my account on the website |
| US21 | See purchase history | high | As an _Authenticated User_, I want to view my purchase history, so that I keep track of all my past and current orders |
| US22 | Checkout | high | As an _Authenticated User_, I want to place an order, so that I can get the products I added to my shopping cart |
| US23 | Manage wishlist | medium | As an _Authenticated User_, I want to add remove products to and from my wishlist, so that I can buy products when they become available or stop tracking said products if I no longer want them |
| US24 | Availability email | medium | As an _Authenticated User_, I want to get an email when a product in my wishlist becomes available, so that I can purchase it |
| US25 | Price change email | medium | As an _Authenticated User_, I want to get an email when a product in my cart changes, so that I can decide if I still want to buy it or not |
| US26 | Add image to review | low | As an _Authenticated User_, I want to add an image to my review of a product, so that other users can better understand my review |
| US27 | Report review | low | As an _Authenticated User_, I want to report a review, so that I can help the website identify offensive speech |
<center> Table 4: Authenticated User user stories </center>
### 2.4 Buyer
| Identifier | Name | Priority | Description |
| ---------- | ------------------------------------ | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| US28 | Review product | medium | As a _Buyer_, I want to review a purchased product, so that I can share my opinion on the product with the rest of the users |
| US29 | Manage review | medium | As a _Buyer_, I want to edit and/or delete my review, so that I can update my opinion on the product, fix a typo or remove the review from the site |
| US30 | Track order | medium | As a _Buyer_, I want to track an order, so that I can see in which processing stage it is |
| US31 | Cancel order | medium | As a _Buyer_, I want cancel an order, so that I don't recieve the items i previously purchased |
| US32 | Payment approved email | medium | As a _Buyer_, I want to receive an email when my payment is approved, so that I know my order has been approved |
| US33 | Processing stage change email | medium | As a _Buyer_, I want to receive an email when the processing stage of my order has changed, so that I can easily keep up to date on the state of my order |
| US34 | Refund Request | medium | As a _Buyer_, I want to request a refund of a bought item, so that if the product my expectations I can be refunded |
<center> Table 5: Buyer user stories </center>
### 2.5 Administrator
| Identifier | Name | Priority | Description |
| ---------- | --------------------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| US35 | View reports list | medium | As an _Administrator_, I want to have a look at all the review reports made by users, so that I can delelte their reviews if they have inappropriate language |
| US36 | Add product | medium | As an _Administrator_, I want to add an item to the system to be sold, so that when there are new items to be sold I can put them up for sale |
| US37 | Remove product | medium | As an _Administrator_, I want to remove an item from sale, so that the user no longer sees the option to buy products with zero stock |
| US38 | Manage products information | medium | As an _Administrator_, I want to change a product's information, such as their category or description, so that the information matches the actual product |
| US39 | Manage product categories | medium | As an _Administrator_, I want to add or remove product categories, so that I can sell new types of products or remove types of products that are no longer sold |
| US40 | Manage products stock | medium | As an _Administrator_, I want alter a products' stock, so that the stock presented on the site is equivalent to the stock of store |
| US41 | View users' product history | medium | As an _Administrator_, I want consult a user's purchase history, so that I get a better idea of what that consumer most likes |
| US42 | Manage order status | medium | As an _Administrator_, I change teh status of an order, so that the buyer knows their order is has change its stage |
| US43 | Ban User | low | As an _Administrator_, I want ban a user who violeted the Terms of Service, so that they can no longer break the rules |
| US44 | Delete review | low | As an _Administrator_, I want to remove a review, so that users of the site are subjected to offensive speech |
| US45 | List refund requests | low | As an _Administrator_, I want to list refund request, so that I can accept or decline them based on what they wrote |
| US46 | Manage refund requests | low | As an _Administrator_, I want to accept or decline a user's refund request, so that the buyers can get a refund if they have a bad expirience |
| US47 | Manage discounts | low | As an _Administrator_, I want to add or remove discounts, so that the prices on the store represent the real value of the item |
<center> Table 6: Administrator user stories </center>
## 3. Supplementary Requirements
### 3.1 Business Rules
| Identifier | Name | Description |
| ---------- | -------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| BR01 | Purchases | Administrator accounts are separate from user accounts, meaning they are unable to make purchases |
| BR02 | Orders | Unauthenticated users can add and remove products from the shopping cart, but they cannot place an order without signing up first |
| BR03 | Deleted user | When a user is deleted/banned, their profile and cart are deleted, but their reviews and purchase history are not |
| BR04 | Inventory | A product can only be bought by an authenticated user if it is in stock and the quantity of the selected product isn't bigger than the quantity in stock |
| BR05 | Clothing types | The available product types are: "Coats and Jackets", "Jumpers and Sweaters", "Suits", "Dresses", "Skirts", "Tops and T-shirts", "Pants and Shorts", "Jumpsuits", "Activewear", "Shoes and Boots", "Accessories"|
| BR06 | Order Stages | An order can have 6 stages: "Order Placed", "Preparing", "Shipped", "Finished", "Canceled" or "Refunded"|
| BR07 | Dates | No order can have the date of the order being placed bigger than the expected date of delivery|
<center> Table 7: Business Rules </center>
### 3.2 Technical Requirements
| Identifier | Name | Description |
| ---------- | ------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| TR01 | Availability | The system must be available 99 percent of the time in each 24-hour period |
| __TR02__ | __Accessibility__ | The system must ensure that everyone can access the pages, regardless of whether they have any handicap or not, or the Web browser they use <br><br> __Everyone wears clothes, therefore everyone should be able to use and access the website, whether they have or not any type of vision impairment for example__ |
| __TR03__ | __Usability__ | The system should be simple and easy to use <br><br> __Because the system is intended to be utilized by consumers of almost all ages (mostly above 18), with or without technological skills, a very good usability is a crucial necessity__ |
| TR04 | Performance | The system should have response times shorter than 2s to ensure the user's attention |
| __TR05__ | __Web application__ | The system should be implemented as a Web application with dynamic pages (HTML5, JavaScript, CSS3 and PHP) <br><br> __Dyanmic pages allow a more efficient and pratical viewing/updating of the website itself and the use of real-time data saving the user a lot of time__ |
| TR06 | Portability | The server-side system should work across multiple platforms (Linux, Mac OS, etc.) |
| TR07 | Database | The PostgreSQL 9.4 database management system must be used |
| TR08 | Security | The system shall protect information from unauthorised access through the use of an authentication and verification system |
| TR09 | Robustness | The system must be prepared to handle and continue operating when runtime errors occur |
| TR10 | Scalability | The system must be prepared to deal with the growth in the number of users and their actions |
| TR11 | Ethics | The system must respect the ethical principles in software development (for example, the password must be stored encrypted to ensure that only the owner knows it) |
<center> Table 8: Technical Requirements </center>
### 3.3 Restrictions
| Identifier | Name | Description |
| ---------- | -------- | ----------------------------------------------------- |
| C01 | Deadline | The system should be ready by the end of the semester |
<center> Table 9: Project Restrictions </center>