namespace CartWise.Domain.Entities;

public class Retailer
{
    public Guid RetailerId { get; private set; }

    public string Name { get; private set; } = null!;

    public string NormalizedName { get; private set; } = null!;

    public string? WebsiteUrl { get; private set; }

    private Retailer()
    {
    }

    public Retailer(string name, string? websiteUrl = null)
    {
        if (string.IsNullOrWhiteSpace(name))
        {
            throw new ArgumentException("Retailer name is required.", nameof(name));
        }

        RetailerId = Guid.NewGuid();
        Name = name.Trim();
        NormalizedName = Name.ToUpperInvariant();
        WebsiteUrl = websiteUrl;
    }
}
