Skip to content

Project 2: E Shop

Trayan Iliev edited this page May 30, 2021 · 22 revisions

Project Description

The main goal of the project is to implement a web application allowing the Users (Customers and Administrators) to register, and buy from a web-shop different types of goods online, and share their experience about bought Products using Comments.

All Users should have following common attributes:

  • id (generated automatically) - long number;
  • name - string 2 to 50 characters long;
  • email - should be valid email address, unique within the system, cannot be changed;
  • username - string 2 to 15 characters long - word characters only, unique within the system, cannot be changed;
  • password - string 8 to 15 characters long, at least one digit, one capital letter, and one sign different than letter or digit, NOT sent back to the User clients for security reasons;
  • gender - MALE / FEMALE enumeration;
  • role - CUSTOMER or ADMIN enumeration, CUSTOMER by default, editable only by Administrators;
  • picture of the user (optional)- valid URL, if missing should ne substituted with an avatar according to the gender;
  • status - validity status of the user account (ACTIVE, CHANGE_PASSWORD - should change password on login, SUSPENDED, or DEACTIVATED), accessible and editable only by Administrators;
  • metadata (optional) - string up to 512 characters long, accessible and editable only by Administrators;
  • created (generated automatically) - time stamp of the moment the user account was created;
  • modified (generated automatically) - time stamp of the moment the user account was last modified;
Additionally, the Customers should have following attributes:
  • type - enumeration PERSON, CORPORATE;
  • ssnVat - SSN of the physical persons or, ID (VAT) number of the corporate customers, string 9 to 16 characters long;
  • address - the address of the Customer, string 10 to 250 characters long;
  • orders - list of all Orders the Customer has already purchased;
  • comments - list of all Comments the Customer has shared;
The Administrators should have in addition to the User's attributes, the following fields:
  • productsAdded - list of all Products the Administrator has added to the shop;
The Customers should be able to manage their own personal data and change their passwords. The Administrators should be able to manage all user's data, except their passwords. The IDs of all entities should be generated automatically and should NOT be changeable;

The Administrators should be able to add new Products and fulfill or cancel Orders (by changing the Order status to COMPLETED or CANCELED). The Orders have the following structure:

  • id (generated automatically) - long number;
  • customer - the Customer that has placed the Order;
  • closingDate - date of Order closing (completion or cancellation);
  • orderLines - list of all OrderLines included in the Order, read further for details;
  • description (optional) - string 10 - 500 characters long allowing the Customer to add further instructions about the Order fulfillment;
  • created (generated automatically) - time stamp of the moment the entity was created;
  • modified (generated automatically) - time stamp of the moment the entity was last modified;
Each OrderLine should have the following attributes:
  • id (generated automatically) - long number;
  • order - the Order this OrderLine belongs to;
  • product - the Product ordered;
  • quantity - real number, the quantity of the Product purchased;
  • price (optional) - real number with double precision, should be taken from Product entity, if missing;
  • created (generated automatically) - time stamp of the moment the entity was created;
  • modified (generated automatically) - time stamp of the moment the entity was last modified;
Each Product should have the following attributes:
  • id (generated automatically) - long number;
  • name - the name of the 'Product, string 2 to 50 characters long;
  • description - string 5 - 2500 characters long, supporting Markdown syntax;
  • price - real number with double precision;
  • isPromoted - boolean, true if product is currently in promotion campaign, false by default;
  • promotionPercentage (optional) - real number with double precision, the percentage of promotion price discount;
  • unit - enumeration of PCS (pieces), KG (kilograms), M (meters), L (liters), PCS by default;
  • tags - string including comma separated tags, allowing to find the Products by quick search;
  • comments (optional) - list of Customer comments about the Product;
  • created (generated automatically) - time stamp of the moment the entity was created;
  • modified (generated automatically) - time stamp of the moment the entity was last modified;
The Customers should be able to add Comments about the Products. The Comments about each Product should be visible in the Product's view, after being approved by an Administrator. The Administrators should be able to approve and delete the Comments of all users. Each Reader should be able to manage (edit / delete) her/his own Comments.

Each Comment should have the following attributes:

  • id (generated automatically) - long number;
  • author - the comment's author (User);
  • product - the Product the comment is about;
  • text - string 5 - 1500 characters long, supporting Markdown syntax;
  • url (optional) - the URL of a web resource Comment author wants to refer, should be valid URL;
  • approvementStatus - enumeration of SUGGESTED, APPROVED, DISAPPROVED;
  • created (generated automatically) - time stamp of the moment the entity was created;
  • modified (generated automatically) - time stamp of the moment the entity was last modified;
In addition to the above described functionality, the web application should allow to manage (add, browse, view, edit, and delete) different types of Users, Orders, OrderLines, Products, and Comments, according to the privileges (role) of the logged-in User, as described above. All input data should be validated according to the above specified requirements. For further questions and clarification - please ask the instructor.
Copyright © 2003-2019 IPT - Intellectual Products & Technologies. All rights reserved.

Clone this wiki locally