73e1971cc3
- Added DiscountProductImage entity and related configurations for product image gallery. - Created commands and queries for managing product images. - Developed GetAllDiscountOrders API for admin order management with various filters. - Implemented VAT calculation service and integrated it into order processing. - Created Sales Reports API with support for daily, weekly, and monthly reports. - Completed gRPC services for BackOffice.BFF to expose new APIs. - Updated Proto files and project references accordingly.
4.5 KiB
4.5 KiB
📝 Changelog - ۲۳ دی ۱۴۰۴ (13 January 2025)
Session: تکمیل BackOffice.BFF WebApi Services برای Discount Shop
🎯 خلاصه تغییرات
تکمیل لایه gRPC Services برای BackOffice.BFF - بخش فروشگاه تخفیفی
🆕 WebApi Services جدید
DiscountCategoryService.cs
مسیر: BackOffice.BFF.WebApi/Services/DiscountCategoryService.cs
| RPC | Command/Query |
|---|---|
Create |
CreateDiscountCategoryCommand |
Update |
UpdateDiscountCategoryCommand |
Delete |
DeleteDiscountCategoryCommand |
GetDiscountCategories |
GetDiscountCategoriesQuery |
DiscountShoppingCartService.cs
مسیر: BackOffice.BFF.WebApi/Services/DiscountShoppingCartService.cs
| RPC | Command/Query |
|---|---|
AddToCart |
AddToCartCommand |
RemoveFromCart |
RemoveFromCartCommand |
UpdateCartItemCount |
UpdateCartItemCountCommand |
GetUserCart |
GetUserCartQuery |
ClearCart |
ClearCartCommand |
توضیح: این سرویس برای مدیریت سبد خرید کاربران توسط پشتیبانی/ادمین استفاده میشود.
TagService.cs
مسیر: BackOffice.BFF.WebApi/Services/TagService.cs
| RPC | Command/Query |
|---|---|
Create |
CreateTagCommand |
Update |
UpdateTagCommand |
Delete |
DeleteTagCommand |
Get |
GetTagQuery |
GetAll |
GetAllTagsQuery |
GetProductsByTag |
GetProductsByTagQuery |
ProductTagService.cs
مسیر: BackOffice.BFF.WebApi/Services/ProductTagService.cs
| RPC | Command/Query |
|---|---|
CreateNewProductTag |
CreateProductTagCommand |
UpdateProductTag |
UpdateProductTagCommand |
DeleteProductTag |
DeleteProductTagCommand |
GetProductTag |
GetProductTagQuery |
GetAllProductTagByFilter |
GetAllProductTagsQuery |
🔧 تغییرات Application Layer
Handlers جدید ایجاد شده
ProductTagCQ/Commands/UpdateProductTag/
UpdateProductTagCommand.csUpdateProductTagCommandHandler.cs
ProductTagCQ/Commands/DeleteProductTag/
DeleteProductTagCommand.csDeleteProductTagCommandHandler.cs
ProductTagCQ/Queries/GetProductTag/
GetProductTagQuery.csGetProductTagQueryHandler.cs
ProductTagCQ/Queries/GetAllProductTags/
GetAllProductTagsQuery.csGetAllProductTagsQueryHandler.cs
DiscountShoppingCartCQ - اصلاحات Proto
فایلهای تغییر یافته:
RemoveFromCartCommand.cs
- public long CartItemId { get; init; }
+ public long ProductId { get; init; }
UpdateCartItemCountCommand.cs
- public long CartItemId { get; init; }
+ public long ProductId { get; init; }
GetUserCartResponseDto.cs
- public long UserId { get; set; }
- public long TotalDiscountedPrice { get; set; }
- public long TotalSavings { get; set; }
+ public long TotalDiscountAmount { get; set; }
+ public long FinalPrice { get; set; }
CartItemDto
- public long Id { get; set; }
- public long DiscountedPrice { get; set; }
- public DateTime AddedAt { get; set; }
+ public long DiscountAmount { get; set; }
+ public long FinalPrice { get; set; }
+ public int ProductRemainingCount { get; set; }
+ public DateTime Created { get; set; }
📦 تغییرات Proto Projects
csproj تغییر یافته (GrpcServices: Client → Both)
BackOffice.BFF.DiscountCategory.Protobuf.csprojBackOffice.BFF.DiscountShoppingCart.Protobuf.csprojBackOffice.BFF.Tag.Protobuf.csprojBackOffice.BFF.ProductTag.Protobuf.csproj
WebApi.csproj - References اضافه شده
<ProjectReference Include="..\Protobufs\BackOffice.BFF.DiscountCategory.Protobuf\..." />
<ProjectReference Include="..\Protobufs\BackOffice.BFF.DiscountShoppingCart.Protobuf\..." />
<ProjectReference Include="..\Protobufs\BackOffice.BFF.Tag.Protobuf\..." />
<ProjectReference Include="..\Protobufs\BackOffice.BFF.ProductTag.Protobuf\..." />
🗑️ Excludes حذف شده
BackOffice.BFF.Application.csproj
- <Compile Remove="DiscountShoppingCartCQ/**/*.cs" />
+ <!-- All excluded handlers have been enabled -->
📊 آمار نهایی
| متریک | مقدار |
|---|---|
| Services جدید | 4 |
| Handlers جدید | 8 |
| فایلهای اصلاح شده | 12 |
| Proto projects تنظیم شده | 4 |
✅ نتیجه Build
Build succeeded.
177 Warning(s)
0 Error(s)