using ColaFlow.Shared.Kernel.Common;

namespace ColaFlow.Modules.IssueManagement.Domain.ValueObjects;

/// <summary>
/// UserId Value Object (strongly-typed ID)
/// </summary>
public sealed class UserId : ValueObject
{
    public Guid Value { get; private set; }

    private UserId(Guid value)
    {
        if (value == Guid.Empty)
            throw new ArgumentException("UserId cannot be empty", nameof(value));

        Value = value;
    }

    public static UserId Create(Guid value) => new UserId(value);
    public static UserId From(Guid value) => new UserId(value);

    protected override IEnumerable<object> GetAtomicValues()
    {
        yield return Value;
    }

    public override string ToString() => Value.ToString();
}
