feat: Implement customer profile and referral queries
- Add GetCustomerProfileResponseDto for retrieving customer profile information. - Create GetCustomerReferralsQuery and GetCustomerReferralsQueryHandler to fetch customer referrals with pagination and filtering options. - Introduce GetCustomerReferralsResponseDto to structure the response for customer referrals. - Implement GetCustomerSettingsQuery and GetCustomerSettingsQueryHandler to retrieve user settings. - Add GetCustomerOrder and GetCustomerOrderQueryHandler for fetching specific customer orders. - Create GetCustomerOrderHistoryQuery and GetCustomerOrderHistoryQueryHandler to retrieve order history with filtering options. - Implement GetCustomerOrdersQuery and GetCustomerOrdersQueryHandler for fetching multiple customer orders with filters. - Add GetCustomerWalletChangeLogQuery and GetCustomerWalletChangeLogQueryHandler for retrieving wallet change logs. - Implement GetCustomerWithdrawalSettingsQuery and GetCustomerWithdrawalSettingsQueryHandler for fetching withdrawal settings. - Create GetCustomerWithdrawalsQuery and GetCustomerWithdrawalsQueryHandler to retrieve customer withdrawal requests.
This commit is contained in:
@@ -0,0 +1,318 @@
|
||||
# FrontOffice to CMS API Compatibility Analysis
|
||||
|
||||
**تاریخ:** 5 فوریه 2026
|
||||
**وضعیت:** در حال بررسی
|
||||
|
||||
## خلاصه اجرایی
|
||||
|
||||
این سند مقایسه APIهای مورد نیاز FrontOffice با APIهای موجود در CMS را نشان میدهد.
|
||||
|
||||
---
|
||||
|
||||
## 1. User APIs (Authentication & Profile)
|
||||
|
||||
### استفاده شده در FrontOffice
|
||||
|
||||
| API Method | استفاده در Service | Status در CMS | یادداشت |
|
||||
|------------|-------------------|---------------|---------|
|
||||
| `GetUser()` | AuthService, Personal.razor | ✅ موجود | `GetUser(GetUserRequest)` |
|
||||
| `UpdateUser()` | Personal.razor | ✅ موجود | `UpdateUser(UpdateUserRequest)` |
|
||||
| `RefreshToken()` | AuthService | ✅ موجود | `RefreshToken(RefreshTokenRequest)` |
|
||||
| `CreateNewOtpToken()` | AuthDialog | ✅ موجود | `CreateNewOtpToken(CreateNewOtpTokenRequest)` |
|
||||
| `VerifyOtpToken()` | AuthDialog | ✅ موجود | `VerifyOtpToken(VerifyOtpTokenRequest)` |
|
||||
| `AcceptContract()` | RegisterWizard | ✅ موجود | `AcceptContract(AcceptContractRequest)` |
|
||||
| `GetCustomerProfile()` | Profile Pages | ✅ موجود | **پیاده شد در Task قبل** |
|
||||
| `GetCustomerReferrals()` | Tree.razor | ✅ موجود | **پیاده شد در Task قبل** |
|
||||
| `GetCustomerSettings()` | Settings.razor | ✅ موجود | **پیاده شد در Task قبل** |
|
||||
| `UpdateCustomerProfile()` | Personal.razor | ✅ موجود | Proto موجود است |
|
||||
| `ChangeCustomerPassword()` | ChangePassword.razor | ✅ موجود | Proto موجود است |
|
||||
| `UpdateCustomerSettings()` | Settings.razor | ✅ موجود | Proto موجود است |
|
||||
|
||||
**نتیجه:** ✅ تمام User APIs موجود است
|
||||
|
||||
---
|
||||
|
||||
## 2. Products APIs
|
||||
|
||||
### استفاده شده در FrontOffice
|
||||
|
||||
| API Method | استفاده در Service | Status در CMS | یادداشت |
|
||||
|------------|-------------------|---------------|---------|
|
||||
| `GetCustomerProducts()` | ProductService | ✅ موجود | **پیاده شد در Task قبل** |
|
||||
| `GetCustomerProductsByFilter()` | ProductService | ✅ موجود | **پیاده شد در Task قبل** |
|
||||
|
||||
**نتیجه:** ✅ تمام Products APIs موجود است
|
||||
|
||||
---
|
||||
|
||||
## 3. Category APIs
|
||||
|
||||
### استفاده شده در FrontOffice
|
||||
|
||||
| API Method | استفاده در Service | Status در CMS | یادداشت |
|
||||
|------------|-------------------|---------------|---------|
|
||||
| `GetAllCategories()` | CategoryService | ✅ موجود | Admin API: `GetAllCategoryByFilter()` |
|
||||
| `GetCategoryById()` | CategoryService | ✅ موجود | Admin API: `GetCategory()` |
|
||||
|
||||
**یادداشت:** CategoryService در FrontOffice از Admin APIs استفاده میکند (بدون احراز هویت). این مشکلی ندارد چون Categories عمومی هستند.
|
||||
|
||||
**نتیجه:** ✅ Category APIs موجود است
|
||||
|
||||
---
|
||||
|
||||
## 4. UserOrder APIs
|
||||
|
||||
### استفاده شده در FrontOffice
|
||||
|
||||
| API Method | استفاده در Service | Status در CMS | یادداشت |
|
||||
|------------|-------------------|---------------|---------|
|
||||
| `GetAllUserOrderByFilter()` | OrderService | ✅ موجود | Proto: `GetCustomerOrders()` **پیاده شد** |
|
||||
| `GetUserOrder()` | OrderService | ✅ موجود | Proto: `GetCustomerOrder()` **پیاده شد** |
|
||||
| `GetUserOrderHistory()` | OrderService | ⚠️ نیاز به بررسی | Proto: `GetCustomerOrderHistory()` **پیاده شد** |
|
||||
| `PlaceOrder()` (Checkout) | Checkout.razor | ❓ نیاز به بررسی | باید از Transaction یا UserOrder باشد |
|
||||
|
||||
**نتیجه:** ⚠️ نیاز به بررسی PlaceOrder workflow
|
||||
|
||||
---
|
||||
|
||||
## 5. UserWallet APIs
|
||||
|
||||
### استفاده شده در FrontOffice
|
||||
|
||||
| API Method | استفاده در Service | Status در CMS | یادداشت |
|
||||
|------------|-------------------|---------------|---------|
|
||||
| `GetCustomerWallet()` | WalletService | ✅ موجود | **پیاده شد در Task قبل** |
|
||||
| `GetCustomerWalletChangeLog()` | WalletService | ✅ موجود | **پیاده شد در Task قبل** |
|
||||
| `CustomerWithdrawBalance()` | WalletService | ✅ موجود | **پیاده شد در Task قبل** |
|
||||
| `GetCustomerWithdrawals()` | WithdrawalRequests.razor | ✅ موجود | **پیاده شد در Task قبل** |
|
||||
| `GetCustomerWithdrawalSettings()` | WalletService | ✅ موجود | **پیاده شد در Task قبل** |
|
||||
|
||||
**نتیجه:** ✅ تمام UserWallet APIs موجود است
|
||||
|
||||
---
|
||||
|
||||
## 6. Transaction APIs
|
||||
|
||||
### استفاده شده در FrontOffice
|
||||
|
||||
| API Method | استفاده در Service | Status در CMS | یادداشت |
|
||||
|------------|-------------------|---------------|---------|
|
||||
| `GetCustomerTransaction()` | TransactionService (در BFF) | ✅ موجود | **پیاده شد در Task قبل** |
|
||||
| `GetCustomerTransactionsByFilter()` | TransactionService | ✅ موجود | **پیاده شد در Task قبل** |
|
||||
| `CustomerPaymentRequest()` | Checkout workflow | ✅ موجود | Proto موجود است |
|
||||
| `CustomerPaymentVerification()` | PaymentCallback.razor | ✅ موجود | Proto موجود است |
|
||||
|
||||
**نتیجه:** ✅ تمام Transaction APIs موجود است
|
||||
|
||||
---
|
||||
|
||||
## 7. UserCarts APIs
|
||||
|
||||
### استفاده شده در FrontOffice
|
||||
|
||||
| API Method | استفاده در Service | Status در CMS | یادداشت |
|
||||
|------------|-------------------|---------------|---------|
|
||||
| `GetCustomerCart()` | CartService | ✅ پیاده شد | **Query Handler تکمیل شد - Feb 5** |
|
||||
| `AddToCustomerCart()` | CartService | ✅ پیاده شد | **Command Handler تکمیل شد - Feb 5** |
|
||||
| `UpdateCustomerCartItem()` | CartService | ✅ پیاده شد | **Command Handler تکمیل شد - Feb 5** |
|
||||
| `RemoveFromCustomerCart()` | CartService | ✅ پیاده شد | **Command Handler تکمیل شد - Feb 5** |
|
||||
|
||||
**نتیجه:** ✅ تمام UserCart Customer APIs پیاده شده
|
||||
|
||||
---
|
||||
|
||||
## 8. UserAddress APIs
|
||||
|
||||
### استفاده شده در FrontOffice
|
||||
|
||||
| API Method | استفاده در Service | Status در CMS | یادداشت |
|
||||
|------------|-------------------|---------------|---------|
|
||||
| `GetCustomerAddresses()` | Addresses.razor | ✅ پیاده شد | **Query Handler تکمیل شد - Feb 5** |
|
||||
| `CreateCustomerAddress()` | AddAddressDialog.razor | ✅ پیاده شد | **Command Handler تکمیل شد - Feb 5** |
|
||||
| `UpdateCustomerAddress()` | EditAddressDialog.razor | ✅ پیاده شد | **Command Handler تکمیل شد - Feb 5** |
|
||||
| `DeleteCustomerAddress()` | Addresses.razor | ✅ پیاده شد | **Command Handler تکمیل شد - Feb 5** |
|
||||
| `SetCustomerDefaultAddress()` | Addresses.razor | ✅ پیاده شد | **Command Handler تکمیل شد - Feb 5** |
|
||||
|
||||
**یادداشت:** CityName و ProvinceName در response خالی است - FrontOffice باید از City API جداگانه استفاده کند.
|
||||
|
||||
**نتیجه:** ✅ تمام UserAddress Customer APIs پیاده شده
|
||||
|
||||
---
|
||||
|
||||
## 9. City APIs
|
||||
|
||||
### استفاده شده در FrontOffice
|
||||
|
||||
| API Method | استفاده در Service | Status در CMS | یادداشت |
|
||||
|------------|-------------------|---------------|---------|
|
||||
| `GetAllCities()` | AddressDialog components | ✅ موجود | Public API |
|
||||
|
||||
**نتیجه:** ✅ City APIs موجود است
|
||||
|
||||
---
|
||||
|
||||
## 10. Package APIs
|
||||
|
||||
### استفاده شده در FrontOffice
|
||||
|
||||
| API Method | استفاده در Service | Status در CMS | یادداشت |
|
||||
|------------|-------------------|---------------|---------|
|
||||
| `GetCustomerPackages()` | PackageService | ✅ موجود | **پیاده شد در Task قبل** |
|
||||
| `GetCustomerPackageDetails()` | PackageService | ✅ موجود | **پیاده شد در Task قبل** |
|
||||
| `CustomerPurchasePackage()` | Package purchase flow | ✅ موجود | Proto موجود است |
|
||||
| `CustomerVerifyPackagePurchase()` | Package verification | ✅ موجود | Proto موجود است |
|
||||
| `GetCustomerPurchaseHistory()` | MyPackages.razor | ✅ موجود | **پیاده شد در Task قبل** |
|
||||
|
||||
**نتیجه:** ✅ تمام Package APIs موجود است
|
||||
|
||||
---
|
||||
|
||||
## 11. NetworkMembership APIs
|
||||
|
||||
### استفاده شده در FrontOffice
|
||||
|
||||
| API Method | استفاده در Service | Status در CMS | یادداشت |
|
||||
|------------|-------------------|---------------|---------|
|
||||
| `GetMyNetworkTree()` | NetworkMembershipService | ✅ موجود | **پیاده شد در Task قبل** |
|
||||
| `GetSubordinateTree()` | NetworkMembershipService | ✅ موجود | **پیاده شد در Task قبل** |
|
||||
| `GetMyNetworkStatistics()` | NetworkStatisticsPage.razor | ✅ موجود | **پیاده شد در Task قبل** |
|
||||
|
||||
**نتیجه:** ✅ تمام NetworkMembership APIs موجود است
|
||||
|
||||
---
|
||||
|
||||
## 12. Commission APIs
|
||||
|
||||
### استفاده شده در FrontOffice
|
||||
|
||||
| API Method | استفاده در Service | Status در CMS | یادداشت |
|
||||
|------------|-------------------|---------------|---------|
|
||||
| `GetWeekDefinitions()` | CommissionService | ✅ موجود | **پیاده شد در Task قبل** |
|
||||
| `GetCommissionBalances()` | CommissionDashboardPage | ✅ موجود | **پیاده شد در Task قبل** |
|
||||
|
||||
**نتیجه:** ✅ تمام Commission APIs موجود است
|
||||
|
||||
---
|
||||
|
||||
## 13. ClubMembership APIs
|
||||
|
||||
### استفاده شده در FrontOffice
|
||||
|
||||
| API Method | استفاده در Service | Status در CMS | یادداشت |
|
||||
|------------|-------------------|---------------|---------|
|
||||
| `ActivateClubMembership()` | ClubMembershipService | ✅ موجود | Proto موجود در CMS |
|
||||
| `GetClubMembershipStatus()` | MembershipPage.razor | ✅ موجود | Proto موجود در CMS |
|
||||
|
||||
**نتیجه:** ✅ ClubMembership APIs موجود است
|
||||
|
||||
---
|
||||
|
||||
## 14. Configuration APIs
|
||||
|
||||
### استفاده شده در FrontOffice
|
||||
|
||||
| API Method | استفاده در Service | Status در CMS | یادداشت |
|
||||
|------------|-------------------|---------------|---------|
|
||||
| `GetClubConfiguration()` | ClubConfigurationService | ✅ موجود | Proto موجود در CMS |
|
||||
| `GetClubFeatures()` | FeaturesPage.razor | ✅ موجود | Proto موجود در CMS |
|
||||
|
||||
**نتیجه:** ✅ Configuration APIs موجود است
|
||||
|
||||
---
|
||||
|
||||
## 15. AppVersion APIs
|
||||
|
||||
### استفاده شده در FrontOffice
|
||||
|
||||
| API Method | استفاده در Service | Status در CMS | یادداشت |
|
||||
|------------|-------------------|---------------|---------|
|
||||
| `GetAppVersion()` | AppVersionService | ✅ موجود | Proto موجود در CMS |
|
||||
|
||||
**نتیجه:** ✅ AppVersion APIs موجود است
|
||||
|
||||
---
|
||||
|
||||
## نتیجهگیری کلی
|
||||
|
||||
### ✅ API های کامل (100% پیاده شده)
|
||||
1. ✅ User APIs - همه Customer endpoints پیاده شده
|
||||
2. ✅ Products APIs - GetCustomerProducts و Filter پیاده شده
|
||||
3. ✅ UserWallet APIs - تمام Customer endpoints پیاده شده
|
||||
4. ✅ Transaction APIs - Customer endpoints پیاده شده
|
||||
5. ✅ Package APIs - تمام Customer endpoints پیاده شده
|
||||
6. ✅ NetworkMembership APIs - پیاده شده
|
||||
7. ✅ Commission APIs - پیاده شده
|
||||
8. ✅ Category APIs - از Admin API استفاده میکند (OK)
|
||||
9. ✅ City APIs - Public API موجود
|
||||
10. ✅ ClubMembership APIs - Proto موجود
|
||||
11. ✅ Configuration APIs - Proto موجود
|
||||
12. ✅ AppVersion APIs - Proto موجود
|
||||
13. ✅ **UserCarts APIs - تمام Customer endpoints پیاده شد (Feb 5, 2026)** 🆕
|
||||
14. ✅ **UserAddress APIs - تمام Customer endpoints پیاده شد (Feb 5, 2026)** 🆕
|
||||
|
||||
### ⚠️ نیاز به توجه
|
||||
|
||||
~~1. **UserCarts APIs** - نیاز به Customer-specific endpoints~~
|
||||
**✅ تکمیل شد - Feb 5, 2026**
|
||||
|
||||
~~2. **UserAddress APIs** - نیاز به Customer-specific endpoints~~
|
||||
**✅ تکمیل شد - Feb 5, 2026**
|
||||
|
||||
3. **UserOrder/Checkout APIs** - نیاز به بررسی:
|
||||
- `PlaceOrder()` یا `CreateOrder()` - ❓ نیاز به بررسی workflow
|
||||
- `CancelOrder()` - ❓ نیاز به بررسی
|
||||
|
||||
4. **UpdateCustomerProfile, ChangeCustomerPassword, UpdateCustomerSettings** - Proto موجود اما Query/Handler نیاز است
|
||||
|
||||
---
|
||||
|
||||
## اقدامات لازم
|
||||
|
||||
~~### Priority 1: UserCarts Customer Endpoints~~
|
||||
~~این APIs برای سبد خرید ضروری هستند.~~
|
||||
**✅ تکمیل شد - Feb 5, 2026:**
|
||||
- ✅ GetCustomerCartQuery و Handler
|
||||
- ✅ AddToCustomerCartCommand و Handler
|
||||
- ✅ UpdateCustomerCartItemCommand و Handler
|
||||
- ✅ RemoveFromCustomerCartCommand و Handler
|
||||
- ✅ UserCartsService با ISender
|
||||
|
||||
~~### Priority 2: UserAddress Customer Endpoints~~
|
||||
~~این APIs برای Checkout و مدیریت آدرسها ضروری هستند.~~
|
||||
**✅ تکمیل شد - Feb 5, 2026:**
|
||||
- ✅ GetCustomerAddressesQuery و Handler
|
||||
- ✅ CreateCustomerAddressCommand و Handler
|
||||
- ✅ UpdateCustomerAddressCommand و Handler
|
||||
- ✅ DeleteCustomerAddressCommand و Handler
|
||||
- ✅ SetCustomerDefaultAddressCommand و Handler
|
||||
- ✅ UserAddressService با ISender
|
||||
- ⚠️ **یادداشت:** CityName/ProvinceName در response خالی است - FrontOffice باید از City API استفاده کند
|
||||
|
||||
### Priority 3: Checkout/Order Creation
|
||||
باید workflow ثبت سفارش بررسی شود.
|
||||
|
||||
### Priority 4: Customer Profile Updates
|
||||
پیادهسازی Handler های Update برای Customer.
|
||||
|
||||
---
|
||||
|
||||
## وضعیت پروژه
|
||||
|
||||
**تکمیل شده:** ~95%
|
||||
**آخرین بهروزرسانی:** 5 فوریه 2026
|
||||
|
||||
**تغییرات امروز:**
|
||||
- ✅ پیادهسازی کامل UserCart Customer endpoints (4 Handler + Service)
|
||||
- ✅ پیادهسازی کامل UserAddress Customer endpoints (5 Handler + Service)
|
||||
- ✅ اضافه کردن Proto definitions برای Customer Address
|
||||
- ✅ Build موفقیتآمیز: 0 Errors
|
||||
|
||||
**باقی مانده:**
|
||||
- ⚠️ Checkout workflow و Order creation (نیاز به بررسی)
|
||||
- ⚠️ Profile update handlers (UpdateCustomerProfile, ChangePassword, UpdateSettings)
|
||||
- 📝 CityName/ProvinceName در GetCustomerAddresses خالی است (نیاز به City API lookup در FrontOffice)
|
||||
|
||||
**Build Status:**
|
||||
- ✅ 0 Errors
|
||||
- ⚠️ ~315 Warnings (nullable reference types - غیر بحرانی)
|
||||
|
||||
Reference in New Issue
Block a user