d232399f43
Build and Deploy to Kubernetes / build-and-deploy (push) Has been cancelled
- Introduced ManualCreditWalletCharge enum value to TransactionType for clarity. - Added AdminManualCreditCharge and GetManualCreditCharges RPC methods in UserWalletService for handling manual credit charges by admin. - Created corresponding request and response messages for manual credit charge operations in Protobuf. - Updated Protobuf project version to reflect the addition of new features.
21 lines
820 B
C#
21 lines
820 B
C#
using CMSMicroservice.Domain.Common;
|
|
using FluentValidation;
|
|
|
|
namespace CMSMicroservice.Application.WalletCQ.Commands.AdminManualCreditCharge;
|
|
|
|
public class AdminManualCreditChargeCommandValidator : AbstractValidator<AdminManualCreditChargeCommand>
|
|
{
|
|
public AdminManualCreditChargeCommandValidator()
|
|
{
|
|
RuleFor(x => x.UserId)
|
|
.GreaterThan(0)
|
|
.WithMessage("شناسه کاربر باید بزرگتر از صفر باشد");
|
|
|
|
RuleFor(x => x.Amount)
|
|
.GreaterThanOrEqualTo(SystemConstants.DiscountWalletMinCharge)
|
|
.WithMessage("حداقل مبلغ شارژ ۱۰,۰۰۰ تومان است")
|
|
.LessThanOrEqualTo(SystemConstants.WalletMaxSafeAmount)
|
|
.WithMessage("مبلغ وارد شده بیش از حد مجاز است");
|
|
}
|
|
}
|