namespace CashLineERP.Contracts.Identity;

public sealed record AdminUserResponse(
    long UserId,
    string LoginName,
    string DisplayName,
    string UserTypeCode,
    string? Email,
    long? BranchId,
    long? PartyId,
    bool IsActive,
    bool IsLocked,
    IReadOnlyCollection<string> RoleCodes,
    IReadOnlyCollection<string> FunctionCodes,
    string LifecycleStatusCode,
    DateTime DateOfJoiningUtc,
    DateTime? DateOfSuspensionUtc,
    string? LastAdminActionReason);

public sealed record AdminRoleFunctionOptionResponse(
    string RoleCode,
    string RoleName,
    string UserTypeCode,
    string FunctionSetCode,
    IReadOnlyCollection<string> FunctionCodes,
    IReadOnlyCollection<string> Functions,
    IReadOnlyCollection<AdminFunctionGovernanceItemResponse> FunctionItems);

public sealed record AdminFunctionConfigurationResponse(
    IReadOnlyCollection<AdminRoleFunctionOptionResponse> InternalRoles,
    IReadOnlyCollection<AdminRoleFunctionOptionResponse> ExternalRoles,
    IReadOnlyCollection<AdminPortalMenuSectionResponse> PortalMenuSections);

public sealed record AdminPortalMenuSectionResponse(
    string PortalCode,
    string UserTypeCode,
    string SectionCode,
    string SectionLabel,
    int DisplayOrder,
    bool IsEnabled,
    IReadOnlyCollection<AdminFunctionGovernanceItemResponse> Functions);

public sealed record AdminFunctionGovernanceItemResponse(
    string FunctionCode,
    string FunctionLabel,
    string MenuSectionCode,
    string MenuSectionLabel,
    string PortalCode,
    string UserTypeCode,
    string Route,
    string StepId,
    string PermissionCode,
    string RuleCode,
    int DisplayOrder,
    bool IsEnabled);

public sealed record AdminUserReportRowResponse(
    string UserName,
    string UserType,
    string Role,
    DateTime DateOfJoiningUtc,
    DateTime? DateOfSuspensionUtc,
    string? LatestAction,
    string? LatestActionReason);
