namespace Backend.Contracts;

public sealed record AdminTeamResponse(
    IEnumerable<AdminTeamMemberDto> Members,
    IEnumerable<AdminTeamRoleDto> Roles,
    IEnumerable<AdminTeamPermissionDto> Permissions);

public sealed record AdminTeamMemberDto(
    int Id,
    string Login,
    string DisplayName,
    string Role,
    string? BoundTwitchUserId,
    string? BoundTwitchDisplayName,
    bool IsActive,
    bool MustChangePassword,
    DateTimeOffset CreatedAt,
    DateTimeOffset? UpdatedAt,
    DateTimeOffset? LastLoginAt,
    DateTimeOffset? LastOnlineAt,
    bool IsOnline,
    DateTimeOffset? TwitchBoundAt,
    DateTimeOffset? PasswordResetAt);

public sealed record AdminTeamRoleDto(
    string Key,
    string Label,
    string Description,
    bool IsSystemRole,
    IEnumerable<string> PermissionKeys);

public sealed record AdminTeamPermissionDto(
    string Key,
    string Label,
    string Description,
    string GroupLabel,
    string MenuPath,
    bool ReadOnlySupported);

public sealed record CreateTeamMemberRequest(
    string Login,
    string DisplayName,
    string Role);

public sealed record UpdateTeamMemberRequest(
    string Login,
    string DisplayName,
    string Role,
    bool IsActive);

public sealed record UpdateTeamRolesRequest(
    AdminTeamRoleUpdateDto[] Roles);

public sealed record AdminTeamRoleUpdateDto(
    string Key,
    string[] PermissionKeys);

public sealed record TeamMemberPasswordResponse(
    bool Saved,
    int MemberId,
    string GeneratedPassword,
    bool MustChangePassword);

public sealed record DeleteTeamMemberResponse(
    bool Deleted,
    int MemberId);
