Repository navigation
Expand file tree
/
Copy pathUser.cs
More file actions
49 lines (45 loc) · 1.43 KB
/
Copy pathUser.cs
File metadata and controls
49 lines (45 loc) · 1.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
namespace SalesAPI;
/// <summary>
/// User account for system access.
/// Roles: Rep, Admin, Management (plus legacy Client).
/// </summary>
public class User
{
public int Id { get; set; }
public string Username { get; set; } = string.Empty;
public string PasswordHash { get; set; } = string.Empty;
public string Role { get; set; } = "Client"; // Rep, Admin, Management, or Client
public int? ClientId { get; set; } // Links to Clients table if Role = Client
public bool IsActive { get; set; } = true;
public string CreatedDate { get; set; } = string.Empty;
}
/// <summary>
/// Login request model
/// </summary>
public class LoginRequest
{
public string Username { get; set; } = string.Empty;
public string Password { get; set; } = string.Empty;
}
/// <summary>
/// Register request model
/// </summary>
public class RegisterRequest
{
public string Username { get; set; } = string.Empty;
public string Password { get; set; } = string.Empty;
public string Role { get; set; } = "Client";
public int? ClientId { get; set; }
}
/// <summary>
/// Login response with token
/// </summary>
public class LoginResponse
{
public bool Success { get; set; }
public string Token { get; set; } = string.Empty;
public string Username { get; set; } = string.Empty;
public string Role { get; set; } = string.Empty;
public int? ClientId { get; set; }
public string Message { get; set; } = string.Empty;
}