namespace StellaOps.Scanner.WebService.Domain;

public sealed record ScanTarget(string? Reference, string? Digest)
{
    public ScanTarget Normalize()
    {
        var normalizedReference = string.IsNullOrWhiteSpace(Reference) ? null : Reference.Trim();
        var normalizedDigest = string.IsNullOrWhiteSpace(Digest) ? null : Digest.Trim().ToLowerInvariant();
        return new ScanTarget(normalizedReference, normalizedDigest);
    }
}
