mirror of
https://github.com/Sea-Haven-Industries/proposal-system.git
synced 2026-10-01 03:33:13 +00:00
20 lines
644 B
C#
20 lines
644 B
C#
|
|
using FluentValidation;
|
||
|
|
using ProposalSystem.Application.DTOs;
|
||
|
|
|
||
|
|
namespace ProposalSystem.Application.Validators;
|
||
|
|
|
||
|
|
// Fix: API-M5 — add FluentValidation for SimilarReference DTO
|
||
|
|
public class CreateSimilarReferenceValidator : AbstractValidator<CreateSimilarReferenceRequest>
|
||
|
|
{
|
||
|
|
public CreateSimilarReferenceValidator()
|
||
|
|
{
|
||
|
|
RuleFor(x => x.ReferencedLibraryItemId)
|
||
|
|
.NotEmpty().WithMessage("Referenced library item ID is required")
|
||
|
|
.MaximumLength(500);
|
||
|
|
|
||
|
|
RuleFor(x => x.SimilarityScore)
|
||
|
|
.InclusiveBetween(0f, 1f)
|
||
|
|
.WithMessage("Similarity score must be between 0 and 1");
|
||
|
|
}
|
||
|
|
}
|