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:
+20
@@ -0,0 +1,20 @@
|
||||
namespace CMSMicroservice.Application.UserCQ.Commands.AcceptContract;
|
||||
public class AcceptContractCommandValidator : AbstractValidator<AcceptContractCommand>
|
||||
{
|
||||
public AcceptContractCommandValidator()
|
||||
{
|
||||
RuleFor(model => model.Code)
|
||||
.NotEmpty();
|
||||
RuleFor(model => model.ContractHtml)
|
||||
.NotEmpty();
|
||||
RuleFor(model => model.SignGuid)
|
||||
.NotEmpty();
|
||||
}
|
||||
public Func<object, string, Task<IEnumerable<string>>> ValidateValue => async (model, propertyName) =>
|
||||
{
|
||||
var result = await ValidateAsync(ValidationContext<AcceptContractCommand>.CreateWithOptions((AcceptContractCommand)model, x => x.IncludeProperties(propertyName)));
|
||||
if (result.IsValid)
|
||||
return Array.Empty<string>();
|
||||
return result.Errors.Select(e => e.ErrorMessage);
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user