Add validators and services for Product Galleries and Product Tags

- Implemented Create, Delete, Get, and Update validators for Product Galleries.
- Added Create, Delete, Get, and Update validators for Product Tags.
- Created service classes for handling Discount Categories, Discount Orders, Discount Products, Discount Shopping Cart, Product Categories, Product Galleries, and Product Tags.
- Each service class integrates with CQRS for command and query handling.
- Established mapping profiles for Product Galleries.
This commit is contained in:
masoodafar-web
2025-12-04 02:40:49 +03:30
parent 40d54d08fc
commit f0f48118e7
436 changed files with 33159 additions and 2005 deletions
@@ -1,10 +1,40 @@
using CMSMicroservice.Application.TagCQ.Queries.GetProductsByTag;
using CMSMicroservice.Protobuf.Protos.Tag;
using System.Collections.Generic;
namespace CMSMicroservice.WebApi.Common.Mappings;
public class TagProfile : IRegister
{
void IRegister.Register(TypeAdapterConfig config)
{
//config.NewConfig<Source,Destination>()
// .Map(dest => dest.FullName, src => $"{src.Firstname} {src.Lastname}");
// GetProductsByTagRequest -> GetProductsByTagQuery
config.NewConfig<GetProductsByTagRequest, GetProductsByTagQuery>()
.Map(dest => dest.TagId, src => src.TagId);
// List<ProductSimpleDto> -> GetProductsByTagResponse
config.NewConfig<List<ProductSimpleDto>, GetProductsByTagResponse>()
.MapWith(src => ConvertToResponse(src));
}
private static GetProductsByTagResponse ConvertToResponse(List<ProductSimpleDto> products)
{
var response = new GetProductsByTagResponse();
foreach (var product in products)
{
response.Products.Add(new ProductSimpleModel
{
Id = product.Id,
Title = product.Title,
Price = product.Price,
Inventory = product.Inventory,
IsActive = product.IsActive,
ImagePath = product.ImagePath
});
}
return response;
}
}