namespace NTP.Application.Auth; public sealed class UserLoginRow { public long Id { get; set; } public string? RoleCode { get; set; } public string? EmpNo { get; set; } public long? LocationId { get; set; } } /// Legacy info.getConactInfo (ntpusers joined to companies). public sealed class UserProfileRow { public long Id { get; set; } public string? DomainName { get; set; } public string? Name { get; set; } public string? RoleCode { get; set; } public string? EmpNo { get; set; } public long? LocationId { get; set; } public long? CompanyId { get; set; } public string? ResetPassword { get; set; } public string? CompanyName { get; set; } public string? CompanyCode { get; set; } } public sealed class UserHierarchyRow { public long? CompanyId { get; set; } public long? GroupId { get; set; } public long? StakeholderId { get; set; } } public sealed class LocationRow { public string? Type { get; set; } public string? Name { get; set; } } public sealed record AuditLogEntry(string? DoneBy, string? Ip, string? DoneByRole, int LogType, string? DoneByName, string? Browser); public sealed record InvalidAccessEntry( long UserDbId, long? LocationId, string RoleCode, string ValidIps, string RemoteIp, string? RemoteIpLocationId, string? UserAgent, int ReasonId); public interface IAuthRepository { /// Credential check. mirrors the ASEZA branch (join COMPANIES, status = 1). Task FindActiveUserByPasswordAsync(string login, string domain, IReadOnlyList passwordCandidates, bool requireActiveCompany, CancellationToken ct = default); /// GateEventsFactory.CheckAuthorization: active UTT (booth) row for the login. Task HasActiveBoothAsync(string login, CancellationToken ct = default); Task GetProfileAsync(string login, string domain, CancellationToken ct = default); Task GetRoleNameAsync(string roleCode, CancellationToken ct = default); Task GetHierarchyAsync(long userDbId, CancellationToken ct = default); Task GetLocationAsync(long locationId, string? domain, CancellationToken ct = default); /// Application.cfc onRequestStart: still active, same role. Task IsActiveWithRoleAsync(string login, string roleCode, CancellationToken ct = default); Task UpdatePasswordAsync(string login, string domain, string newPassword, string updatedBy, CancellationToken ct = default); Task> GetLocationIpsAsync(string locationId, CancellationToken ct = default); /// LOCATIONS_IPS.LOCATION_ID that owns this IP, or null. Task GetLocationForIpAsync(string ip, CancellationToken ct = default); Task InsertInvalidAccessLogAsync(InvalidAccessEntry entry, CancellationToken ct = default); /// logs.addLog: LOGS row (1 = sign in, 2 = sign out, 35 = SSO). Task InsertLogAsync(AuditLogEntry entry, CancellationToken ct = default); }