feat: Implement User Package Status and User Order Management features

- Added GetUserPackageStatus functionality with mapping and service implementation.
- Introduced UserOrder service methods for updating order status, applying discounts, and calculating order PV.
- Created Protobuf definitions for public messages and user orders, including necessary request and response messages.
- Implemented mapping profiles for package and user order related queries and commands.
- Developed query handlers and validators for new commands and queries in the application layer.
- Established PublicMessage service for handling public messages with appropriate gRPC endpoints.
This commit is contained in:
masoodafar-web
2025-12-04 03:43:28 +03:30
parent 256b41fcb5
commit 4b6f8187e5
34 changed files with 884 additions and 18 deletions

View File

@@ -25,7 +25,7 @@ public class CreateDiscountCategoryCommandHandler : IRequestHandler<CreateDiscou
};
if (request.ParentCategoryId.HasValue)
createRequest.ParentCategoryId = new Int64Value { Value = request.ParentCategoryId.Value };
createRequest.ParentCategoryId = request.ParentCategoryId.Value ;
// Upload Image
if (request.ImageFile != null && request.ImageFile.File != null && request.ImageFile.File.Length > 0)

View File

@@ -26,7 +26,7 @@ public class UpdateDiscountCategoryCommandHandler : IRequestHandler<UpdateDiscou
};
if (request.ParentCategoryId.HasValue)
updateRequest.ParentCategoryId = new Int64Value { Value = request.ParentCategoryId.Value };
updateRequest.ParentCategoryId =request.ParentCategoryId.Value ;
// Upload new Image if provided
if (request.ImageFile != null && request.ImageFile.File != null && request.ImageFile.File.Length > 0)

View File

@@ -17,10 +17,10 @@ public class GetDiscountCategoriesQueryHandler : IRequestHandler<GetDiscountCate
var grpcRequest = new GetDiscountCategoriesRequest();
if (request.ParentCategoryId.HasValue)
grpcRequest.ParentCategoryId = new Int64Value { Value = request.ParentCategoryId.Value };
grpcRequest.ParentCategoryId = request.ParentCategoryId.Value ;
if (request.IsActive.HasValue)
grpcRequest.IsActive = new BoolValue { Value = request.IsActive.Value };
grpcRequest.IsActive = request.IsActive.Value ;
var response = await _context.DiscountCategories.GetDiscountCategoriesAsync(grpcRequest, cancellationToken: cancellationToken);
@@ -37,9 +37,9 @@ public class GetDiscountCategoriesQueryHandler : IRequestHandler<GetDiscountCate
Id = node.Id,
Name = node.Name,
Title = node.Title,
Description = node.HasDescription ? node.Description.Value : string.Empty,
ImagePath = node.HasImagePath ? node.ImagePath.Value : string.Empty,
ParentCategoryId = node.HasParentCategoryId ? node.ParentCategoryId.Value : null,
Description = string.IsNullOrWhiteSpace(node.Description) ? node.Description : string.Empty,
ImagePath =string.IsNullOrWhiteSpace(node.ImagePath)? node.ImagePath : string.Empty,
ParentCategoryId = node.ParentCategoryId!=null? node.ParentCategoryId.Value : null,
SortOrder = node.SortOrder,
IsActive = node.IsActive,
ProductCount = node.ProductCount,