using Books.Api.Domain.UserAccess;
using EventFlow.Commands;

namespace Books.Api.Commands.UserAccess;

public class GrantUserCompanyAccessCommand(
    UserCompanyAccessId aggregateId,
    string userId,
    string companyId,
    CompanyRole role,
    string grantedBy) : Command<UserCompanyAccessAggregate, UserCompanyAccessId>(aggregateId)
{
    public string UserId { get; } = userId;
    public string CompanyId { get; } = companyId;
    public CompanyRole Role { get; } = role;
    public string GrantedBy { get; } = grantedBy;
}

public class ChangeUserCompanyAccessRoleCommand(
    UserCompanyAccessId aggregateId,
    CompanyRole newRole,
    string changedBy) : Command<UserCompanyAccessAggregate, UserCompanyAccessId>(aggregateId)
{
    public CompanyRole NewRole { get; } = newRole;
    public string ChangedBy { get; } = changedBy;
}

public class RevokeUserCompanyAccessCommand(
    UserCompanyAccessId aggregateId,
    string revokedBy) : Command<UserCompanyAccessAggregate, UserCompanyAccessId>(aggregateId)
{
    public string RevokedBy { get; } = revokedBy;
}
