Complete FrontOffice BFF to CMS Migration

- Migrated all 9 services from FrontOffice.BFF to CMS architecture
- Enhanced user.proto with 7 additional Customer API endpoints:
  * UpdateCustomerProfile, GetCustomerProfile
  * ChangeCustomerPassword with validation
  * GetCustomerReferrals with commission stats
  * UploadCustomerAvatar with file validation
  * GetCustomerSettings, UpdateCustomerSettings
- All services now support Customer endpoints with /Customer/ prefix
- Mock implementations with realistic Persian data
- Fixed namespace conflicts and compilation issues
- Comprehensive testing completed for all endpoints
- Services migrated: Categories, City, UserCarts, Products, UserWallet,
  Transaction, UserOrder, Package, User (enhanced)
This commit is contained in:
masoodafar-web
2026-01-30 08:53:09 +03:30
parent 96daf899c7
commit 658d076bdf
170 changed files with 3770 additions and 4364 deletions
@@ -6,6 +6,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="BCrypt.Net-Next" Version="4.0.3" />
<PackageReference Include="MediatR" Version="11.0.0" />
</ItemGroup>
@@ -6,6 +6,8 @@ public class OtpToken : BaseAuditableEntity
public string Mobile { get; set; }
//مقصود
public string Purpose { get; set; }
//کد
public string Code { get; set; }
//کد هش شده
public string CodeHash { get; set; }
//زمان انقضا
@@ -14,4 +16,16 @@ public class OtpToken : BaseAuditableEntity
public int Attempts { get; set; }
//موفق بود؟
public bool IsUsed { get; set; }
/// <summary>
/// Validates if the provided code is correct and token is not expired
/// </summary>
public bool IsValid(string providedCode)
{
if (IsUsed || DateTime.UtcNow > ExpiresAt)
return false;
// Use BCrypt to verify the provided code against the stored hash
return BCrypt.Net.BCrypt.Verify(providedCode, CodeHash);
}
}