using CartWise.Domain.Enums;

namespace CartWise.Domain.Entities;

public class HouseholdMember
{
    public Guid HouseholdId { get; private set; }

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

    public HouseholdRole Role { get; private set; }

    public DateTime JoinedUtc { get; private set; }

    private HouseholdMember()
    {
    }

    internal HouseholdMember(Guid householdId, string userId, HouseholdRole role, DateTime joinedUtc)
    {
        if (string.IsNullOrWhiteSpace(userId))
        {
            throw new ArgumentException("UserId is required.", nameof(userId));
        }

        HouseholdId = householdId;
        UserId = userId;
        Role = role;
        JoinedUtc = joinedUtc;
    }
}
