Skip to content

ClassCode

karalleyna edited this page Mar 24, 2020 · 1 revision
@startuml Getflix
class Message {
    Int productId
    String text
    Date date
    RegisteredUser sender
    RegisteredUser receiver

    RegisteredUser getSender()
    RegisteredUser getReceiver()
    Int getSubject()
    String getText()
    Date getDate()
    void setReceiver(RegisteredUser user)
    void setSender(RegisteredUser user)
    void setDate(Date date)
    void setText(String context)
    void setProductId(Int id)
}

class MessageController {
    HashMap<RegisteredUser,List<Message>> chats

    Message createMessage(Int productId,String context,RegisteredUser receiver)
    Boolean sendMessage(Message message)
    Boolean receiveMessage(Message message)
    Boolean validateOrder(Int productId)
    Boolean validateReceiver(RegisteredUser receiver)
    List<Message> getChat(RegisteredUser user)
    HashMap<RegisteredUser,List<Message>> getChats()
}

class Card {
    Int id 
    Int securityCode
    String owner
    Date expirationDate
    Type type

    Boolean validateCardId()
    Boolean verify()
}

class CommentRateSystem {

    Boolean validateComment(Customer customer,Product product)
    Comment createComment(Int rate ,String comment,Customer sender)
    Boolean addComment(Product product,Comment comment)
    void setRate(Product product,Int rate)
    void incrementNumOfReviews(Product product)
    Boolean validateRate(Customer customer,Vendor vendor,Int rate)
    void setRate(Vendor vendor, Int rate)
    void incrementNumOfReviews(Vendor vendor)
    Boolean addReply(Product product, Comment comment, Reply reply)
    Reply createReply(Vendor vendor, Product product, Comment comment , String text)
}

class ProductDeliverySystem {
    HashMap<Customer,OrderInformation> deliveries

    void receiveOrderRequest(Customer customer,OrderInformation orderInformation)
    void deliver(Customer customer)
    void setDeliverDate(OrderInformation orderInformation,Date deliverDate)
    void setTrackingURL(OrderInformation orderInformation,String trackingURL)
    void setTrackingId(OrderInformation orderInformation,StringTrackingId)
    void setStatus(OrderInformation orderInformation,String status)
    void updateCustomer(Customer customer, OrderInformation orderInformation)
}

class OrderController {
    HashMap<Int,OrderInformation> orders

    void addOrder(OrderInformation orderInformation)
    OrderInformation getOrderInformation(Int orderId)
    void cancelOrder(Int orderId)
    Boolean validateOrderCancellation(Int orderId)
    void updateOrderInformation(OrderInformation orderInformation)
}

class NotificationSystem {
    List<Notification> notifications

    void sendPriceChangeNotification(User user)
    void handlePriceChange(Int productId)
    void addPriceChangeListener(User user, Int productId)
}
class RecommenderSystem {
    Stack<Product> recommended

    Stack<Product> getRecommended()
    Boolean validateList()
    void addRecommendedProduct(Product product)
}

class Admin extends RegisteredUser {

    void banUser(RegisteredUser user)
    void deleteComment(Comment comment)
    void deleteReply(Reply reply)
}

class Vendor extends RegisteredUser {
    ProductController productController
    ProductDeliverySystem productDeliverySystem	
    CompanyInformation company	
    Int rate
    Int numberOfReviews

    Boolean reply(Comment comment,Reply reply)
}

class User {
    String authenticationToken

    List<Comment> viewComment(Product product)
    List<Product> searchProduct(String keyword, Category category)
    List<Vendor> searchVendor(String keyword)
}

class PaymentController {
    HashMap<Product,Int> orders
    Card card
    Location billingAddress
    Location deliveryAddress

    Boolean setBillingAddress(Location billingAddress)
    Location getBillingAddress()
    Boolean setDeliveryAddress(Location deliveryAddress)
    Location getDeliveryAddress()
    Boolean validateDeliveryAddress(Product product)
    Double getTotalAmount()
    Boolean verifyCard()
    Boolean makePayment(Product product)
    void setOrders(List<Product> order)
    List<Product> getOrders()
    OrderInformation createOrder(Int orderId,Date orderDate)
    void saveOrder(OrderInformation orderInformation)
    void notifyVendor(OrderInformation orderInformation)
}

class ProductController {
    HashMap<Int,Product> products

    void changePrice(int id,int newPrice)
    void deleteProduct(int id)
    Int encryptProduct(String name,Category category,String,Double Price)
    Product createProduct(String name,Category category,String productPicture,Double Price,String description)
    void setCargoInformation(Status status, List<Location> deliverableTo)
    void addProduct(int id, Product product)
    void updateDescriptionOfProduct(int id,string text)
    List<Product> getProducts()
}

class Guest extends User {
    HashMap<Product,Int> shoppingCart
    PaymentController paymentController

    Boolean signUp(PersonalInformation)
    Boolean signUpWithGoogle()
    Boolean checkOutShoppingCart()
    Boolean createCard(Int securityCode, String owner, Date expirationDate)
}

class RegisteredUser extends User {
    PersonalInformation personalInfo
    Boolean isVerified
    Boolean isSignedUpWithGoogle
    MessageController messageController

    Boolean signInWithGoogle()
    Boolean signIn(String email,string password)
    Boolean changePassword(String email, string password)
}

class Customer extends RegisteredUser {
    HashMap<Product,Int> shoppingCart
    List<Card> creditCard
    PaymentController paymentController
    OrderController orderController
    ProductListController productListController

    Boolean sendComment(Int rate, String comment, Customer sender,Product product)
    void like(Comment comment)
    void dislike(Comment comment)
    void addToCart(Product product, Int quantity)
    void removeFromCart(Product product)
    HashMap<Product,Int> getShoppingCart()

}

class ProductListController {
    HashMap<String, List<Product>> lists

    void createList(String name,List<Product> list)
    void addProduct(String name,Product product)
    void deleteProduct(String name,Product product)
    void updateName(String oldName, String newName)
    List<Product> getListByName(String name)
}

class Product {
    ProductInformation productInformation
    Status status
    List<Location> deliverableTo
    Vendor vendor
    Int rate
    Int numOfReviews
    List<Comment> comments
    Date date

    ProductInformation getProductInfo()
    Vendor getVendor()
    List<Comment> getComments()
    void addLocation(Location newLocation)
    void setDeliverableTo(List<Location> locations)
    void setVendor(Vendor vendor)
    void setDate(Date date)
    Date getDate()

}

class Reply {
    String reply
    Vendor writer
}

class OrderInformation {
    String productName
    String status
    Int quantity
    Date orderDate
    Date deliverDate
    String trackingId
    String trackingURL

    void setDeliverDate(Date date)
    void setTrackingId(String TrackingId)
    void setTrackingURL(String TrackingURL)
    void setOrderDate(Date date)
    Date getOrderDate()
    Date getDeliverDate()
    String getTrackingId()
    String getTrackingURL()
    Double getTotalAmount()
    void setQuantity(Int quantity)
    Int getQuantity()
}

class Comment {
    Int rate
    String comment
    Customer writer
    Int numOfLikes
    Int numOfDislikes
    Reply reply

    Int getNumOfLikes()
    Int getNumOfDislikes()
}

class Location {
    String city
    String country
    String street
    String additional
    Int postalCode

    String getLocation()
    String getCity()
    String getCountry()
    String getStreet()
    String getAdditional()
    Int getPostalCode()
    void setCity(String city)
    void setCountry(String country)
    void setStreet(String street)
    void setAdditional(String additional)
    void setPostalCode(Int postalCode)
    Boolean validate()
}

class AuthorizationService {
    Boolean isAuthorized(String authorizationToken)  
    void setAuthorized(Boolean isAuthorized)
    String getAuthorization(String authenticationToken)
    Boolean checkGoogleSignUpPermission(String authorizationToken)
    Boolean checkUpdateProductInformationPermission(String authorizationToken)
    Boolean checkUpdateStockInformationPermission(String authorizationToken)
    Boolean checkSendMessagePermission(String authorizationToken)
    void setUpdateProductInformationPermission(String authenticationToken)
    void setGoogleSignUpPermission(String authenticationToken)
    void setUpdateStockInformationPermission(String authenticationToken)
    void setSendMessagePermission(String authenticationToken)
}

class AuthenticationController {
    HashMap<String, Date> authenticationSession

    void sendTermsOfServices()
    Boolean isAuthenticated(String authenticationToken)  
    void setAuthenticated(Boolean isAuthenticated)
    String getAuthentication(String email)
    Boolean signIn(String email,String password)
    Boolean signInWithGoogle()
    void sendPasswordResetEmail(String email)
    Boolean validatePassword(String password)
    Boolean validateUsername(String username)
    Boolean validateLocation(Location location)
    Boolean verifyEmail(String email)
    void setVerified(Boolean isVerified)
    Boolean updatePassword(String newPassword)
    Boolean signOut(String authenticationToken)
    RegisteredUser signUp(Personal Information personalInformation)
    RegisteredUser signUpWithGoogle()
    Boolean checkGoogleSignIn(String email)
}

class CompanyInformation {
    String name
    String logo

    void setName(String name)
    void setLogo(String logo)
    String getName()
    String getLogo()
}

class PersonalInformation {
    String username
    String hashedPassword
    String email
    String firstName
    String lastName
    Location address

    void setUsername(String username)
    void setPassword(String hashedPassword)
    void setEmail(String email)
    void setFirstName(String firstName)
    void setLastName(String lastName)
    void setAddress(String address)
    void setLocation(Location address)

    String getUsername()
    String getHashedPassword()
    String getEmail()
    String getFirstName()
    String getLastName()
    Location getAddress()
}

class ProductInformation {
    String name
    Category category
    String productPicture
    Double price
    String description

    Boolean setPrice(Double price)
    Boolean setName(String name)
    Boolean setType(Category category)
    Boolean setPicture (String pictureAddress)
    Boolean setDescription(String description)
    String getName()
    Category getType()
    String getPicture()
    Double getPrice()
    String getDescription()
    Vendor getVendor()
}

class SearchEngine {
    List<Vendor> searchVendor(String name)
    List<Product> searchProduct(String name, Category category)
    List<Product> bestSellers(List<Product> list)
    List<Product> highToLow(List<Product> list)
    List<Product> lowToHigh(List<Product> list)
    List<Product> newestArrivals(List<Product> list)
    List<Product> sortByRate(List<Product> list)
    List<Product> sortByReviews(List<Product> list)
    List<Product> filterByRate(List<Product> productList)
    List<Product> filterByVendor(List<Product> productList)
    List<Product> filterByRange(List<Product> productList)
}

enum Category {
  ARTSCRAFTS
  AUTOMOTIVE
  BABY 
  BEAUTYPERSONALCARE 
  BOOKS
  BOYSFASHION
  COMPUTERS
  CAMERAPHOTO
  CELLPHONESACCESSORIES
  DIGITALVIDEOS
  ELECTRONICS
  FURNITURE
  GIRLSFASHION
  HEALTHHOUSEHOLDS
  HOMEGARDEN
  INDUSTRIALSCIENTIFIC
  LUGGAGE
  MENSFASHION
  MOVIESTVS
  MUSICCDS
  PETSUPPLIES
  SOFTWARE
  SPORTSOUTDOOR
  TOYSGAMES
  VIDEOGAMES
  WOMENSFASHION
}

enum Type{
  CREDITCARD
  DEBITCARD
}

enum Status{
  AVAILABLE
  OUTOFSTOCK
  ONLINEONLY
}

RegisteredUser “1” *-- “1” MessageController
MessageController “1” *— “0..*” Message : controls
Message “1”  --> “2” RegisteredUser : has
NotificationSystem “1” *— “0..*” Notification : controls
RecommenderSystem “1”--> “0..*” Product : has
Vendor “1” *-- “1” ProductController
Vendor “1” *-- “1” ProductDeliverySystem 
Vendor “1” *— “1” OrderInformation
PaymentController “1”  --> “0..*”  Product : has
OrderController “1”  o— “0..*”  OrderInformation : has
ProductDeliverySystem “1”  o— “0..*”  OrderInformation : has
ProductController “1” *— “0..*” Product : controls
Guest “1”  --> “0..*”  Product : has
PaymentController "1"--> "1" Card : has
ProductListController "1" -> "0..*" Product : controls
AuthenticationController "1" *-- "0..*" User 
CommentRateSystem "1" *-- "0..*" Comment : controls
CommentRateSystem "1" *-- "0..*" Reply : controls
AuthorizationService "1" ->"0..*" User : controls
NotificationSystem "1"-> "0..*" Product : watches
@enduml

Logo

🏠 Home

👤 Group Members

Practice App

💻 Project

📆 Meeting Notes

CMPE352 Meeting notes

CMPE451 Meeting notes

📈 Milestones

📜 Assignments

🔎 Research

Clone this wiki locally