Package com.mt.ecommerce.product.service
Class OrderService
java.lang.Object
com.mt.ecommerce.product.service.OrderService
Service class for managing orders.
Provides methods for adding, editing, and retrieving orders.
-
Constructor Summary
ConstructorsConstructorDescriptionOrderService
(OrderRepository orderRepository, ProductRepository productRepository, OrderProductRepository orderProductRepository, PaymentService paymentService) -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a new order.void
editOrderStatus
(UUID uuid, OrderStatus status) Edits the status of an existing order.getAllOrder
(UUID vendorId, int pageNo, int size) Retrieves all orders for a specific vendor with pagination.getAllOrderByUserId
(String userId, int pageNo, int size) Retrieves all orders for a specific user with pagination.
-
Constructor Details
-
OrderService
public OrderService(OrderRepository orderRepository, ProductRepository productRepository, OrderProductRepository orderProductRepository, PaymentService paymentService)
-
-
Method Details
-
addOrder
Adds a new order.- Parameters:
orderBO
- the order information to addvendorId
- the ID of the vendor associated with the orderuserId
- the ID of the user placing the order
-
editOrderStatus
Edits the status of an existing order.- Parameters:
uuid
- the ID of the order to editstatus
- the new status for the order
-
getAllOrder
Retrieves all orders for a specific vendor with pagination.- Parameters:
vendorId
- the ID of the vendor whose orders are to be retrievedpageNo
- the page number for paginationsize
- the number of records per page- Returns:
- a list of OrderBO objects representing the vendor's orders
-
getAllOrderByUserId
Retrieves all orders for a specific user with pagination.- Parameters:
userId
- the ID of the user whose orders are to be retrievedpageNo
- the page number for paginationsize
- the number of records per page- Returns:
- a list of OrderBO objects representing the user's orders
-