-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathOrganizationUser.cs
More file actions
67 lines (50 loc) · 1.95 KB
/
OrganizationUser.cs
File metadata and controls
67 lines (50 loc) · 1.95 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
using System.ComponentModel.DataAnnotations;
using Aquiis.Core.Validation;
namespace Aquiis.Core.Entities
{
/// <summary>
/// Junction table for multi-organization user assignments with role-based permissions
/// </summary>
public class OrganizationUser
{
[RequiredGuid]
[Display(Name = "OrganizationUser ID")]
public Guid Id { get; set; } = Guid.NewGuid();
/// <summary>
/// The user being granted access
/// </summary>
public string UserId { get; set; } = string.Empty;
/// <summary>
/// The organization they're being granted access to
/// </summary>
[RequiredGuid]
public Guid OrganizationId { get; set; } = Guid.Empty;
/// <summary>
/// Role within this organization: "Owner", "Administrator", "PropertyManager", "User"
/// </summary>
public string Role { get; set; } = string.Empty;
/// <summary>
/// UserId of the user who granted this access
/// </summary>
public string GrantedBy { get; set; } = string.Empty;
/// <summary>
/// When access was granted
/// </summary>
public DateTime GrantedOn { get; set; }
/// <summary>
/// When access was revoked (NULL if still active)
/// </summary>
public DateTime? RevokedOn { get; set; }
/// <summary>
/// Active assignment flag
/// </summary>
public bool IsActive { get; set; } = true;
public string CreatedBy { get; set; } = string.Empty;
public DateTime CreatedOn { get; set; } = DateTime.UtcNow;
public string? LastModifiedBy { get; set; } = string.Empty;
public DateTime? LastModifiedOn { get; set; }
public bool IsDeleted { get; set; } = false;
// Navigation properties
public virtual Organization Organization { get; set; } = null!;
}
}