{"id":21445975,"url":"https://github.com/bourgui07/backend-of-spring-boot-e-commerce-app","last_synced_at":"2025-04-19T20:36:55.650Z","repository":{"id":249784763,"uuid":"832514434","full_name":"BOURGUI07/Backend-of-spring-boot-e-Commerce-app","owner":"BOURGUI07","description":"Backend of an E-commerce Application","archived":false,"fork":false,"pushed_at":"2024-08-25T18:37:22.000Z","size":782,"stargazers_count":5,"open_issues_count":3,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-29T13:06:13.986Z","etag":null,"topics":["datatransferobject","entrypoint","filtering","hibernate","junit5","maven","mockito","mysql","pagination","profiling","rabbitmq","rbac","redis","rest-client","restful-api","springboot","springdata-jpa","springsecurity","springweb","swagger"],"latest_commit_sha":null,"homepage":"https://github.com/BOURGUI07/eComBackendMaster","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BOURGUI07.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-07-23T07:17:05.000Z","updated_at":"2024-12-05T10:21:20.000Z","dependencies_parsed_at":"2024-08-25T19:46:41.479Z","dependency_job_id":null,"html_url":"https://github.com/BOURGUI07/Backend-of-spring-boot-e-Commerce-app","commit_stats":null,"previous_names":["bourgui07/ecombackendmaster","bourgui07/monolithic-arch-backend-of-spring-boot-e-commerce-app","bourgui07/backend-of-spring-boot-e-commerce-app"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BOURGUI07%2FBackend-of-spring-boot-e-Commerce-app","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BOURGUI07%2FBackend-of-spring-boot-e-Commerce-app/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BOURGUI07%2FBackend-of-spring-boot-e-Commerce-app/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BOURGUI07%2FBackend-of-spring-boot-e-Commerce-app/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BOURGUI07","download_url":"https://codeload.github.com/BOURGUI07/Backend-of-spring-boot-e-Commerce-app/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249795192,"owners_count":21326776,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["datatransferobject","entrypoint","filtering","hibernate","junit5","maven","mockito","mysql","pagination","profiling","rabbitmq","rbac","redis","rest-client","restful-api","springboot","springdata-jpa","springsecurity","springweb","swagger"],"created_at":"2024-11-23T02:40:16.366Z","updated_at":"2025-04-19T20:36:55.623Z","avatar_url":"https://github.com/BOURGUI07.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Backend of Spring Boot e-Commerce App\n\nThis eCommerce backend project is built with a robust and modern tech stack to provide a scalable, secure, and efficient solution for managing an online store. The project leverages Spring Boot, MySQL, Spring Data JPA, Maven, JUnit, Mockito, Redis, Swagger, and Spring Security to offer a comprehensive set of features, ensuring high performance and reliability.\n\n## Tech Stack\n\n- **Spring Boot**: A powerful framework for building Java-based applications, providing a wide range of functionalities out-of-the-box.\n- **MySQL**: A reliable and widely-used relational database management system.\n- **Spring Data JPA**: Simplifies database interactions using the Java Persistence API, providing a rich repository layer.\n- **Maven**: A build automation tool used for managing project dependencies and build lifecycle.\n- **JUnit**: A testing framework for writing and running unit tests in Java.\n- **Mockito**: A mocking framework for unit tests in Java.\n- **Redis**: An in-memory data structure store, used for caching and session management.\n- **Swagger**: A tool for generating API documentation and exploring API endpoints.\n- **Spring Security**: A comprehensive security framework for authentication, authorization, and more.\n- **Lombok**: A Java library that helps reduce boilerplate code by automatically generating getters, setters, constructors, and other   common methods through annotations.\n- **RestClient and RestTemplate**: Tools for consuming external service APIs, such as a sales tax API and internal APIs as well.\n- **RabbitMQ**: A message broker used for sending and receiving messages, particularly for handling order email confirmations asynchronously.\n\n## Features\n\n- **Modern Java Features**:\n  - **`var`**: Utilizes type inference to make the code more concise and readable.\n  - **Streams API**: Leverages streams for efficient and expressive data processing, enabling operations like filtering, mapping, and reducing.\n  - **Lambda Expressions**: Implements lambda expressions for more concise and functional-style code, particularly in collections and streams.\n  - **Method References**: Uses method references as a shorthand for lambda expressions, making the code more readable and expressive.\n  - **Optionals**: Uses `Optional` to handle potentially null values in a safe and expressive manner, reducing the risk of `NullPointerException`.\n  - **Records**: Implements records for immutable data carriers, reducing boilerplate code and enhancing the clarity of data structure definitions.\n  - **Text Blocks**: Employs text blocks for easier handling and readability of multi-line strings, especially in SQL queries.\n\n\n- **Role-Based Access Control (RBAC)**: Implemented at the method level to ensure fine-grained security for different user roles.\n- **Session Management**: Efficient handling of user sessions to maintain security and performance.\n- **Entrypoint Customization**: Customization of security entry points to provide a flexible and secure authentication mechanism.\n- **Profiling**: Allows the application to run with different profiles, enabling environment-specific configurations.\n- **JPA Auditing**: Automatically tracks and logs entity changes, providing an audit trail for database operations.\n- **Pagination, Filtering, Searching, and Sorting**: Comprehensive support for managing large datasets with ease.\n- **REST API Best Practices**: Follows industry standards to ensure robust, maintainable, and scalable API design.\n- **External API Consumption**: Integrates with external service APIs (e.g., sales tax API) using RestClient to retrieve and process data from third-party services.\n- **Comprehensive Exception Handling**: Ensures that the application gracefully handles and logs exceptions, providing meaningful error messages.\n- **Detailed Swagger Documentation**: Automatically generated API documentation for easy exploration and testing of endpoints.\n- **Unit Testing**: Extensive use of JUnit and Mockito for reliable and maintainable tests.\n- **CSV Exporting**: Ability to export reports into CSV files based on SQL querying retrieval, enabling easy data analysis and sharing.\n- **CSV Import and Persistence**: Supports uploading CSV files and automatically persists the data into the database, streamlining data management and integration.\n- **Data Validation**: Ensures that data integrity and correctness are maintained through comprehensive validation mechanisms at various layers.\n- **Data Caching**: Implements efficient caching strategies to enhance application performance and reduce the load on the database by storing frequently accessed data in memory.\n- **Spring Application Events**: Utilized for handling `OrderCreation`, `ProductCreation`, and `UserCreation` events.\n\n\n# CategoryController REST Endpoints\n\n### 1. Retrieve All Categories\n- **Endpoint:** `GET /api/categories`\n- **Description:** Paginated retrieval for all categories.\n- **Responses:**\n  - `200 OK` - Successfully retrieved the list of categories.\n  - `204 No Content` - The list of categories is empty.\n  - `500 Internal Server Error` - An error occurred on the server.\n\n---\n\n### 2. Get Category By ID\n- **Endpoint:** `GET /api/categories/{id}`\n- **Description:** Retrieve a single category by ID.\n- **PreAuthorize:** `hasAnyRole('SUPER_ADMIN','ADMIN')`\n- **Responses:**\n  - `200 OK` - Successfully found the category.\n  - `404 Not Found` - Category not found.\n  - `400 Bad Request` - Invalid ID (e.g., negative ID).\n  - `500 Internal Server Error` - An error occurred on the server.\n\n---\n\n### 3. Create a New Category\n- **Endpoint:** `POST /api/categories`\n- **Description:** Create a new category.\n- **PreAuthorize:** `hasAnyRole('SUPER_ADMIN','ADMIN')`\n- **Request Body:** `CategoryRequestDTO`\n- **Responses:**\n  - `201 Created` - Successfully created the category.\n  - `400 Bad Request` - Invalid request body.\n  - `500 Internal Server Error` - An error occurred on the server.\n\n---\n\n### 4. Update Category\n- **Endpoint:** `PUT /api/categories/{id}`\n- **Description:** Update an existing category.\n- **PreAuthorize:** `hasAnyRole('SUPER_ADMIN','ADMIN')`\n- **Request Body:** `CategoryRequestDTO`\n- **Responses:**\n  - `200 OK` - Successfully updated the category.\n  - `404 Not Found` - Category not found.\n  - `400 Bad Request` - Invalid ID or request body.\n  - `500 Internal Server Error` - An error occurred on the server.\n\n---\n\n### 5. Delete Category By ID\n- **Endpoint:** `DELETE /api/categories/{id}`\n- **Description:** Delete a category by ID.\n- **PreAuthorize:** `hasAnyRole('SUPER_ADMIN','ADMIN')`\n- **Responses:**\n  - `204 No Content` - Successfully deleted the category.\n  - `404 Not Found` - Category not found.\n  - `400 Bad Request` - Invalid ID.\n  - `500 Internal Server Error` - An error occurred on the server.\n\n---\n\n### 6. Search Categories\n- **Endpoint:** `GET /api/categories/search`\n- **Description:** Search for categories based on name, description, or product name.\n- **Query Parameters:**\n  - `name` (optional) - Category name to search for.\n  - `desc` (optional) - Category description to search for.\n  - `productName` (optional) - Product name to search for.\n  - `page` (default: `0`) - The page number to retrieve.\n  - `size` (default: `10`) - The number of items per page.\n- **Responses:**\n  - `200 OK` - Successfully retrieved the search results.\n  - `204 No Content` - No results found.\n  - `500 Internal Server Error` - An error occurred on the server.\n\n---\n\n### 7. Add Products to Category\n- **Endpoint:** `PATCH /api/categories/add_products`\n- **Description:** Add products to an existing category.\n- **PreAuthorize:** `hasAnyRole('SUPER_ADMIN','ADMIN')`\n- **Request Body:** `AddProductsToCategoryRequest`\n- **Responses:**\n  - `200 OK` - Successfully added products to the category.\n  - `404 Not Found` - Category not found.\n  - `400 Bad Request` - Invalid ID or request body.\n  - `500 Internal Server Error` - An error occurred on the server.\n\n\n\n# ProductController REST Endpoints\n\n### 1. Retrieve All Products\n- **Endpoint:** `GET /api/products`\n- **Description:** Paginated retrieval for all products.\n- **Responses:**\n  - `200 OK` - Successfully retrieved the list of products.\n  - `204 No Content` - The list of products is empty.\n  - `500 Internal Server Error` - An error occurred on the server.\n\n---\n\n### 2. Get Product By ID\n- **Endpoint:** `GET /api/products/{id}`\n- **Description:** Retrieve a single product by ID.\n- **PreAuthorize:** `hasAnyRole('SUPERADMIN', 'ADMIN')`\n- **Responses:**\n  - `200 OK` - Successfully found the product.\n  - `404 Not Found` - Product not found.\n  - `400 Bad Request` - Invalid ID (e.g., negative ID).\n  - `500 Internal Server Error` - An error occurred on the server.\n\n---\n\n### 3. Create a New Product\n- **Endpoint:** `POST /api/products`\n- **Description:** Create a new product.\n- **PreAuthorize:** `hasAnyRole('SUPERADMIN', 'ADMIN')`\n- **Request Body:** `ProductRequestDTO`\n- **Responses:**\n  - `201 Created` - Successfully created the product.\n  - `400 Bad Request` - Invalid request body.\n  - `500 Internal Server Error` - An error occurred on the server.\n\n---\n\n### 4. Update Product\n- **Endpoint:** `PUT /api/products/{id}`\n- **Description:** Update an existing product.\n- **PreAuthorize:** `hasAnyRole('SUPERADMIN', 'ADMIN')`\n- **Request Body:** `ProductRequestDTO`\n- **Responses:**\n  - `200 OK` - Successfully updated the product.\n  - `404 Not Found` - Product not found.\n  - `400 Bad Request` - Invalid ID or request body.\n  - `500 Internal Server Error` - An error occurred on the server.\n\n---\n\n### 5. Delete Product By ID\n- **Endpoint:** `DELETE /api/products/{id}`\n- **Description:** Delete a product by ID.\n- **PreAuthorize:** `hasAnyRole('SUPERADMIN', 'ADMIN')`\n- **Responses:**\n  - `204 No Content` - Successfully deleted the product.\n  - `404 Not Found` - Product not found.\n  - `400 Bad Request` - Invalid ID.\n  - `500 Internal Server Error` - An error occurred on the server.\n\n---\n\n### 6. Search Products\n- **Endpoint:** `GET /api/products/search`\n- **Description:** Search for products based on various criteria.\n- **Query Parameters:**\n  - `name` (optional) - Product name to search for.\n  - `desc` (optional) - Product description to search for.\n  - `discountStatus` (optional) - Discount status to search for.\n  - `categoryName` (optional) - Category name to search for.\n  - `minPrice` (optional) - Minimum price to search for.\n  - `maxPrice` (optional) - Maximum price to search for.\n  - `page` (default: `0`) - The page number to retrieve.\n  - `size` (default: `10`) - The number of items per page.\n- **Responses:**\n  - `200 OK` - Successfully retrieved the search results.\n  - `204 No Content` - No results found.\n  - `500 Internal Server Error` - An error occurred on the server.\n\n---\n\n### 7. Find Products By Category ID\n- **Endpoint:** `GET /api/products/category/{id}`\n- **Description:** Retrieve all products for a specific category by ID.\n- **PreAuthorize:** `hasRole('ADMIN')`\n- **Responses:**\n  - `200 OK` - Successfully retrieved the list of products for the category.\n  - `204 No Content` - No products found for the category.\n  - `500 Internal Server Error` - An error occurred on the server.\n\n---\n\n### 8. Retrieve Products by Set of Ids\n- **Endpoint:** `GET /api/products/product_ids`\n- **Responses:**\n  - `200 OK` - Successfully retrieved the list of products for the category.\n  - `204 No Content` - No products found for the category.\n  - `500 Internal Server Error` - An error occurred on the server.\n\n\n# DiscountController REST Endpoints\n\n### 1. Retrieve All Discounts\n- **Endpoint:** `GET /api/discounts`\n- **Description:** Paginated retrieval for all discounts.\n- **PreAuthorize:** `hasAnyRole('SUPERADMIN', 'ADMIN')`\n- **Query Parameters:**\n  - `page` (default: `0`) - The page number to retrieve.\n  - `size` (default: `10`) - The number of items per page.\n- **Responses:**\n  - `200 OK` - Successfully retrieved the list of discounts.\n  - `204 No Content` - The list of discounts is empty.\n  - `500 Internal Server Error` - An error occurred on the server.\n\n---\n\n### 2. Get Discount By ID\n- **Endpoint:** `GET /api/discounts/{id}`\n- **Description:** Retrieve a single discount by ID.\n- **PreAuthorize:** `hasAnyRole('SUPERADMIN', 'ADMIN')`\n- **Path Variable:**\n  - `id` - The ID of the discount to retrieve.\n- **Responses:**\n  - `200 OK` - Successfully found the discount.\n  - `404 Not Found` - Discount not found.\n  - `400 Bad Request` - Invalid ID (e.g., negative ID).\n  - `500 Internal Server Error` - An error occurred on the server.\n\n---\n\n### 3. Create a New Discount\n- **Endpoint:** `POST /api/discounts`\n- **Description:** Create a new discount.\n- **PreAuthorize:** `hasAnyRole('SUPERADMIN', 'ADMIN')`\n- **Request Body:** `DiscountRequestDTO`\n- **Responses:**\n  - `201 Created` - Successfully created the discount.\n  - `400 Bad Request` - Invalid request body.\n  - `500 Internal Server Error` - An error occurred on the server.\n\n---\n\n### 4. Update Discount\n- **Endpoint:** `PUT /api/discounts/{id}`\n- **Description:** Update an existing discount.\n- **PreAuthorize:** `hasAnyRole('SUPERADMIN', 'ADMIN')`\n- **Request Body:** `DiscountRequestDTO`\n- **Path Variable:**\n  - `id` - The ID of the discount to update.\n- **Responses:**\n  - `200 OK` - Successfully updated the discount.\n  - `404 Not Found` - Discount not found.\n  - `400 Bad Request` - Invalid ID or request body.\n  - `500 Internal Server Error` - An error occurred on the server.\n\n---\n\n### 5. Delete Discount By ID\n- **Endpoint:** `DELETE /api/discounts/{id}`\n- **Description:** Delete a discount by ID.\n- **PreAuthorize:** `hasAnyRole('SUPERADMIN', 'ADMIN')`\n- **Path Variable:**\n  - `id` - The ID of the discount to delete.\n- **Responses:**\n  - `204 No Content` - Successfully deleted the discount.\n  - `404 Not Found` - Discount not found.\n  - `400 Bad Request` - Invalid ID.\n  - `500 Internal Server Error` - An error occurred on the server.\n\n---\n\n### 6. Add Products to Discount\n- **Endpoint:** `PATCH /api/discounts/add_products`\n- **Description:** Add products to an existing discount.\n- **PreAuthorize:** `hasAnyRole('SUPERADMIN', 'ADMIN')`\n- **Request Body:** `AddProductsToDiscountRequest`\n- **Responses:**\n  - `200 OK` - Successfully added products to the discount.\n  - `404 Not Found` - Discount not found.\n  - `400 Bad Request` - Invalid request body or discount ID.\n  - `500 Internal Server Error` - An error occurred on the server.\n\n\n\n# InventoryController REST Endpoints\n\n### 1. Retrieve All Inventories\n- **Endpoint:** `GET /api/inventories`\n- **Description:** Paginated retrieval for all inventories.\n- **PreAuthorize:** `hasAnyRole('SUPERADMIN', 'ADMIN')`\n- **Query Parameters:**\n  - `page` (default: `0`) - The page number to retrieve.\n  - `size` (default: `10`) - The number of items per page.\n- **Responses:**\n  - `200 OK` - Successfully retrieved the list of inventories.\n  - `204 No Content` - The list of inventories is empty.\n  - `500 Internal Server Error` - An error occurred on the server.\n\n---\n\n### 2. Get Inventory By ID\n- **Endpoint:** `GET /api/inventories/{id}`\n- **Description:** Retrieve a single inventory by ID.\n- **PreAuthorize:** `hasAnyRole('SUPERADMIN', 'ADMIN')`\n- **Path Variable:**\n  - `id` - The ID of the inventory to retrieve.\n- **Responses:**\n  - `200 OK` - Successfully found the inventory.\n  - `404 Not Found` - Inventory not found.\n  - `400 Bad Request` - Invalid ID (e.g., negative ID).\n  - `500 Internal Server Error` - An error occurred on the server.\n \n---\n\n### 3. Get Inventory By Product Id\n- **Endpoint:** `GET /api/inventories/product/{id}`\n- **Description:** Retrieve a single Inventory by Product Id.\n- **Path Variable:**\n  - `id` - Id of the Product to retrieve inventory for.\n- **Responses:**\n  - `200 OK` - Successfully found the inventory.\n  - `404 Not Found` - Inventory not found.\n  - `400 Bad Request` - Invalid ID (e.g., negative ID).\n  - `500 Internal Server Error` - An error occurred on the server.\n\n---\n\n### 4. Create a New Inventory\n- **Endpoint:** `POST /api/inventories`\n- **Description:** Create a new inventory.\n- **PreAuthorize:** `hasAnyRole('SUPERADMIN', 'ADMIN')`\n- **Request Body:** `InventoryDTO`\n- **Responses:**\n  - `201 Created` - Successfully created the inventory.\n  - `400 Bad Request` - Invalid request body.\n  - `500 Internal Server Error` - An error occurred on the server.\n\n---\n\n### 5. Update Inventory\n- **Endpoint:** `PUT /api/inventories/{id}`\n- **Description:** Update an existing inventory.\n- **PreAuthorize:** `hasAnyRole('SUPERADMIN', 'ADMIN')`\n- **Request Body:** `InventoryDTO`\n- **Path Variable:**\n  - `id` - The ID of the inventory to update.\n- **Responses:**\n  - `200 OK` - Successfully updated the inventory.\n  - `404 Not Found` - Inventory not found.\n  - `400 Bad Request` - Invalid ID or request body.\n  - `500 Internal Server Error` - An error occurred on the server.\n\n---\n\n### 6. Delete Inventory By ID\n- **Endpoint:** `DELETE /api/inventories/{id}`\n- **Description:** Delete an inventory by ID.\n- **PreAuthorize:** `hasAnyRole('SUPERADMIN', 'ADMIN')`\n- **Path Variable:**\n  - `id` - The ID of the inventory to delete.\n- **Responses:**\n  - `204 No Content` - Successfully deleted the inventory.\n  - `404 Not Found` - Inventory not found.\n  - `400 Bad Request` - Invalid ID.\n  - `500 Internal Server Error` - An error occurred on the server.\n\n\n\n# OrderController REST Endpoints\n\n### 1. Retrieve All Orders\n- **Endpoint:** `GET /api/orders`\n- **Description:** Paginated retrieval for all orders.\n- **PreAuthorize:** `hasAnyRole('SUPERADMIN', 'ADMIN')`\n- **Query Parameters:**\n  - `page` (default: `0`) - The page number to retrieve.\n  - `size` (default: `10`) - The number of items per page.\n- **Responses:**\n  - `200 OK` - Successfully retrieved the list of orders.\n  - `204 No Content` - The list of orders is empty.\n  - `500 Internal Server Error` - An error occurred on the server.\n\n---\n\n### 2. Get Order By ID\n- **Endpoint:** `GET /api/orders/{id}`\n- **Description:** Retrieve a single order by ID.\n- **PreAuthorize:** `hasAnyRole('SUPERADMIN', 'ADMIN')`\n- **Path Variable:**\n  - `id` - The ID of the order to retrieve.\n- **Responses:**\n  - `200 OK` - Successfully found the order.\n  - `404 Not Found` - Order not found.\n  - `400 Bad Request` - Invalid ID (e.g., negative ID).\n  - `500 Internal Server Error` - An error occurred on the server.\n\n---\n\n### 3. Create a New Order\n- **Endpoint:** `POST /api/orders`\n- **Description:** Create a new order.\n- **PreAuthorize:** `hasAnyRole('SUPERADMIN', 'ADMIN')`\n- **Request Body:** `OrderDTO`\n- **Responses:**\n  - `201 Created` - Successfully created the order.\n  - `400 Bad Request` - Invalid request body.\n  - `500 Internal Server Error` - An error occurred on the server.\n\n---\n\n### 4. Update Order\n- **Endpoint:** `PUT /api/orders/{id}`\n- **Description:** Update an existing order.\n- **PreAuthorize:** `hasAnyRole('SUPERADMIN', 'ADMIN')`\n- **Request Body:** `OrderDTO`\n- **Path Variable:**\n  - `id` - The ID of the order to update.\n- **Responses:**\n  - `200 OK` - Successfully updated the order.\n  - `404 Not Found` - Order not found.\n  - `400 Bad Request` - Invalid ID or request body.\n  - `500 Internal Server Error` - An error occurred on the server.\n\n---\n\n### 5. Delete Order By ID\n- **Endpoint:** `DELETE /api/orders/{id}`\n- **Description:** Delete an order by ID.\n- **PreAuthorize:** `hasAnyRole('SUPERADMIN', 'ADMIN')`\n- **Path Variable:**\n  - `id` - The ID of the order to delete.\n- **Responses:**\n  - `204 No Content` - Successfully deleted the order.\n  - `404 Not Found` - Order not found.\n  - `400 Bad Request` - Invalid ID.\n  - `500 Internal Server Error` - An error occurred on the server.\n\n---\n\n### 6. Find Orders by User ID\n- **Endpoint:** `GET /api/orders/user/{id}`\n- **Description:** Retrieve all orders associated with a specific user ID.\n- **PreAuthorize:** `hasAnyRole('SUPERADMIN', 'ADMIN')`\n- **Path Variable:**\n  - `id` - The ID of the user to find orders for.\n- **Responses:**\n  - `200 OK` - Successfully retrieved the list of orders for the user.\n  - `204 No Content` - No orders found for the user.\n  - `500 Internal Server Error` - An error occurred on the server.\n\n\n\n# CartItemController REST Endpoints\n\n### 1. Retrieve All Cart Items\n- **Endpoint:** `GET /api/cartitems`\n- **Description:** Paginated retrieval of all cart items.\n- **PreAuthorize:** `hasAnyRole('SUPERADMIN', 'ADMIN')`\n- **Query Parameters:**\n  - `page` (default: `0`) - The page number to retrieve.\n  - `size` (default: `10`) - The number of items per page.\n- **Responses:**\n  - `200 OK` - Successfully retrieved the list of cart items.\n  - `204 No Content` - The list of cart items is empty.\n  - `500 Internal Server Error` - An error occurred on the server.\n\n---\n\n### 2. Get Cart Item By ID\n- **Endpoint:** `GET /api/cartitems/{id}`\n- **Description:** Retrieve a single cart item by ID.\n- **PreAuthorize:** `hasAnyRole('SUPERADMIN', 'ADMIN')`\n- **Path Variable:**\n  - `id` - The ID of the cart item to retrieve.\n- **Responses:**\n  - `200 OK` - Successfully found the cart item.\n  - `404 Not Found` - Cart item not found.\n  - `400 Bad Request` - Invalid ID (e.g., negative ID).\n  - `500 Internal Server Error` - An error occurred on the server.\n\n---\n\n### 3. Create a New Cart Item\n- **Endpoint:** `POST /api/cartitems`\n- **Description:** Create a new cart item.\n- **PreAuthorize:** `hasAnyRole('SUPERADMIN', 'ADMIN')`\n- **Request Body:** `CartItemDTO`\n- **Responses:**\n  - `201 Created` - Successfully created the cart item.\n  - `400 Bad Request` - Invalid request body.\n  - `500 Internal Server Error` - An error occurred on the server.\n\n---\n\n### 4. Update Cart Item\n- **Endpoint:** `PUT /api/cartitems/{id}`\n- **Description:** Update an existing cart item.\n- **PreAuthorize:** `hasAnyRole('SUPERADMIN', 'ADMIN')`\n- **Request Body:** `CartItemDTO`\n- **Path Variable:**\n  - `id` - The ID of the cart item to update.\n- **Responses:**\n  - `200 OK` - Successfully updated the cart item.\n  - `404 Not Found` - Cart item not found.\n  - `400 Bad Request` - Invalid ID or request body.\n  - `500 Internal Server Error` - An error occurred on the server.\n\n---\n\n### 5. Delete Cart Item By ID\n- **Endpoint:** `DELETE /api/cartitems/{id}`\n- **Description:** Delete a cart item by ID.\n- **PreAuthorize:** `hasAnyRole('SUPERADMIN', 'ADMIN')`\n- **Path Variable:**\n  - `id` - The ID of the cart item to delete.\n- **Responses:**\n  - `204 No Content` - Successfully deleted the cart item.\n  - `404 Not Found` - Cart item not found.\n  - `400 Bad Request` - Invalid ID.\n  - `500 Internal Server Error` - An error occurred on the server.\n\n\n\n\n# OrderItemController REST Endpoints\n\n### 1. Retrieve All Order Items\n- **Endpoint:** `GET /api/orderitems`\n- **Description:** Paginated retrieval of all order items.\n- **Query Parameters:**\n  - `page` (default: `0`) - The page number to retrieve.\n  - `size` (default: `10`) - The number of items per page.\n- **Responses:**\n  - `200 OK` - Successfully retrieved the list of order items.\n  - `204 No Content` - The list of order items is empty.\n  - `500 Internal Server Error` - An error occurred on the server.\n\n---\n\n### 2. Get Order Item By ID\n- **Endpoint:** `GET /api/orderitems/{id}`\n- **Description:** Retrieve a single order item by ID.\n- **Path Variable:**\n  - `id` - The ID of the order item to retrieve.\n- **Responses:**\n  - `200 OK` - Successfully found the order item.\n  - `404 Not Found` - Order item not found.\n  - `400 Bad Request` - Invalid ID (e.g., negative ID).\n  - `500 Internal Server Error` - An error occurred on the server.\n\n---\n\n### 3. Create a New Order Item\n- **Endpoint:** `POST /api/orderitems`\n- **Description:** Create a new order item.\n- **Request Body:** `OrderItemDTO`\n- **Responses:**\n  - `201 Created` - Successfully created the order item.\n  - `400 Bad Request` - Invalid request body or ordered quantity exceeds product inventory.\n  - `500 Internal Server Error` - An error occurred on the server.\n\n---\n\n### 4. Update Order Item\n- **Endpoint:** `PUT /api/orderitems/{id}`\n- **Description:** Update an existing order item.\n- **Request Body:** `OrderItemDTO`\n- **Path Variable:**\n  - `id` - The ID of the order item to update.\n- **Responses:**\n  - `200 OK` - Successfully updated the order item.\n  - `404 Not Found` - Order item not found.\n  - `400 Bad Request` - Invalid ID, request body, or ordered quantity exceeds product inventory.\n  - `500 Internal Server Error` - An error occurred on the server.\n\n---\n\n### 5. Delete Order Item By ID\n- **Endpoint:** `DELETE /api/orderitems/{id}`\n- **Description:** Delete an order item by ID.\n- **Path Variable:**\n  - `id` - The ID of the order item to delete.\n- **Responses:**\n  - `204 No Content` - Successfully deleted the order item.\n  - `404 Not Found` - Order item not found.\n  - `400 Bad Request` - Invalid ID.\n  - `500 Internal Server Error` - An error occurred on the server.\n\n---\n\n### 6. Find Order Details With Product ID\n- **Endpoint:** `GET /api/orderitems/product/{id}`\n- **Description:** Retrieve order details associated with a specific product ID.\n- **Path Variable:**\n  - `id` - The product ID to retrieve associated order items.\n- **Responses:**\n  - `200 OK` - Successfully found the order items for the product.\n  - `204 No Content` - No order items found for the specified product.\n  - `500 Internal Server Error` - An error occurred on the server.\n\n\n\n\n# PaymentDetailController REST Endpoints\n\n### 1. Retrieve All Payment Details\n- **Endpoint:** `GET /api/payment_details`\n- **Description:** Paginated retrieval of all payment details.\n- **Query Parameters:**\n  - `page` (default: `0`) - The page number to retrieve.\n  - `size` (default: `10`) - The number of items per page.\n- **Responses:**\n  - `200 OK` - Successfully retrieved the list of payment details.\n  - `204 No Content` - The list of payment details is empty.\n  - `500 Internal Server Error` - An error occurred on the server.\n\n---\n\n### 2. Get Payment Detail By ID\n- **Endpoint:** `GET /api/payment_details/{id}`\n- **Description:** Retrieve a single payment detail by ID.\n- **Path Variable:**\n  - `id` - The ID of the payment detail to retrieve.\n- **Responses:**\n  - `200 OK` - Successfully found the payment detail.\n  - `404 Not Found` - Payment detail not found.\n  - `400 Bad Request` - Invalid ID (e.g., negative ID).\n  - `500 Internal Server Error` - An error occurred on the server.\n\n---\n\n### 3. Create a New Payment Detail\n- **Endpoint:** `POST /api/payment_details`\n- **Description:** Create a new payment detail.\n- **Request Body:** `PaymentDetailDTO`\n- **Responses:**\n  - `201 Created` - Successfully created the payment detail.\n  - `400 Bad Request` - Invalid request body.\n  - `500 Internal Server Error` - An error occurred on the server.\n\n---\n\n### 4. Update Payment Detail\n- **Endpoint:** `PUT /api/payment_details/{id}`\n- **Description:** Update an existing payment detail.\n- **Request Body:** `PaymentDetailDTO`\n- **Path Variable:**\n  - `id` - The ID of the payment detail to update.\n- **Responses:**\n  - `200 OK` - Successfully updated the payment detail.\n  - `404 Not Found` - Payment detail not found.\n  - `400 Bad Request` - Invalid ID or request body.\n  - `500 Internal Server Error` - An error occurred on the server.\n\n---\n\n### 5. Delete Payment Detail By ID\n- **Endpoint:** `DELETE /api/payment_details/{id}`\n- **Description:** Delete a payment detail by ID.\n- **Path Variable:**\n  - `id` - The ID of the payment detail to delete.\n- **Responses:**\n  - `204 No Content` - Successfully deleted the payment detail.\n  - `404 Not Found` - Payment detail not found.\n  - `400 Bad Request` - Invalid ID.\n  - `500 Internal Server Error` - An error occurred on the server.\n\n\n\n\n# ReviewsController REST Endpoints\n\n### 1. Retrieve All Reviews by Product ID\n- **Endpoint:** `GET /api/reviews/product_id/{productId}`\n- **Description:** Paginated retrieval of all reviews for a given product ID.\n- **Path Variable:**\n  - `productId` - The ID of the product to retrieve reviews for.\n- **Query Parameters:**\n  - `page` (default: `0`) - The page number to retrieve.\n  - `size` (default: `10`) - The number of items per page.\n- **Responses:**\n  - `200 OK` - Successfully retrieved the list of reviews.\n  - `204 No Content` - The list of reviews is empty.\n  - `500 Internal Server Error` - An error occurred on the server.\n\n---\n\n### 2. Retrieve All Reviews by Product Name\n- **Endpoint:** `GET /api/reviews/product_name/{productName}`\n- **Description:** Paginated retrieval of all reviews for a given product name.\n- **Path Variable:**\n  - `productName` - The name of the product to retrieve reviews for.\n- **Query Parameters:**\n  - `page` (default: `0`) - The page number to retrieve.\n  - `size` (default: `10`) - The number of items per page.\n- **Responses:**\n  - `200 OK` - Successfully retrieved the list of reviews.\n  - `204 No Content` - The list of reviews is empty.\n  - `500 Internal Server Error` - An error occurred on the server.\n\n---\n\n### 3. Get Review By ID\n- **Endpoint:** `GET /api/reviews/{id}`\n- **Description:** Retrieve a single review by ID.\n- **Path Variable:**\n  - `id` - The ID of the review to retrieve.\n- **Responses:**\n  - `200 OK` - Successfully found the review.\n  - `404 Not Found` - Review not found.\n  - `400 Bad Request` - Invalid ID (e.g., negative ID).\n  - `500 Internal Server Error` - An error occurred on the server.\n\n---\n\n### 4. Create a New Review\n- **Endpoint:** `POST /api/reviews`\n- **Description:** Create a new review.\n- **Request Body:** `ReviewsRequestDTO`\n- **Responses:**\n  - `201 Created` - Successfully created the review.\n  - `400 Bad Request` - Invalid request body.\n  - `500 Internal Server Error` - An error occurred on the server.\n\n---\n\n### 5. Update Review\n- **Endpoint:** `PUT /api/reviews/{id}`\n- **Description:** Update an existing review.\n- **Path Variable:**\n  - `id` - The ID of the review to update.\n- **Request Body:** `ReviewsUpdateRequestDTO`\n- **Responses:**\n  - `200 OK` - Successfully updated the review.\n  - `404 Not Found` - Review not found.\n  - `400 Bad Request` - Invalid ID or request body.\n  - `500 Internal Server Error` - An error occurred on the server.\n\n---\n\n### 6. Delete Review By ID\n- **Endpoint:** `DELETE /api/reviews/{id}`\n- **Description:** Delete a review by ID.\n- **Path Variable:**\n  - `id` - The ID of the review to delete.\n- **Responses:**\n  - `204 No Content` - Successfully deleted the review.\n  - `404 Not Found` - Review not found.\n  - `400 Bad Request` - Invalid ID.\n  - `500 Internal Server Error` - An error occurred on the server.\n\n\n\n\n# SessionController REST Endpoints\n\n### 1. Retrieve All User Shopping Sessions\n- **Endpoint:** `GET /api/sessions`\n- **Description:** Paginated retrieval of all user shopping sessions.\n- **Query Parameters:**\n  - `page` (default: `0`) - The page number to retrieve.\n  - `size` (default: `10`) - The number of items per page.\n- **Responses:**\n  - `200 OK` - Successfully retrieved the list of user shopping sessions.\n  - `204 No Content` - The list of user shopping sessions is empty.\n  - `500 Internal Server Error` - An error occurred on the server.\n\n---\n\n### 2. Get Shopping Session By ID\n- **Endpoint:** `GET /api/sessions/{id}`\n- **Description:** Retrieve a single shopping session by ID.\n- **Path Variable:**\n  - `id` - The ID of the shopping session to retrieve.\n- **Responses:**\n  - `200 OK` - Successfully found the shopping session.\n  - `404 Not Found` - Shopping session not found.\n  - `400 Bad Request` - Invalid ID (e.g., negative ID).\n  - `500 Internal Server Error` - An error occurred on the server.\n\n---\n\n### 3. Create a New User Shopping Session\n- **Endpoint:** `POST /api/sessions`\n- **Description:** Create a new user shopping session.\n- **Request Body:** `UserShoppingSessionDTO`\n- **Responses:**\n  - `201 Created` - Successfully created the user shopping session.\n  - `400 Bad Request` - Invalid request body.\n  - `500 Internal Server Error` - An error occurred on the server.\n\n---\n\n### 4. Update Shopping Session\n- **Endpoint:** `PUT /api/sessions/{id}`\n- **Description:** Update an existing shopping session.\n- **Path Variable:**\n  - `id` - The ID of the shopping session to update.\n- **Request Body:** `UserShoppingSessionDTO`\n- **Responses:**\n  - `200 OK` - Successfully updated the shopping session.\n  - `404 Not Found` - Shopping session not found.\n  - `400 Bad Request` - Invalid ID or request body.\n  - `500 Internal Server Error` - An error occurred on the server.\n\n---\n\n### 5. Delete Shopping Session By ID\n- **Endpoint:** `DELETE /api/sessions/{id}`\n- **Description:** Delete a shopping session by ID.\n- **Path Variable:**\n  - `id` - The ID of the shopping session to delete.\n- **Responses:**\n  - `204 No Content` - Successfully deleted the shopping session.\n  - `404 Not Found` - Shopping session not found.\n  - `400 Bad Request` - Invalid ID.\n  - `500 Internal Server Error` - An error occurred on the server.\n\n---\n\n### 6. Get Shopping Session By User ID\n- **Endpoint:** `GET /api/sessions/user/{id}`\n- **Description:** Retrieve the shopping session for a specific user by user ID.\n- **Path Variable:**\n  - `id` - The ID of the user to retrieve the shopping session for.\n- **Responses:**\n  - `200 OK` - Successfully retrieved the shopping session for the user.\n  - `404 Not Found` - Shopping session not found.\n  - `500 Internal Server Error` - An error occurred on the server.\n\n\n\n\n# UserAddressController REST Endpoints\n\n### 1. Retrieve All User Addresses\n- **Endpoint:** `GET /api/addresses`\n- **Description:** Paginated retrieval of all user addresses.\n- **Query Parameters:**\n  - `page` (default: `0`) - The page number to retrieve.\n  - `size` (default: `10`) - The number of items per page.\n- **Responses:**\n  - `200 OK` - Successfully retrieved the list of user addresses.\n  - `204 No Content` - The list of user addresses is empty.\n  - `500 Internal Server Error` - An error occurred on the server.\n\n---\n\n### 2. Get User Address By ID\n- **Endpoint:** `GET /api/addresses/{id}`\n- **Description:** Retrieve a single user address by ID.\n- **Path Variable:**\n  - `id` - The ID of the user address to retrieve.\n- **Responses:**\n  - `200 OK` - Successfully found the user address.\n  - `404 Not Found` - User address not found.\n  - `400 Bad Request` - Invalid ID (e.g., negative ID).\n  - `500 Internal Server Error` - An error occurred on the server.\n\n---\n\n### 3. Create a New User Address\n- **Endpoint:** `POST /api/addresses`\n- **Description:** Create a new user address.\n- **Request Body:** `UserAddressDTO`\n- **Responses:**\n  - `201 Created` - Successfully created the user address.\n  - `400 Bad Request` - Invalid request body.\n  - `500 Internal Server Error` - An error occurred on the server.\n\n---\n\n### 4. Update User Address\n- **Endpoint:** `PUT /api/addresses/{id}`\n- **Description:** Update an existing user address.\n- **Path Variable:**\n  - `id` - The ID of the user address to update.\n- **Request Body:** `UserAddressDTO`\n- **Responses:**\n  - `200 OK` - Successfully updated the user address.\n  - `404 Not Found` - User address not found.\n  - `400 Bad Request` - Invalid ID or request body.\n  - `500 Internal Server Error` - An error occurred on the server.\n\n---\n\n### 5. Delete User Address By ID\n- **Endpoint:** `DELETE /api/addresses/{id}`\n- **Description:** Delete a user address by ID.\n- **Path Variable:**\n  - `id` - The ID of the user address to delete.\n- **Responses:**\n  - `204 No Content` - Successfully deleted the user address.\n  - `404 Not Found` - User address not found.\n  - `400 Bad Request` - Invalid ID.\n  - `500 Internal Server Error` - An error occurred on the server.\n\n---\n\n### 6. Get User Address By User ID\n- **Endpoint:** `GET /api/addresses/user/{id}`\n- **Description:** Retrieve the address for a specific user by user ID.\n- **Path Variable:**\n  - `id` - The ID of the user to retrieve the address for.\n- **Responses:**\n  - `200 OK` - Successfully retrieved the address for the user.\n  - `404 Not Found` - User address not found.\n  - `500 Internal Server Error` - An error occurred on the server.\n\n\n\n# UserAuthenticationController REST Endpoints\n\n### 1. Register a New User\n- **Endpoint:** `POST /auth/signup`\n- **Description:** Register a new user with the provided details.\n- **Request Body:** `UserRegistrationRequestDTO`\n- **Responses:**\n  - `201 Created` - User is successfully registered.\n  - `400 Bad Request` - Invalid request body (e.g., missing required fields, validation errors).\n\n---\n\n### 2. Login User\n- **Endpoint:** `POST /auth/login`\n- **Description:** Authenticate a user and return a login token.\n- **Request Body:** `UserLoginRequestDTO`\n- **Responses:**\n  - `200 OK` - Successfully authenticated, returns login details.\n  - `400 Bad Request` - Invalid request body (e.g., missing required fields, validation errors).\n  - `401 Unauthorized` - Invalid credentials.\n\n---\n\n### 3. Register a New Admin\n- **Endpoint:** `POST /auth/admin/register`\n- **Description:** Register a new admin user with the provided details.\n- **Request Body:** `UserRegistrationRequestDTO`\n- **Responses:**\n  - `201 Created` - Admin is successfully registered.\n  - `400 Bad Request` - Invalid request body (e.g., missing required fields, validation errors).\n- **Security:** Requires `SUPERADMIN` role.\n\n---\n\n### 2. Get User By ID\n- **Endpoint:** `GET /api/users/{id}`\n- **Description:** Retrieve a single User by ID.\n- **Path Variable:**\n  - `id` - The ID of the User to retrieve.\n- **Responses:**\n  - `200 OK` - Successfully found the user.\n  - `404 Not Found` - user not found.\n  - `400 Bad Request` - Invalid ID (e.g., negative ID).\n  - `500 Internal Server Error` - An error occurred on the server.\n\n\n\n# UserPaymentController REST Endpoints\n\n### 1. Retrieve All User Payments\n- **Endpoint:** `GET /api/user_payments`\n- **Description:** Retrieve a paginated list of all user payments.\n- **Query Parameters:**\n  - `page` (optional, default: 0) - The page number to retrieve.\n  - `size` (optional, default: 10) - The number of items per page.\n- **Responses:**\n  - `200 OK` - Successfully retrieved the list of user payments.\n  - `204 No Content` - No user payments found.\n  - `500 Internal Server Error` - Unexpected error occurred.\n\n---\n\n### 2. Get User Payment By Id\n- **Endpoint:** `GET /api/user_payments/{id}`\n- **Description:** Retrieve a specific user payment by its ID.\n- **Path Variables:**\n  - `id` - The ID of the user payment to retrieve.\n- **Responses:**\n  - `200 OK` - Successfully found the user payment.\n  - `404 Not Found` - User payment with the given ID was not found.\n  - `400 Bad Request` - Invalid ID provided.\n  - `500 Internal Server Error` - Unexpected error occurred.\n\n---\n\n### 3. Create a New User Payment\n- **Endpoint:** `POST /api/user_payments`\n- **Description:** Create a new user payment with the provided details.\n- **Request Body:** `UserPaymentDTO`\n- **Responses:**\n  - `201 Created` - Successfully created the user payment.\n  - `400 Bad Request` - Invalid request body (e.g., missing required fields, validation errors).\n  - `500 Internal Server Error` - Unexpected error occurred.\n\n---\n\n### 4. Update User Payment\n- **Endpoint:** `PUT /api/user_payments/{id}`\n- **Description:** Update an existing user payment by its ID.\n- **Path Variables:**\n  - `id` - The ID of the user payment to update.\n- **Request Body:** `UserPaymentDTO`\n- **Responses:**\n  - `200 OK` - Successfully updated the user payment.\n  - `404 Not Found` - User payment with the given ID was not found.\n  - `400 Bad Request` - Invalid ID or request body (e.g., missing required fields, validation errors).\n  - `500 Internal Server Error` - Unexpected error occurred.\n\n---\n\n### 5. Delete User Payment By Id\n- **Endpoint:** `DELETE /api/user_payments/{id}`\n- **Description:** Delete a specific user payment by its ID.\n- **Path Variables:**\n  - `id` - The ID of the user payment to delete.\n- **Responses:**\n  - `204 No Content` - Successfully deleted the user payment.\n  - `404 Not Found` - User payment with the given ID was not found.\n  - `400 Bad Request` - Invalid ID provided.\n  - `500 Internal Server Error` - Unexpected error occurred.\n\n---\n\n### 6. Find Payments By User Id\n- **Endpoint:** `GET /api/user_payments/user/{id}`\n- **Description:** Retrieve a list of user payments for a specific user by their ID.\n- **Path Variables:**\n  - `id` - The ID of the user to find payments for.\n- **Responses:**\n  - `200 OK` - Successfully retrieved the list of user payments.\n  - `404 Not Found` - User payments for the given user ID were not found.\n  - `500 Internal Server Error` - Unexpected error occurred.\n\n---\n\n### 7. Find Payments By Provider\n- **Endpoint:** `GET /api/user_payments/provider/{providerName}`\n- **Description:** Retrieve a list of user payments by payment provider.\n- **Path Variables:**\n  - `providerName` - The name of the payment provider to filter by.\n- **Responses:**\n  - `200 OK` - Successfully retrieved the list of user payments by provider.\n  - `204 No Content` - No payments found for the given provider.\n  - `500 Internal Server Error` - Unexpected error occurred.\n\n---\n\n### 8. Find Payments By Type\n- **Endpoint:** `GET /api/user_payments/type/{typeName}`\n- **Description:** Retrieve a list of user payments by payment type.\n- **Path Variables:**\n  - `typeName` - The name of the payment type to filter by.\n- **Responses:**\n  - `200 OK` - Successfully retrieved the list of user payments by type.\n  - `204 No Content` - No payments found for the given type.\n  - `500 Internal Server Error` - Unexpected error occurred.\n\n\n\n\n# WishListController REST Endpoints\n\n### 1. Create a New Wish List\n- **Endpoint:** `POST /api/wishlists`\n- **Description:** Create a new wish list with the provided details.\n- **Request Body:** `WishListCreationRequest`\n- **Responses:**\n  - `201 Created` - Successfully created the wish list.\n  - `400 Bad Request` - Invalid request body (e.g., missing required fields, validation errors).\n  - `500 Internal Server Error` - Unexpected error occurred.\n\n---\n\n### 2. Merge Wish List\n- **Endpoint:** `PUT /api/wishlists`\n- **Description:** Merge a wish list with the provided details.\n- **Request Body:** `WishListMergeRequest`\n- **Responses:**\n  - `201 Created` - Successfully merged the wish list.\n  - `400 Bad Request` - Invalid request body (e.g., missing required fields, validation errors).\n  - `500 Internal Server Error` - Unexpected error occurred.\n\n---\n\n### 3. Update Wish List\n- **Endpoint:** `PUT /api/wishlists/{id}`\n- **Description:** Update an existing wish list by its ID.\n- **Path Variables:**\n  - `id` - The ID of the wish list to update.\n- **Request Body:** `WishListUpdateRequest`\n- **Responses:**\n  - `200 OK` - Successfully updated the wish list.\n  - `404 Not Found` - Wish list with the given ID was not found.\n  - `400 Bad Request` - Invalid ID or request body (e.g., missing required fields, validation errors).\n  - `500 Internal Server Error` - Unexpected error occurred.\n\n---\n\n### 4. Delete Wish List By Id\n- **Endpoint:** `DELETE /api/wishlists/{id}`\n- **Description:** Delete a specific wish list by its ID.\n- **Path Variables:**\n  - `id` - The ID of the wish list to delete.\n- **Responses:**\n  - `204 No Content` - Successfully deleted the wish list.\n  - `404 Not Found` - Wish list with the given ID was not found.\n  - `400 Bad Request` - Invalid ID provided.\n  - `500 Internal Server Error` - Unexpected error occurred.\n\n---\n\n### 5. Add Product to Wish List\n- **Endpoint:** `PATCH /api/wishlists/add/product_id/{pid}/wishlist_id/{wid}`\n- **Description:** Add a product to a wish list.\n- **Path Variables:**\n  - `pid` - The ID of the product to add.\n  - `wid` - The ID of the wish list to add the product to.\n- **Responses:**\n  - `200 OK` - Successfully added the product to the wish list.\n  - `404 Not Found` - Wish list or product with the given ID was not found.\n  - `400 Bad Request` - Invalid ID provided.\n  - `500 Internal Server Error` - Unexpected error occurred.\n\n---\n\n### 6. Remove Product from Wish List\n- **Endpoint:** `PATCH /api/wishlists/remove/product_id/{pid}/wishlist_id/{wid}`\n- **Description:** Remove a product from a wish list.\n- **Path Variables:**\n  - `pid` - The ID of the product to remove.\n  - `wid` - The ID of the wish list to remove the product from.\n- **Responses:**\n  - `200 OK` - Successfully removed the product from the wish list.\n  - `404 Not Found` - Wish list or product with the given ID was not found.\n  - `400 Bad Request` - Invalid ID provided.\n  - `500 Internal Server Error` - Unexpected error occurred.\n\n\n\n\n\n# CsvImportController REST Endpoints\n\n### 1. Upload Categories CSV\n- **Endpoint:** `POST /api/upload_csv_file/categories`\n- **Description:** Upload a CSV file containing category data.\n- **Request Parameters:**\n  - `file` - The CSV file to upload.\n- **Request Body:** `MultipartFile`\n- **Responses:**\n  - `200 OK` - Successfully processed the CSV file. Returns the number of categories uploaded.\n  - `400 Bad Request` - Invalid file or request.\n  - `500 Internal Server Error` - Unexpected error occurred.\n\n---\n\n### 2. Upload Products CSV\n- **Endpoint:** `POST /api/upload_csv_file/products`\n- **Description:** Upload a CSV file containing product data.\n- **Request Parameters:**\n  - `file` - The CSV file to upload.\n- **Request Body:** `MultipartFile`\n- **Responses:**\n  - `200 OK` - Successfully processed the CSV file. Returns the number of products uploaded.\n  - `400 Bad Request` - Invalid file or request.\n  - `500 Internal Server Error` - Unexpected error occurred.\n\n\n\n\n\n# ReportController REST Endpoints\n\n## 1. Export Products by Category Name\n- **Endpoint:** `GET /api/reports/product_by_category_name/{category_name}`\n- **Description:** Generate a report of all products in a specific category and save it as a CSV file.\n- **Request Parameters:**\n  - `category_name` (Path Variable) - The name of the category to retrieve products for.\n- **Responses:**\n  - `200 OK` - Report generated and saved to `C:\\Users\\hp\\Documents\\NetBeansProjects\\eComMaster\\product_by_category_name.csv`.\n  - `500 Internal Server Error` - Unexpected error occurred.\n\n---\n\n## 2. Export Active Discount Products\n- **Endpoint:** `GET /api/reports/active_discount_products`\n- **Description:** Generate a report of all products with active discounts and save it as a CSV file.\n- **Responses:**\n  - `200 OK` - Report generated and saved to `C:\\Users\\hp\\Documents\\NetBeansProjects\\eComMaster\\active_discount_products.csv`.\n  - `500 Internal Server Error` - Unexpected error occurred.\n\n---\n\n## 3. Export Products by Rating Above\n- **Endpoint:** `GET /api/reports/products_by_rating_above/{rating}`\n- **Description:** Generate a report of all products with ratings above a specified value and save it as a CSV file.\n- **Request Parameters:**\n  - `rating` (Path Variable) - The minimum rating to filter products.\n- **Responses:**\n  - `200 OK` - Report generated and saved to `C:\\Users\\hp\\Documents\\NetBeansProjects\\eComMaster\\products_by_rating_above.csv`.\n  - `500 Internal Server Error` - Unexpected error occurred.\n\n---\n\n## 4. Export Out of Stock Products\n- **Endpoint:** `GET /api/reports/out_of_stock_products`\n- **Description:** Generate a report of all products that are out of stock and save it as a CSV file.\n- **Responses:**\n  - `200 OK` - Report generated and saved to `C:\\Users\\hp\\Documents\\NetBeansProjects\\eComMaster\\out_of_stock_products.csv`.\n  - `500 Internal Server Error` - Unexpected error occurred.\n\n---\n\n## 5. Export Orders with Products from Category\n- **Endpoint:** `GET /api/reports/orders_with_category_name/{category_name}`\n- **Description:** Generate a report of all orders that include products from a specific category and save it as a CSV file.\n- **Request Parameters:**\n  - `category_name` (Path Variable) - The name of the category to retrieve orders for.\n- **Responses:**\n  - `200 OK` - Report generated and saved to `C:\\Users\\hp\\Documents\\NetBeansProjects\\eComMaster\\orders_with_category_name.csv`.\n  - `500 Internal Server Error` - Unexpected error occurred.\n\n---\n\n## 6. Export Users Who Used a Payment Provider\n- **Endpoint:** `GET /api/reports/users_who_used_provider/{provider}`\n- **Description:** Generate a report of all users who have used a specific payment provider and save it as a CSV file.\n- **Request Parameters:**\n  - `provider` (Path Variable) - The payment provider to filter users by.\n- **Responses:**\n  - `200 OK` - Report generated and saved to `C:\\Users\\hp\\Documents\\NetBeansProjects\\eComMaster\\users_who_used_provider.csv`.\n  - `500 Internal Server Error` - Unexpected error occurred.\n\n---\n\n## 7. Export Reviews for Category\n- **Endpoint:** `GET /api/reports/reviews_for_category_name/{category_name}`\n- **Description:** Generate a report of all reviews for products in a specific category and save it as a CSV file.\n- **Request Parameters:**\n  - `category_name` (Path Variable) - The name of the category to retrieve reviews for.\n- **Responses:**\n  - `200 OK` - Report generated and saved to `C:\\Users\\hp\\Documents\\NetBeansProjects\\eComMaster\\reviews_for_category_name.csv`.\n  - `500 Internal Server Error` - Unexpected error occurred.\n\n---\n\n## 8. Get Average Rating for Product\n- **Endpoint:** `GET /api/reports/avg_rating_for_product/{productName}`\n- **Description:** Retrieve the average rating for a specific product.\n- **Request Parameters:**\n  - `productName` (Path Variable) - The name of the product to retrieve the average rating for.\n- **Responses:**\n  - `200 OK` - Average rating of the product.\n  - `500 Internal Server Error` - Unexpected error occurred.\n\n---\n\n## 9. Get Total Cart Quantity for User\n- **Endpoint:** `GET /api/reports/total_cart_qty_for_user/{userId}`\n- **Description:** Retrieve the total quantity of items in the cart for a specific user.\n- **Request Parameters:**\n  - `userId` (Path Variable) - The ID of the user to retrieve the total cart quantity for.\n- **Responses:**\n  - `200 OK` - Total cart quantity for the user.\n  - `500 Internal Server Error` - Unexpected error occurred.\n\n\n\n\n# SalesTaxController REST Endpoints\n\n## 1. Retrieve All Sales Taxes\n- **Endpoint:** `GET /api/sales_taxes`\n- **Description:** Paginated retrieval of all sales taxes.\n- **Request Parameters:**\n  - `page` (Query Parameter, default: `0`) - The page number to retrieve.\n  - `size` (Query Parameter, default: `10`) - The number of items per page.\n- **Responses:**\n  - `200 OK` - Successfully retrieved sales tax list. Response contains a paginated list of `SalesTaxResponse`.\n  - `204 No Content` - List of sales taxes is empty.\n  - `500 Internal Server Error` - Unexpected error occurred.\n\n---\n\n## 2. Get Sales Tax By Id\n- **Endpoint:** `GET /api/sales_taxes/{id}`\n- **Description:** Retrieve a single sales tax by its ID.\n- **Request Parameters:**\n  - `id` (Path Variable) - ID of the sales tax to retrieve.\n- **Responses:**\n  - `200 OK` - Sales tax successfully found. Response contains a `SalesTaxResponse`.\n  - `404 Not Found` - Sales tax with the given ID is not found.\n  - `400 Bad Request` - Client entered a negative ID.\n  - `500 Internal Server Error` - Unexpected error occurred.\n\n---\n\n## 3. Create a New Sales Tax\n- **Endpoint:** `POST /api/sales_taxes`\n- **Description:** Create a new sales tax.\n- **Request Body:**\n  - `SalesTaxRequest` - Details of the sales tax to create.\n- **Responses:**\n  - `201 Created` - Sales tax successfully created. Response contains a `SalesTaxResponse`.\n  - `400 Bad Request` - Client entered an invalid entity body.\n  - `500 Internal Server Error` - Unexpected error occurred.\n\n---\n\n## 4. Update Sales Tax\n- **Endpoint:** `PUT /api/sales_taxes/{id}`\n- **Description:** Update an existing sales tax.\n- **Request Parameters:**\n  - `id` (Path Variable) - ID of the sales tax to update.\n- **Request Body:**\n  - `SalesTaxRequest` - Updated details of the sales tax.\n- **Responses:**\n  - `200 OK` - Sales tax successfully updated. Response contains a `SalesTaxResponse`.\n  - `404 Not Found` - Sales tax with the given ID is not found.\n  - `400 Bad Request` - Client entered a negative ID or an invalid entity body.\n  - `500 Internal Server Error` - Unexpected error occurred.\n\n---\n\n## 5. Delete Sales Tax By Id\n- **Endpoint:** `DELETE /api/sales_taxes/{id}`\n- **Description:** Delete a sales tax by its ID.\n- **Request Parameters:**\n  - `id` (Path Variable) - ID of the sales tax to delete.\n- **Responses:**\n  - `204 No Content` - Sales tax successfully deleted.\n  - `404 Not Found` - Sales tax with the given ID is not found.\n  - `400 Bad Request` - Client entered a negative ID.\n  - `500 Internal Server Error` - Unexpected error occurred.\n\n---\n\n## 6. Get Tax Rate for a Specific Country\n- **Endpoint:** `GET /api/sales_taxes/country/{country}`\n- **Description:** Retrieve the sales tax rate for a specific country.\n- **Request Parameters:**\n  - `country` (Path Variable) - Country to retrieve the tax rate for.\n- **Responses:**\n  - `200 OK` - Sales tax rate successfully retrieved. Response contains the tax rate as a `Double`.\n  - `404 Not Found` - Sales tax rate for the given country is not found.\n  - `400 Bad Request` - Client entered a blank country.\n  - `500 Internal Server Error` - Unexpected error occurred.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbourgui07%2Fbackend-of-spring-boot-e-commerce-app","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbourgui07%2Fbackend-of-spring-boot-e-commerce-app","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbourgui07%2Fbackend-of-spring-boot-e-commerce-app/lists"}