From 57f0f396146441499db2781c626e6c3e923fc96f Mon Sep 17 00:00:00 2001 From: Oscar Morales Date: Mon, 19 May 2025 14:13:01 -0600 Subject: [PATCH] Add reference to Document class --- .../Adapters/ModuleAdapter.cs | 43 +------------------ .../Adapters/PermissionAdapter.cs | 43 +------------------ .../Adapters/RoleAdapter.cs | 43 +------------------ .../Adapters/UserAdapter.cs | 43 +------------------ .../Core.Thalos.BuildingBlocks.csproj | 1 + 5 files changed, 5 insertions(+), 168 deletions(-) diff --git a/Core.Thalos.BuildingBlocks/Adapters/ModuleAdapter.cs b/Core.Thalos.BuildingBlocks/Adapters/ModuleAdapter.cs index 37294d0..c82e9eb 100644 --- a/Core.Thalos.BuildingBlocks/Adapters/ModuleAdapter.cs +++ b/Core.Thalos.BuildingBlocks/Adapters/ModuleAdapter.cs @@ -14,7 +14,7 @@ namespace Core.Thalos.Adapters /// /// Adapter for representing a module. /// - public class ModuleAdapter + public class ModuleAdapter : Document { /// /// Gets or sets the ID of the module. @@ -73,46 +73,5 @@ namespace Core.Thalos.Adapters [JsonPropertyName("application")] [JsonConverter(typeof(JsonStringEnumConverter))] public ApplicationsEnum? Application { get; set; } = null!; - - /// - /// Gets or sets the date and time when the module was created. - /// - [BsonElement("createdAt")] - [BsonRepresentation(BsonType.DateTime)] - [JsonPropertyName("createdAt")] - public DateTime CreatedAt { get; set; } = DateTime.UtcNow; - - /// - /// Gets or sets the user who created the module. - /// - [BsonElement("createdBy")] - [BsonRepresentation(BsonType.String)] - [JsonPropertyName("createdBy")] - public string? CreatedBy { get; set; } - - /// - /// Gets or sets the date and time when the module was last updated. - /// - [BsonElement("updatedAt")] - [BsonRepresentation(BsonType.DateTime)] - [JsonPropertyName("updatedAt")] - public DateTime? UpdatedAt { get; set; } = null; - - /// - /// Gets or sets the user who last updated the module. - /// - [BsonElement("updatedBy")] - [BsonRepresentation(BsonType.String)] - [JsonPropertyName("updatedBy")] - public string? UpdatedBy { get; set; } = null; - - /// - /// Gets or sets the status of the module. - /// - [BsonElement("status")] - [BsonRepresentation(BsonType.String)] - [JsonPropertyName("status")] - [JsonConverter(typeof(JsonStringEnumConverter))] - public StatusEnum Status { get; set; } = StatusEnum.Active; } } diff --git a/Core.Thalos.BuildingBlocks/Adapters/PermissionAdapter.cs b/Core.Thalos.BuildingBlocks/Adapters/PermissionAdapter.cs index 33ad97f..a795e18 100644 --- a/Core.Thalos.BuildingBlocks/Adapters/PermissionAdapter.cs +++ b/Core.Thalos.BuildingBlocks/Adapters/PermissionAdapter.cs @@ -15,7 +15,7 @@ namespace Core.Thalos.Adapters /// /// Adapter for representing a permission. /// - public class PermissionAdapter + public class PermissionAdapter : Document { /// /// Gets or sets the ID of the entity. @@ -50,46 +50,5 @@ namespace Core.Thalos.Adapters [JsonPropertyName("accessLevel")] [JsonConverter(typeof(JsonStringEnumConverter))] public AccessLevelEnum? AccessLevel { get; set; } = null!; - - /// - /// Gets or sets the date and time when the entity was created. - /// - [BsonElement("createdAt")] - [BsonRepresentation(BsonType.DateTime)] - [JsonPropertyName("createdAt")] - public DateTime CreatedAt { get; set; } = DateTime.UtcNow; - - /// - /// Gets or sets the user who created the entity. - /// - [BsonElement("createdBy")] - [BsonRepresentation(BsonType.String)] - [JsonPropertyName("createdBy")] - public string? CreatedBy { get; set; } - - /// - /// Gets or sets the date and time when the entity was last updated. - /// - [BsonElement("updatedAt")] - [BsonRepresentation(BsonType.DateTime)] - [JsonPropertyName("updatedAt")] - public DateTime? UpdatedAt { get; set; } = null; - - /// - /// Gets or sets the user who last updated the entity. - /// - [BsonElement("updatedBy")] - [BsonRepresentation(BsonType.String)] - [JsonPropertyName("updatedBy")] - public string? UpdatedBy { get; set; } = null; - - /// - /// Gets or sets the status of the entity. - /// - [BsonElement("status")] - [BsonRepresentation(BsonType.String)] - [JsonPropertyName("status")] - [JsonConverter(typeof(JsonStringEnumConverter))] - public StatusEnum Status { get; set; } = StatusEnum.Active; } } diff --git a/Core.Thalos.BuildingBlocks/Adapters/RoleAdapter.cs b/Core.Thalos.BuildingBlocks/Adapters/RoleAdapter.cs index 74d06fd..37ba5c6 100644 --- a/Core.Thalos.BuildingBlocks/Adapters/RoleAdapter.cs +++ b/Core.Thalos.BuildingBlocks/Adapters/RoleAdapter.cs @@ -14,7 +14,7 @@ namespace Core.Thalos.Adapters /// /// Adapter representing a role. /// - public class RoleAdapter + public class RoleAdapter : Document { /// /// Gets or sets the unique identifier of the role. @@ -62,46 +62,5 @@ namespace Core.Thalos.Adapters [BsonElement("permissions")] [JsonPropertyName("permissions")] public string[] Permissions { get; set; } = null!; - - /// - /// Gets or sets the date and time when the entity was created. - /// - [BsonElement("createdAt")] - [BsonRepresentation(BsonType.DateTime)] - [JsonPropertyName("createdAt")] - public DateTime CreatedAt { get; set; } = DateTime.UtcNow; - - /// - /// Gets or sets the user who created the entity. - /// - [BsonElement("createdBy")] - [BsonRepresentation(BsonType.String)] - [JsonPropertyName("createdBy")] - public string? CreatedBy { get; set; } - - /// - /// Gets or sets the date and time when the entity was last updated. - /// - [BsonElement("updatedAt")] - [BsonRepresentation(BsonType.DateTime)] - [JsonPropertyName("updatedAt")] - public DateTime? UpdatedAt { get; set; } = null; - - /// - /// Gets or sets the user who last updated the entity. - /// - [BsonElement("updatedBy")] - [BsonRepresentation(BsonType.String)] - [JsonPropertyName("updatedBy")] - public string? UpdatedBy { get; set; } = null; - - /// - /// Gets or sets the status of the entity. - /// - [BsonElement("status")] - [BsonRepresentation(BsonType.String)] - [JsonPropertyName("status")] - [JsonConverter(typeof(JsonStringEnumConverter))] - public StatusEnum Status { get; set; } = StatusEnum.Active; } } diff --git a/Core.Thalos.BuildingBlocks/Adapters/UserAdapter.cs b/Core.Thalos.BuildingBlocks/Adapters/UserAdapter.cs index b7df0b1..e1c4158 100644 --- a/Core.Thalos.BuildingBlocks/Adapters/UserAdapter.cs +++ b/Core.Thalos.BuildingBlocks/Adapters/UserAdapter.cs @@ -13,7 +13,7 @@ namespace Core.Thalos.Adapters /// /// Adapter representing a user. /// - public class UserAdapter : BaseAdapterResponse + public class UserAdapter : Document { /// /// Gets or sets the unique identifier of the user. @@ -126,46 +126,5 @@ namespace Core.Thalos.Adapters [BsonRepresentation(BsonType.String)] [JsonPropertyName("token")] public string? Token { get; set; } = null; - - /// - /// Gets or sets the date and time when the entity was created. - /// - [BsonElement("createdAt")] - [BsonRepresentation(BsonType.DateTime)] - [JsonPropertyName("createdAt")] - public DateTime CreatedAt { get; set; } = DateTime.UtcNow; - - /// - /// Gets or sets the user who created the entity. - /// - [BsonElement("createdBy")] - [BsonRepresentation(BsonType.String)] - [JsonPropertyName("createdBy")] - public string? CreatedBy { get; set; } - - /// - /// Gets or sets the date and time when the entity was last updated. - /// - [BsonElement("updatedAt")] - [BsonRepresentation(BsonType.DateTime)] - [JsonPropertyName("updatedAt")] - public DateTime? UpdatedAt { get; set; } = null; - - /// - /// Gets or sets the user who last updated the entity. - /// - [BsonElement("updatedBy")] - [BsonRepresentation(BsonType.String)] - [JsonPropertyName("updatedBy")] - public string? UpdatedBy { get; set; } = null; - - /// - /// Gets or sets the status of the entity. - /// - [BsonElement("status")] - [BsonRepresentation(BsonType.String)] - [JsonPropertyName("status")] - [JsonConverter(typeof(JsonStringEnumConverter))] - public StatusEnum Status { get; set; } = StatusEnum.Active; } } diff --git a/Core.Thalos.BuildingBlocks/Core.Thalos.BuildingBlocks.csproj b/Core.Thalos.BuildingBlocks/Core.Thalos.BuildingBlocks.csproj index 73729fa..fdc8f35 100644 --- a/Core.Thalos.BuildingBlocks/Core.Thalos.BuildingBlocks.csproj +++ b/Core.Thalos.BuildingBlocks/Core.Thalos.BuildingBlocks.csproj @@ -12,6 +12,7 @@ +