Add RetailManagementSystem app

This commit is contained in:
2025-11-02 19:25:39 +01:00
parent aae358b2be
commit 8577d69eb1
44 changed files with 6386 additions and 1 deletions

View File

@@ -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.

View File

@@ -0,0 +1 @@
# coding-project-template

View File

@@ -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'
}

View File

@@ -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);
}
}

View File

@@ -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<String, Object>` 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."`.
}

View File

@@ -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 doesnt 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`.
}

View File

@@ -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<String, Object>` 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<String, Object>` 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<String, Object>` 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<String, Object>` 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<String, Object>` with key `products`.
}

View File

@@ -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<String, Object>` with key `reviews`.
}

View File

@@ -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<String, String>` 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.
}

View File

@@ -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;
}
}

View File

@@ -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.
}

View File

@@ -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)
}

View File

@@ -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<OrderItem>
// - 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).
}

View File

@@ -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).
}

View File

@@ -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<PurchaseProductDTO> 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<PurchaseProductDTO> getPurchaseProduct() {
return purchaseProduct;
}
public void setPurchaseProduct(List<PurchaseProductDTO> purchaseProduct) {
this.purchaseProduct = purchaseProduct;
}
public Double getTotalPrice() {
return totalPrice;
}
public void setTotalPrice(Double totalPrice) {
this.totalPrice = totalPrice;
}
}

View File

@@ -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).
}

View File

@@ -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;
}
}

View File

@@ -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).
}

View File

@@ -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).
}

View File

@@ -0,0 +1,39 @@
package com.project.code.Repo;
public interface CustomerRepository {
// 1. Add the repository interface:
// - Extend JpaRepository<Customer, Long> 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<Customer, Long> {}
// 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<Customer> 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.
}

View File

@@ -0,0 +1,34 @@
package com.project.code.Repo;
public interface InventoryRepository {
// 1. Add the repository interface:
// - Extend JpaRepository<Inventory, Long> 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<Inventory, Long> {}
// 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<Inventory>
// - Parameter: Long storeId
// Example: public List<Inventory> 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.
}

View File

@@ -0,0 +1,14 @@
package com.project.code.Repo;
public interface OrderDetailsRepository {
// 1. Add the repository interface:
// - Extend JpaRepository<OrderDetails, Long> 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<OrderDetails, Long> {}
// 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.
}

View File

@@ -0,0 +1,16 @@
package com.project.code.Repo;
public interface OrderItemRepository {
// 1. Add the repository interface:
// - Extend JpaRepository<OrderItem, Long> 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<OrderItem, Long> {}
// 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.
}

View File

@@ -0,0 +1,53 @@
package com.project.code.Repo;
public interface ProductRepository {
// 1. Add the repository interface:
// - Extend JpaRepository<Product, Long> 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<Product, Long> {}
// 2. Add custom query methods:
// - **findAll**:
// - This method will retrieve all products.
// - Return type: List<Product>
// Example: public List<Product> findAll();
// - **findByCategory**:
// - This method will retrieve products by their category.
// - Return type: List<Product>
// - Parameter: String category
// Example: public List<Product> findByCategory(String category);
// - **findByPriceBetween**:
// - This method will retrieve products within a price range.
// - Return type: List<Product>
// - Parameters: Double minPrice, Double maxPrice
// Example: public List<Product> 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<Product>
// - Parameters: Long storeId, String pname
// - Use @Query annotation to write a custom query.
}

View File

@@ -0,0 +1,18 @@
package com.project.code.Repo;
public interface ReviewRepository {
// 1. Add the repository interface:
// - Extend MongoRepository<Review, String> 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<Review, String> {}
// 2. Add custom query methods:
// - **findByStoreIdAndProductId**:
// - This method will retrieve reviews for a specific product and store.
// - Return type: List<Review>
// - Parameters: Long storeId, Long productId
// Example: public List<Review> findByStoreIdAndProductId(Long storeId, Long productId);
}

View File

@@ -0,0 +1,26 @@
package com.project.code.Repo;
public interface StoreRepository {
// 1. Add the repository interface:
// - Extend JpaRepository<Store, Long> 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<Store, Long> {}
// 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<Store>
// - Parameter: String pname
// - Use @Query annotation to write a custom query.
}

View File

@@ -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()`.
}

View File

@@ -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)
}

View File

@@ -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
}
}

View File

@@ -0,0 +1,2 @@
spring.application.name=code

View File

@@ -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() {
}
}

View File

@@ -0,0 +1,87 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>IMS: Manage Inventory
</title>
<!-- Latest compiled and minified CSS -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">
<!-- Latest compiled JavaScript -->
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
<link rel="stylesheet" href="frontend.css">
<link rel="shortcut icon" href="images/Logo.png" type="image/x-icon">
<script src="script.js"></script>
</head>
<body>
<nav class="navbar navbar-expand-sm bg-dark navbar-dark">
<div id="navitem">
<a class="navbar-brand" href="#">
<img src="images/Logo.png" alt="Avatar Logo" class="rounded-pill">
</a>
<div id="head">
<h1 style="color: white;">Add Product </h1>
</div>
</div>
</nav>
<div id="form" style="display: flex;">
<form id="myform" onsubmit="addParentProduct(event)">
<label for="parentproductName"> Product Name</label>
<input type="text" name="parentproductName" id="parentproductName" placeholder=" Product Name"
required>
<div id="aStoreSuggestion" style="margin-bottom: 10px;">
</div>
<label for="parentcategory">Select Category</label>
<select name="parentcategory" class="category" id="parentcategory" required>
<option value="" selected>Select category</option>
<option value="Mobile">Mobile </option>
<option value="TV and AV">TV and AV</option>
<option value="Home Appliances">Home Appliances</option>
<option value="Laptops and Monitors">Laptops and Monitors</option>
<option value="Accessories">Accessories</option>
</select>
<label for="pparentroductPrice"> Product's Price</label>
<input type="text" name="parentproductPrice" id="parentproductPrice" placeholder=" price in $"
required>
<label for="SKU"> Product's SKU</label>
<input type="text" name="parentSKU" id="parentSKU" placeholder=" SKU" required>
<input type="submit" value="Add product">
</form>
</div>
<script>
window.onload = () => {
const url = window.location.href;
const params = new URLSearchParams(window.location.search);
let storeId = params.get('storeId');
let storeField = document.getElementById('astoreId');
storeField.value = storeId;
}
</script>
</body>
</html>

View File

@@ -0,0 +1,97 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>IMS: Manage Inventory
</title>
<!-- Latest compiled and minified CSS -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">
<!-- Latest compiled JavaScript -->
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
<link rel="stylesheet" href="frontend.css">
<link rel="shortcut icon" href="images/Logo.png" type="image/x-icon">
<script src="script.js"></script>
</head>
<body>
<nav class="navbar navbar-expand-sm bg-dark navbar-dark">
<div id="navitem">
<a class="navbar-brand" href="#">
<img src="images/Logo.png" alt="Avatar Logo" class="rounded-pill">
</a>
<div id="head">
<h1 style="color: white;">Add Product </h1>
</div>
</div>
</nav>
<div id="form" style="display: flex;">
<form id="myform" onsubmit="addProductToInventory(event)">
<label for="astoreId"> Store Id</label>
<input type="text" name="astoreId" id="astoreId" required disabled>
<label for="productName"> Product Name</label>
<input type="text" name="productName" id="productName" placeholder=" Product Name" required
onkeyup="fillProductName()">
<div id="aStoreSuggestion" style="margin-bottom: 10px;">
</div>
<label for="productId"> Product Id</label>
<input type="text" name="productId" id="productId" placeholder=" Product Id" required disabled>
<label for="category">Select Category</label>
<select name="category" class="category" id="category" required disabled>
<option value="" selected disabled>Select category</option>
<option value="Mobile">Mobile </option>
<option value="TV and AV">TV and AV</option>
<option value="Home Appliances">Home Appliances</option>
<option value="Laptops and Monitors">Laptops and Monitors</option>
<option value="Accessories">Accessories</option>
</select>
<label for="productPrice"> Product's Price</label disabled>
<input type="text" name="productPrice" id="productPrice" placeholder=" price in $" required disabled>
<label for="SKU"> Product's SKU</label>
<input type="text" name="SKU" id="SKU" placeholder=" SKU" required disabled>
<label for="astockLevel"> Product's Stock Level</label>
<input type="text" name="astockLevel" id="astockLevel" placeholder=" Stock Level">
<input type="submit" value="Add product">
</form>
</div>
<script>
window.onload = () => {
const url = window.location.href;
const params = new URLSearchParams(window.location.search);
let storeId = params.get('storeId');
let storeField = document.getElementById('astoreId');
storeField.value = storeId;
}
</script>
</body>
</html>

View File

@@ -0,0 +1 @@
apply plugin: 'base'

View File

@@ -0,0 +1,113 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>IMS: Manage Inventory
</title>
<!-- Latest compiled and minified CSS -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">
<!-- Latest compiled JavaScript -->
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
<link rel="stylesheet" href="frontend.css">
<link rel="shortcut icon" href="images/Logo.png" type="image/x-icon">
<script src="script.js"></script>
</head>
<body>
<nav class="navbar navbar-expand-sm bg-dark navbar-dark">
<div id="navitem">
<a class="navbar-brand" href="#">
<img src="images/Logo.png" alt="Avatar Logo" class="rounded-pill">
</a>
<div id="head">
<h1 style="color: white;">Edit Product</h1>
</div>
</div>
</nav>
<div id="form" style="display: flex;">
<form id="myform" onsubmit="updateParentProduct(event)">
<div>
<label for="pproductId"> Product Id:</label>
<input type="number" name="pproductId" id="pproductId" placeholder=" Product Id" disabled>
</div>
<div>
<label for="pproductName"> Product Name:</label>
<input type="text" name="pproductName" id="pproductName" placeholder=" Product Name" required>
</div>
<div>
<label for="pcategory">Select Category:</label>
<select name="pcategory" class="category" id="pcategory" required>
<option value="" selected disabled>Select category</option>
<option value="Mobile">Mobile </option>
<option value="TV and AV">TV and AV</option>
<option value="Home Appliances">Home Appliances</option>
<option value="Laptops and Monitors">Laptops and Monitors</option>
<option value="Accessories">Accessories</option>
</select>
</div>
<div>
<label for="pproductPrice"> Price:</label>
<input type="text" name="pproductPrice" id="pproductPrice" placeholder=" price in $" required>
</div>
<div>
<label for="pSKU"> SKU:</label>
<input type="text" name="pSKU" id="pSKU" placeholder=" SKU">
</div>
<div>
<input type="submit" value="Update product">
</div>
</form>
</div>
<script>
window.onload = () => {
const url = window.location.href;
const params = new URLSearchParams(window.location.search);
const productId = params.get('productId');
document.getElementById('pproductId').value = productId;
setTimeout(() => {
getProductByid(productId);
}, 100);
}
</script>
</body>
</html>

View File

@@ -0,0 +1,122 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>IMS: Manage Inventory
</title>
<!-- Latest compiled and minified CSS -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">
<!-- Latest compiled JavaScript -->
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
<link rel="stylesheet" href="frontend.css">
<link rel="shortcut icon" href="images/Logo.png" type="image/x-icon">
<script src="script.js"></script>
</head>
<body>
<nav class="navbar navbar-expand-sm bg-dark navbar-dark">
<div id="navitem">
<a class="navbar-brand" href="#">
<img src="images/Logo.png" alt="Avatar Logo" class="rounded-pill">
</a>
<div id="head">
<h1 style="color: white;">Edit Product</h1>
</div>
</div>
</nav>
<div id="form" style="display: flex;">
<form id="myform" onsubmit="updateProduct(event)">
<div>
<label for="ustoreId"> Store Id:</label>
<input type="text" name="ustoreId" id="ustoreId" placeholder=" Store ID" required readonly
disabled>
</div>
<div>
<label for="uproductId"> Product Id:</label>
<input type="number" name="productId" id="uproductId" placeholder=" Product Id" readonly disabled>
</div>
<div>
<label for="uproductName"> Product Name:</label>
<input type="text" name="productName" id="uproductName" placeholder=" Product Name" required
disabled>
</div>
<div>
<label for="ucategory">Select Category:</label>
<select name="category" class="category" id="ucategory" required disabled>
<option value="" selected disabled>Select category</option>
<option value="Mobile">Mobile </option>
<option value="TV and AV">TV and AV</option>
<option value="Home Appliances">Home Appliances</option>
<option value="Laptops and Monitors">Laptops and Monitors</option>
<option value="Accessories">Accessories</option>
</select>
</div>
<div>
<label for="uproductPrice"> Price:</label>
<input type="text" name="productPrice" id="uproductPrice" placeholder=" price in $" required
disabled>
</div>
<div>
<label for="uSKU"> SKU:</label>
<input type="text" name="SKU" id="uSKU" placeholder=" SKU" disabled>
</div>
<div>
<label for="ustockLevel"> Stock Level:</label>
<input type="text" name="stockLevel" id="ustockLevel" placeholder=" Stock Level">
</div>
<div>
<input type="submit" value="Update product">
</div>
</form>
</div>
<script>
window.onload = () => {
const url = window.location.href;
const params = new URLSearchParams(window.location.search);
const productId = params.get('productId');
let storeId = params.get('storeId');
let stockLevel = params.get('stockLevel');
let stockField = document.getElementById('ustockLevel')
let storeField = document.getElementById('ustoreId');
stockField.value = stockLevel;
storeField.value = storeId;
setInterval(viewProductByid(productId), 1000);
}
</script>
</body>
</html>

View File

@@ -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
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 258 KiB

View File

@@ -0,0 +1,413 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>IMS: Manage Inventory
</title>
<!-- Latest compiled and minified CSS -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">
<!-- Latest compiled JavaScript -->
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
<link rel="stylesheet" href="frontend.css">
<link rel="shortcut icon" href="images/Logo.png" type="image/x-icon">
<script src="script.js"></script>
</head>
<body>
<nav class="navbar navbar-expand-sm bg-dark navbar-dark">
<div id="navitem">
<a class="navbar-brand" href="#">
<img src="images/Logo.png" alt="Avatar Logo" class="rounded-pill">
</a>
<div id="head">
<h1 style="color: white;">Manage Inventory </h1>
</div>
</div>
</nav>
<div id="navbelow">
<ul class="nav nav-pills">
<li class="nav-item">
<a class="nav-link active" id="navBar1" data-bs-toggle="pill" href="#AddStore" onclick="location=`frontend.html`">Add Store</a>
</li>
<li class="nav-item">
<a class="nav-link" id="navBar2" data-bs-toggle="pill" href="#ManageProducts">Manage Products</a>
</li>
<li class="nav-item">
<a class="nav-link" id="navBar3" data-bs-toggle="pill" href="#ManageInventory">Manage Inventory </a>
</li>
<li class="nav-item">
<a class="nav-link" id="navBar4" data-bs-toggle="pill" href="#PlaceOrder">Place Order</a>
</li>
</ul>
</div>
<div class="tab-content">
<div class="tab-pane container fade" id="ManageInventory">
<div>
<div id="form">
<div style="display: flex; justify-content: center;">
<form id="myform" onsubmit="viewProduct(event)"
style="display: flex; justify-content: center; align-items: center;">
<label for="storeId">Store Id: </label>
<input type="number" name="storeId" id="vstoreId" placeholder="Store Id" required>
<input type="submit" id="ViewProductButton" value="View products">
</form>
</div>
<div class="row" style="display: flex;">
<div class="col">
<select name="category" class="category" id="category" required onchange="filter()"
disabled>
<option value="Allcategory" selected>All category</option>
<option value="Mobile">Mobile </option>
<option value="TV and AV">TV and AV</option>
<option value="Home Appliances">Home Appliances</option>
<option value="Laptops and Monitors">Laptops and Monitors</option>
<option value="Accessories">Accessories</option>
</select>
</div>
<div class="col" style="display: flex;">
<input type="text" name="searchBar" id="searchBar" placeholder="Type Here" disabled>
<input type="submit" id="SearchButton" value="Search" onclick="filter()" disabled>
</div>
<div class="col">
<input type="submit" id="AddProducts" value="Add Product" onclick="redirectToAddPrdouct()"
style="background-color: rgb(125, 231, 125);color: black;">
</div>
</div>
</div>
</div>
<div class="tablediv container-fluid">
<table class="table table-hover styled-table">
<thead>
<tr>
<th scope="col">ProductId</th>
<th scope="col">Product Name</th>
<th scope="col">Category</th>
<th scope="col">Price</th>
<th scope="col">SKU</th>
<th scope="col">Stock Level</th>
<th scope="col">Reviews</th>
<th scope="col">Edit</th>
<th scope="col">Delete</th>
</tr>
</thead>
<tbody id="tableBody">
</tbody>
</table>
</div>
</div>
<div class="tab-pane container fade" id="ManageProducts">
<div id="form" style="margin-top: 50px; margin-bottom: 50px;">
<div class="row" id="all-product-list" style="display: flex;">
<div class="col">
<input type="submit" id="AddParentProduct" value="Add Product"
onclick="RedirectToAddParentProduct()"
style="background-color: rgb(125, 231, 125);color: black;">
</div>
<div class="col">
<input type="text" name="searchBar" id="ProductsearchBar" placeholder="Type Here">
<input type="submit" id="ProductSearchButton" value="Search" onclick="filterParentProduct()">
</div>
<div class="col">
<select name="category" class="pcategory" id="pcategory" required
onchange="filterParentProduct()">
<option value="Allcategory" selected>All category</option>
<option value="Mobile">Mobile </option>
<option value="TV and AV">TV and AV</option>
<option value="Home Appliances">Home Appliances</option>
<option value="Laptops and Monitors">Laptops and Monitors</option>
<option value="Accessories">Accessories</option>
</select>
</div>
</div>
</div>
<div class="tablediv container-fluid">
<table class="table table-hover styled-table">
<thead>
<tr>
<th scope="col">ProductId</th>
<th scope="col">Product Name</th>
<th scope="col">Category</th>
<th scope="col">Price</th>
<th scope="col">SKU</th>
<th scope="col">Edit</th>
<th scope="col">Delete</th>
</tr>
</thead>
<tbody id="allProducts">
</tbody>
</table>
<div id="paginationControls">
</div><br>
</div>
</div>
<div class="tab-pane container active" id="AddStore">
<div>
<div id="form">
<form id="myform" class="addStoreForm" onsubmit="addStore(event)">
<label for="storeName"> Name:</label>
<input type="text" id="storeName" name="storeName" placeholder=" Store Name" required>
<label for="storeAddress1"> Address Line 1:</label>
<input type="text" id="storeAddress1" name="storeAddress1" placeholder=" Address Line1"
maxlength="26" required>
<label for="storeAddress2"> Address Line 2</label>
<input type="text" id="storeAddress2" name="storeAddress2" placeholder=" Address Line2"
maxlength="26">
<label for="storeAddress3"> Address Line 3</label>
<input type="text" id="storeAddress3" name="storeAddress3" placeholder=" Address Line3"
maxlength="26">
<input type="submit" value="Add Store">
</form>
</div>
</div>
</div>
<div class="tab-pane container fade" id="PlaceOrder">
<div id="Orderform" class="container">
<form id="myform" onsubmit="validateStoreId(event)"
style="display:flex;align-items: center; justify-content: center; margin-bottom: 50px;">
<label for="orderStoreId"> Store Id:</label>
<input type="number" name="orderStoreId" id="orderStoreId" placeholder=" Store Id" required>
<input type="submit" id="ViewProductButton" value="Validate">
</form>
<form onsubmit="placeOrder(event)">
<div id="displayForm" style="display: none;">
<div id="CustomerForm">
<h2>Customer Details</h2>
<div id="CustomerDetails">
<div class="row">
<div class="col">
<label for="customerName"> Name:</label>
<input type="text" name="customerName" id="customerName" placeholder=" Name"
required>
</div>
<div class="col">
<label for="customerEmail"> Email:</label>
<input type="email" name="customerEmail" id="customerEmail" placeholder=" Email"
required>
</div>
</div>
<div class="row">
<div class="col">
<label for="customerPhone"> Mobile No:</label>
<input type="tel" name="customerPhone" id="customerPhone"
placeholder=" Mobile No" required>
</div>
<div class="col">
<label for="datetime">Date and Time:</label>
<input type="datetime-local" name="datetime" id="datetime"
placeholder=" Date and time" required disabled>
</div>
</div>
</div>
<div style="display: flex; justify-content: left; margin-top: 20px;">
<h2>Order Details</h2>
</div>
<div id="OrderList">
<table id="productTable">
<thead>
<tr>
<th>Serial No</th>
<th>Product Name</th>
<th>Product ID</th>
<th>Price</th>
<th>Quantity</th>
<th>Total Price</th>
<th>Remove</th>
</tr>
</thead>
<tbody id="OrderListBody">
<tr id="1">
<td><input type="text" value="1" class="input-cell SerialNo" disabled>
</td>
<td><input type="text" class="input-cell" id="orderProductName1"
placeholder=" Product Name" onkeyup="fillProductId(1)" required>
<div id="OrderSuggestion1">
</div>
</td>
<td><input type="text" class="input-cell" id="orderProductId1"
placeholder=" ProductId" disabled required></td>
<td><input type="text" class="input-cell" id="orderProductPrice1"
placeholder=" Product price" disabled required></td>
<td><input type="text" class="input-cell" id="orderProductQuantity1"
placeholder=" Quantity" required
onkeyup="calculatePrice(1),validateQuantity(1)"></td>
<td><input type="text" class="input-cell" id="orderTotal1"
placeholder=" Total Here" disabled required></td>
<td><button type="button" class="remove-btn"
onclick="deleteDiv(1)">Remove</button></td>
</tr>
</tbody>
</table>
<div id="AddBtn">
<button type="button" onclick="createMoreOrderField()">Add Field</button>
</div>
</div>
<div id="totalOrderValuediv">
<label for="OrderValue">Total Price</label>
<input type="number" name="totalOrderValue" id="totalOrderValue"
placeholder="Total Price" required disabled>
</div>
</div>
<div id="submitButton" style="display: none; ">
<input type="submit" value="Place Order">
</div>
</form>
</div>
</div>
</div>
<div id="modal">
<div class="modal" id="myModal">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">Alert</h4>
<button type="button" class="btn-close" data-bs-dismiss="modal"></button>
</div>
<!-- Modal body -->
<div class="modal-body">
<span>Are you sure you want to delete</span>
<span id="deleteProuctName" style="display: inline-block;"></span>
<span> from database permanently</span>
</div>
<!-- Modal footer -->
<div class="modal-footer" id="modal-footer">
</div>
</div>
</div>
</div>
</div>
<script>
window.onload = () => {
const url = window.location.href;
const params = new URLSearchParams(window.location.search);
const navbar = params.get('id');
const storeId = params.get('storeid');
if (storeId)
{
document.getElementById('vstoreId').value=storeId;
document.getElementById('ViewProductButton').click();
}
if (navbar) {
let navbar1 = document.getElementById('navBar1');
let navbarText = document.getElementById('AddStore');
navbar1.classList.remove('active');
navbarText.classList.remove('active');
navbarText.classList.add('fade');
let currentNavbar = document.getElementById(navbar);
currentNavbar.classList.add('active');
let hrefValue = currentNavbar.getAttribute("href");
let activeContent = document.querySelector(hrefValue);
activeContent.classList.remove('fade');
activeContent.classList.add('active');
}
viewProductList();
}
function RedirectToAddParentProduct() {
location.href = `add-parent-product.html`;
}
function redirectToAddPrdouct() {
let storeId = document.getElementById('vstoreId').value;
if (storeId) {
location.href = `add-product.html?storeId=${storeId}`
}
else {
alert("Enter store id first");
}
}
</script>
</body>
</html>

View File

@@ -0,0 +1,181 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Reviews
</title>
<!-- Latest compiled and minified CSS -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">
<!-- Latest compiled JavaScript -->
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.6.0/css/all.min.css"
integrity="sha512-Kc323vGBEqzTmouAECnVceyQqyqdsSiqLQISBL29aUW4U/M7pSPA/gEUZQqv1cwx4OnYxTxve5UMg5GT6L4JJg=="
crossorigin="anonymous" referrerpolicy="no-referrer" />
<link rel="stylesheet" href="frontend.css">
<link rel="shortcut icon" href="images/Logo.png" type="image/x-icon">
</head>
<style>
#backButton {
background-color: rgb(209, 213, 219);
border-radius: 10px;
font-size: large;
}
</style>
<body>
<nav class="navbar navbar-expand-sm bg-dark navbar-dark">
<div id="navitem">
<a class="navbar-brand" href="#">
<img src="images/Logo.png" alt="Avatar Logo" class="rounded-pill">
</a>
<div id="head">
<h1 style="color: white;">Customer Reviews </h1>
</div>
<div id="back-button">
</div>
</div>
</nav>
<div id="product-details">
<label for="product-id">Product Id: </label>
<input type="text" name="product-id" id="product-id" placeholder="Product Id:" disabled>
<label for="product-name">Product Name: </label>
<input type="text" name="product-name" id="product-name" placeholder="Product Name" disabled>
</div>
<hr class="container">
<div id="reviews" class="container">
<div class="row">
<div class="col">
</div>
<div class="col">
</div>
<div class="col">
</div>
</div>
</div>
<script>
window.onload = () => {
const url = window.location.href;
const params = new URLSearchParams(window.location.search);
let storeId = params.get('storeId');
let productName = params.get('productName');
let productId = params.get('productId');
let backDiv=document.getElementById('back-button');
backDiv.innerHTML=`<button id="backButton" type="button" value="${storeId}" onclick="goBackToInventory()">Go Back</button>`;
document.getElementById('product-id').value = productId;
document.getElementById('product-name').value = productName;
setTimeout(() => {
getReviews(storeId, productId);
}, 500);
}
function getReviews(storeId, productId) {
url = `URL/reviews/${storeId}/${productId}`;
fetch(url, {
method: "GET",
headers: { "content-type": "application/json" }
})
.then(response => {
return response.json();
})
.then(data => {
createReview(data.reviews)
})
.catch(error => {
alert(error);
})
}
function createReview(reviews) {
try {
let allColumns = document.querySelectorAll('.col');
let count = 0;
for (review of reviews) {
reviewcard = document.createElement('div');
reviewcard.classList.add('review-card');
customerName = document.createElement('div');
customerName.classList.add("customer-name");
customerSpan = document.createElement('span')
customerSpan.textContent = review.customerName;
customerName.appendChild(customerSpan);
reviewDiv = document.createElement('div');
reviewDiv.classList.add('review');
rating = document.createElement('div');
rating.classList.add('rating');
let i = 0
let listStar = "";
for (; i < review.rating; i++) {
listStar = listStar + "" + `<i class="fa-solid fa-star golden"></i>`;
}
for (; i < 5; i++) {
listStar = listStar + "" + `<i class="fa-solid fa-star"></i>`;
}
rating.innerHTML = listStar;
reviewDiv.appendChild(rating);
customerReview = document.createElement('div');
customerReview.classList.add('customer-review')
customerReview.textContent = review.review;
reviewDiv.appendChild(customerReview);
reviewcard.appendChild(customerName);
reviewcard.appendChild(reviewDiv);
allColumns[`${count % 3}`].appendChild(reviewcard);
count++;
}
}
catch (error) {
console.log(error);
}
}
function goBackToInventory() {
button=document.getElementById('backButton');
storeId=button.value;
location.href = `index.html?id=navBar3&storeid=${storeId}`;
}
</script>
</body>
</html>

View File

@@ -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 = `<h1 style='color: white;'>${activeLink.textContent}</h1>`
head.innerHTML = html;
}
navLinks.forEach(link => {
link.addEventListener('click', function (event) {
let html = `<h1 style='color: white;'>${event.target.textContent}</h1>`
head.innerHTML = html;
});
});
});
function createMoreOrderField() {
Ordercount++;
OrderList = document.getElementById('OrderListBody');
tr = document.createElement('tr');
tr.setAttribute('id', `${Ordercount}`)
tr.innerHTML =
`
<td><input type="text" class="input-cell SerialNo" disabled>
</td>
<td><input type="text" class="input-cell" id="orderProductName${Ordercount}"
placeholder="Enter Product Name" onkeyup="fillProductId(${Ordercount})"
required>
<div id="OrderSuggestion${Ordercount}">
</div>
</td>
<td><input type="text" class="input-cell" id="orderProductId${Ordercount}"
placeholder="Enter ProductId" disabled required></td>
<td><input type="text" class="input-cell" id="orderProductPrice${Ordercount}"
placeholder=" Enter Product price" disabled required></td>
<td><input type="text" class="input-cell" id="orderProductQuantity${Ordercount}"
placeholder="Enter Quantity" required
onkeyup="calculatePrice(${Ordercount}),validateQuantity(${Ordercount})"></td>
<td><input type="text" class="input-cell" id="orderTotal${Ordercount}"
placeholder="Enter Total Here" disabled required></td>
<td><button type="button" class="remove-btn" onclick="deleteDiv(${Ordercount})">Remove</button></td>
`
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);
}
}

View File

@@ -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);

File diff suppressed because it is too large Load Diff

View File

@@ -1,4 +1,6 @@
rootProject.name = 'java-developer-course' rootProject.name = 'java-developer-course'
include 'PetCareScheduler' include 'PetCareScheduler'
include 'Portfolio' include 'Portfolio'
include 'OnlineQuiz' include 'OnlineQuiz'
include 'RetailManagementSystem:back-end'
include 'RetailManagementSystem:front-end'