The purpose of this task is to check your knowledge and understanding in Java and Spring.
Duration: 15 hours
Your objective is to develop a "Book Store Service" following the MVC pattern.
Project may have two main roles of authority: customer and employee.
The project structure is already set up, with essential classes waiting for implementation in their respective folders. Your project is organized into several packages. Here's a brief overview of each:
- Houses all configuration classes.
- Contains controller files.
- Contains DTO files.
- Contains all model classes.
- Contains custom user exception files.
- Contains repository files.
-
Includes interfaces with declared methods for all services.
-
impl: Encompasses implementations of declared services.
The class diagram of the Domain model is shown in the figure below:
For Any Registered Users
- Access a list of available books.
- View detailed information about any book.
- Edit personal information and view user profile.
For Employees
- Add, edit, or delete books from the list.
- Confirm orders placed by customers.
- Block or unblock customer accounts.
- Access a list of registered customers.
For Customers
- Add books to the basket for purchase.
- Delete their account.
- Submit orders for purchase.
Below is a list of available services with corresponding methods for implementation.
Note: You can add your own methods to existing services, as well as create additional services.
getAllOrdersByClient(email: String)Retrieves a list of all orders by client's email placed in the system.getAllOrdersByEmployee(email: String)Retrieves a list of all orders by employee's email placed in the system.addOrder(order: OrderDTO)Adds a new order to the system, incorporating the provided order details.
getAllEmployees()Retrieves a list of all employees registered in the system.getEmployeeByEmail(email: String)Fetches details of a specific employee based on their email.updateEmployeeByEmail(email: String, employee: EmployeeDTO)Updates the information of an existing employee identified by their email with the provided details.deleteEmployeeByEmail(email: String)Removes an employee from the system based on their email.addEmployee(employee: EmployeeDTO)Registers a new employee in the system with the provided details.
getAllClients()Retrieves a list of all clients (customers) registered in the system.getClientByEmail(email: String)Fetches details of a specific client based on their email.updateClientByEmail(email: String, client: ClientDTO)Updates the information of an existing client identified by their email with the provided details.deleteClientByEmail(email: String)Removes a client from the system based on their email.addClient(client: ClientDTO)Registers a new client in the system with the provided details.
getAllBooks()Retrieves a list of all books available in the store.getBookByName(name: String)Fetches details of a specific book based on its name.updateBookByName(name: String, book: BookDTO)Updates the information of an existing book identified by its name with the provided details.deleteBookByName(name: String)Removes a book from the system based on its name.addBook(book: BookDTO)Adds a new book to the system with the provided details.
Ensure implementation of the following:
Spring Data JPAfor efficient data management.- Incorporate
Spring Securityfor robust authentication and authorization. - Enable
Internationalization and Localizationto support English and any language you choose. - Implement
Validationfor data integrity. - Establish
Error handlingfor graceful error management. - Utilize
DTOs- data transfer objects structured as illustrated below:
Consider the following additional features:
- Incorporate
Loggingfor comprehensive system monitoring. - Implement
Pagination and Sortingfor enhanced data presentation.
Use wrapper classes (like Long, Integer, etc.) instead of primitive types whenever possible.
- Utilize
Lombokfor streamlined Java code. - Use
ModelMapperfor easy mapping between objects. - Utilize
Thymeleaffor HTML templating. - Explore the
testfolder to execute provided test cases for your solution. - Refer to the
main\resources\sqlfolder for SQL scripts to initialize data.
- Make the most of the time available. While we understand you may not cover all the points, aim to accomplish as much as possible within the given duration of 15 hours.

