diff --git a/RetailManagementSystem/LICENSE b/RetailManagementSystem/LICENSE new file mode 100644 index 0000000..45cd622 --- /dev/null +++ b/RetailManagementSystem/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2020 IBM Developer Skills Network + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/RetailManagementSystem/README.md b/RetailManagementSystem/README.md new file mode 100644 index 0000000..5884e26 --- /dev/null +++ b/RetailManagementSystem/README.md @@ -0,0 +1 @@ +# coding-project-template \ No newline at end of file diff --git a/RetailManagementSystem/back-end/build.gradle b/RetailManagementSystem/back-end/build.gradle new file mode 100644 index 0000000..7e24356 --- /dev/null +++ b/RetailManagementSystem/back-end/build.gradle @@ -0,0 +1,32 @@ +import org.springframework.boot.gradle.plugin.SpringBootPlugin + +apply plugin: 'java' +apply plugin: 'org.springframework.boot' +apply plugin: 'io.spring.dependency-management' + +description = "Retail management system" + +java { + sourceCompatibility = JavaVersion.VERSION_21 + targetCompatibility = JavaVersion.VERSION_21 +} + +repositories { + mavenCentral() +} + +dependencyManagement { + imports { + mavenBom SpringBootPlugin.BOM_COORDINATES + } +} + +dependencies { + implementation 'org.springframework.boot:spring-boot-starter-data-jpa' + implementation 'org.springframework.boot:spring-boot-starter-data-mongodb' + implementation 'org.springframework.boot:spring-boot-starter-validation' + implementation 'org.springframework.boot:spring-boot-starter-web' + runtimeOnly 'org.springframework.boot:spring-boot-devtools' + runtimeOnly 'com.mysql:mysql-connector-j' + testImplementation 'org.springframework.boot:spring-boot-starter-test' +} \ No newline at end of file diff --git a/RetailManagementSystem/back-end/src/main/java/com/project/code/CodeApplication.java b/RetailManagementSystem/back-end/src/main/java/com/project/code/CodeApplication.java new file mode 100644 index 0000000..93464e7 --- /dev/null +++ b/RetailManagementSystem/back-end/src/main/java/com/project/code/CodeApplication.java @@ -0,0 +1,16 @@ +package com.project.code; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.ComponentScan; + +@SpringBootApplication +@ComponentScan("com.project.code") +public class CodeApplication { + + public static void main(String[] args) { + SpringApplication.run(CodeApplication.class, args); + + } + +} diff --git a/RetailManagementSystem/back-end/src/main/java/com/project/code/Controller/GlobalExceptionHandler.java b/RetailManagementSystem/back-end/src/main/java/com/project/code/Controller/GlobalExceptionHandler.java new file mode 100644 index 0000000..a66ae73 --- /dev/null +++ b/RetailManagementSystem/back-end/src/main/java/com/project/code/Controller/GlobalExceptionHandler.java @@ -0,0 +1,18 @@ +package com.project.code.Controller; + + +public class GlobalExceptionHandler { + +// 1. Set Up the Global Exception Handler Class: +// - Annotate the class with `@RestControllerAdvice` to enable global exception handling for REST controllers. +// - This allows the class to handle exceptions thrown in any of the controllers globally. + + +// 2. Define the `handleJsonParseException` Method: +// - Annotate with `@ExceptionHandler(HttpMessageNotReadableException.class)` to handle cases where the request body is not correctly formatted (e.g., invalid JSON). +// - The `HttpMessageNotReadableException` typically occurs when the input data cannot be deserialized or is improperly formatted. +// - Use `@ResponseStatus(HttpStatus.BAD_REQUEST)` to specify that the response status will be **400 Bad Request** when this exception is thrown. +// - The method should return a `Map` with the following key: +// - **`message`**: The error message should indicate that the input provided is invalid. The value should be `"Invalid input: The data provided is not valid."`. + +} diff --git a/RetailManagementSystem/back-end/src/main/java/com/project/code/Controller/InventoryController.java b/RetailManagementSystem/back-end/src/main/java/com/project/code/Controller/InventoryController.java new file mode 100644 index 0000000..8b4689e --- /dev/null +++ b/RetailManagementSystem/back-end/src/main/java/com/project/code/Controller/InventoryController.java @@ -0,0 +1,58 @@ +package com.project.code.Controller; + +public class InventoryController { +// 1. Set Up the Controller Class: +// - Annotate the class with `@RestController` to indicate that this is a REST controller, which handles HTTP requests and responses. +// - Use `@RequestMapping("/inventory")` to set the base URL path for all methods in this controller. All endpoints related to inventory will be prefixed with `/inventory`. + + +// 2. Autowired Dependencies: +// - Autowire necessary repositories and services: +// - `ProductRepository` will be used to interact with product data (i.e., finding, updating products). +// - `InventoryRepository` will handle CRUD operations related to the inventory. +// - `ServiceClass` will help with the validation logic (e.g., validating product IDs and inventory data). + + +// 3. Define the `updateInventory` Method: +// - This method handles HTTP PUT requests to update inventory for a product. +// - It takes a `CombinedRequest` (containing `Product` and `Inventory`) in the request body. +// - The product ID is validated, and if valid, the inventory is updated in the database. +// - If the inventory exists, update it and return a success message. If not, return a message indicating no data available. + + +// 4. Define the `saveInventory` Method: +// - This method handles HTTP POST requests to save a new inventory entry. +// - It accepts an `Inventory` object in the request body. +// - It first validates whether the inventory already exists. If it exists, it returns a message stating so. If it doesn’t exist, it saves the inventory and returns a success message. + + +// 5. Define the `getAllProducts` Method: +// - This method handles HTTP GET requests to retrieve products for a specific store. +// - It uses the `storeId` as a path variable and fetches the list of products from the database for the given store. +// - The products are returned in a `Map` with the key `"products"`. + + +// 6. Define the `getProductName` Method: +// - This method handles HTTP GET requests to filter products by category and name. +// - If either the category or name is `"null"`, adjust the filtering logic accordingly. +// - Return the filtered products in the response with the key `"product"`. + + +// 7. Define the `searchProduct` Method: +// - This method handles HTTP GET requests to search for products by name within a specific store. +// - It uses `name` and `storeId` as parameters and searches for products that match the `name` in the specified store. +// - The search results are returned in the response with the key `"product"`. + + +// 8. Define the `removeProduct` Method: +// - This method handles HTTP DELETE requests to delete a product by its ID. +// - It first validates if the product exists. If it does, it deletes the product from the `ProductRepository` and also removes the related inventory entry from the `InventoryRepository`. +// - Returns a success message with the key `"message"` indicating successful deletion. + + +// 9. Define the `validateQuantity` Method: +// - This method handles HTTP GET requests to validate if a specified quantity of a product is available in stock for a given store. +// - It checks the inventory for the product in the specified store and compares it to the requested quantity. +// - If sufficient stock is available, return `true`; otherwise, return `false`. + +} diff --git a/RetailManagementSystem/back-end/src/main/java/com/project/code/Controller/ProductController.java b/RetailManagementSystem/back-end/src/main/java/com/project/code/Controller/ProductController.java new file mode 100644 index 0000000..1e01dee --- /dev/null +++ b/RetailManagementSystem/back-end/src/main/java/com/project/code/Controller/ProductController.java @@ -0,0 +1,73 @@ +package com.project.code.Controller; + +public class ProductController { +// 1. Set Up the Controller Class: +// - Annotate the class with `@RestController` to designate it as a REST controller for handling HTTP requests. +// - Map the class to the `/product` URL using `@RequestMapping("/product")`. + + +// 2. Autowired Dependencies: +// - Inject the following dependencies via `@Autowired`: +// - `ProductRepository` for CRUD operations on products. +// - `ServiceClass` for product validation and business logic. +// - `InventoryRepository` for managing the inventory linked to products. + + +// 3. Define the `addProduct` Method: +// - Annotate with `@PostMapping` to handle POST requests for adding a new product. +// - Accept `Product` object in the request body. +// - Validate product existence using `validateProduct()` in `ServiceClass`. +// - Save the valid product using `save()` method of `ProductRepository`. +// - Catch exceptions (e.g., `DataIntegrityViolationException`) and return appropriate error message. + + +// 4. Define the `getProductbyId` Method: +// - Annotate with `@GetMapping("/product/{id}")` to handle GET requests for retrieving a product by ID. +// - Accept product ID via `@PathVariable`. +// - Use `findById(id)` method from `ProductRepository` to fetch the product. +// - Return the product in a `Map` with key `products`. + + + // 5. Define the `updateProduct` Method: +// - Annotate with `@PutMapping` to handle PUT requests for updating an existing product. +// - Accept updated `Product` object in the request body. +// - Use `save()` method from `ProductRepository` to update the product. +// - Return a success message with key `message` after updating the product. + + +// 6. Define the `filterbyCategoryProduct` Method: +// - Annotate with `@GetMapping("/category/{name}/{category}")` to handle GET requests for filtering products by `name` and `category`. +// - Use conditional filtering logic if `name` or `category` is `"null"`. +// - Fetch products based on category using methods like `findByCategory()` or `findProductBySubNameAndCategory()`. +// - Return filtered products in a `Map` with key `products`. + + + // 7. Define the `listProduct` Method: +// - Annotate with `@GetMapping` to handle GET requests to fetch all products. +// - Fetch all products using `findAll()` method from `ProductRepository`. +// - Return all products in a `Map` with key `products`. + + +// 8. Define the `getProductbyCategoryAndStoreId` Method: +// - Annotate with `@GetMapping("filter/{category}/{storeid}")` to filter products by `category` and `storeId`. +// - Use `findProductByCategory()` method from `ProductRepository` to retrieve products. +// - Return filtered products in a `Map` with key `product`. + + +// 9. Define the `deleteProduct` Method: +// - Annotate with `@DeleteMapping("/{id}")` to handle DELETE requests for removing a product by its ID. +// - Validate product existence using `ValidateProductId()` in `ServiceClass`. +// - Remove product from `Inventory` first using `deleteByProductId(id)` in `InventoryRepository`. +// - Remove product from `Product` using `deleteById(id)` in `ProductRepository`. +// - Return a success message with key `message` indicating product deletion. + + + // 10. Define the `searchProduct` Method: +// - Annotate with `@GetMapping("/searchProduct/{name}")` to search for products by `name`. +// - Use `findProductBySubName()` method from `ProductRepository` to search products by name. +// - Return search results in a `Map` with key `products`. + + + + +} diff --git a/RetailManagementSystem/back-end/src/main/java/com/project/code/Controller/ReviewController.java b/RetailManagementSystem/back-end/src/main/java/com/project/code/Controller/ReviewController.java new file mode 100644 index 0000000..6ca5d91 --- /dev/null +++ b/RetailManagementSystem/back-end/src/main/java/com/project/code/Controller/ReviewController.java @@ -0,0 +1,25 @@ +package com.project.code.Controller; + +public class ReviewController { +// 1. Set Up the Controller Class: +// - Annotate the class with `@RestController` to designate it as a REST controller for handling HTTP requests. +// - Map the class to the `/reviews` URL using `@RequestMapping("/reviews")`. + + + // 2. Autowired Dependencies: +// - Inject the following dependencies via `@Autowired`: +// - `ReviewRepository` for accessing review data. +// - `CustomerRepository` for retrieving customer details associated with reviews. + + +// 3. Define the `getReviews` Method: +// - Annotate with `@GetMapping("/{storeId}/{productId}")` to fetch reviews for a specific product in a store by `storeId` and `productId`. +// - Accept `storeId` and `productId` via `@PathVariable`. +// - Fetch reviews using `findByStoreIdAndProductId()` method from `ReviewRepository`. +// - Filter reviews to include only `comment`, `rating`, and the `customerName` associated with the review. +// - Use `findById(review.getCustomerId())` from `CustomerRepository` to get customer name. +// - Return filtered reviews in a `Map` with key `reviews`. + + + +} diff --git a/RetailManagementSystem/back-end/src/main/java/com/project/code/Controller/StoreController.java b/RetailManagementSystem/back-end/src/main/java/com/project/code/Controller/StoreController.java new file mode 100644 index 0000000..fd82978 --- /dev/null +++ b/RetailManagementSystem/back-end/src/main/java/com/project/code/Controller/StoreController.java @@ -0,0 +1,35 @@ +package com.project.code.Controller; + + +public class StoreController { +// 1. Set Up the Controller Class: +// - Annotate the class with `@RestController` to designate it as a REST controller for handling HTTP requests. +// - Map the class to the `/store` URL using `@RequestMapping("/store")`. + + + // 2. Autowired Dependencies: +// - Inject the following dependencies via `@Autowired`: +// - `StoreRepository` for managing store data. +// - `OrderService` for handling order-related functionality. + + + // 3. Define the `addStore` Method: +// - Annotate with `@PostMapping` to create an endpoint for adding a new store. +// - Accept `Store` object in the request body. +// - Return a success message in a `Map` with the key `message` containing store creation confirmation. + + + // 4. Define the `validateStore` Method: +// - Annotate with `@GetMapping("validate/{storeId}")` to check if a store exists by its `storeId`. +// - Return a **boolean** indicating if the store exists. + + + // 5. Define the `placeOrder` Method: +// - Annotate with `@PostMapping("/placeOrder")` to handle order placement. +// - Accept `PlaceOrderRequestDTO` in the request body. +// - Return a success message with key `message` if the order is successfully placed. +// - Return an error message with key `Error` if there is an issue processing the order. + + + +} diff --git a/RetailManagementSystem/back-end/src/main/java/com/project/code/Model/CombinedRequest.java b/RetailManagementSystem/back-end/src/main/java/com/project/code/Model/CombinedRequest.java new file mode 100644 index 0000000..5d80b48 --- /dev/null +++ b/RetailManagementSystem/back-end/src/main/java/com/project/code/Model/CombinedRequest.java @@ -0,0 +1,26 @@ +package com.project.code.Model; + +public class CombinedRequest { + + private Product product; + private Inventory inventory; + + public Product getProduct() { + return product; + } + + // Setter for product + public void setProduct(Product product) { + this.product = product; + } + + // Getter for store + public Inventory getInventory() { + return inventory; + } + + // Setter for store + public void setInventory(Inventory inventory) { + this.inventory = inventory; + } +} \ No newline at end of file diff --git a/RetailManagementSystem/back-end/src/main/java/com/project/code/Model/Customer.java b/RetailManagementSystem/back-end/src/main/java/com/project/code/Model/Customer.java new file mode 100644 index 0000000..e5158fd --- /dev/null +++ b/RetailManagementSystem/back-end/src/main/java/com/project/code/Model/Customer.java @@ -0,0 +1,49 @@ +package com.project.code.Model; + + +public class Customer { + +// 1. Add 'id' field: +// - Type: private long +// - It should be auto-incremented. +// - Use @Id to mark it as the primary key and @GeneratedValue(strategy = GenerationType.IDENTITY) to auto-increment it. + +// 2. Add 'name' field: +// - Type: private String +// - This field cannot be empty, use the @NotNull annotation to enforce this rule. + + // Example: @NotNull(message = "Name cannot be null") + +// 3. Add 'email' field: +// - Type: private String +// - This field cannot be empty, use the @NotNull annotation to enforce this rule. + + // Example: @NotNull(message = "Email cannot be null") + +// 4. Add 'phone' field: +// - Type: private String +// - This field cannot be empty, use the @NotNull annotation to enforce this rule. + + // Example: @NotNull(message = "Phone cannot be null") + +// 5. Add one-to-many relationship with orders: +// - A customer can have multiple orders. +// - Use the @OneToMany annotation to establish this relationship. +// - Specify "mappedBy = 'customer'" to indicate that the 'customer' field in the 'Order' entity owns the relationship. +// - Use @JsonManagedReference to ensure proper JSON serialization of related orders. + + // Example: @OneToMany(mappedBy = "customer", fetch = FetchType.EAGER) + // Example: @JsonManagedReference + +// 6. Getters and Setters: +// - For each field ('id', 'name', 'email', 'phone'), add getter and setter methods. +// - Example: public Long getId(), public void setId(Long id) +// - Example: public String getName(), public void setName(String name) +// - Add getters and setters for 'email' and 'phone' fields as well. + +// 7. Ensure to use proper annotations and validate constraints: +// - Use @NotNull for fields that cannot be empty like 'name', 'email', and 'phone'. +// - Make sure you add the correct annotations for entity mapping and relationship management like @Entity, @Id, @GeneratedValue, @OneToMany, and @JsonManagedReference. + +} + diff --git a/RetailManagementSystem/back-end/src/main/java/com/project/code/Model/Inventory.java b/RetailManagementSystem/back-end/src/main/java/com/project/code/Model/Inventory.java new file mode 100644 index 0000000..d49e8ba --- /dev/null +++ b/RetailManagementSystem/back-end/src/main/java/com/project/code/Model/Inventory.java @@ -0,0 +1,49 @@ +package com.project.code.Model; + + +public class Inventory { + // 1. Add 'id' field: +// - Type: private long +// - This field will represent the unique identifier for the inventory entry. +// - Use @Id to mark it as the primary key. +// - Use @GeneratedValue(strategy = GenerationType.IDENTITY) to auto-increment it. + +// 2. Add 'product' field: +// - Type: private Product +// - This field will represent the product associated with the inventory entry. +// - Use @ManyToOne to establish a many-to-one relationship with the Product entity. + +// 3. Add 'store' field: +// - Type: private Store +// - This field will represent the store where the inventory is located. +// - Use @ManyToOne to establish a many-to-one relationship with the Store entity. + +// 4. Add 'stockLevel' field: +// - Type: private Integer +// - This field will represent the current stock level of the product at the store. + +// 5. Add relationships: +// - **Product Relationship**: Use @ManyToOne to link this inventory entry to a product. +// - **Store Relationship**: Use @ManyToOne to link this inventory entry to a store. +// - Use @JsonBackReference("inventory-product") to prevent circular references during JSON serialization for the product field. +// - Use @JsonBackReference("inventory-store") to prevent circular references during JSON serialization for the store field. + +// 6. Use @JoinColumn for foreign key associations: +// - For the 'product' field, use @JoinColumn(name = "product_id") to specify the foreign key column. +// - For the 'store' field, use @JoinColumn(name = "store_id") to specify the foreign key column. + +// 7. Create a constructor: +// - Add a constructor that takes a Product, Store, and Integer stockLevel to initialize the Inventory object. + +// 8. Add @Entity annotation: +// - Use @Entity above the class definition to mark it as a JPA entity that will be mapped to a database table. + +// 9. Add Getters and Setters: +// - Add getters and setters for 'id', 'product', 'store', and 'stockLevel' fields. +// - Example: public Long getId(), public void setId(Long id) +// - Example: public Product getProduct(), public void setProduct(Product product) +// - Example: public Store getStore(), public void setStore(Store store) +// - Example: public Integer getStockLevel(), public void setStockLevel(Integer stockLevel) + +} + diff --git a/RetailManagementSystem/back-end/src/main/java/com/project/code/Model/OrderDetails.java b/RetailManagementSystem/back-end/src/main/java/com/project/code/Model/OrderDetails.java new file mode 100644 index 0000000..71ebc48 --- /dev/null +++ b/RetailManagementSystem/back-end/src/main/java/com/project/code/Model/OrderDetails.java @@ -0,0 +1,48 @@ +package com.project.code.Model; + + +public class OrderDetails { + +// 1. Add 'id' field: +// - Type: private Long +// - This field will be auto-incremented. +// - Use @Id to mark it as the primary key. +// - Use @GeneratedValue(strategy = GenerationType.IDENTITY) to auto-increment it. + +// 2. Add 'customer' field: +// - Type: private Customer +// - This field refers to the customer who placed the order. +// - Use @ManyToOne with @JoinColumn(name = "customer_id") to define the foreign key relationship. +// - Apply @JsonManagedReference to handle bidirectional relationships and JSON serialization. + +// 3. Add 'store' field: +// - Type: private Store +// - This field refers to the store from where the order was placed. +// - Use @ManyToOne with @JoinColumn(name = "store_id") to define the foreign key relationship. +// - Apply @JsonManagedReference to handle bidirectional relationships and JSON serialization. + +// 4. Add 'totalPrice' field: +// - Type: private Double +// - This field represents the total price of the order. + +// 5. Add 'date' field: +// - Type: private LocalDateTime +// - This field represents the date and time when the order was placed. + +// 6. Add 'orderItems' field: +// - Type: private List +// - This field represents the list of items in the order. +// - Use @OneToMany(mappedBy = "order", fetch = FetchType.EAGER) to establish the one-to-many relationship with OrderItem. +// - Apply @JsonManagedReference to prevent circular references during JSON serialization. + +// 7. Add constructors: +// - A no-argument constructor. +// - A parameterized constructor that accepts Customer, Store, totalPrice, and date as parameters. + +// 8. Add @Entity annotation: +// - Use @Entity above the class name to mark it as a JPA entity. + +// 9. Add Getters and Setters: +// - Add getter and setter methods for all fields (id, customer, store, totalPrice, date, orderItems). + +} diff --git a/RetailManagementSystem/back-end/src/main/java/com/project/code/Model/OrderItem.java b/RetailManagementSystem/back-end/src/main/java/com/project/code/Model/OrderItem.java new file mode 100644 index 0000000..083a863 --- /dev/null +++ b/RetailManagementSystem/back-end/src/main/java/com/project/code/Model/OrderItem.java @@ -0,0 +1,42 @@ +package com.project.code.Model; + +public class OrderItem { + +// 1. Add 'id' field: +// - Type: private Long +// - This field will be auto-incremented. +// - Use @Id to mark it as the primary key. +// - Use @GeneratedValue(strategy = GenerationType.IDENTITY) to auto-increment it. + +// 2. Add 'order' field: +// - Type: private OrderDetails +// - This field refers to the order this item belongs to. +// - Use @ManyToOne with @JoinColumn(name = "order_id") to define the foreign key relationship. +// - Apply @JsonManagedReference to manage bidirectional relationships and JSON serialization. + +// 3. Add 'product' field: +// - Type: private Product +// - This field refers to the product in the order. +// - Use @ManyToOne with @JoinColumn(name = "product_id") to define the foreign key relationship. +// - Apply @JsonManagedReference to prevent circular references during JSON serialization. + +// 4. Add 'quantity' field: +// - Type: private Integer +// - This field represents the quantity of the product in the order. + +// 5. Add 'price' field: +// - Type: private Double +// - This field represents the price of the product at the time of the order. + +// 6. Add constructors: +// - A no-argument constructor. +// - A parameterized constructor that accepts OrderDetails, Product, quantity, and price as parameters. + +// 7. Add @Entity annotation: +// - Use @Entity above the class name to mark it as a JPA entity. + +// 8. Add Getters and Setters: +// - Add getter and setter methods for all fields (id, order, product, quantity, price). + +} + diff --git a/RetailManagementSystem/back-end/src/main/java/com/project/code/Model/PlaceOrderRequestDTO.java b/RetailManagementSystem/back-end/src/main/java/com/project/code/Model/PlaceOrderRequestDTO.java new file mode 100644 index 0000000..449c334 --- /dev/null +++ b/RetailManagementSystem/back-end/src/main/java/com/project/code/Model/PlaceOrderRequestDTO.java @@ -0,0 +1,72 @@ +package com.project.code.Model; + + +import java.util.List; + +public class PlaceOrderRequestDTO { + private Long storeId; + private String customerName; + private String customerEmail; + private String customerPhone; + private String datetime; + private List purchaseProduct; + private Double totalPrice; + + // Getters and Setters + + public Long getStoreId() { + return storeId; + } + + public void setStoreId(Long storeId) { + this.storeId = storeId; + } + + public String getCustomerName() { + return customerName; + } + + public void setCustomerName(String customerName) { + this.customerName = customerName; + } + + public String getCustomerEmail() { + return customerEmail; + } + + public void setCustomerEmail(String customerEmail) { + this.customerEmail = customerEmail; + } + + public String getCustomerPhone() { + return customerPhone; + } + + public void setCustomerPhone(String customerPhone) { + this.customerPhone = customerPhone; + } + + public String getDatetime() { + return datetime; + } + + public void setDatetime(String datetime) { + this.datetime = datetime; + } + + public List getPurchaseProduct() { + return purchaseProduct; + } + + public void setPurchaseProduct(List purchaseProduct) { + this.purchaseProduct = purchaseProduct; + } + + public Double getTotalPrice() { + return totalPrice; + } + + public void setTotalPrice(Double totalPrice) { + this.totalPrice = totalPrice; + } +} diff --git a/RetailManagementSystem/back-end/src/main/java/com/project/code/Model/Product.java b/RetailManagementSystem/back-end/src/main/java/com/project/code/Model/Product.java new file mode 100644 index 0000000..b478b7f --- /dev/null +++ b/RetailManagementSystem/back-end/src/main/java/com/project/code/Model/Product.java @@ -0,0 +1,44 @@ +package com.project.code.Model; + + +public class Product { + +// 1. Add 'id' field: +// - Type: private long +// - This field will be auto-incremented. +// - Use @Id to mark it as the primary key. +// - Use @GeneratedValue(strategy = GenerationType.IDENTITY) to auto-increment it. + +// 2. Add 'name' field: +// - Type: private String +// - This field cannot be empty, use the @NotNull annotation to enforce this rule. + +// 3. Add 'category' field: +// - Type: private String +// - This field cannot be empty, use the @NotNull annotation to enforce this rule. + +// 4. Add 'price' field: +// - Type: private Double +// - This field cannot be empty, use the @NotNull annotation to enforce this rule. + +// 5. Add 'sku' field: +// - Type: private String +// - This field cannot be empty, must be unique, use the @NotNull annotation to enforce this rule. +// - Use the @Table annotation with uniqueConstraints to ensure the 'sku' column is unique. + +// Example: @Table(name = "product", uniqueConstraints = @UniqueConstraint(columnNames = "sku")) + +// 6. Add relationships: +// - **Inventory**: A product can have multiple inventory entries. +// - Use @OneToMany(mappedBy = "product") to reflect the one-to-many relationship with Inventory. +// - Use @JsonManagedReference("inventory-product") to manage bidirectional relationships and avoid circular references. + +// 7. Add @Entity annotation: +// - Use @Entity above the class name to mark it as a JPA entity. + +// 8. Add Getters and Setters: +// - Add getter and setter methods for all fields (id, name, category, price, sku). + +} + + diff --git a/RetailManagementSystem/back-end/src/main/java/com/project/code/Model/PurchaseProductDTO.java b/RetailManagementSystem/back-end/src/main/java/com/project/code/Model/PurchaseProductDTO.java new file mode 100644 index 0000000..591e04e --- /dev/null +++ b/RetailManagementSystem/back-end/src/main/java/com/project/code/Model/PurchaseProductDTO.java @@ -0,0 +1,52 @@ +package com.project.code.Model; + + +public class PurchaseProductDTO { + private Long id; + private String name; + private Double price; + private Integer quantity; + private Double total; + + // Getters and Setters + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Double getPrice() { + return price; + } + + public void setPrice(Double price) { + this.price = price; + } + + public Integer getQuantity() { + return quantity; + } + + public void setQuantity(Integer quantity) { + this.quantity = quantity; + } + + public Double getTotal() { + return total; + } + + public void setTotal(Double total) { + this.total = total; + } +} diff --git a/RetailManagementSystem/back-end/src/main/java/com/project/code/Model/Review.java b/RetailManagementSystem/back-end/src/main/java/com/project/code/Model/Review.java new file mode 100644 index 0000000..b90d5a7 --- /dev/null +++ b/RetailManagementSystem/back-end/src/main/java/com/project/code/Model/Review.java @@ -0,0 +1,47 @@ +package com.project.code.Model; + +public class Review { + +// 1. Add 'customerId' field: +// - Type: private Long +// - This field represents the customer who created the review. +// - This field cannot be empty, use the @NotNull annotation to enforce this rule. + +// 2. Add 'productId' field: +// - Type: private Long +// - This field represents the product being reviewed. +// - This field cannot be empty, use the @NotNull annotation to enforce this rule. + +// 3. Add 'storeId' field: +// - Type: private Long +// - This field represents the store associated with the product. +// - This field cannot be empty, use the @NotNull annotation to enforce this rule. + +// 4. Add 'rating' field: +// - Type: private Integer +// - This field represents the rating given to the product (out of 5). +// - This field cannot be empty, use the @NotNull annotation to enforce this rule. + +// 5. Add 'comment' field: +// - Type: private String +// - This field represents an optional comment on the product. + +// 6. Add validation: +// - Apply @NotNull to the customerId, productId, storeId, and rating fields to ensure they are not null. +// - Example: @NotNull(message = "Customer cannot be null") + +// 7. Add @Document annotation: +// - Use @Document(collection = "reviews") to indicate that this class represents a MongoDB document. + +// 8. Add constructor: +// - The constructor should accept values for customerId, productId, storeId, rating, and an optional comment. + +// 9. Add @Id annotation: +// - Use @Id to mark the field 'id' as the primary key for MongoDB. +// - The 'id' field is of type String and will be automatically generated by MongoDB. + +// 10. Add Getters and Setters: +// - Add getter and setter methods for all fields (customerId, productId, storeId, rating, comment). + + +} diff --git a/RetailManagementSystem/back-end/src/main/java/com/project/code/Model/Store.java b/RetailManagementSystem/back-end/src/main/java/com/project/code/Model/Store.java new file mode 100644 index 0000000..286d2e8 --- /dev/null +++ b/RetailManagementSystem/back-end/src/main/java/com/project/code/Model/Store.java @@ -0,0 +1,35 @@ +package com.project.code.Model; + + +public class Store { + +// 1. Add 'id' field: +// - Type: private long +// - This field will be auto-incremented. +// - Use @Id to mark it as the primary key. +// - Use @GeneratedValue(strategy = GenerationType.IDENTITY) to auto-increment it. + +// 2. Add 'name' field: +// - Type: private String +// - This field cannot be empty, use the @NotNull annotation to enforce this rule. + +// 3. Add 'address' field: +// - Type: private String +// - This field cannot be empty, use the @NotNull and @NotBlank annotations to enforce this rule. + +// 4. Add relationships: +// - **Inventory**: A store can have multiple inventory entries. +// - Use @OneToMany(mappedBy = "store") to reflect the one-to-many relationship with Inventory. +// - Use @JsonManagedReference("inventory-store") to manage bidirectional relationships and avoid circular references. + +// 5. Add constructor: +// - Create a constructor that accepts name and address as parameters to initialize the Store object. + +// 6. Add @Entity annotation: +// - Use @Entity above the class name to mark it as a JPA entity. + +// 7. Add Getters and Setters: +// - Add getter and setter methods for all fields (id, name, address). + +} + diff --git a/RetailManagementSystem/back-end/src/main/java/com/project/code/Repo/CustomerRepository.java b/RetailManagementSystem/back-end/src/main/java/com/project/code/Repo/CustomerRepository.java new file mode 100644 index 0000000..448dd02 --- /dev/null +++ b/RetailManagementSystem/back-end/src/main/java/com/project/code/Repo/CustomerRepository.java @@ -0,0 +1,39 @@ +package com.project.code.Repo; + + +public interface CustomerRepository { +// 1. Add the repository interface: +// - Extend JpaRepository to inherit basic CRUD functionality. +// - This allows the repository to perform operations like save, delete, update, and find without having to implement these methods manually. + +// Example: public interface CustomerRepository extends JpaRepository {} + +// 2. Add custom query methods: +// - **findByEmail**: +// - This method will allow you to find a customer by their email address. +// - Return type: Customer +// - Parameter: String email + +// Example: public Customer findByEmail(String email); + +// - **findById**: +// - This method will allow you to find a customer by their ID. +// - Return type: Customer +// - Parameter: Long id + +// Example: public Customer findById(Long id); + +// 3. Add any additional methods you may need for custom queries: +// - You can create other query methods as needed, like finding customers by name or phone number, etc. + +// Example: public List findByName(String name); + +// 4. Add @Repository annotation: +// - Mark the interface with @Repository to indicate that it's a Spring Data JPA repository. +// - This annotation is optional if you extend JpaRepository, as Spring Data automatically registers the repository, but it's good practice to add it for clarity. + + + +} + + diff --git a/RetailManagementSystem/back-end/src/main/java/com/project/code/Repo/InventoryRepository.java b/RetailManagementSystem/back-end/src/main/java/com/project/code/Repo/InventoryRepository.java new file mode 100644 index 0000000..e4cb6c9 --- /dev/null +++ b/RetailManagementSystem/back-end/src/main/java/com/project/code/Repo/InventoryRepository.java @@ -0,0 +1,34 @@ +package com.project.code.Repo; + + +public interface InventoryRepository { +// 1. Add the repository interface: +// - Extend JpaRepository to inherit basic CRUD functionality. +// - This allows the repository to perform operations like save, delete, update, and find without having to implement these methods manually. + +// Example: public interface InventoryRepository extends JpaRepository {} + +// 2. Add custom query methods: +// - **findByProductIdandStoreId**: +// - This method will allow you to find an inventory record by its product ID and store ID. +// - Return type: Inventory +// - Parameters: Long productId, Long storeId + +// Example: public Inventory findByProductIdandStoreId(Long productId, Long storeId); + +// - **findByStore_Id**: +// - This method will allow you to find a list of inventory records for a specific store. +// - Return type: List +// - Parameter: Long storeId + +// Example: public List findByStore_Id(Long storeId); + +// - **deleteByProductId**: +// - This method will allow you to delete all inventory records related to a specific product ID. +// - Return type: void +// - Parameter: Long productId +// - Use @Modifying and @Transactional annotations to ensure the database is modified correctly. + + + +} diff --git a/RetailManagementSystem/back-end/src/main/java/com/project/code/Repo/OrderDetailsRepository.java b/RetailManagementSystem/back-end/src/main/java/com/project/code/Repo/OrderDetailsRepository.java new file mode 100644 index 0000000..800bca5 --- /dev/null +++ b/RetailManagementSystem/back-end/src/main/java/com/project/code/Repo/OrderDetailsRepository.java @@ -0,0 +1,14 @@ +package com.project.code.Repo; + + +public interface OrderDetailsRepository { +// 1. Add the repository interface: +// - Extend JpaRepository to inherit basic CRUD functionality. +// - This allows the repository to perform operations like save, delete, update, and find without having to implement these methods manually. + +// Example: public interface OrderDetailsRepository extends JpaRepository {} + +// 2. Since no custom methods are required for this repository, the default CRUD operations (save, delete, update, findById, etc.) are available out of the box. + +} + diff --git a/RetailManagementSystem/back-end/src/main/java/com/project/code/Repo/OrderItemRepository.java b/RetailManagementSystem/back-end/src/main/java/com/project/code/Repo/OrderItemRepository.java new file mode 100644 index 0000000..0e9cb86 --- /dev/null +++ b/RetailManagementSystem/back-end/src/main/java/com/project/code/Repo/OrderItemRepository.java @@ -0,0 +1,16 @@ +package com.project.code.Repo; + + + +public interface OrderItemRepository { +// 1. Add the repository interface: +// - Extend JpaRepository to inherit basic CRUD functionality. +// - This allows the repository to perform operations like save, delete, update, and find without having to implement these methods manually. + +// Example: public interface OrderItemRepository extends JpaRepository {} + +// 2. Since no custom methods are required for this repository, the default CRUD operations (save, delete, update, findById, etc.) are available out of the box. + +} + + diff --git a/RetailManagementSystem/back-end/src/main/java/com/project/code/Repo/ProductRepository.java b/RetailManagementSystem/back-end/src/main/java/com/project/code/Repo/ProductRepository.java new file mode 100644 index 0000000..7f2de5b --- /dev/null +++ b/RetailManagementSystem/back-end/src/main/java/com/project/code/Repo/ProductRepository.java @@ -0,0 +1,53 @@ +package com.project.code.Repo; + + +public interface ProductRepository { +// 1. Add the repository interface: +// - Extend JpaRepository to inherit basic CRUD functionality. +// - This allows the repository to perform operations like save, delete, update, and find without having to implement these methods manually. + +// Example: public interface ProductRepository extends JpaRepository {} + +// 2. Add custom query methods: +// - **findAll**: +// - This method will retrieve all products. +// - Return type: List + +// Example: public List findAll(); + +// - **findByCategory**: +// - This method will retrieve products by their category. +// - Return type: List +// - Parameter: String category + +// Example: public List findByCategory(String category); + +// - **findByPriceBetween**: +// - This method will retrieve products within a price range. +// - Return type: List +// - Parameters: Double minPrice, Double maxPrice + +// Example: public List findByPriceBetween(Double minPrice, Double maxPrice); + +// - **findBySku**: +// - This method will retrieve a product by its SKU. +// - Return type: Product +// - Parameter: String sku + +// Example: public Product findBySku(String sku); + +// - **findByName**: +// - This method will retrieve a product by its name. +// - Return type: Product +// - Parameter: String name + +// Example: public Product findByName(String name); + +// - **findByNameLike**: +// - This method will retrieve products by a name pattern for a specific store. +// - Return type: List +// - Parameters: Long storeId, String pname +// - Use @Query annotation to write a custom query. + + +} diff --git a/RetailManagementSystem/back-end/src/main/java/com/project/code/Repo/ReviewRepository.java b/RetailManagementSystem/back-end/src/main/java/com/project/code/Repo/ReviewRepository.java new file mode 100644 index 0000000..1e2a460 --- /dev/null +++ b/RetailManagementSystem/back-end/src/main/java/com/project/code/Repo/ReviewRepository.java @@ -0,0 +1,18 @@ +package com.project.code.Repo; + +public interface ReviewRepository { +// 1. Add the repository interface: +// - Extend MongoRepository to inherit basic CRUD functionality for MongoDB operations. +// - This allows the repository to perform operations like save, delete, update, and find without having to implement these methods manually. + +// Example: public interface ReviewRepository extends MongoRepository {} + +// 2. Add custom query methods: +// - **findByStoreIdAndProductId**: +// - This method will retrieve reviews for a specific product and store. +// - Return type: List +// - Parameters: Long storeId, Long productId + +// Example: public List findByStoreIdAndProductId(Long storeId, Long productId); + +} diff --git a/RetailManagementSystem/back-end/src/main/java/com/project/code/Repo/StoreRepository.java b/RetailManagementSystem/back-end/src/main/java/com/project/code/Repo/StoreRepository.java new file mode 100644 index 0000000..895456f --- /dev/null +++ b/RetailManagementSystem/back-end/src/main/java/com/project/code/Repo/StoreRepository.java @@ -0,0 +1,26 @@ +package com.project.code.Repo; + +public interface StoreRepository { +// 1. Add the repository interface: +// - Extend JpaRepository to inherit basic CRUD functionality. +// - This allows the repository to perform operations like save, delete, update, and find without having to implement these methods manually. + +// Example: public interface StoreRepository extends JpaRepository {} + +// 2. Add custom query methods: +// - **findById**: +// - This method will retrieve a store by its ID. +// - Return type: Store +// - Parameter: Long id + +// Example: public Store findById(Long id); + +// - **findBySubName**: +// - This method will retrieve stores whose name contains a given substring. +// - Return type: List +// - Parameter: String pname +// - Use @Query annotation to write a custom query. + + + +} diff --git a/RetailManagementSystem/back-end/src/main/java/com/project/code/Service/OrderService.java b/RetailManagementSystem/back-end/src/main/java/com/project/code/Service/OrderService.java new file mode 100644 index 0000000..a2993be --- /dev/null +++ b/RetailManagementSystem/back-end/src/main/java/com/project/code/Service/OrderService.java @@ -0,0 +1,27 @@ +package com.project.code.Service; + + +public class OrderService { +// 1. **saveOrder Method**: +// - Processes a customer's order, including saving the order details and associated items. +// - Parameters: `PlaceOrderRequestDTO placeOrderRequest` (Request data for placing an order) +// - Return Type: `void` (This method doesn't return anything, it just processes the order) + +// 2. **Retrieve or Create the Customer**: +// - Check if the customer exists by their email using `findByEmail`. +// - If the customer exists, use the existing customer; otherwise, create and save a new customer using `customerRepository.save()`. + +// 3. **Retrieve the Store**: +// - Fetch the store by ID from `storeRepository`. +// - If the store doesn't exist, throw an exception. Use `storeRepository.findById()`. + +// 4. **Create OrderDetails**: +// - Create a new `OrderDetails` object and set customer, store, total price, and the current timestamp. +// - Set the order date using `java.time.LocalDateTime.now()` and save the order with `orderDetailsRepository.save()`. + +// 5. **Create and Save OrderItems**: +// - For each product purchased, find the corresponding inventory, update stock levels, and save the changes using `inventoryRepository.save()`. +// - Create and save `OrderItem` for each product and associate it with the `OrderDetails` using `orderItemRepository.save()`. + + +} diff --git a/RetailManagementSystem/back-end/src/main/java/com/project/code/Service/ServiceClass.java b/RetailManagementSystem/back-end/src/main/java/com/project/code/Service/ServiceClass.java new file mode 100644 index 0000000..fd334cc --- /dev/null +++ b/RetailManagementSystem/back-end/src/main/java/com/project/code/Service/ServiceClass.java @@ -0,0 +1,26 @@ +package com.project.code.Service; + + +public class ServiceClass { + +// 1. **validateInventory Method**: +// - Checks if an inventory record exists for a given product and store combination. +// - Parameters: `Inventory inventory` +// - Return Type: `boolean` (Returns `false` if inventory exists, otherwise `true`) + +// 2. **validateProduct Method**: +// - Checks if a product exists by its name. +// - Parameters: `Product product` +// - Return Type: `boolean` (Returns `false` if a product with the same name exists, otherwise `true`) + +// 3. **ValidateProductId Method**: +// - Checks if a product exists by its ID. +// - Parameters: `long id` +// - Return Type: `boolean` (Returns `false` if the product does not exist with the given ID, otherwise `true`) + +// 4. **getInventoryId Method**: +// - Fetches the inventory record for a given product and store combination. +// - Parameters: `Inventory inventory` +// - Return Type: `Inventory` (Returns the inventory record for the product-store combination) + +} diff --git a/RetailManagementSystem/back-end/src/main/java/com/project/code/config/WebConfig.java b/RetailManagementSystem/back-end/src/main/java/com/project/code/config/WebConfig.java new file mode 100644 index 0000000..f72de70 --- /dev/null +++ b/RetailManagementSystem/back-end/src/main/java/com/project/code/config/WebConfig.java @@ -0,0 +1,18 @@ +package com.project.code.config; + +import org.springframework.context.annotation.Configuration; +import org.springframework.web.servlet.config.annotation.CorsRegistry; +import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; + +@Configuration +public class WebConfig implements WebMvcConfigurer { + + @Override + public void addCorsMappings(CorsRegistry registry) { + // Allow CORS for all endpoints + registry.addMapping("/**") + .allowedOrigins("*") // Add your frontend URL here + .allowedMethods("GET", "POST", "PUT", "DELETE") // Specify allowed methods + .allowedHeaders("*"); // You can restrict headers if needed + } +} diff --git a/RetailManagementSystem/back-end/src/main/resources/application.properties b/RetailManagementSystem/back-end/src/main/resources/application.properties new file mode 100644 index 0000000..d143fe5 --- /dev/null +++ b/RetailManagementSystem/back-end/src/main/resources/application.properties @@ -0,0 +1,2 @@ +spring.application.name=code + diff --git a/RetailManagementSystem/back-end/src/test/java/com/project/code/CodeApplicationTests.java b/RetailManagementSystem/back-end/src/test/java/com/project/code/CodeApplicationTests.java new file mode 100644 index 0000000..550e5ff --- /dev/null +++ b/RetailManagementSystem/back-end/src/test/java/com/project/code/CodeApplicationTests.java @@ -0,0 +1,13 @@ +package com.project.code; + +import org.junit.jupiter.api.Test; +import org.springframework.boot.test.context.SpringBootTest; + +@SpringBootTest +class CodeApplicationTests { + + @Test + void contextLoads() { + } + +} diff --git a/RetailManagementSystem/front-end/add-parent-product.html b/RetailManagementSystem/front-end/add-parent-product.html new file mode 100644 index 0000000..474e296 --- /dev/null +++ b/RetailManagementSystem/front-end/add-parent-product.html @@ -0,0 +1,87 @@ + + + + + + + IMS: Manage Inventory + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +
+ + + + + + + + + +
+
+ + + + + + + + + + + \ No newline at end of file diff --git a/RetailManagementSystem/front-end/add-product.html b/RetailManagementSystem/front-end/add-product.html new file mode 100644 index 0000000..9507744 --- /dev/null +++ b/RetailManagementSystem/front-end/add-product.html @@ -0,0 +1,97 @@ + + + + + + + IMS: Manage Inventory + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ +
+ + + + + + + + + + + + + +
+ + + + +
+ + + + + + + \ No newline at end of file diff --git a/RetailManagementSystem/front-end/build.gradle b/RetailManagementSystem/front-end/build.gradle new file mode 100644 index 0000000..9e49f9c --- /dev/null +++ b/RetailManagementSystem/front-end/build.gradle @@ -0,0 +1 @@ +apply plugin: 'base' \ No newline at end of file diff --git a/RetailManagementSystem/front-end/edit-parent-product.html b/RetailManagementSystem/front-end/edit-parent-product.html new file mode 100644 index 0000000..e3717cd --- /dev/null +++ b/RetailManagementSystem/front-end/edit-parent-product.html @@ -0,0 +1,113 @@ + + + + + + + IMS: Manage Inventory + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+ + +
+
+ + +
+ +
+ + +
+ +
+ + + +
+ +
+ + + +
+ +
+ +
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/RetailManagementSystem/front-end/edit-product.html b/RetailManagementSystem/front-end/edit-product.html new file mode 100644 index 0000000..e9c57e4 --- /dev/null +++ b/RetailManagementSystem/front-end/edit-product.html @@ -0,0 +1,122 @@ + + + + + + + IMS: Manage Inventory + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ + + +
+ +
+ + +
+
+ + +
+ +
+ + +
+ +
+ + + +
+ +
+ + + +
+ +
+ + + +
+ +
+ +
+
+
+ + + + + + + + + + + \ No newline at end of file diff --git a/RetailManagementSystem/front-end/frontend.css b/RetailManagementSystem/front-end/frontend.css new file mode 100644 index 0000000..5eb3c25 --- /dev/null +++ b/RetailManagementSystem/front-end/frontend.css @@ -0,0 +1,471 @@ +* { + margin: 0%; + pad: 0%; + box-sizing: border-box; +} + +html, +body { + width: 100%; + height: 100%; +} + +.navbar { + background-color: #343a40 !important; + padding: 10px; +} + +.navbar h1 { + color: white; + margin-left: 10px; +} + + +#form input, +#form select { + display: block; + margin: 10px 30px 0 10px; + padding: 7px; + border-radius: 10px; + width: 220px; +} + +input[type="submit"], +input[type="button"] { + background-color: black; + color: white; +} + + + + +#all-product-list .col { + display: flex; + align-items: center; + justify-content: center; +} + + +.navbar { + height: 100px; +} + +.rounded-pill { + width: 80px; + height: 80px; +} + + +#navitem { + display: flex; + justify-content: space-between; + align-items: center; + width: 100%; +} + +#head { + flex-grow: 1; + display: flex; + justify-content: center; + margin-right: 50px; +} + +#navbelow { + margin-top: 10px; + display: flex; + justify-content: center; +} + +#form { + margin-top: 20px; + display: block; + justify-content: center; + align-items: center; + +} + +.nav-pills .nav-link.active { + color: white !important; +} + +input:focus, +select:focus, +textarea:focus { + outline: none; +} + +#success, +#failed { + margin-top: 10px; + justify-self: center; +} + +#alert { + position: relative; + height: 40px; + +} + +.alert { + margin-bottom: 0px !important; +} + + +td input, +td label { + margin-right: 5px; +} + + +#submit { + display: flex; + justify-content: center; + margin-top: 40px; + +} + +#submit button { + color: white; + background-color: black; + border-radius: 10px; +} + +#suggestion, +#StoreSuggestion, +#usuggestion, +#uStoreSuggestion { + margin-top: -15px; + display: grid; +} + +#suggestion button, +#StoreSuggestion button, +#usuggestion button, +#uStoreSuggestion button { + justify-content: center; + align-items: center; + border: 2px solid black; + background-color: white; + margin-left: 10px; + width: 250px; + +} + + + +.addStoreForm { + align-items: center; + justify-content: center; + display: grid; +} + +#CustomerForm, +#OrderForm, +.OrderQuantity { + display: ruby; + width: 100%; + justify-content: center; +} + +#submitButton { + align-items: center; + justify-content: center; +} + + + +#productTable { + width: 100%; + border-collapse: collapse; + /* Ensures no space between cells */ + margin: 20px 0; + font-family: Arial, sans-serif; + box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); + /* Table shadow */ +} + +#productTable th, +#productTable td { + padding: 12px 15px; + /* Padding inside cells */ + text-align: left; + /* Align text to the left */ +} + +#productTable th { + background-color: #f2f2f2; + /* Light gray background for headers */ + font-weight: bold; +} + +#productTable td { + background-color: #fff; + /* White background for table data */ + border: 1px solid #ddd; + /* Border around table cells */ +} + +#productTable .input-cell { + width: 107%; + /* Make input fill the cell */ + border: none; + /* Remove default input border */ + padding: 8px; + /* Padding inside the input */ + font-size: 14px; + /* Font size for input */ + background-color: #f9f9f9; + /* Light background for inputs */ + border-radius: 10px; +} + +#productTable .input-cell:disabled { + background-color: #e0e0e0; + /* Gray background for disabled inputs */ + color: #a0a0a0; + /* Light gray text for disabled inputs */ + cursor: not-allowed; + /* Change cursor to indicate the input is disabled */ +} + + +#productTable .remove-btn { + padding: 6px 12px; + background-color: #ff4d4d; + /* Red button */ + color: white; + border: none; + border-radius: 5px; + cursor: pointer; +} + +#productTable .remove-btn:hover { + background-color: #e60000; + /* Darker red on hover */ +} + +#productTable td:last-child { + text-align: center; + /* Center-align the "Remove" button */ +} + + +[id^="OrderSuggestion"] { + box-shadow: 5px 5px 10px rgba(0, 0, 0, 0.3); + z-index: 1000; +} + +.suggestionCard { + background-color: white; + height: auto; + display: flex; + align-items: center; + width: 107%; + justify-content: center; +} + +.suggestionCard h6 { + height: 30px; + border-radius: 10px; + width: 107%; + display: flex; + align-items: center; + justify-content: center; + + +} + +.suggestionCard h6:hover { + background-color: #e9e8e8; +} + +#AddBtn { + display: flex; + justify-content: right; + border-radius: 10px; +} + +#AddBtn button { + border-radius: 2px; + color: black; + border-radius: 10px; + background-color: rgb(125, 231, 125); +} + +#submitButton input { + border-radius: 10px; + width: 250px; + font: inherit; + height: 42px; + + margin-bottom: 100px; + +} + + + +#myform { + margin: 50px; +} + +#myform input, +#totalOrderValuediv input { + text-align: center; +} + +#totalOrderValuediv { + justify-content: right; + align-items: center; + display: flex; + margin-top: 50px; + margin-bottom: 50px; +} + +#CustomerDetails input, +#myform input, +#totalOrderValuediv input { + border-radius: 5px; + font-size: inherit; + height: 42px; + margin: 10px; + width: 250px; +} + +#CustomerForm label { + margin: 10px; +} + +#CustomerForm { + display: block; +} + +#CustomerDetails .row { + margin: 20px; +} + +#CustomerDetails .col { + display: grid; + align-items: center; + justify-content: center; +} + + + +table { + table-layout: fixed; + width: 100%; +} + +td, +th { + overflow: hidden; + background-color: black; + text-overflow: ellipsis; + max-width: 200px; +} + +/* Default state: Truncate text and show ellipsis */ +.expandable { + max-width: 300px; + /* Adjust this width as needed */ + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + cursor: pointer; + /* Indicate that it's clickable */ +} + + + +.styled-table { + border-collapse: collapse; + margin: 25px 0; + font-size: 0.9em; + font-family: sans-serif; + min-width: 400px; + +} + + + +.tablediv { + overflow-x: auto; +} + + +#aStoreSuggestion { + display: grid; + margin-top: -12px; + justify-content: center; + border-bottom: 2px solid black; + width: 250px; + margin-left: 10px +} + +#aStoreSuggestion button { + width: 250px; + background-color: white; + border-bottom: none; +} + +#product-details { + display: flex; + margin: 100px; + justify-content: center; +} + +#product-details input { + margin-right: 100px; + padding: 7px; + border-radius: 10px; + width: 220px; +} + +#product-details label { + display: flex; + margin-right: 30px; + align-items: center; +} + + +#reviews { + margin-top: 50px; +} + +.customer-name +{ + font-weight: bold; + display: flex; + justify-content: center; +} +.customer-review +{ + display: flex; + justify-content: center; + margin-top: 10px; +} + +.review-card { + padding: 20px; + background-color: white; + box-shadow: rgba(0, 0, 0, 0.24) 0px 3px 8px; + width: 100%; + height: auto; + margin-bottom: 24px; +} + +.rating +{ + display: flex; + justify-content: center; +} + +.review{ + margin-top: 20px; +} + +.golden +{ + color: #ffc100 +} + diff --git a/RetailManagementSystem/front-end/images/Logo.png b/RetailManagementSystem/front-end/images/Logo.png new file mode 100644 index 0000000..a4a33ee Binary files /dev/null and b/RetailManagementSystem/front-end/images/Logo.png differ diff --git a/RetailManagementSystem/front-end/index.html b/RetailManagementSystem/front-end/index.html new file mode 100644 index 0000000..86463c6 --- /dev/null +++ b/RetailManagementSystem/front-end/index.html @@ -0,0 +1,413 @@ + + + + + + + IMS: Manage Inventory + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+
+
+ + + +
+
+ +
+
+ +
+ +
+ + +
+
+ + +
+ +
+ + +
+ + + + +
+ +
+ + + + + + + + + + + + + + + + + + +
ProductIdProduct NameCategoryPriceSKUStock LevelReviewsEditDelete
+
+
+ + +
+ + +
+ +
+
+ + +
+
+ + +
+
+ + +
+
+ + + +
+ +
+ + + + + + + + + + + + + + + + +
ProductIdProduct NameCategoryPriceSKUEditDelete
+
+ +

+
+
+ + +
+
+
+
+ + + + + + + + + + +
+
+
+
+ +
+ +
+
+ + + + + +
+
+
+
+ +
+ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/RetailManagementSystem/front-end/reviews.html b/RetailManagementSystem/front-end/reviews.html new file mode 100644 index 0000000..2eff2e8 --- /dev/null +++ b/RetailManagementSystem/front-end/reviews.html @@ -0,0 +1,181 @@ + + + + + + + Reviews + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+
+ +
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+ + + + + + + + diff --git a/RetailManagementSystem/front-end/script.js b/RetailManagementSystem/front-end/script.js new file mode 100644 index 0000000..6ad5c7c --- /dev/null +++ b/RetailManagementSystem/front-end/script.js @@ -0,0 +1,948 @@ +const apiURL = ''; +let students = []; +let Ordercount = 1; +let deleteRow = []; + +function resetForm() { + const inputs = document.querySelectorAll("#myform input:not([type='submit']), #myform select"); + inputs.forEach(input => { + input.value = ""; + }) +} + +document.addEventListener('DOMContentLoaded', function () { + const navLinks = document.querySelectorAll('.nav-item .nav-link'); + + const activeLink = document.querySelector('.nav-item .nav-link.active'); + + if (activeLink) { + + let html = `

${activeLink.textContent}

` + head.innerHTML = html; + + } + + navLinks.forEach(link => { + link.addEventListener('click', function (event) { + let html = `

${event.target.textContent}

` + head.innerHTML = html; + }); + }); +}); + + +function createMoreOrderField() { + Ordercount++; + OrderList = document.getElementById('OrderListBody'); + + tr = document.createElement('tr'); + tr.setAttribute('id', `${Ordercount}`) + + + + tr.innerHTML = + ` + + + +
+ +
+ + + + + + + + ` + + + OrderList.appendChild(tr); + setSerialNo(); + +} + +function deleteDiv(count) { + + let divToDelete = document.getElementById(`${count}`); + + // Check if the div exists + if (divToDelete && Ordercount != 1) { + divToDelete.remove(); + deleteRow.push(count); + } + else { + alert(`Atleast One row is required`); + } + + + setSerialNo() + calculateTotal() + +} + +function calculateTotal() { + let total = 0; + for (let i = 1; i <= Ordercount; i++) { + totalField = document.getElementById(`orderTotal${i}`); + if (totalField) { + if (totalField.value) + total = total + parseInt(totalField.value) + } + + } + + document.getElementById('totalOrderValue').value = total; +} + + +function setSerialNo() { + const serialNos = document.querySelectorAll('.SerialNo'); + let count = 1; + serialNos.forEach(serialNo => { + serialNo.value = count++; + + }); + +} + + +function fillProductId(count) { + let storeId = document.getElementById('orderStoreId').value; + suggestion = document.getElementById(`OrderSuggestion${count}`); + productId = document.getElementById(`orderProductName${count}`).value + if (productId.trim() !== '') { + let url = `${apiURL}/inventory/search/${productId}/${storeId}`; + fetch(url, { + method: "GET", + headers: { "content-type": "application/json" }, + }) + .then(response => { + return response.json(); + }) + .then(data => { + + showOrderSuggestion(data.product, count); + }) + .catch(error => { + alert(error); + }) + } + else { + suggestion.innerHTML = ""; + } + + +} + + + + + +function showOrderSuggestion(products, count) { + + + suggestion = document.getElementById(`OrderSuggestion${count}`); + productName = document.getElementById(`orderProductName${count}`); + productId = document.getElementById(`orderProductId${count}`); + productPrice = document.getElementById(`orderProductPrice${count}`); + quantity = document.getElementById(`orderProductQuantity${count}`); + suggestion.innerHTML = ""; + for (product of products) { + div = document.createElement('div'); + div.classList.add('suggestionCard'); + h6 = document.createElement('h6'); + h6.textContent = product.name + div.appendChild(h6); + div.addEventListener('click', (function (product) { + return function () { + quantity.value = '1'; + productName.value = product.name; + productId.value = product.id; + productPrice.value = product.price; + suggestion.innerHTML = ""; + calculatePrice(count); + + }; + })(product)); + suggestion.appendChild(div); + } +} + + + +function calculatePrice(count) { + + price = document.getElementById(`orderProductPrice${count}`).value; + quantity = document.getElementById(`orderProductQuantity${count}`).value; + total = document.getElementById(`orderTotal${count}`); + total.value = (price * quantity); + calculateTotal(); +} + +function validateStoreId(event) { + event.preventDefault(); + + let now = new Date(); + let year = now.getFullYear(); + let month = String(now.getMonth() + 1).padStart(2, '0'); + let day = String(now.getDate()).padStart(2, '0'); + let hours = String(now.getHours()).padStart(2, '0'); + let minutes = String(now.getMinutes()).padStart(2, '0'); + let formattedDateTime = `${year}-${month}-${day}T${hours}:${minutes}`; + let dateTimeInput = document.getElementById("datetime"); + dateTimeInput.value = formattedDateTime; + + + let submitButton = document.getElementById('submitButton'); + let storeId = document.getElementById('orderStoreId'); + let url = `${apiURL}/store/validate/${storeId.value}` + fetch(url, { + method: "GET", + headers: { "content-type": "application/json" }, + }) + .then(response => { + return response.json(); + }) + .then(data => { + if (data === true) { + storeId.disabled = true; + document.getElementById('displayForm').style = 'display:block'; + submitButton.style = 'display:flex'; + + } + else { + alert("Enter correct Store id") + } + }) +} + + +function addStore(event) { + event.preventDefault(); + let storeName = document.getElementById('storeName').value; + let storeAddress1 = document.getElementById('storeAddress1').value; + let storeAddress2 = document.getElementById('storeAddress2').value; + let storeAddress3 = document.getElementById('storeAddress3').value; + let storeAddress = storeAddress1 + " " + storeAddress2 + " " + storeAddress3; + + let data = { name: storeName, address: storeAddress }; + + let url = `${apiURL}/store` + fetch(url, { + method: "POST", + headers: { "content-type": "application/json" }, + body: JSON.stringify(data) + }) + .then(response => { + return response.json(); + }) + .then(data => { + alert(data.message); + resetForm(); + }) +} + + +function viewProduct(event) { + if (event) { + event.preventDefault(); + } + + let inputstoreId = document.getElementById('vstoreId'); + document.getElementById('searchBar').disabled = false + document.getElementById('SearchButton').disabled = false; + document.getElementById('vstoreId').disabled = false + document.getElementById('category').disabled = false; + storeId = inputstoreId.value; + inputstoreId.disabled = true; + + let url = `${apiURL}/inventory/${storeId}`; + fetch(url, { + method: "GET", + headers: { "content-type": "application/json" }, + }) + .then(response => { + return response.json(); + }) + .then(data => { + createData(data.products, storeId); + }) +} + + + +function filter() { + + productName = document.getElementById('searchBar').value + + category = document.getElementById('category').value; + + + if (category.trim() == 'Allcategory' && productName.trim().length == 0) { + viewProduct(event); + return; + } + + else if (productName.trim().length == 0) { + productName = null; + } + else if (category.trim() == 'Allcategory') { + category = null; + } + + let storeId = document.getElementById('vstoreId').value; + + + let url = `${apiURL}/inventory/filter/${category}/${productName}/${storeId}`; + fetch(url, { + method: "GET", + headers: { "content-type": "application/json" }, + }) + .then(response => { + return response.json(); + }) + .then(data => { + createData(data.product, storeId); + }) + .catch(error => { + alert(error); + }) +} + + + + + +async function createData(products, storeId) { + const tableBody = document.getElementById('tableBody'); + tableBody.innerHTML = ''; + products.forEach(product => { + + const row = document.createElement('tr'); + + const prodId = document.createElement('td'); + prodId.classList.add('expandable'); + prodId.textContent = product.id; + + const name = document.createElement('td'); + name.classList.add('expandable'); + name.textContent = product.name; + + const category = document.createElement('td'); + category.classList.add('expandable'); + category.textContent = product.category; + + const price = document.createElement('td'); + price.classList.add('expandable'); + price.textContent = product.price; + + const sku = document.createElement('td'); + sku.classList.add('expandable'); + sku.textContent = product.sku; + + const stockLevel = document.createElement('td'); + stockLevel.classList.add('expandable'); + stockLevel.textContent = product.inventory[0].stockLevel; + + const reviewCol = document.createElement('td'); + const reviewBtn = document.createElement('button'); + reviewBtn.classList.add('btn', 'btn-info'); + reviewBtn.textContent = 'Reviews'; + reviewBtn.addEventListener('click', () => { + window.location = `reviews.html?productId=${product.id}&storeId=${storeId}&productName=${product.name}`; + }) + reviewCol.appendChild(reviewBtn); + + + + const buttoncolumn = document.createElement('td'); + const button = document.createElement('button') + button.classList.add('btn', 'btn-warning'); + button.textContent = 'Edit'; + button.addEventListener('click', () => { + window.location = `edit-product.html?productId=${product.id}&storeId=${storeId}&stockLevel=${product.inventory[0].stockLevel}`; + + }); + buttoncolumn.appendChild(button); + + + const buttonTable2 = document.createElement('td'); + const delbutton = document.createElement('button') + delbutton.classList.add('btn', 'btn-danger'); + delbutton.textContent = 'Delete'; + delbutton.value = product.id; + delbutton.addEventListener('click', function () { + showModal(this.value, product.name, 2); + }); + buttonTable2.appendChild(delbutton); + + + row.appendChild(prodId); + row.appendChild(name); + row.appendChild(category); + row.appendChild(price); + row.appendChild(sku); + row.appendChild(stockLevel); + row.appendChild(reviewCol); + row.appendChild(buttoncolumn); + row.appendChild(buttonTable2); + + tableBody.appendChild(row); + }); +} + + + + + +function viewProductByid(productId) { + + let url = `${apiURL}/product/product/${productId}`; + fetch(url, { + method: "GET", + headers: { "content-type": "application/json" }, + }) + .then(response => { + return response.json(); + }) + .then(data => { + console.log(data); + if (data.products) { + fillDetails(data.products, productId); + } + else { + alert("No data with product id: " + productId); + resetForm(); + return; + } + }) + .catch(error => { + alert(error); + }) +} + + +function fillDetails(products, productId) { + let productIdDiv = document.getElementById('uproductId'); + let productName = document.getElementById('uproductName'); + let category = document.getElementById('ucategory'); + let productPrice = document.getElementById('uproductPrice'); + let SKU = document.getElementById('uSKU'); + + productIdDiv.value = productId; + productName.value = products.name; + category.value = products.category; + productPrice.value = products.price; + SKU.value = products.sku; + +} + + + +function updateProduct(event) { + event.preventDefault(); + let productId = document.getElementById('uproductId').value; + let productName = document.getElementById('uproductName').value; + let category = document.getElementById('ucategory').value; + let productPrice = document.getElementById('uproductPrice').value; + let SKU = document.getElementById('uSKU').value; + let stockLevel = document.getElementById('ustockLevel').value; + let storeId = document.getElementById('ustoreId').value; + + let ProductModel = { id: productId, name: productName, category: category, price: productPrice, sku: SKU }; + let InventoryModel = { product: { id: productId }, store: { id: storeId }, stockLevel: stockLevel }; + let data = { product: ProductModel, inventory: InventoryModel }; + + console.log(data); + let url = `${apiURL}/inventory`; + fetch(url, { + method: "PUT", + headers: { "content-type": "application/json" }, + body: JSON.stringify(data) + }) + .then(response => { + return response.json(); + }) + .then(data => { + alert(data.message); + location.href = `index.html?id=navBar3&storeid=${storeId}`; + }) +} + + + +function fillProductName() { + let productName = document.getElementById('productName').value; + if (productName.trim() != "") { + let url = `${apiURL}/product/searchProduct/${productName}`; + fetch(url, { + method: "GET", + headers: { "content-type": "application/json" }, + }) + .then(response => { + return response.json(); + }) + .then(data => { + showproductSuggestion(data.products); + }) + .catch(error => { + alert(error); + }) + } + else { + suggestion = document.getElementById('aStoreSuggestion'); + suggestion.innerHTML = ""; + + } +} + + +function showproductSuggestion(products) { + + suggestion = document.getElementById('aStoreSuggestion'); + productName = document.getElementById('productName') + productId = document.getElementById('productId') + category = document.getElementById('category'); + productPrice = document.getElementById('productPrice'); + SKU = document.getElementById('SKU'); + + suggestion.innerHTML = ""; + for (product of products) { + button = document.createElement('button'); + button.type = 'button' + button.value = product.id; + button.innerHTML = product.name; + button.addEventListener('click', (function (product) { + return function () { + productName.value = product.name; + suggestion.innerHTML = ""; + productId.value = product.id; + category.value = product.category; + productPrice.value = product.price; + SKU.value = product.sku; + }; + })(product)); + + + + suggestion.appendChild(button); + } +} + + + +function addProductToInventory(event) { + event.preventDefault(); + + productId = document.getElementById('productId').value; + storeId = document.getElementById('astoreId').value; + stockLevel = document.getElementById('astockLevel').value; + + let data = { product: { id: productId }, store: { id: storeId }, stockLevel: stockLevel }; + let url = `${apiURL}/inventory` + fetch(url, { + method: "POST", + headers: { "content-type": "application/json" }, + body: JSON.stringify(data) + }) + .then(response => { + return response.json(); + }) + .then(data => { + alert(data.message); + location.href = `index.html?id=navBar3&storeid=${storeId}`; + }) +} + + + +function viewProductList() { + let url = `${apiURL}/product`; + fetch(url, { + method: "GET", + headers: { "content-type": "application/json" }, + }) + .then(response => { + return response.json(); + }) + .then(data => { + if (data.products) { + showProductsInTable(data.products); + } + else { + alert("No data with product id: " + productId); + resetForm(); + return; + } + }) + .catch(error => { + alert(error); + }) +} + +function showProductsInTable(products) { + allProducts = document.getElementById('allProducts') + allProducts.innerHTML = ""; + products.forEach(product => { + + const row = document.createElement('tr'); + + const prodId = document.createElement('td'); + prodId.classList.add('expandable'); + prodId.textContent = product.id; + + const name = document.createElement('td'); + name.classList.add('expandable'); + name.textContent = product.name; + + const category = document.createElement('td'); + category.classList.add('expandable'); + category.textContent = product.category; + + const price = document.createElement('td'); + price.classList.add('expandable'); + price.textContent = product.price; + + const sku = document.createElement('td'); + sku.classList.add('expandable'); + sku.textContent = product.sku; + + + const buttonTable = document.createElement('td'); + const button = document.createElement('button') + button.classList.add('btn', 'btn-warning'); + button.value = product.id; + button.textContent = 'Edit'; + button.addEventListener('click', function () { + window.location = `edit-parent-product.html?productId=${this.value}` + + }); + buttonTable.appendChild(button); + + const buttonTable2 = document.createElement('td'); + const delbutton = document.createElement('button') + delbutton.classList.add('btn', 'btn-danger'); + delbutton.textContent = 'Delete'; + delbutton.value = product.id; + delbutton.addEventListener('click', function () { + showModal(this.value, product.name, 1); + }); + buttonTable2.appendChild(delbutton); + + row.appendChild(prodId); + row.appendChild(name); + row.appendChild(category); + row.appendChild(price); + row.appendChild(sku); + row.appendChild(buttonTable); + row.appendChild(buttonTable2); + + allProducts.appendChild(row); + }); +} + + + +function showModal(id, name, action) { + console.log(action); + const myModal = new bootstrap.Modal(document.getElementById('myModal')); + const modalFooter = document.getElementById('modal-footer'); + text = document.getElementById('deleteProuctName'); + text.innerHTML = name; + modalFooter.innerHTML = ""; + button = document.createElement('button'); + button.classList.add('btn', 'btn-danger') + button.textContent = 'Yes'; + if (action == 1) { + button.addEventListener('click', function () { + deleteItembyId(id); + myModal.hide(); + }) + } + else { + button.addEventListener('click', function () { + removeFromInventory(id) + myModal.hide(); + }) + } + modalFooter.appendChild(button); + myModal.show(); +} + + +function deleteItembyId(id) { + + + + let url = `${apiURL}/product/${id}`; + fetch(url, { + method: "DELETE", + headers: { "content-type": "application/json" }, + }) + .then(response => { + return response.json(); + }) + .then(data => { + alert(data.message); + location.href = "index.html?id=navBar2"; + }) + .catch(error => { + alert(error); + }) + + +} + +function removeFromInventory(id) { + let url = `${apiURL}/inventory/${id}` + fetch(url, { + method: "DELETE", + headers: { "content-type": "application/json" }, + }) + .then(response => { + return response.json(); + }) + .then(data => { + alert(data.message); + viewProduct(event); + location.href = `index.html?id=navBar3&storeid=${storeId}`; + + }) + .catch(error => { + alert(error); + }) +} + + + +async function filterParentProduct() { + category = document.getElementById('pcategory').value; + productName = document.getElementById('ProductsearchBar').value; + + if (category.trim() == 'Allcategory' && productName.trim().length == 0) { + viewProductList(); + return; + } + else if(category.trim() == 'Allcategory') + { + category=null; + } + else if(productName.trim().length == 0) + { + productName=null; + } + + let url = `${apiURL}/product/category/${productName}/${category}`; + fetch(url, { + method: "GET", + headers: { "content-type": "application/json" }, + }) + .then(response => { + return response.json(); + }) + .then(data => { + + showProductsInTable(data.products); + }) + .catch(error => { + alert(error); + }) +} + + + +function getProductByid(productId) { + + let url = `${apiURL}/product/product/${productId}`; + fetch(url, { + method: "GET", + headers: { "content-type": "application/json" }, + }) + .then(response => { + return response.json(); + }) + .then(data => { + if (data.products) { + setParentProduct(data.products); + } + else { + alert("No data with product id: " + productId); + resetForm(); + return; + } + }) + .catch(error => { + alert(error); + }) +} + +function setParentProduct(product) { + document.getElementById('pproductName').value = product.name; + document.getElementById('pcategory').value = product.category; + document.getElementById('pproductPrice').value = product.price; + document.getElementById('pSKU').value = product.sku; +} + + + +function updateParentProduct(event) { + event.preventDefault(); + + productId = document.getElementById('pproductId').value; + productName = document.getElementById('pproductName').value; + category = document.getElementById('pcategory').value; + price = document.getElementById('pproductPrice').value; + sku = document.getElementById('pSKU').value; + let url = `${apiURL}/product` + data = { id: productId, name: productName, category: category, price: price, sku: sku }; + fetch(url, { + method: "PUT", + headers: { "content-type": "application/json" }, + body: JSON.stringify(data) + }) + .then(response => { + return response.json(); + }) + .then(data => { + alert(data.message); + location.href = "index.html?id=navBar2"; + }) +} + + + +function addParentProduct(event) { + event.preventDefault(); + let productName = document.getElementById('parentproductName').value; + let category = document.getElementById('parentcategory').value; + let productPrice = document.getElementById('parentproductPrice').value; + let SKU = document.getElementById('parentSKU').value; + + let data = { name: productName, category: category, price: productPrice, sku: SKU }; + + let url = `${apiURL}/product` + fetch(url, { + method: "POST", + headers: { "content-type": "application/json" }, + body: JSON.stringify(data) + }) + .then(response => { + return response.json(); + }) + .then(data => { + alert(data.message); + location.href = "index.html?id=navBar2"; + }) +} + + + + +function validateQuantity(OrderNo) { + quantity = document.getElementById(`orderProductQuantity${OrderNo}`).value; + storeId = document.getElementById('orderStoreId').value; + productId = document.getElementById(`orderProductId${OrderNo}`).value; + if (!quantity || !productId || !storeId) { + return; + } + let url = `${apiURL}/inventory/validate/${quantity}/${storeId}/${productId}` + fetch(url, { + method: "GET", + headers: { "content-type": "application/json" } + }) + .then(response => { + return response.json(); + }) + .then(data => { + if (!data) { + alert("Limited Quantity Available, Reduce quantity") + } + }) + .catch(error => { + alert(error); + }) +} + +async function placeOrder(event) { + event.preventDefault(); + + + let storeId = document.getElementById("orderStoreId").value; + let customerName = document.getElementById("customerName").value; + let customerEmail = document.getElementById("customerEmail").value; + let customerPhone = document.getElementById("customerPhone").value; + let datetime = document.getElementById("datetime").value; + let totalOrderValue = document.getElementById('totalOrderValue').value; + if (!totalOrderValue) { + alert("Enter atleast one product"); + return + } + + let purchaseProduct = []; + for (let i = 1; i <= Ordercount; i++) { + + if (deleteRow.includes(i)) { + continue; + } + console.log(`orderProductName${i}`); + + let orderProductName = document.getElementById(`orderProductName${i}`).value; + let orderProductId = document.getElementById(`orderProductId${i}`).value; + let orderProductPrice = document.getElementById(`orderProductPrice${i}`).value; + let orderProductQuantity = document.getElementById(`orderProductQuantity${i}`).value; + let orderProductTotal = document.getElementById(`orderTotal${i}`).value; + + let data = { + name: orderProductName, + id: orderProductId, + price: orderProductPrice, + quantity: orderProductQuantity, + total: orderProductTotal + }; + purchaseProduct.push(data); + } + + + let orderData = { + storeId: storeId, + customerName: customerName, + customerEmail: customerEmail, + customerPhone: customerPhone, + datetime: datetime, + purchaseProduct: purchaseProduct, + totalPrice: totalOrderValue + }; + + + try { + const response = await fetch(`${apiURL}/store/placeOrder`, { + method: 'POST', + headers: { + 'Content-Type': 'application/json' + }, + body: JSON.stringify(orderData) + }).then(response => { + return response.json(); + }).then(data => { + if (data.message) { + alert(data.message); + location.href = "index.html?id=navBar4"; + } + else { + alert(data.error); + } + }) + + } catch (error) { + alert('Error placing order:', error); + } +} diff --git a/RetailManagementSystem/insert_data.sql b/RetailManagementSystem/insert_data.sql new file mode 100644 index 0000000..09dbd4d --- /dev/null +++ b/RetailManagementSystem/insert_data.sql @@ -0,0 +1,989 @@ +use inventory; + +INSERT INTO product (name, category, price, sku) +VALUES +('Galaxy S21', 'Mobile', 799.99, 'SKU001'), +('iPhone 13', 'Mobile', 999.99, 'SKU002'), +('Samsung QLED TV', 'TV and AV', 1499.99, 'SKU003'), +('LG OLED TV', 'TV and AV', 1999.99, 'SKU004'), +('Dyson Vacuum Cleaner', 'Home Appliances', 499.99, 'SKU005'), +('Philips Air Purifier', 'Home Appliances', 199.99, 'SKU006'), +('Dell XPS 13', 'Laptops and Monitors', 1299.99, 'SKU007'), +('MacBook Pro 16"', 'Laptops and Monitors', 2399.99, 'SKU008'), +('Apple Watch Series 7', 'Accessories', 399.99, 'SKU009'), +('Sony WH-1000XM4', 'Accessories', 349.99, 'SKU010'), +('OnePlus 9 Pro', 'Mobile', 1069.99, 'SKU011'), +('Google Pixel 6', 'Mobile', 699.99, 'SKU012'), +('Sony Bravia 4K TV', 'TV and AV', 1200.00, 'SKU013'), +('Bose SoundLink Revolve', 'TV and AV', 229.99, 'SKU014'), +('Samsung Washing Machine', 'Home Appliances', 799.99, 'SKU015'), +('Nespresso Coffee Maker', 'Home Appliances', 149.99, 'SKU016'), +('HP Envy Laptop', 'Laptops and Monitors', 999.99, 'SKU017'), +('Acer Predator Helios 300', 'Laptops and Monitors', 1499.99, 'SKU018'), +('Logitech MX Master 3', 'Accessories', 99.99, 'SKU019'), +('Bose QuietComfort 35 II', 'Accessories', 299.99, 'SKU020'), +('Samsung Galaxy Note 20', 'Mobile', 949.99, 'SKU021'), +('iPad Air', 'Mobile', 599.99, 'SKU022'), +('Sharp 8K TV', 'TV and AV', 3999.99, 'SKU023'), +('Sony 65" 4K TV', 'TV and AV', 1799.99, 'SKU024'), +('iRobot Roomba i7', 'Home Appliances', 649.99, 'SKU025'), +('Breville Espresso Machine', 'Home Appliances', 599.99, 'SKU026'), +('Razer Blade 15', 'Laptops and Monitors', 1999.99, 'SKU027'), +('MSI GE66 Raider', 'Laptops and Monitors', 2299.99, 'SKU028'), +('Beats Studio3 Wireless', 'Accessories', 349.99, 'SKU029'), +('Samsung Galaxy Buds Pro', 'Accessories', 199.99, 'SKU030'), +('Google Pixel 5', 'Mobile', 699.99, 'SKU031'), +('Huawei P40 Pro', 'Mobile', 899.99, 'SKU032'), +('LG NanoCell TV', 'TV and AV', 1299.99, 'SKU033'), +('Vizio 4K Smart TV', 'TV and AV', 899.99, 'SKU034'), +('Whirlpool Refrigerator', 'Home Appliances', 1199.99, 'SKU035'), +('Instant Pot Pressure Cooker', 'Home Appliances', 89.99, 'SKU036'), +('Microsoft Surface Laptop 4', 'Laptops and Monitors', 1399.99, 'SKU037'), +('Lenovo ThinkPad X1 Carbon', 'Laptops and Monitors', 1799.99, 'SKU038'), +('JBL Flip 5', 'Accessories', 119.99, 'SKU039'), +('Sony Xperia 1 II', 'Mobile', 1199.99, 'SKU040'), +('Apple AirPods Pro', 'Accessories', 249.99, 'SKU041'), +('Samsung Galaxy Z Fold 3', 'Mobile', 1799.99, 'SKU042'), +('LG UltraWide Monitor', 'Laptops and Monitors', 399.99, 'SKU043'), +('Dell UltraSharp U2720Q', 'Laptops and Monitors', 599.99, 'SKU044'), +('Anker PowerCore 20000', 'Accessories', 49.99, 'SKU045'), +('Canon EOS R5 Camera', 'Accessories', 3899.99, 'SKU046'), +('Apple MacBook Air', 'Laptops and Monitors', 999.99, 'SKU047'), +('HP Spectre x360', 'Laptops and Monitors', 1399.99, 'SKU048'), +('Samsung T7 Portable SSD', 'Accessories', 129.99, 'SKU049'), +('Sony A7 III Camera', 'Accessories', 1999.99, 'SKU050'); + + +INSERT INTO store (name, address) +VALUES +('Tech Store A', '123 Tech Street, Silicon Valley, CA'), +('Gadget Hub', '456 Gadget Road, San Francisco, CA'), +('ElectroMart', '789 Electro Avenue, Los Angeles, CA'), +('Mobile World', '101 Mobile Blvd, New York, NY'), +('Home Appliances HQ', '202 Appliance Parkway, Chicago, IL'), +('Laptop Zone', '303 Laptop Lane, Austin, TX'), +('The Accessory Spot', '404 Accessory Street, Seattle, WA'), +('TV & AV Store', '505 AV Drive, Miami, FL'), +('Smart Store', '606 Smart Road, Boston, MA'), +('Gadget Central', '707 Gadget Street, Dallas, TX'); + + +INSERT INTO inventory (product_id, store_id, stock_Level) +VALUES +(1, 1, 50), (2, 2, 30), (3, 3, 40), (4, 4, 20), (5, 5, 70), +(6, 6, 60), (7, 7, 50), (8, 8, 40), (9, 9, 80), (10, 10, 90), +(11, 1, 60), (12, 2, 50), (13, 3, 30), (14, 4, 40), (15, 5, 20), +(16, 6, 70), (17, 7, 80), (18, 8, 60), (19, 9, 50), (20, 10, 30), +(21, 1, 40), (22, 2, 60), (23, 3, 50), (24, 4, 30), (25, 5, 80), +(26, 6, 90), (27, 7, 40), (28, 8, 50), (29, 9, 30), (30, 10, 70), +(31, 1, 50), (32, 2, 80), (33, 3, 60), (34, 4, 90), (35, 5, 20), +(36, 6, 30), (37, 7, 40), (38, 8, 60), (39, 9, 80), (40, 10, 90), +(41, 1, 70), (42, 2, 50), (43, 3, 40), (44, 4, 80), (45, 5, 60), +(46, 6, 90), (47, 7, 30), (48, 8, 70), (49, 9, 50), (50, 10, 60); + +INSERT INTO customer (name, email, phone) VALUES +('John Doe', 'john.doe@example.com', '1234567890'), +('Jane Smith', 'jane.smith@example.com', '0987654321'), +('Tom Hanks', 'tom.hanks@example.com', '1122334455'), +('Alice Johnson', 'alice.johnson@example.com', '2233445566'), +('Bob Brown', 'bob.brown@example.com', '3344556677'), +('Mary Davis', 'mary.davis@example.com', '4455667788'), +('James Wilson', 'james.wilson@example.com', '5566778899'), +('Emily Clark', 'emily.clark@example.com', '6677889900'), +('David Lewis', 'david.lewis@example.com', '7788990011'), +('Sarah Walker', 'sarah.walker@example.com', '8899001122'), +('Daniel Young', 'daniel.young@example.com', '9900112233'), +('Jessica Hall', 'jessica.hall@example.com', '1011122334'), +('Matthew Allen', 'matthew.allen@example.com', '1122334455'), +('Olivia Scott', 'olivia.scott@example.com', '2233445566'), +('William Harris', 'william.harris@example.com', '3344556677'), +('Sophia King', 'sophia.king@example.com', '4455667788'), +('Jackson Wright', 'jackson.wright@example.com', '5566778899'), +('Lily Lopez', 'lily.lopez@example.com', '6677889900'), +('Ethan Perez', 'ethan.perez@example.com', '7788990011'), +('Mia Turner', 'mia.turner@example.com', '8899001122'), +('Aiden Nelson', 'aiden.nelson@example.com', '9900112233'), +('Charlotte Carter', 'charlotte.carter@example.com', '1011122334'), +('Liam Mitchell', 'liam.mitchell@example.com', '1122334455'), +('Amelia Roberts', 'amelia.roberts@example.com', '2233445566'), +('Harper Evans', 'harper.evans@example.com', '3344556677'), +('Jacob Morgan', 'jacob.morgan@example.com', '4455667788'), +('Ella Garcia', 'ella.garcia@example.com', '5566778899'), +('Michael Rodriguez', 'michael.rodriguez@example.com', '6677889900'), +('Madison Perez', 'madison.perez@example.com', '7788990011'), +('Benjamin Thompson', 'benjamin.thompson@example.com', '8899001122'), +('Evelyn King', 'evelyn.king@example.com', '9900112233'), +('Alexander Lee', 'alexander.lee@example.com', '1011122334'), +('Isabella Harris', 'isabella.harris@example.com', '1122334455'), +('Sebastian Walker', 'sebastian.walker@example.com', '2233445566'), +('Chloe Adams', 'chloe.adams@example.com', '3344556677'), +('Mason Baker', 'mason.baker@example.com', '4455667788'), +('Grace Gonzalez', 'grace.gonzalez@example.com', '5566778899'), +('Lucas Carter', 'lucas.carter@example.com', '6677889900'), +('Zoe Cooper', 'zoe.cooper@example.com', '7788990011'), +('Owen Mitchell', 'owen.mitchell@example.com', '8899001122'), +('Nora Jenkins', 'nora.jenkins@example.com', '9900112233'), +('Henry Price', 'henry.price@example.com', '1011122334'), +('Luna Long', 'luna.long@example.com', '1122334455'), +('Samuel Torres', 'samuel.torres@example.com', '2233445566'), +('Leo Clark', 'leo.clark@example.com', '3344556677'), +('Violet Green', 'violet.green@example.com', '4455667788'), +('Matthew Ramirez', 'matthew.ramirez@example.com', '5566778899'), +('Scarlett Evans', 'scarlett.evans@example.com', '6677889900'), +('Jack Wright', 'jack.wright@example.com', '7788990011'), +('Chloe Harris', 'chloe.harris@example.com', '8899001122'), +('Sophie Mitchell', 'sophie.mitchell@example.com', '9900112233'), +('Daniel Lopez', 'daniel.lopez@example.com', '1011122334'), +('Luke Walker', 'luke.walker@example.com', '1122334455'), +('Zara Foster', 'zara.foster@example.com', '2233445566'), +('Gabriel Edwards', 'gabriel.edwards@example.com', '3344556677'), +('Ella Parker', 'ella.parker@example.com', '4455667788'), +('Ryan King', 'ryan.king@example.com', '5566778899'), +('Caroline Miller', 'caroline.miller@example.com', '6677889900'), +('Oscar Murphy', 'oscar.murphy@example.com', '7788990011'), +('Harper Evans', 'harper.evans@example.com', '8899001122'), +('Elliot Simmons', 'elliot.simmons@example.com', '9900112233'), +('Amelia Campbell', 'amelia.campbell@example.com', '1011122334'), +('Isaac Ramirez', 'isaac.ramirez@example.com', '1122334455'), +('Ruby Lee', 'ruby.lee@example.com', '2233445566'), +('Sebastian Nelson', 'sebastian.nelson@example.com', '3344556677'), +('Hannah Peterson', 'hannah.peterson@example.com', '4455667788'), +('Jackie Adams', 'jackie.adams@example.com', '5566778899'), +('Nina Foster', 'nina.foster@example.com', '6677889900'), +('Landon Brooks', 'landon.brooks@example.com', '7788990011'), +('Ethan Scott', 'ethan.scott@example.com', '8899001122'), +('Autumn Hill', 'autumn.hill@example.com', '9900112233'), +('Caleb Collins', 'caleb.collins@example.com', '1011122334'), +('Victoria Morris', 'victoria.morris@example.com', '1122334455'), +('Grace Lopez', 'grace.lopez@example.com', '2233445566'), +('Jaden Turner', 'jaden.turner@example.com', '3344556677'), +('Addison Brooks', 'addison.brooks@example.com', '4455667788'), +('Sophia Lee', 'sophia.lee@example.com', '5566778899'), +('Samuel Thompson', 'samuel.thompson@example.com', '6677889900'), +('Ivy Bailey', 'ivy.bailey@example.com', '7788990011'), +('Owen Scott', 'owen.scott@example.com', '8899001122'), +('David Wright', 'david.wright@example.com', '9900112233'), +('Maya White', 'maya.white@example.com', '1011122334'), +('Maddox Price', 'maddox.price@example.com', '1122334455'), +('Madison James', 'madison.james@example.com', '2233445566'), +('Benjamin Lee', 'benjamin.lee@example.com', '3344556677'), +('Mila Green', 'mila.green@example.com', '4455667788'), +('Connor Gonzalez', 'connor.gonzalez@example.com', '5566778899'), +('Jaxon Mitchell', 'jaxon.mitchell@example.com', '6677889900'), +('Chloe Harris', 'chloe.harris@example.com', '7788990011'), +('Elijah Murphy', 'elijah.murphy@example.com', '8899001122'), +('Hazel Simmons', 'hazel.simmons@example.com', '9900112233'), +('Matthew Cooper', 'matthew.cooper@example.com', '1011122334'), +('Nina Torres', 'nina.torres@example.com', '1122334455'), +('Jacob Lopez', 'jacob.lopez@example.com', '2233445566'), +('Willow Wright', 'willow.wright@example.com', '3344556677'), +('Evan Green', 'evan.green@example.com', '4455667788'), +('Chase Morgan', 'chase.morgan@example.com', '5566778899'), +('Zoe Davis', 'zoe.davis@example.com', '6677889900'), +('Joshua Young', 'joshua.young@example.com', '7788990011'), +('Luke Davis', 'luke.davis@example.com', '8899001122'); + +INSERT INTO order_details (customer_id, store_id, total_price, date) +VALUES (1, 1, ROUND(RAND() * 300 + 100, 2), DATE_ADD('2024-03-31', INTERVAL FLOOR(RAND() * 365) DAY)); + +-- Order 2 +INSERT INTO order_details (customer_id, store_id, total_price, date) +VALUES (2, 2, ROUND(RAND() * 300 + 100, 2), DATE_ADD('2024-03-31', INTERVAL FLOOR(RAND() * 365) DAY)); + +-- Order 3 +INSERT INTO order_details (customer_id, store_id, total_price, date) +VALUES (3, 3, ROUND(RAND() * 300 + 100, 2), DATE_ADD('2024-03-31', INTERVAL FLOOR(RAND() * 365) DAY)); + +-- Order 4 +INSERT INTO order_details (customer_id, store_id, total_price, date) +VALUES (4, 4, ROUND(RAND() * 300 + 100, 2), DATE_ADD('2024-03-31', INTERVAL FLOOR(RAND() * 365) DAY)); + +-- Order 5 +INSERT INTO order_details (customer_id, store_id, total_price, date) +VALUES (5, 5, ROUND(RAND() * 300 + 100, 2), DATE_ADD('2024-03-31', INTERVAL FLOOR(RAND() * 365) DAY)); + +-- Order 6 +INSERT INTO order_details (customer_id, store_id, total_price, date) +VALUES (6, 6, ROUND(RAND() * 300 + 100, 2), DATE_ADD('2024-03-31', INTERVAL FLOOR(RAND() * 365) DAY)); + +-- Order 7 +INSERT INTO order_details (customer_id, store_id, total_price, date) +VALUES (7, 7, ROUND(RAND() * 300 + 100, 2), DATE_ADD('2024-03-31', INTERVAL FLOOR(RAND() * 365) DAY)); + +-- Order 8 +INSERT INTO order_details (customer_id, store_id, total_price, date) +VALUES (8, 8, ROUND(RAND() * 300 + 100, 2), DATE_ADD('2024-03-31', INTERVAL FLOOR(RAND() * 365) DAY)); + +-- Order 9 +INSERT INTO order_details (customer_id, store_id, total_price, date) +VALUES (9, 9, ROUND(RAND() * 300 + 100, 2), DATE_ADD('2024-03-31', INTERVAL FLOOR(RAND() * 365) DAY)); + +-- Order 10 +INSERT INTO order_details (customer_id, store_id, total_price, date) +VALUES (10, 10, ROUND(RAND() * 300 + 100, 2), DATE_ADD('2024-03-31', INTERVAL FLOOR(RAND() * 365) DAY)); + +-- Order 11 +INSERT INTO order_details (customer_id, store_id, total_price, date) +VALUES (11, 1, ROUND(RAND() * 300 + 100, 2), DATE_ADD('2024-03-31', INTERVAL FLOOR(RAND() * 365) DAY)); + +-- Order 12 +INSERT INTO order_details (customer_id, store_id, total_price, date) +VALUES (12, 2, ROUND(RAND() * 300 + 100, 2), DATE_ADD('2024-03-31', INTERVAL FLOOR(RAND() * 365) DAY)); + +-- Order 13 +INSERT INTO order_details (customer_id, store_id, total_price, date) +VALUES (13, 3, ROUND(RAND() * 300 + 100, 2), DATE_ADD('2024-03-31', INTERVAL FLOOR(RAND() * 365) DAY)); + +-- Order 14 +INSERT INTO order_details (customer_id, store_id, total_price, date) +VALUES (14, 4, ROUND(RAND() * 300 + 100, 2), DATE_ADD('2024-03-31', INTERVAL FLOOR(RAND() * 365) DAY)); + +-- Order 15 +INSERT INTO order_details (customer_id, store_id, total_price, date) +VALUES (15, 5, ROUND(RAND() * 300 + 100, 2), DATE_ADD('2024-03-31', INTERVAL FLOOR(RAND() * 365) DAY)); + +-- Order 16 +INSERT INTO order_details (customer_id, store_id, total_price, date) +VALUES (16, 6, ROUND(RAND() * 300 + 100, 2), DATE_ADD('2024-03-31', INTERVAL FLOOR(RAND() * 365) DAY)); + +-- Order 17 +INSERT INTO order_details (customer_id, store_id, total_price, date) +VALUES (17, 7, ROUND(RAND() * 300 + 100, 2), DATE_ADD('2024-03-31', INTERVAL FLOOR(RAND() * 365) DAY)); + +-- Order 18 +INSERT INTO order_details (customer_id, store_id, total_price, date) +VALUES (18, 8, ROUND(RAND() * 300 + 100, 2), DATE_ADD('2024-03-31', INTERVAL FLOOR(RAND() * 365) DAY)); + +-- Order 19 +INSERT INTO order_details (customer_id, store_id, total_price, date) +VALUES (19, 9, ROUND(RAND() * 300 + 100, 2), DATE_ADD('2024-03-31', INTERVAL FLOOR(RAND() * 365) DAY)); + +-- Order 20 +INSERT INTO order_details (customer_id, store_id, total_price, date) +VALUES (20, 10, ROUND(RAND() * 300 + 100, 2), DATE_ADD('2024-03-31', INTERVAL FLOOR(RAND() * 365) DAY)); + +-- Order 21 +INSERT INTO order_details (customer_id, store_id, total_price, date) +VALUES (21, 1, ROUND(RAND() * 300 + 100, 2), DATE_ADD('2024-03-31', INTERVAL FLOOR(RAND() * 365) DAY)); + +-- Order 22 +INSERT INTO order_details (customer_id, store_id, total_price, date) +VALUES (22, 2, ROUND(RAND() * 300 + 100, 2), DATE_ADD('2024-03-31', INTERVAL FLOOR(RAND() * 365) DAY)); + +-- Order 23 +INSERT INTO order_details (customer_id, store_id, total_price, date) +VALUES (23, 3, ROUND(RAND() * 300 + 100, 2), DATE_ADD('2024-03-31', INTERVAL FLOOR(RAND() * 365) DAY)); + +-- Order 24 +INSERT INTO order_details (customer_id, store_id, total_price, date) +VALUES (24, 4, ROUND(RAND() * 300 + 100, 2), DATE_ADD('2024-03-31', INTERVAL FLOOR(RAND() * 365) DAY)); + +-- Order 25 +INSERT INTO order_details (customer_id, store_id, total_price, date) +VALUES (25, 5, ROUND(RAND() * 300 + 100, 2), DATE_ADD('2024-03-31', INTERVAL FLOOR(RAND() * 365) DAY)); + +-- Order 26 +INSERT INTO order_details (customer_id, store_id, total_price, date) +VALUES (26, 6, ROUND(RAND() * 300 + 100, 2), DATE_ADD('2024-03-31', INTERVAL FLOOR(RAND() * 365) DAY)); + +-- Order 27 +INSERT INTO order_details (customer_id, store_id, total_price, date) +VALUES (27, 7, ROUND(RAND() * 300 + 100, 2), DATE_ADD('2024-03-31', INTERVAL FLOOR(RAND() * 365) DAY)); + +-- Order 28 +INSERT INTO order_details (customer_id, store_id, total_price, date) +VALUES (28, 8, ROUND(RAND() * 300 + 100, 2), DATE_ADD('2024-03-31', INTERVAL FLOOR(RAND() * 365) DAY)); + +-- Order 29 +INSERT INTO order_details (customer_id, store_id, total_price, date) +VALUES (29, 9, ROUND(RAND() * 300 + 100, 2), DATE_ADD('2024-03-31', INTERVAL FLOOR(RAND() * 365) DAY)); + +-- Order 30 +INSERT INTO order_details (customer_id, store_id, total_price, date) +VALUES (30, 10, ROUND(RAND() * 300 + 100, 2), DATE_ADD('2024-03-31', INTERVAL FLOOR(RAND() * 365) DAY)); + +-- Order 31 +INSERT INTO order_details (customer_id, store_id, total_price, date) +VALUES (31, 1, ROUND(RAND() * 300 + 100, 2), DATE_ADD('2024-03-31', INTERVAL FLOOR(RAND() * 365) DAY)); + +-- Order 32 +INSERT INTO order_details (customer_id, store_id, total_price, date) +VALUES (32, 2, ROUND(RAND() * 300 + 100, 2), DATE_ADD('2024-03-31', INTERVAL FLOOR(RAND() * 365) DAY)); + +-- Order 33 +INSERT INTO order_details (customer_id, store_id, total_price, date) +VALUES (33, 3, ROUND(RAND() * 300 + 100, 2), DATE_ADD('2024-03-31', INTERVAL FLOOR(RAND() * 365) DAY)); + +-- Order 34 +INSERT INTO order_details (customer_id, store_id, total_price, date) +VALUES (34, 4, ROUND(RAND() * 300 + 100, 2), DATE_ADD('2024-03-31', INTERVAL FLOOR(RAND() * 365) DAY)); + +-- Order 35 +INSERT INTO order_details (customer_id, store_id, total_price, date) +VALUES (35, 5, ROUND(RAND() * 300 + 100, 2), DATE_ADD('2024-03-31', INTERVAL FLOOR(RAND() * 365) DAY)); + +-- Order 36 +INSERT INTO order_details (customer_id, store_id, total_price, date) +VALUES (36, 6, ROUND(RAND() * 300 + 100, 2), DATE_ADD('2024-03-31', INTERVAL FLOOR(RAND() * 365) DAY)); + +-- Order 37 +INSERT INTO order_details (customer_id, store_id, total_price, date) +VALUES (37, 7, ROUND(RAND() * 300 + 100, 2), DATE_ADD('2024-03-31', INTERVAL FLOOR(RAND() * 365) DAY)); + +-- Order 38 +INSERT INTO order_details (customer_id, store_id, total_price, date) +VALUES (38, 8, ROUND(RAND() * 300 + 100, 2), DATE_ADD('2024-03-31', INTERVAL FLOOR(RAND() * 365) DAY)); + +-- Order 39 +INSERT INTO order_details (customer_id, store_id, total_price, date) +VALUES (39, 9, ROUND(RAND() * 300 + 100, 2), DATE_ADD('2024-03-31', INTERVAL FLOOR(RAND() * 365) DAY)); + +-- Order 40 +INSERT INTO order_details (customer_id, store_id, total_price, date) +VALUES (40, 10, ROUND(RAND() * 300 + 100, 2), DATE_ADD('2024-03-31', INTERVAL FLOOR(RAND() * 365) DAY)); + +-- Order 41 +INSERT INTO order_details (customer_id, store_id, total_price, date) +VALUES (41, 1, ROUND(RAND() * 300 + 100, 2), DATE_ADD('2024-03-31', INTERVAL FLOOR(RAND() * 365) DAY)); + +-- Order 42 +INSERT INTO order_details (customer_id, store_id, total_price, date) +VALUES (42, 2, ROUND(RAND() * 300 + 100, 2), DATE_ADD('2024-03-31', INTERVAL FLOOR(RAND() * 365) DAY)); + +-- Order 43 +INSERT INTO order_details (customer_id, store_id, total_price, date) +VALUES (43, 3, ROUND(RAND() * 300 + 100, 2), DATE_ADD('2024-03-31', INTERVAL FLOOR(RAND() * 365) DAY)); + +-- Order 44 +INSERT INTO order_details (customer_id, store_id, total_price, date) +VALUES (44, 4, ROUND(RAND() * 300 + 100, 2), DATE_ADD('2024-03-31', INTERVAL FLOOR(RAND() * 365) DAY)); + +-- Order 45 +INSERT INTO order_details (customer_id, store_id, total_price, date) +VALUES (45, 5, ROUND(RAND() * 300 + 100, 2), DATE_ADD('2024-03-31', INTERVAL FLOOR(RAND() * 365) DAY)); + +-- Order 46 +INSERT INTO order_details (customer_id, store_id, total_price, date) +VALUES (46, 6, ROUND(RAND() * 300 + 100, 2), DATE_ADD('2024-03-31', INTERVAL FLOOR(RAND() * 365) DAY)); + +-- Order 47 +INSERT INTO order_details (customer_id, store_id, total_price, date) +VALUES (47, 7, ROUND(RAND() * 300 + 100, 2), DATE_ADD('2024-03-31', INTERVAL FLOOR(RAND() * 365) DAY)); + +-- Order 48 +INSERT INTO order_details (customer_id, store_id, total_price, date) +VALUES (48, 8, ROUND(RAND() * 300 + 100, 2), DATE_ADD('2024-03-31', INTERVAL FLOOR(RAND() * 365) DAY)); + +-- Order 49 +INSERT INTO order_details (customer_id, store_id, total_price, date) +VALUES (49, 9, ROUND(RAND() * 300 + 100, 2), DATE_ADD('2024-03-31', INTERVAL FLOOR(RAND() * 365) DAY)); + +-- Order 50 +INSERT INTO order_details (customer_id, store_id, total_price, date) +VALUES (50, 10, ROUND(RAND() * 300 + 100, 2), DATE_ADD('2024-03-31', INTERVAL FLOOR(RAND() * 365) DAY)); + + +-- Order 51 +INSERT INTO order_details (customer_id, store_id, total_price, date) +VALUES (51, 1, ROUND(RAND() * 300 + 100, 2), DATE_ADD('2024-03-31', INTERVAL FLOOR(RAND() * 365) DAY)); + +-- Order 52 +INSERT INTO order_details (customer_id, store_id, total_price, date) +VALUES (52, 2, ROUND(RAND() * 300 + 100, 2), DATE_ADD('2024-03-31', INTERVAL FLOOR(RAND() * 365) DAY)); + +-- Order 53 +INSERT INTO order_details (customer_id, store_id, total_price, date) +VALUES (53, 3, ROUND(RAND() * 300 + 100, 2), DATE_ADD('2024-03-31', INTERVAL FLOOR(RAND() * 365) DAY)); + +-- Order 54 +INSERT INTO order_details (customer_id, store_id, total_price, date) +VALUES (54, 4, ROUND(RAND() * 300 + 100, 2), DATE_ADD('2024-03-31', INTERVAL FLOOR(RAND() * 365) DAY)); + +-- Order 55 +INSERT INTO order_details (customer_id, store_id, total_price, date) +VALUES (55, 5, ROUND(RAND() * 300 + 100, 2), DATE_ADD('2024-03-31', INTERVAL FLOOR(RAND() * 365) DAY)); + +-- Order 56 +INSERT INTO order_details (customer_id, store_id, total_price, date) +VALUES (56, 6, ROUND(RAND() * 300 + 100, 2), DATE_ADD('2024-03-31', INTERVAL FLOOR(RAND() * 365) DAY)); + +-- Order 57 +INSERT INTO order_details (customer_id, store_id, total_price, date) +VALUES (57, 7, ROUND(RAND() * 300 + 100, 2), DATE_ADD('2024-03-31', INTERVAL FLOOR(RAND() * 365) DAY)); + +-- Order 58 +INSERT INTO order_details (customer_id, store_id, total_price, date) +VALUES (58, 8, ROUND(RAND() * 300 + 100, 2), DATE_ADD('2024-03-31', INTERVAL FLOOR(RAND() * 365) DAY)); + +-- Order 59 +INSERT INTO order_details (customer_id, store_id, total_price, date) +VALUES (59, 9, ROUND(RAND() * 300 + 100, 2), DATE_ADD('2024-03-31', INTERVAL FLOOR(RAND() * 365) DAY)); + +-- Order 60 +INSERT INTO order_details (customer_id, store_id, total_price, date) +VALUES (60, 10, ROUND(RAND() * 300 + 100, 2), DATE_ADD('2024-03-31', INTERVAL FLOOR(RAND() * 365) DAY)); + +-- Order 61 +INSERT INTO order_details (customer_id, store_id, total_price, date) +VALUES (61, 1, ROUND(RAND() * 300 + 100, 2), DATE_ADD('2024-03-31', INTERVAL FLOOR(RAND() * 365) DAY)); + +-- Order 62 +INSERT INTO order_details (customer_id, store_id, total_price, date) +VALUES (62, 2, ROUND(RAND() * 300 + 100, 2), DATE_ADD('2024-03-31', INTERVAL FLOOR(RAND() * 365) DAY)); + +-- Order 63 +INSERT INTO order_details (customer_id, store_id, total_price, date) +VALUES (63, 3, ROUND(RAND() * 300 + 100, 2), DATE_ADD('2024-03-31', INTERVAL FLOOR(RAND() * 365) DAY)); + +-- Order 64 +INSERT INTO order_details (customer_id, store_id, total_price, date) +VALUES (64, 4, ROUND(RAND() * 300 + 100, 2), DATE_ADD('2024-03-31', INTERVAL FLOOR(RAND() * 365) DAY)); + +-- Order 65 +INSERT INTO order_details (customer_id, store_id, total_price, date) +VALUES (65, 5, ROUND(RAND() * 300 + 100, 2), DATE_ADD('2024-03-31', INTERVAL FLOOR(RAND() * 365) DAY)); + +-- Order 66 +INSERT INTO order_details (customer_id, store_id, total_price, date) +VALUES (66, 6, ROUND(RAND() * 300 + 100, 2), DATE_ADD('2024-03-31', INTERVAL FLOOR(RAND() * 365) DAY)); + +-- Order 67 +INSERT INTO order_details (customer_id, store_id, total_price, date) +VALUES (67, 7, ROUND(RAND() * 300 + 100, 2), DATE_ADD('2024-03-31', INTERVAL FLOOR(RAND() * 365) DAY)); + +-- Order 68 +INSERT INTO order_details (customer_id, store_id, total_price, date) +VALUES (68, 8, ROUND(RAND() * 300 + 100, 2), DATE_ADD('2024-03-31', INTERVAL FLOOR(RAND() * 365) DAY)); + +-- Order 69 +INSERT INTO order_details (customer_id, store_id, total_price, date) +VALUES (69, 9, ROUND(RAND() * 300 + 100, 2), DATE_ADD('2024-03-31', INTERVAL FLOOR(RAND() * 365) DAY)); + +-- Order 70 +INSERT INTO order_details (customer_id, store_id, total_price, date) +VALUES (70, 10, ROUND(RAND() * 300 + 100, 2), DATE_ADD('2024-03-31', INTERVAL FLOOR(RAND() * 365) DAY)); + +-- Order 71 +INSERT INTO order_details (customer_id, store_id, total_price, date) +VALUES (71, 1, ROUND(RAND() * 300 + 100, 2), DATE_ADD('2024-03-31', INTERVAL FLOOR(RAND() * 365) DAY)); + +-- Order 72 +INSERT INTO order_details (customer_id, store_id, total_price, date) +VALUES (72, 2, ROUND(RAND() * 300 + 100, 2), DATE_ADD('2024-03-31', INTERVAL FLOOR(RAND() * 365) DAY)); + +-- Order 73 +INSERT INTO order_details (customer_id, store_id, total_price, date) +VALUES (73, 3, ROUND(RAND() * 300 + 100, 2), DATE_ADD('2024-03-31', INTERVAL FLOOR(RAND() * 365) DAY)); + +-- Order 74 +INSERT INTO order_details (customer_id, store_id, total_price, date) +VALUES (74, 4, ROUND(RAND() * 300 + 100, 2), DATE_ADD('2024-03-31', INTERVAL FLOOR(RAND() * 365) DAY)); + +-- Order 75 +INSERT INTO order_details (customer_id, store_id, total_price, date) +VALUES (75, 5, ROUND(RAND() * 300 + 100, 2), DATE_ADD('2024-03-31', INTERVAL FLOOR(RAND() * 365) DAY)); + +-- Order 76 +INSERT INTO order_details (customer_id, store_id, total_price, date) +VALUES (76, 6, ROUND(RAND() * 300 + 100, 2), DATE_ADD('2024-03-31', INTERVAL FLOOR(RAND() * 365) DAY)); + +-- Order 77 +INSERT INTO order_details (customer_id, store_id, total_price, date) +VALUES (77, 7, ROUND(RAND() * 300 + 100, 2), DATE_ADD('2024-03-31', INTERVAL FLOOR(RAND() * 365) DAY)); + +-- Order 78 +INSERT INTO order_details (customer_id, store_id, total_price, date) +VALUES (78, 8, ROUND(RAND() * 300 + 100, 2), DATE_ADD('2024-03-31', INTERVAL FLOOR(RAND() * 365) DAY)); + +-- Order 79 +INSERT INTO order_details (customer_id, store_id, total_price, date) +VALUES (79, 9, ROUND(RAND() * 300 + 100, 2), DATE_ADD('2024-03-31', INTERVAL FLOOR(RAND() * 365) DAY)); + +-- Order 80 +INSERT INTO order_details (customer_id, store_id, total_price, date) +VALUES (80, 10, ROUND(RAND() * 300 + 100, 2), DATE_ADD('2024-03-31', INTERVAL FLOOR(RAND() * 365) DAY)); + +-- Order 81 +INSERT INTO order_details (customer_id, store_id, total_price, date) +VALUES (81, 1, ROUND(RAND() * 300 + 100, 2), DATE_ADD('2024-03-31', INTERVAL FLOOR(RAND() * 365) DAY)); + +-- Order 82 +INSERT INTO order_details (customer_id, store_id, total_price, date) +VALUES (82, 2, ROUND(RAND() * 300 + 100, 2), DATE_ADD('2024-03-31', INTERVAL FLOOR(RAND() * 365) DAY)); + +-- Order 83 +INSERT INTO order_details (customer_id, store_id, total_price, date) +VALUES (83, 3, ROUND(RAND() * 300 + 100, 2), DATE_ADD('2024-03-31', INTERVAL FLOOR(RAND() * 365) DAY)); + +-- Order 84 +INSERT INTO order_details (customer_id, store_id, total_price, date) +VALUES (84, 4, ROUND(RAND() * 300 + 100, 2), DATE_ADD('2024-03-31', INTERVAL FLOOR(RAND() * 365) DAY)); + +-- Order 85 +INSERT INTO order_details (customer_id, store_id, total_price, date) +VALUES (85, 5, ROUND(RAND() * 300 + 100, 2), DATE_ADD('2024-03-31', INTERVAL FLOOR(RAND() * 365) DAY)); + +-- Order 86 +INSERT INTO order_details (customer_id, store_id, total_price, date) +VALUES (86, 6, ROUND(RAND() * 300 + 100, 2), DATE_ADD('2024-03-31', INTERVAL FLOOR(RAND() * 365) DAY)); + +-- Order 87 +INSERT INTO order_details (customer_id, store_id, total_price, date) +VALUES (87, 7, ROUND(RAND() * 300 + 100, 2), DATE_ADD('2024-03-31', INTERVAL FLOOR(RAND() * 365) DAY)); + +-- Order 88 +INSERT INTO order_details (customer_id, store_id, total_price, date) +VALUES (88, 8, ROUND(RAND() * 300 + 100, 2), DATE_ADD('2024-03-31', INTERVAL FLOOR(RAND() * 365) DAY)); + +-- Order 89 +INSERT INTO order_details (customer_id, store_id, total_price, date) +VALUES (89, 9, ROUND(RAND() * 300 + 100, 2), DATE_ADD('2024-03-31', INTERVAL FLOOR(RAND() * 365) DAY)); + +-- Order 90 +INSERT INTO order_details (customer_id, store_id, total_price, date) +VALUES (90, 10, ROUND(RAND() * 300 + 100, 2), DATE_ADD('2024-03-31', INTERVAL FLOOR(RAND() * 365) DAY)); + +-- Order 91 +INSERT INTO order_details (customer_id, store_id, total_price, date) +VALUES (91, 1, ROUND(RAND() * 300 + 100, 2), DATE_ADD('2024-03-31', INTERVAL FLOOR(RAND() * 365) DAY)); + +-- Order 92 +INSERT INTO order_details (customer_id, store_id, total_price, date) +VALUES (92, 2, ROUND(RAND() * 300 + 100, 2), DATE_ADD('2024-03-31', INTERVAL FLOOR(RAND() * 365) DAY)); + +-- Order 93 +INSERT INTO order_details (customer_id, store_id, total_price, date) +VALUES (93, 3, ROUND(RAND() * 300 + 100, 2), DATE_ADD('2024-03-31', INTERVAL FLOOR(RAND() * 365) DAY)); + +-- Order 94 +INSERT INTO order_details (customer_id, store_id, total_price, date) +VALUES (94, 4, ROUND(RAND() * 300 + 100, 2), DATE_ADD('2024-03-31', INTERVAL FLOOR(RAND() * 365) DAY)); + +-- Order 95 +INSERT INTO order_details (customer_id, store_id, total_price, date) +VALUES (95, 5, ROUND(RAND() * 300 + 100, 2), DATE_ADD('2024-03-31', INTERVAL FLOOR(RAND() * 365) DAY)); + +-- Order 96 +INSERT INTO order_details (customer_id, store_id, total_price, date) +VALUES (96, 6, ROUND(RAND() * 300 + 100, 2), DATE_ADD('2024-03-31', INTERVAL FLOOR(RAND() * 365) DAY)); + +-- Order 97 +INSERT INTO order_details (customer_id, store_id, total_price, date) +VALUES (97, 7, ROUND(RAND() * 300 + 100, 2), DATE_ADD('2024-03-31', INTERVAL FLOOR(RAND() * 365) DAY)); + +-- Order 98 +INSERT INTO order_details (customer_id, store_id, total_price, date) +VALUES (98, 8, ROUND(RAND() * 300 + 100, 2), DATE_ADD('2024-03-31', INTERVAL FLOOR(RAND() * 365) DAY)); + +-- Order 99 +INSERT INTO order_details (customer_id, store_id, total_price, date) +VALUES (99, 9, ROUND(RAND() * 300 + 100, 2), DATE_ADD('2024-03-31', INTERVAL FLOOR(RAND() * 365) DAY)); + +-- Order 100 +INSERT INTO order_details (customer_id, store_id, total_price, date) +VALUES (100, 10, ROUND(RAND() * 300 + 100, 2), DATE_ADD('2024-03-31', INTERVAL FLOOR(RAND() * 365) DAY)); + +-- Order Item for Order 1 +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (1, 1, 2, 29.99); +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (1, 11, 1, 59.99); + +-- Order Item for Order 2 +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (2, 2, 3, 19.99); +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (2, 12, 1, 79.99); + +-- Order Item for Order 3 +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (3, 3, 1, 49.99); +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (3, 13, 2, 39.99); + +-- Order Item for Order 4 +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (4, 4, 1, 59.99); +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (4, 14, 3, 79.99); + +-- Order Item for Order 5 +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (5, 5, 2, 29.99); +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (5, 15, 1, 99.99); + +-- Order Item for Order 6 +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (6, 6, 3, 69.99); +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (6, 16, 2, 49.99); + +-- Order Item for Order 7 +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (7, 7, 1, 19.99); +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (7, 17, 2, 39.99); + +-- Order Item for Order 8 +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (8, 8, 2, 99.99); +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (8, 18, 1, 79.99); + +-- Order Item for Order 9 +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (9, 9, 1, 29.99); +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (9, 19, 3, 49.99); + +-- Order Item for Order 10 +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (10, 10, 2, 69.99); +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (10, 20, 1, 59.99); + +-- Order Item for Order 11 +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (11, 1, 1, 39.99); +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (11, 11, 2, 79.99); + +-- Order Item for Order 12 +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (12, 2, 3, 19.99); +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (12, 12, 1, 89.99); + +-- Order Item for Order 13 +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (13, 3, 2, 49.99); +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (13, 13, 1, 59.99); + +-- Order Item for Order 14 +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (14, 4, 1, 69.99); +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (14, 14, 2, 99.99); + +-- Order Item for Order 15 +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (15, 5, 1, 29.99); +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (15, 15, 3, 79.99); + +-- Order Item for Order 16 +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (16, 6, 2, 39.99); +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (16, 16, 1, 69.99); + +-- Order Item for Order 17 +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (17, 7, 1, 49.99); +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (17, 17, 3, 79.99); + +-- Order Item for Order 18 +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (18, 8, 2, 59.99); +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (18, 18, 1, 99.99); + +-- Order Item for Order 19 +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (19, 9, 3, 29.99); +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (19, 19, 1, 39.99); + +-- Order Item for Order 20 +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (20, 10, 2, 69.99); +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (20, 20, 1, 49.99); + +-- Order Item for Order 21 +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (21, 1, 1, 39.99); +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (21, 11, 2, 89.99); + +-- Order Item for Order 22 +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (22, 2, 3, 19.99); +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (22, 12, 1, 79.99); + +-- Order Item for Order 23 +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (23, 3, 1, 59.99); +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (23, 13, 2, 49.99); + +-- Order Item for Order 24 +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (24, 4, 1, 69.99); +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (24, 14, 2, 79.99); + +-- Order Item for Order 25 +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (25, 5, 2, 39.99); +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (25, 15, 1, 99.99); + +-- Order Item for Order 26 +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (26, 6, 3, 49.99); +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (26, 16, 2, 59.99); + +-- Order Item for Order 27 +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (27, 7, 1, 29.99); +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (27, 17, 2, 39.99); + +-- Order Item for Order 28 +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (28, 8, 2, 79.99); +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (28, 18, 1, 69.99); + +-- Order Item for Order 29 +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (29, 9, 1, 59.99); +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (29, 19, 3, 49.99); + +-- Order Item for Order 30 +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (30, 10, 2, 69.99); +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (30, 20, 1, 79.99); + +-- Order Item for Order 31 +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (31, 1, 3, 29.99); +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (31, 11, 1, 89.99); + +-- Order Item for Order 32 +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (32, 2, 2, 49.99); +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (32, 12, 1, 59.99); + +-- Order Item for Order 33 +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (33, 3, 1, 39.99); +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (33, 13, 2, 69.99); + +-- Order Item for Order 34 +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (34, 4, 1, 49.99); +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (34, 14, 2, 99.99); + +-- Order Item for Order 35 +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (35, 5, 2, 79.99); +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (35, 15, 1, 49.99); + +-- Order Item for Order 36 +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (36, 6, 2, 59.99); +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (36, 16, 1, 69.99); + +-- Order Item for Order 37 +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (37, 7, 1, 29.99); +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (37, 17, 2, 49.99); + +-- Order Item for Order 38 +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (38, 8, 3, 39.99); +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (38, 18, 1, 79.99); + +-- Order Item for Order 39 +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (39, 9, 1, 69.99); +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (39, 19, 2, 49.99); + +-- Order Item for Order 40 +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (40, 10, 1, 59.99); +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (40, 20, 3, 89.99); + +-- Order Item for Order 41 +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (41, 1, 2, 79.99); +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (41, 11, 1, 69.99); + +-- Order Item for Order 42 +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (42, 2, 1, 39.99); +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (42, 12, 3, 99.99); + +-- Order Item for Order 43 +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (43, 3, 2, 69.99); +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (43, 13, 1, 79.99); + +-- Order Item for Order 44 +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (44, 4, 1, 59.99); +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (44, 14, 2, 69.99); + +-- Order Item for Order 45 +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (45, 5, 3, 29.99); +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (45, 15, 2, 49.99); + +-- Order Item for Order 46 +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (46, 6, 1, 49.99); +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (46, 16, 2, 69.99); + +-- Order Item for Order 47 +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (47, 7, 3, 59.99); +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (47, 17, 1, 39.99); + +-- Order Item for Order 48 +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (48, 8, 1, 69.99); +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (48, 18, 2, 49.99); + +-- Order Item for Order 49 +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (49, 9, 1, 59.99); +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (49, 19, 3, 79.99); + +-- Order Item for Order 50 +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (50, 10, 2, 49.99); +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (50, 20, 1, 69.99); + + +-- Order Item 51 +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (51, 1, 2, 49.99); +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (51, 5, 1, 69.99); +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (51, 13, 3, 29.99); + +-- Order Item 52 +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (52, 2, 1, 19.99); +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (52, 6, 2, 79.99); + +-- Order Item 53 +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (53, 3, 1, 39.99); +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (53, 12, 2, 89.99); + +-- Order Item 54 +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (54, 4, 3, 19.99); +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (54, 14, 1, 59.99); + +-- Order Item 55 +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (55, 5, 2, 49.99); +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (55, 11, 1, 99.99); + +-- Order Item 56 +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (56, 6, 1, 59.99); +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (56, 8, 3, 69.99); + +-- Order Item 57 +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (57, 7, 2, 79.99); +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (57, 9, 1, 89.99); + +-- Order Item 58 +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (58, 8, 1, 69.99); +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (58, 10, 3, 39.99); + +-- Order Item 59 +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (59, 9, 2, 59.99); +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (59, 11, 1, 79.99); + +-- Order Item 60 +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (60, 10, 3, 49.99); +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (60, 12, 2, 89.99); + +-- Order Item 61 +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (61, 11, 1, 99.99); +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (61, 13, 2, 29.99); + +-- Order Item 62 +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (62, 12, 3, 69.99); +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (62, 14, 1, 39.99); + +-- Order Item 63 +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (63, 13, 2, 49.99); +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (63, 15, 1, 59.99); + +-- Order Item 64 +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (64, 14, 1, 79.99); +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (64, 16, 2, 89.99); + +-- Order Item 65 +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (65, 15, 3, 19.99); +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (65, 17, 2, 69.99); + +-- Order Item 66 +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (66, 16, 2, 49.99); +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (66, 18, 1, 79.99); + +-- Order Item 67 +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (67, 17, 1, 39.99); +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (67, 19, 3, 59.99); + +-- Order Item 68 +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (68, 18, 2, 69.99); +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (68, 20, 1, 99.99); + +-- Order Item 69 +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (69, 19, 1, 59.99); +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (69, 21, 3, 39.99); + +-- Order Item 70 +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (70, 20, 2, 49.99); +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (70, 22, 1, 79.99); + +-- Order Item 71 +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (71, 21, 3, 69.99); +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (71, 23, 1, 59.99); + +-- Order Item 72 +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (72, 22, 2, 79.99); +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (72, 24, 1, 89.99); + +-- Order Item 73 +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (73, 23, 1, 39.99); +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (73, 25, 2, 49.99); + +-- Order Item 74 +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (74, 24, 2, 59.99); +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (74, 26, 1, 69.99); + +-- Order Item 75 +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (75, 25, 3, 49.99); +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (75, 27, 1, 79.99); + +-- Order Item 76 +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (76, 26, 1, 89.99); +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (76, 28, 2, 39.99); + +-- Order Item 77 +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (77, 27, 1, 79.99); +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (77, 29, 3, 59.99); + +-- Order Item 78 +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (78, 28, 2, 69.99); +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (78, 30, 1, 99.99); + +-- Order Item 79 +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (79, 29, 1, 39.99); +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (79, 31, 2, 49.99); + +-- Order Item 80 +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (80, 30, 2, 59.99); +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (80, 32, 1, 69.99); + +-- Order Item 81 +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (81, 31, 3, 49.99); +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (81, 33, 2, 59.99); + +-- Order Item 82 +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (82, 32, 1, 69.99); +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (82, 34, 3, 79.99); + +-- Order Item 83 +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (83, 33, 2, 89.99); +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (83, 35, 1, 99.99); + +-- Order Item 84 +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (84, 34, 2, 39.99); +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (84, 36, 1, 49.99); + +-- Order Item 85 +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (85, 35, 1, 59.99); +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (85, 37, 2, 69.99); + +-- Order Item 86 +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (86, 36, 3, 79.99); +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (86, 38, 2, 89.99); + +-- Order Item 87 +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (87, 37, 1, 99.99); +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (87, 39, 3, 49.99); + +-- Order Item 88 +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (88, 38, 1, 59.99); +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (88, 40, 2, 69.99); + +-- Order Item 89 +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (89, 39, 2, 79.99); +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (89, 41, 1, 89.99); + +-- Order Item 90 +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (90, 40, 3, 99.99); +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (90, 42, 2, 59.99); + +-- Order Item 91 +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (91, 41, 1, 69.99); +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (91, 43, 3, 49.99); + +-- Order Item 92 +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (92, 42, 2, 39.99); +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (92, 44, 1, 79.99); + +-- Order Item 93 +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (93, 43, 3, 59.99); +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (93, 45, 2, 69.99); + +-- Order Item 94 +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (94, 44, 1, 79.99); +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (94, 46, 3, 49.99); + +-- Order Item 95 +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (95, 45, 2, 59.99); +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (95, 47, 1, 99.99); + +-- Order Item 96 +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (96, 46, 1, 39.99); +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (96, 48, 2, 69.99); + +-- Order Item 97 +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (97, 47, 3, 79.99); +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (97, 49, 2, 89.99); + +-- Order Item 98 +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (98, 48, 2, 59.99); +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (98, 50, 1, 69.99); + +-- Order Item 99 +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (99, 49, 1, 39.99); +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (99, 50, 3, 49.99); + +-- Order Item 100 +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (100, 50, 2, 59.99); +INSERT INTO order_item (order_id, product_id, quantity, price) VALUES (100, 1, 1, 79.99); + + + diff --git a/RetailManagementSystem/reviews.json b/RetailManagementSystem/reviews.json new file mode 100644 index 0000000..4709990 --- /dev/null +++ b/RetailManagementSystem/reviews.json @@ -0,0 +1,1752 @@ +[ + { + "productId": 1, + "customerId": 45, + "storeId": 1, + "rating": 5, + "comment": "Amazing laptop! Very fast and lightweight." + }, + { + "productId": 1, + "customerId": 15, + "storeId": 1, + "rating": 4, + "comment": "Great product! Worth every penny." + }, + { + "productId": 1, + "customerId": 78, + "storeId": 1, + "rating": 3, + "comment": "The quality exceeded my expectations." + }, + { + "productId": 1, + "customerId": 25, + "storeId": 1, + "rating": 2, + "comment": "Would definitely recommend to others." + }, + { + "productId": 1, + "customerId": 12, + "storeId": 1, + "rating": 1, + "comment": "Not as expected. The performance is subpar." + }, + { + "productId": 11, + "customerId": 38, + "storeId": 1, + "rating": 5, + "comment": "Satisfactory, but I was hoping for better features." + }, + { + "productId": 11, + "customerId": 99, + "storeId": 1, + "rating": 4, + "comment": "Great value for money!" + }, + { + "productId": 11, + "customerId": 10, + "storeId": 1, + "rating": 5, + "comment": "Highly recommend it. Best purchase ever!" + }, + { + "productId": 11, + "customerId": 66, + "storeId": 1, + "rating": 3, + "comment": "The laptop is great for gaming." + }, + { + "productId": 11, + "customerId": 53, + "storeId": 1, + "rating": 4, + "comment": "It\u2019s okay, but there are better options out there." + }, + { + "productId": 21, + "customerId": 7, + "storeId": 1, + "rating": 5, + "comment": "Amazing laptop! Very fast and lightweight." + }, + { + "productId": 21, + "customerId": 88, + "storeId": 1, + "rating": 2, + "comment": "Great product! Worth every penny." + }, + { + "productId": 21, + "customerId": 54, + "storeId": 1, + "rating": 3, + "comment": "The quality exceeded my expectations." + }, + { + "productId": 21, + "customerId": 13, + "storeId": 1, + "rating": 4, + "comment": "Would definitely recommend to others." + }, + { + "productId": 21, + "customerId": 60, + "storeId": 1, + "rating": 1, + "comment": "Not as expected. The performance is subpar." + }, + { + "productId": 31, + "customerId": 9, + "storeId": 1, + "rating": 4, + "comment": "Satisfactory, but I was hoping for better features." + }, + { + "productId": 31, + "customerId": 85, + "storeId": 1, + "rating": 5, + "comment": "Great value for money!" + }, + { + "productId": 31, + "customerId": 35, + "storeId": 1, + "rating": 5, + "comment": "Highly recommend it. Best purchase ever!" + }, + { + "productId": 31, + "customerId": 72, + "storeId": 1, + "rating": 3, + "comment": "The laptop is great for gaming." + }, + { + "productId": 31, + "customerId": 22, + "storeId": 1, + "rating": 4, + "comment": "It\u2019s okay, but there are better options out there." + }, + { + "productId": 41, + "customerId": 16, + "storeId": 1, + "rating": 5, + "comment": "Amazing laptop! Very fast and lightweight." + }, + { + "productId": 41, + "customerId": 34, + "storeId": 1, + "rating": 2, + "comment": "Great product! Worth every penny." + }, + { + "productId": 41, + "customerId": 49, + "storeId": 1, + "rating": 3, + "comment": "The quality exceeded my expectations." + }, + { + "productId": 41, + "customerId": 28, + "storeId": 1, + "rating": 4, + "comment": "Would definitely recommend to others." + }, + { + "productId": 41, + "customerId": 42, + "storeId": 1, + "rating": 1, + "comment": "Not as expected. The performance is subpar." + }, + { + "productId": 2, + "customerId": 38, + "storeId": 2, + "rating": 5, + "comment": "Satisfactory, but I was hoping for better features." + }, + { + "productId": 2, + "customerId": 99, + "storeId": 2, + "rating": 4, + "comment": "Great value for money!" + }, + { + "productId": 2, + "customerId": 10, + "storeId": 2, + "rating": 5, + "comment": "Highly recommend it. Best purchase ever!" + }, + { + "productId": 2, + "customerId": 66, + "storeId": 2, + "rating": 3, + "comment": "The laptop is great for gaming." + }, + { + "productId": 2, + "customerId": 53, + "storeId": 2, + "rating": 4, + "comment": "It\u2019s okay, but there are better options out there." + }, + { + "productId": 12, + "customerId": 7, + "storeId": 2, + "rating": 5, + "comment": "Amazing laptop! Very fast and lightweight." + }, + { + "productId": 12, + "customerId": 88, + "storeId": 2, + "rating": 2, + "comment": "Great product! Worth every penny." + }, + { + "productId": 12, + "customerId": 54, + "storeId": 2, + "rating": 3, + "comment": "The quality exceeded my expectations." + }, + { + "productId": 12, + "customerId": 13, + "storeId": 2, + "rating": 4, + "comment": "Would definitely recommend to others." + }, + { + "productId": 12, + "customerId": 60, + "storeId": 2, + "rating": 1, + "comment": "Not as expected. The performance is subpar." + }, + { + "productId": 22, + "customerId": 9, + "storeId": 2, + "rating": 4, + "comment": "Satisfactory, but I was hoping for better features." + }, + { + "productId": 22, + "customerId": 85, + "storeId": 2, + "rating": 5, + "comment": "Great value for money!" + }, + { + "productId": 22, + "customerId": 35, + "storeId": 2, + "rating": 5, + "comment": "Highly recommend it. Best purchase ever!" + }, + { + "productId": 22, + "customerId": 72, + "storeId": 2, + "rating": 3, + "comment": "The laptop is great for gaming." + }, + { + "productId": 22, + "customerId": 22, + "storeId": 2, + "rating": 4, + "comment": "It\u2019s okay, but there are better options out there." + }, + { + "productId": 32, + "customerId": 16, + "storeId": 2, + "rating": 5, + "comment": "Amazing laptop! Very fast and lightweight." + }, + { + "productId": 32, + "customerId": 34, + "storeId": 2, + "rating": 2, + "comment": "Great product! Worth every penny." + }, + { + "productId": 32, + "customerId": 49, + "storeId": 2, + "rating": 3, + "comment": "The quality exceeded my expectations." + }, + { + "productId": 32, + "customerId": 28, + "storeId": 2, + "rating": 4, + "comment": "Would definitely recommend to others." + }, + { + "productId": 32, + "customerId": 42, + "storeId": 2, + "rating": 1, + "comment": "Not as expected. The performance is subpar." + }, + { + "productId": 42, + "customerId": 63, + "storeId": 2, + "rating": 4, + "comment": "Satisfactory, but I was hoping for better features." + }, + { + "productId": 42, + "customerId": 39, + "storeId": 2, + "rating": 5, + "comment": "Great value for money!" + }, + { + "productId": 42, + "customerId": 51, + "storeId": 2, + "rating": 5, + "comment": "Highly recommend it. Best purchase ever!" + }, + { + "productId": 42, + "customerId": 8, + "storeId": 2, + "rating": 3, + "comment": "The laptop is great for gaming." + }, + { + "productId": 42, + "customerId": 21, + "storeId": 2, + "rating": 4, + "comment": "It\u2019s okay, but there are better options out there." + }, + { + "productId": 3, + "customerId": 7, + "storeId": 3, + "rating": 5, + "comment": "Amazing laptop! Very fast and lightweight." + }, + { + "productId": 3, + "customerId": 88, + "storeId": 3, + "rating": 2, + "comment": "Great product! Worth every penny." + }, + { + "productId": 3, + "customerId": 54, + "storeId": 3, + "rating": 3, + "comment": "The quality exceeded my expectations." + }, + { + "productId": 3, + "customerId": 13, + "storeId": 3, + "rating": 4, + "comment": "Would definitely recommend to others." + }, + { + "productId": 3, + "customerId": 60, + "storeId": 3, + "rating": 1, + "comment": "Not as expected. The performance is subpar." + }, + { + "productId": 13, + "customerId": 38, + "storeId": 3, + "rating": 5, + "comment": "Satisfactory, but I was hoping for better features." + }, + { + "productId": 13, + "customerId": 99, + "storeId": 3, + "rating": 4, + "comment": "Great value for money!" + }, + { + "productId": 13, + "customerId": 10, + "storeId": 3, + "rating": 5, + "comment": "Highly recommend it. Best purchase ever!" + }, + { + "productId": 13, + "customerId": 66, + "storeId": 3, + "rating": 3, + "comment": "The laptop is great for gaming." + }, + { + "productId": 13, + "customerId": 53, + "storeId": 3, + "rating": 4, + "comment": "It\u2019s okay, but there are better options out there." + }, + { + "productId": 23, + "customerId": 7, + "storeId": 3, + "rating": 5, + "comment": "Amazing laptop! Very fast and lightweight." + }, + { + "productId": 23, + "customerId": 88, + "storeId": 3, + "rating": 2, + "comment": "Great product! Worth every penny." + }, + { + "productId": 23, + "customerId": 54, + "storeId": 3, + "rating": 3, + "comment": "The quality exceeded my expectations." + }, + { + "productId": 23, + "customerId": 13, + "storeId": 3, + "rating": 4, + "comment": "Would definitely recommend to others." + }, + { + "productId": 23, + "customerId": 60, + "storeId": 3, + "rating": 1, + "comment": "Not as expected. The performance is subpar." + }, + { + "productId": 33, + "customerId": 9, + "storeId": 3, + "rating": 4, + "comment": "Satisfactory, but I was hoping for better features." + }, + { + "productId": 33, + "customerId": 85, + "storeId": 3, + "rating": 5, + "comment": "Great value for money!" + }, + { + "productId": 33, + "customerId": 35, + "storeId": 3, + "rating": 5, + "comment": "Highly recommend it. Best purchase ever!" + }, + { + "productId": 33, + "customerId": 72, + "storeId": 3, + "rating": 3, + "comment": "The laptop is great for gaming." + }, + { + "productId": 33, + "customerId": 22, + "storeId": 3, + "rating": 4, + "comment": "It\u2019s okay, but there are better options out there." + }, + { + "productId": 43, + "customerId": 16, + "storeId": 3, + "rating": 5, + "comment": "Amazing laptop! Very fast and lightweight." + }, + { + "productId": 43, + "customerId": 34, + "storeId": 3, + "rating": 2, + "comment": "Great product! Worth every penny." + }, + { + "productId": 43, + "customerId": 49, + "storeId": 3, + "rating": 3, + "comment": "The quality exceeded my expectations." + }, + { + "productId": 43, + "customerId": 28, + "storeId": 3, + "rating": 4, + "comment": "Would definitely recommend to others." + }, + { + "productId": 43, + "customerId": 42, + "storeId": 3, + "rating": 1, + "comment": "Not as expected. The performance is subpar." + }, + { + "productId": 4, + "customerId": 7, + "storeId": 4, + "rating": 5, + "comment": "Amazing laptop! Very fast and lightweight." + }, + { + "productId": 4, + "customerId": 88, + "storeId": 4, + "rating": 2, + "comment": "Great product! Worth every penny." + }, + { + "productId": 4, + "customerId": 54, + "storeId": 4, + "rating": 3, + "comment": "The quality exceeded my expectations." + }, + { + "productId": 4, + "customerId": 13, + "storeId": 4, + "rating": 4, + "comment": "Would definitely recommend to others." + }, + { + "productId": 4, + "customerId": 60, + "storeId": 4, + "rating": 1, + "comment": "Not as expected. The performance is subpar." + }, + { + "productId": 14, + "customerId": 38, + "storeId": 4, + "rating": 5, + "comment": "Satisfactory, but I was hoping for better features." + }, + { + "productId": 14, + "customerId": 99, + "storeId": 4, + "rating": 4, + "comment": "Great value for money!" + }, + { + "productId": 14, + "customerId": 10, + "storeId": 4, + "rating": 5, + "comment": "Highly recommend it. Best purchase ever!" + }, + { + "productId": 14, + "customerId": 66, + "storeId": 4, + "rating": 3, + "comment": "The laptop is great for gaming." + }, + { + "productId": 14, + "customerId": 53, + "storeId": 4, + "rating": 4, + "comment": "It\u2019s okay, but there are better options out there." + }, + { + "productId": 24, + "customerId": 7, + "storeId": 4, + "rating": 5, + "comment": "Amazing laptop! Very fast and lightweight." + }, + { + "productId": 24, + "customerId": 88, + "storeId": 4, + "rating": 2, + "comment": "Great product! Worth every penny." + }, + { + "productId": 24, + "customerId": 54, + "storeId": 4, + "rating": 3, + "comment": "The quality exceeded my expectations." + }, + { + "productId": 24, + "customerId": 13, + "storeId": 4, + "rating": 4, + "comment": "Would definitely recommend to others." + }, + { + "productId": 24, + "customerId": 60, + "storeId": 4, + "rating": 1, + "comment": "Not as expected. The performance is subpar." + }, + { + "productId": 34, + "customerId": 9, + "storeId": 4, + "rating": 4, + "comment": "Satisfactory, but I was hoping for better features." + }, + { + "productId": 34, + "customerId": 85, + "storeId": 4, + "rating": 5, + "comment": "Great value for money!" + }, + { + "productId": 34, + "customerId": 35, + "storeId": 4, + "rating": 5, + "comment": "Highly recommend it. Best purchase ever!" + }, + { + "productId": 34, + "customerId": 72, + "storeId": 4, + "rating": 3, + "comment": "The laptop is great for gaming." + }, + { + "productId": 34, + "customerId": 22, + "storeId": 4, + "rating": 4, + "comment": "It\u2019s okay, but there are better options out there." + }, + { + "productId": 44, + "customerId": 16, + "storeId": 4, + "rating": 5, + "comment": "Amazing laptop! Very fast and lightweight." + }, + { + "productId": 44, + "customerId": 34, + "storeId": 4, + "rating": 2, + "comment": "Great product! Worth every penny." + }, + { + "productId": 44, + "customerId": 49, + "storeId": 4, + "rating": 3, + "comment": "The quality exceeded my expectations." + }, + { + "productId": 44, + "customerId": 28, + "storeId": 4, + "rating": 4, + "comment": "Would definitely recommend to others." + }, + { + "productId": 44, + "customerId": 42, + "storeId": 4, + "rating": 1, + "comment": "Not as expected. The performance is subpar." + }, + { + "productId": 5, + "customerId": 7, + "storeId": 5, + "rating": 5, + "comment": "Amazing laptop! Very fast and lightweight." + }, + { + "productId": 5, + "customerId": 88, + "storeId": 5, + "rating": 2, + "comment": "Great product! Worth every penny." + }, + { + "productId": 5, + "customerId": 54, + "storeId": 5, + "rating": 3, + "comment": "The quality exceeded my expectations." + }, + { + "productId": 5, + "customerId": 13, + "storeId": 5, + "rating": 4, + "comment": "Would definitely recommend to others." + }, + { + "productId": 5, + "customerId": 60, + "storeId": 5, + "rating": 1, + "comment": "Not as expected. The performance is subpar." + }, + { + "productId": 15, + "customerId": 38, + "storeId": 5, + "rating": 5, + "comment": "Satisfactory, but I was hoping for better features." + }, + { + "productId": 15, + "customerId": 99, + "storeId": 5, + "rating": 4, + "comment": "Great value for money!" + }, + { + "productId": 15, + "customerId": 10, + "storeId": 5, + "rating": 5, + "comment": "Highly recommend it. Best purchase ever!" + }, + { + "productId": 15, + "customerId": 66, + "storeId": 5, + "rating": 3, + "comment": "The laptop is great for gaming." + }, + { + "productId": 15, + "customerId": 53, + "storeId": 5, + "rating": 4, + "comment": "It\u2019s okay, but there are better options out there." + }, + { + "productId": 25, + "customerId": 7, + "storeId": 5, + "rating": 5, + "comment": "Amazing laptop! Very fast and lightweight." + }, + { + "productId": 25, + "customerId": 88, + "storeId": 5, + "rating": 2, + "comment": "Great product! Worth every penny." + }, + { + "productId": 25, + "customerId": 54, + "storeId": 5, + "rating": 3, + "comment": "The quality exceeded my expectations." + }, + { + "productId": 25, + "customerId": 13, + "storeId": 5, + "rating": 4, + "comment": "Would definitely recommend to others." + }, + { + "productId": 25, + "customerId": 60, + "storeId": 5, + "rating": 1, + "comment": "Not as expected. The performance is subpar." + }, + { + "productId": 35, + "customerId": 9, + "storeId": 5, + "rating": 4, + "comment": "Satisfactory, but I was hoping for better features." + }, + { + "productId": 35, + "customerId": 85, + "storeId": 5, + "rating": 5, + "comment": "Great value for money!" + }, + { + "productId": 35, + "customerId": 35, + "storeId": 5, + "rating": 5, + "comment": "Highly recommend it. Best purchase ever!" + }, + { + "productId": 35, + "customerId": 72, + "storeId": 5, + "rating": 3, + "comment": "The laptop is great for gaming." + }, + { + "productId": 35, + "customerId": 22, + "storeId": 5, + "rating": 4, + "comment": "It\u2019s okay, but there are better options out there." + }, + { + "productId": 45, + "customerId": 16, + "storeId": 5, + "rating": 5, + "comment": "Amazing laptop! Very fast and lightweight." + }, + { + "productId": 45, + "customerId": 34, + "storeId": 5, + "rating": 2, + "comment": "Great product! Worth every penny." + }, + { + "productId": 45, + "customerId": 49, + "storeId": 5, + "rating": 3, + "comment": "The quality exceeded my expectations." + }, + { + "productId": 45, + "customerId": 28, + "storeId": 5, + "rating": 4, + "comment": "Would definitely recommend to others." + }, + { + "productId": 45, + "customerId": 42, + "storeId": 5, + "rating": 1, + "comment": "Not as expected. The performance is subpar." + }, + { + "productId": 6, + "customerId": 7, + "storeId": 6, + "rating": 5, + "comment": "Amazing laptop! Very fast and lightweight." + }, + { + "productId": 6, + "customerId": 88, + "storeId": 6, + "rating": 2, + "comment": "Great product! Worth every penny." + }, + { + "productId": 6, + "customerId": 54, + "storeId": 6, + "rating": 3, + "comment": "The quality exceeded my expectations." + }, + { + "productId": 6, + "customerId": 13, + "storeId": 6, + "rating": 4, + "comment": "Would definitely recommend to others." + }, + { + "productId": 6, + "customerId": 60, + "storeId": 6, + "rating": 1, + "comment": "Not as expected. The performance is subpar." + }, + { + "productId": 16, + "customerId": 38, + "storeId": 6, + "rating": 5, + "comment": "Satisfactory, but I was hoping for better features." + }, + { + "productId": 16, + "customerId": 99, + "storeId": 6, + "rating": 4, + "comment": "Great value for money!" + }, + { + "productId": 16, + "customerId": 10, + "storeId": 6, + "rating": 5, + "comment": "Highly recommend it. Best purchase ever!" + }, + { + "productId": 16, + "customerId": 66, + "storeId": 6, + "rating": 3, + "comment": "The laptop is great for gaming." + }, + { + "productId": 16, + "customerId": 53, + "storeId": 6, + "rating": 4, + "comment": "It\u2019s okay, but there are better options out there." + }, + { + "productId": 26, + "customerId": 7, + "storeId": 6, + "rating": 5, + "comment": "Amazing laptop! Very fast and lightweight." + }, + { + "productId": 26, + "customerId": 88, + "storeId": 6, + "rating": 2, + "comment": "Great product! Worth every penny." + }, + { + "productId": 26, + "customerId": 54, + "storeId": 6, + "rating": 3, + "comment": "The quality exceeded my expectations." + }, + { + "productId": 26, + "customerId": 13, + "storeId": 6, + "rating": 4, + "comment": "Would definitely recommend to others." + }, + { + "productId": 26, + "customerId": 60, + "storeId": 6, + "rating": 1, + "comment": "Not as expected. The performance is subpar." + }, + { + "productId": 36, + "customerId": 9, + "storeId": 6, + "rating": 4, + "comment": "Satisfactory, but I was hoping for better features." + }, + { + "productId": 36, + "customerId": 85, + "storeId": 6, + "rating": 5, + "comment": "Great value for money!" + }, + { + "productId": 36, + "customerId": 35, + "storeId": 6, + "rating": 5, + "comment": "Highly recommend it. Best purchase ever!" + }, + { + "productId": 36, + "customerId": 72, + "storeId": 6, + "rating": 3, + "comment": "The laptop is great for gaming." + }, + { + "productId": 36, + "customerId": 22, + "storeId": 6, + "rating": 4, + "comment": "It\u2019s okay, but there are better options out there." + }, + { + "productId": 46, + "customerId": 16, + "storeId": 6, + "rating": 5, + "comment": "Amazing laptop! Very fast and lightweight." + }, + { + "productId": 46, + "customerId": 34, + "storeId": 6, + "rating": 2, + "comment": "Great product! Worth every penny." + }, + { + "productId": 46, + "customerId": 49, + "storeId": 6, + "rating": 3, + "comment": "The quality exceeded my expectations." + }, + { + "productId": 46, + "customerId": 28, + "storeId": 6, + "rating": 4, + "comment": "Would definitely recommend to others." + }, + { + "productId": 46, + "customerId": 42, + "storeId": 6, + "rating": 1, + "comment": "Not as expected. The performance is subpar." + }, + { + "productId": 7, + "customerId": 7, + "storeId": 7, + "rating": 5, + "comment": "Amazing laptop! Very fast and lightweight." + }, + { + "productId": 7, + "customerId": 88, + "storeId": 7, + "rating": 2, + "comment": "Great product! Worth every penny." + }, + { + "productId": 7, + "customerId": 54, + "storeId": 7, + "rating": 3, + "comment": "The quality exceeded my expectations." + }, + { + "productId": 7, + "customerId": 13, + "storeId": 7, + "rating": 4, + "comment": "Would definitely recommend to others." + }, + { + "productId": 7, + "customerId": 60, + "storeId": 7, + "rating": 1, + "comment": "Not as expected. The performance is subpar." + }, + { + "productId": 17, + "customerId": 38, + "storeId": 7, + "rating": 5, + "comment": "Satisfactory, but I was hoping for better features." + }, + { + "productId": 17, + "customerId": 99, + "storeId": 7, + "rating": 4, + "comment": "Great value for money!" + }, + { + "productId": 17, + "customerId": 10, + "storeId": 7, + "rating": 5, + "comment": "Highly recommend it. Best purchase ever!" + }, + { + "productId": 17, + "customerId": 66, + "storeId": 7, + "rating": 3, + "comment": "The laptop is great for gaming." + }, + { + "productId": 17, + "customerId": 53, + "storeId": 7, + "rating": 4, + "comment": "It\u2019s okay, but there are better options out there." + }, + { + "productId": 27, + "customerId": 7, + "storeId": 7, + "rating": 5, + "comment": "Amazing laptop! Very fast and lightweight." + }, + { + "productId": 27, + "customerId": 88, + "storeId": 7, + "rating": 2, + "comment": "Great product! Worth every penny." + }, + { + "productId": 27, + "customerId": 54, + "storeId": 7, + "rating": 3, + "comment": "The quality exceeded my expectations." + }, + { + "productId": 27, + "customerId": 13, + "storeId": 7, + "rating": 4, + "comment": "Would definitely recommend to others." + }, + { + "productId": 27, + "customerId": 60, + "storeId": 7, + "rating": 1, + "comment": "Not as expected. The performance is subpar." + }, + { + "productId": 37, + "customerId": 9, + "storeId": 7, + "rating": 4, + "comment": "Satisfactory, but I was hoping for better features." + }, + { + "productId": 37, + "customerId": 85, + "storeId": 7, + "rating": 5, + "comment": "Great value for money!" + }, + { + "productId": 37, + "customerId": 35, + "storeId": 7, + "rating": 5, + "comment": "Highly recommend it. Best purchase ever!" + }, + { + "productId": 37, + "customerId": 72, + "storeId": 7, + "rating": 3, + "comment": "The laptop is great for gaming." + }, + { + "productId": 37, + "customerId": 22, + "storeId": 7, + "rating": 4, + "comment": "It\u2019s okay, but there are better options out there." + }, + { + "productId": 47, + "customerId": 16, + "storeId": 7, + "rating": 5, + "comment": "Amazing laptop! Very fast and lightweight." + }, + { + "productId": 47, + "customerId": 34, + "storeId": 7, + "rating": 2, + "comment": "Great product! Worth every penny." + }, + { + "productId": 47, + "customerId": 49, + "storeId": 7, + "rating": 3, + "comment": "The quality exceeded my expectations." + }, + { + "productId": 47, + "customerId": 28, + "storeId": 7, + "rating": 4, + "comment": "Would definitely recommend to others." + }, + { + "productId": 47, + "customerId": 42, + "storeId": 7, + "rating": 1, + "comment": "Not as expected. The performance is subpar." + }, + { + "productId": 8, + "customerId": 7, + "storeId": 8, + "rating": 5, + "comment": "Amazing laptop! Very fast and lightweight." + }, + { + "productId": 8, + "customerId": 88, + "storeId": 8, + "rating": 2, + "comment": "Great product! Worth every penny." + }, + { + "productId": 8, + "customerId": 54, + "storeId": 8, + "rating": 3, + "comment": "The quality exceeded my expectations." + }, + { + "productId": 8, + "customerId": 13, + "storeId": 8, + "rating": 4, + "comment": "Would definitely recommend to others." + }, + { + "productId": 8, + "customerId": 60, + "storeId": 8, + "rating": 1, + "comment": "Not as expected. The performance is subpar." + }, + { + "productId": 18, + "customerId": 38, + "storeId": 8, + "rating": 5, + "comment": "Satisfactory, but I was hoping for better features." + }, + { + "productId": 18, + "customerId": 99, + "storeId": 8, + "rating": 4, + "comment": "Great value for money!" + }, + { + "productId": 18, + "customerId": 10, + "storeId": 8, + "rating": 5, + "comment": "Highly recommend it. Best purchase ever!" + }, + { + "productId": 18, + "customerId": 66, + "storeId": 8, + "rating": 3, + "comment": "The laptop is great for gaming." + }, + { + "productId": 18, + "customerId": 53, + "storeId": 8, + "rating": 4, + "comment": "It\u2019s okay, but there are better options out there." + }, + { + "productId": 28, + "customerId": 7, + "storeId": 8, + "rating": 5, + "comment": "Amazing laptop! Very fast and lightweight." + }, + { + "productId": 28, + "customerId": 88, + "storeId": 8, + "rating": 2, + "comment": "Great product! Worth every penny." + }, + { + "productId": 28, + "customerId": 54, + "storeId": 8, + "rating": 3, + "comment": "The quality exceeded my expectations." + }, + { + "productId": 28, + "customerId": 13, + "storeId": 8, + "rating": 4, + "comment": "Would definitely recommend to others." + }, + { + "productId": 28, + "customerId": 60, + "storeId": 8, + "rating": 1, + "comment": "Not as expected. The performance is subpar." + }, + { + "productId": 38, + "customerId": 9, + "storeId": 8, + "rating": 4, + "comment": "Satisfactory, but I was hoping for better features." + }, + { + "productId": 38, + "customerId": 85, + "storeId": 8, + "rating": 5, + "comment": "Great value for money!" + }, + { + "productId": 38, + "customerId": 35, + "storeId": 8, + "rating": 5, + "comment": "Highly recommend it. Best purchase ever!" + }, + { + "productId": 38, + "customerId": 72, + "storeId": 8, + "rating": 3, + "comment": "The laptop is great for gaming." + }, + { + "productId": 38, + "customerId": 22, + "storeId": 8, + "rating": 4, + "comment": "It\u2019s okay, but there are better options out there." + }, + { + "productId": 48, + "customerId": 16, + "storeId": 8, + "rating": 5, + "comment": "Amazing laptop! Very fast and lightweight." + }, + { + "productId": 48, + "customerId": 34, + "storeId": 8, + "rating": 2, + "comment": "Great product! Worth every penny." + }, + { + "productId": 48, + "customerId": 49, + "storeId": 8, + "rating": 3, + "comment": "The quality exceeded my expectations." + }, + { + "productId": 48, + "customerId": 28, + "storeId": 8, + "rating": 4, + "comment": "Would definitely recommend to others." + }, + { + "productId": 48, + "customerId": 42, + "storeId": 8, + "rating": 1, + "comment": "Not as expected. The performance is subpar." + }, + { + "productId": 9, + "customerId": 7, + "storeId": 9, + "rating": 5, + "comment": "Amazing laptop! Very fast and lightweight." + }, + { + "productId": 9, + "customerId": 88, + "storeId": 9, + "rating": 2, + "comment": "Great product! Worth every penny." + }, + { + "productId": 9, + "customerId": 54, + "storeId": 9, + "rating": 3, + "comment": "The quality exceeded my expectations." + }, + { + "productId": 9, + "customerId": 13, + "storeId": 9, + "rating": 4, + "comment": "Would definitely recommend to others." + }, + { + "productId": 9, + "customerId": 60, + "storeId": 9, + "rating": 1, + "comment": "Not as expected. The performance is subpar." + }, + { + "productId": 19, + "customerId": 38, + "storeId": 9, + "rating": 5, + "comment": "Satisfactory, but I was hoping for better features." + }, + { + "productId": 19, + "customerId": 99, + "storeId": 9, + "rating": 4, + "comment": "Great value for money!" + }, + { + "productId": 19, + "customerId": 10, + "storeId": 9, + "rating": 5, + "comment": "Highly recommend it. Best purchase ever!" + }, + { + "productId": 19, + "customerId": 66, + "storeId": 9, + "rating": 3, + "comment": "The laptop is great for gaming." + }, + { + "productId": 19, + "customerId": 53, + "storeId": 9, + "rating": 4, + "comment": "It\u2019s okay, but there are better options out there." + }, + { + "productId": 29, + "customerId": 7, + "storeId": 9, + "rating": 5, + "comment": "Amazing laptop! Very fast and lightweight." + }, + { + "productId": 29, + "customerId": 88, + "storeId": 9, + "rating": 2, + "comment": "Great product! Worth every penny." + }, + { + "productId": 29, + "customerId": 54, + "storeId": 9, + "rating": 3, + "comment": "The quality exceeded my expectations." + }, + { + "productId": 29, + "customerId": 13, + "storeId": 9, + "rating": 4, + "comment": "Would definitely recommend to others." + }, + { + "productId": 29, + "customerId": 60, + "storeId": 9, + "rating": 1, + "comment": "Not as expected. The performance is subpar." + }, + { + "productId": 39, + "customerId": 9, + "storeId": 9, + "rating": 4, + "comment": "Satisfactory, but I was hoping for better features." + }, + { + "productId": 39, + "customerId": 85, + "storeId": 9, + "rating": 5, + "comment": "Great value for money!" + }, + { + "productId": 39, + "customerId": 35, + "storeId": 9, + "rating": 5, + "comment": "Highly recommend it. Best purchase ever!" + }, + { + "productId": 39, + "customerId": 72, + "storeId": 9, + "rating": 3, + "comment": "The laptop is great for gaming." + }, + { + "productId": 39, + "customerId": 22, + "storeId": 9, + "rating": 4, + "comment": "It\u2019s okay, but there are better options out there." + }, + { + "productId": 49, + "customerId": 16, + "storeId": 9, + "rating": 5, + "comment": "Amazing laptop! Very fast and lightweight." + }, + { + "productId": 49, + "customerId": 34, + "storeId": 9, + "rating": 2, + "comment": "Great product! Worth every penny." + }, + { + "productId": 49, + "customerId": 49, + "storeId": 9, + "rating": 3, + "comment": "The quality exceeded my expectations." + }, + { + "productId": 49, + "customerId": 28, + "storeId": 9, + "rating": 4, + "comment": "Would definitely recommend to others." + }, + { + "productId": 49, + "customerId": 42, + "storeId": 9, + "rating": 1, + "comment": "Not as expected. The performance is subpar." + }, + { + "productId": 10, + "customerId": 7, + "storeId": 10, + "rating": 5, + "comment": "Amazing laptop! Very fast and lightweight." + }, + { + "productId": 10, + "customerId": 88, + "storeId": 10, + "rating": 2, + "comment": "Great product! Worth every penny." + }, + { + "productId": 10, + "customerId": 54, + "storeId": 10, + "rating": 3, + "comment": "The quality exceeded my expectations." + }, + { + "productId": 10, + "customerId": 13, + "storeId": 10, + "rating": 4, + "comment": "Would definitely recommend to others." + }, + { + "productId": 10, + "customerId": 60, + "storeId": 10, + "rating": 1, + "comment": "Not as expected. The performance is subpar." + }, + { + "productId": 20, + "customerId": 38, + "storeId": 10, + "rating": 5, + "comment": "Satisfactory, but I was hoping for better features." + }, + { + "productId": 20, + "customerId": 99, + "storeId": 10, + "rating": 4, + "comment": "Great value for money!" + }, + { + "productId": 20, + "customerId": 10, + "storeId": 10, + "rating": 5, + "comment": "Highly recommend it. Best purchase ever!" + }, + { + "productId": 20, + "customerId": 66, + "storeId": 10, + "rating": 3, + "comment": "The laptop is great for gaming." + }, + { + "productId": 20, + "customerId": 53, + "storeId": 10, + "rating": 4, + "comment": "It\u2019s okay, but there are better options out there." + }, + { + "productId": 30, + "customerId": 7, + "storeId": 10, + "rating": 5, + "comment": "Amazing laptop! Very fast and lightweight." + }, + { + "productId": 30, + "customerId": 88, + "storeId": 10, + "rating": 2, + "comment": "Great product! Worth every penny." + }, + { + "productId": 30, + "customerId": 54, + "storeId": 10, + "rating": 3, + "comment": "The quality exceeded my expectations." + }, + { + "productId": 30, + "customerId": 13, + "storeId": 10, + "rating": 4, + "comment": "Would definitely recommend to others." + }, + { + "productId": 30, + "customerId": 60, + "storeId": 10, + "rating": 1, + "comment": "Not as expected. The performance is subpar." + }, + { + "productId": 40, + "customerId": 9, + "storeId": 10, + "rating": 4, + "comment": "Satisfactory, but I was hoping for better features." + }, + { + "productId": 40, + "customerId": 85, + "storeId": 10, + "rating": 5, + "comment": "Great value for money!" + }, + { + "productId": 40, + "customerId": 35, + "storeId": 10, + "rating": 5, + "comment": "Highly recommend it. Best purchase ever!" + }, + { + "productId": 40, + "customerId": 72, + "storeId": 10, + "rating": 3, + "comment": "The laptop is great for gaming." + }, + { + "productId": 40, + "customerId": 22, + "storeId": 10, + "rating": 4, + "comment": "It\u2019s okay, but there are better options out there." + }, + { + "productId": 50, + "customerId": 16, + "storeId": 10, + "rating": 5, + "comment": "Amazing laptop! Very fast and lightweight." + }, + { + "productId": 50, + "customerId": 34, + "storeId": 10, + "rating": 2, + "comment": "Great product! Worth every penny." + }, + { + "productId": 50, + "customerId": 49, + "storeId": 10, + "rating": 3, + "comment": "The quality exceeded my expectations." + }, + { + "productId": 50, + "customerId": 28, + "storeId": 10, + "rating": 4, + "comment": "Would definitely recommend to others." + }, + { + "productId": 50, + "customerId": 42, + "storeId": 10, + "rating": 1, + "comment": "Not as expected. The performance is subpar." + } +] diff --git a/settings.gradle b/settings.gradle index 6b10282..312b3de 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,4 +1,6 @@ rootProject.name = 'java-developer-course' include 'PetCareScheduler' include 'Portfolio' -include 'OnlineQuiz' \ No newline at end of file +include 'OnlineQuiz' +include 'RetailManagementSystem:back-end' +include 'RetailManagementSystem:front-end' \ No newline at end of file