Wave 2 — 3 parallel agents fixing P1 issues: Validators (57 new FluentValidation validators): - ads-manager: 10 validators for all commands - ads-billing: 3 validators for all commands - ads-tracking: 2 validators for missing commands - ads-analytics: 1 validator for CreateReport - social: 8 validators for all commands - mining: 16 validators for all commands - mission: 4 validators for all commands - promotion: 13 validators for all commands Missing handlers (10 implemented): - promotion: ExchangeVoucher, PurchaseVoucher, SearchVouchers, GetCampaignStatistics, GetCampaignVouchers - mission: GetUserMissionProgress - mkt-facebook: GetConversations, GetCustomers - ads-manager: ListAudiences, GetAudienceById All validators use bilingual messages (EN/VI) and are auto-registered via MediatR ValidatorBehavior pipeline. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
25 lines
888 B
C#
25 lines
888 B
C#
using FluentValidation;
|
|
using MiningService.API.Application.Commands;
|
|
|
|
namespace MiningService.API.Application.Validations;
|
|
|
|
/// <summary>
|
|
/// EN: Validator for AdjustMinerPointsCommand.
|
|
/// VI: Validator cho AdjustMinerPointsCommand.
|
|
/// </summary>
|
|
public class AdjustMinerPointsCommandValidator : AbstractValidator<AdjustMinerPointsCommand>
|
|
{
|
|
public AdjustMinerPointsCommandValidator()
|
|
{
|
|
RuleFor(x => x.MinerId)
|
|
.NotEmpty().WithMessage("Miner ID is required / ID thợ đào là bắt buộc");
|
|
|
|
RuleFor(x => x.Amount)
|
|
.NotEqual(0).WithMessage("Amount must not be zero / Số lượng không được bằng 0");
|
|
|
|
RuleFor(x => x.Reason)
|
|
.NotEmpty().WithMessage("Reason is required / Lý do là bắt buộc")
|
|
.MaximumLength(500).WithMessage("Reason max 500 chars / Lý do tối đa 500 ký tự");
|
|
}
|
|
}
|