feat: Update proto namespaces and enable product image management

This commit is contained in:
masoodafar-web
2025-12-06 20:57:43 +03:30
parent 88c691c3fb
commit 523754af2c
17 changed files with 345 additions and 252 deletions

View File

@@ -30,6 +30,35 @@
---
## ⚠️ ملاحظات مهم Proto Packages
> **هشدار مهم**: هر تغییری در Proto files نیاز به این 3 مرحله دارد:
### چک‌لیست اجباری بعد از تغییر Proto:
1. **افزایش Version** در `.csproj`:
```xml
<Version>0.0.142</Version> → <Version>0.0.143</Version>
```
2. **Pack کردن** Proto project:
```bash
cd path/to/proto/project
dotnet pack -c Release
# ✅ خودکار push می‌شه به GitLab Registry
```
3. **Update Version** در پروژه‌های وابسته (لایه بالاتر):
```xml
<PackageReference Include="Foursat.CMSMicroservice.Protobuf" Version="0.0.143" />
```
**مثال**: تغییر در CMS Proto → Pack → Update در BFF Protos → Pack → Update در UI
**⚠️ فراموش کردن این مراحل = Build Error یا Runtime Bug**
---
## ماژول‌های فعال شده (Enabled Modules)
### ✅ کاملاً فعال و تست شده:
@@ -77,21 +106,24 @@
- Proto: BackOffice.BFF.Products.Protobuf (BulkUpdateProductPrices, BulkUpdateProductStock, ToggleProductStatus)
- Note: استفاده از `BackOffice.BFF.Protobuf.Common.PaginationState` با using alias
9. **Product Image Management** - ✅ FULLY OPERATIONAL
- ✅ GalleryDialog - گالری تصاویر محصول
- ✅ CreateDialog - ایجاد محصول با آپلود تصویر
- ✅ UpdateDialog - ویرایش محصول با آپلود تصویر
- ✅ Proto: GetProductGallery, AddProductImage, RemoveProductImage
- ✅ Messages: ImageFileModel, ProductGalleryItem
- ✅ Backend: ProductsService methods uncommented and active
- ✅ CQRS Handlers: AddProductImageCommandHandler, GetProductGalleryQueryHandler, RemoveProductImageCommandHandler
- ✅ CMS Integration: ProductGalleries microservice connected
- ✅ Image Optimization: SixLabors.ImageSharp (1200x1200 + 300x300 thumbnail)
---
## ماژول‌های Exclude شده (نیاز به کار اضافی)
### ❌ نیاز به متدهای Proto جدید:
**هیچ فایلی Exclude نیست!** ✅
1. **GalleryDialog** (`Pages/Products/Components/GalleryDialog.razor`)
- مشکل: استفاده از `AddProductImageAsync` و `RemoveProductImageAsync`
- راه‌حل: افزودن این RPCها به `products.proto`
- وضعیت: نیاز به تغییرات در BackOffice.BFF
2. **CreateDialog & UpdateDialog** (`Pages/Products/Components/`)
- مشکل: استفاده از `ImageFileModel` برای آپلود تصویر
- راه‌حل: افزودن `ImageFileModel` message و متدهای مربوطه
- وضعیت: نیاز به تغییرات در BackOffice.BFF
تمامی صفحات و کامپوننت‌ها build می‌شوند. فقط Backend implementation برای Image Upload لازمه.
---