Are these suitable classes for an online stationery store using scala2.12.19?

I am relatively new to scala and I was tasked with creating 10 classes for an online stationery website/store. I am unsure if I have used the different types of classes such as: abstract class, case class, traits, and inherited classes correctly. I am using scala 2, JDK 1.8, and scala version 2.12.19. The classes do not need implementation but needs to show the behaviour and characteristics of the classes.

Are these valid classes in scala2 and suitable to be used to describe an online stationery store? Are there better alternatives to the classes I have written down below? These are the classes I have written down below:

//Case class for holding Login data
case class Login(username: String, password: String)

//Class for user authentication when logging in
class Authentication (val user: User){
  def authenticate(login: Login) : Boolean = {
    user.login.password == login.password && user.login.username == login.username
  }
}

//Abstract class used to represent a user of the system
abstract class User(val id: Int, val firstName: String, val lastName: String, val username: String, var email: String,
                    var phoneNumber: String, var address: String, var login: Login) {
  //updateProfile() method to update user profile.
  def updateProfile() : Unit
  def saveProfile() : Unit
  def deleteProfile() : Unit //deleteProfile() method to delete user profile.
  //Common implementation to delete profile
}

//Class for Admin
class Admin(_id: Int, _firstName: String, _lastName: String, _username: String, _email: String, _phoneNumber: String, _address: String, _login: Login)
  extends User(_id, _firstName, _lastName, _username, _email, _phoneNumber, _address, _login) {
  override def updateProfile(): Unit = { //Admin-specific implementation to update profile. Such as allow Admin to update his own profile or update customer's profile
  }
  override def saveProfile(): Unit = {
  }
  override def deleteProfile(): Unit = { //Admin-specific implementation to delete profile. Such as administrative action to delete Customer's profile.
  }
}

//Class for Customer
class Customer(_id: Int, _firstName: String, _lastName: String, _username: String, _email: String, _phoneNumber: String, _address: String, _login: Login) extends User(_id,
  _firstName, _lastName, _username, _email, _phoneNumber, _address, _login) {
  //Customer-specific methods.
  override def updateProfile(): Unit = {
  }
  override def saveProfile(): Unit = {
  }
  override def deleteProfile(): Unit = {
  }
}

trait Reusable {
}

//Abstract class used to represent a generic product found in the store
abstract class Product(val id: Int, val name: String, val sellerName: String, var price: Double, val category: String) {
  def changePrice(): Unit
  def displayProductDetails(): Unit
  def discount(): Unit
}

//Class for Book
class Book(_id: Int, _name: String, _sellerName: String, _price: Double, _category: String,
           val author: String, val publisher: String) extends Product(_id, _name, _sellerName, _price, _category) {
  //Common implementation for Book category
  override def displayProductDetails(): Unit = {
    //Book specific implementation for displaying different books
  }
  override def discount(): Unit = {
    //Book specific discount depending on what type of book and what type of discount being offered.
  }
  override def changePrice(): Unit = {
  }
}

//Class for Writing Utensil
class Stationery(_id: Int, _name: String, _sellerName: String, _price: Double, _category: String)
  extends Product(_id, _name, _sellerName, _price, _category) with Reusable {
  //Common implementation for Writing Utensil category (Pen, pencil, etc.)
  override def displayProductDetails(): Unit = {
  }
  override def discount(): Unit = {
  }
  override def changePrice(): Unit = {
  }
}

//Case class for Review data
case class Review(productId: Product, userId: User, rating: Double, comment: String ) {
  def postReview(): Unit = {
  }
}

I have read through the classes but I am unsure whether I have correctly and accurately defined good classes and used good OOP concepts to make the code “maintainable”.

New contributor

Wong Jun Teng is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật