Merge pull request #2 from SergioMatias94/feature/use-blueprint-mongo

Use Blueprint.Mongo package
This commit is contained in:
2025-05-19 17:17:07 -06:00
committed by GitHub
5 changed files with 5 additions and 168 deletions

View File

@@ -14,7 +14,7 @@ namespace Core.Thalos.Adapters
/// <summary> /// <summary>
/// Adapter for representing a module. /// Adapter for representing a module.
/// </summary> /// </summary>
public class ModuleAdapter public class ModuleAdapter : Document
{ {
/// <summary> /// <summary>
/// Gets or sets the ID of the module. /// Gets or sets the ID of the module.
@@ -73,46 +73,5 @@ namespace Core.Thalos.Adapters
[JsonPropertyName("application")] [JsonPropertyName("application")]
[JsonConverter(typeof(JsonStringEnumConverter))] [JsonConverter(typeof(JsonStringEnumConverter))]
public ApplicationsEnum? Application { get; set; } = null!; public ApplicationsEnum? Application { get; set; } = null!;
/// <summary>
/// Gets or sets the date and time when the module was created.
/// </summary>
[BsonElement("createdAt")]
[BsonRepresentation(BsonType.DateTime)]
[JsonPropertyName("createdAt")]
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
/// <summary>
/// Gets or sets the user who created the module.
/// </summary>
[BsonElement("createdBy")]
[BsonRepresentation(BsonType.String)]
[JsonPropertyName("createdBy")]
public string? CreatedBy { get; set; }
/// <summary>
/// Gets or sets the date and time when the module was last updated.
/// </summary>
[BsonElement("updatedAt")]
[BsonRepresentation(BsonType.DateTime)]
[JsonPropertyName("updatedAt")]
public DateTime? UpdatedAt { get; set; } = null;
/// <summary>
/// Gets or sets the user who last updated the module.
/// </summary>
[BsonElement("updatedBy")]
[BsonRepresentation(BsonType.String)]
[JsonPropertyName("updatedBy")]
public string? UpdatedBy { get; set; } = null;
/// <summary>
/// Gets or sets the status of the module.
/// </summary>
[BsonElement("status")]
[BsonRepresentation(BsonType.String)]
[JsonPropertyName("status")]
[JsonConverter(typeof(JsonStringEnumConverter))]
public StatusEnum Status { get; set; } = StatusEnum.Active;
} }
} }

View File

@@ -15,7 +15,7 @@ namespace Core.Thalos.Adapters
/// <summary> /// <summary>
/// Adapter for representing a permission. /// Adapter for representing a permission.
/// </summary> /// </summary>
public class PermissionAdapter public class PermissionAdapter : Document
{ {
/// <summary> /// <summary>
/// Gets or sets the ID of the entity. /// Gets or sets the ID of the entity.
@@ -50,46 +50,5 @@ namespace Core.Thalos.Adapters
[JsonPropertyName("accessLevel")] [JsonPropertyName("accessLevel")]
[JsonConverter(typeof(JsonStringEnumConverter))] [JsonConverter(typeof(JsonStringEnumConverter))]
public AccessLevelEnum? AccessLevel { get; set; } = null!; public AccessLevelEnum? AccessLevel { get; set; } = null!;
/// <summary>
/// Gets or sets the date and time when the entity was created.
/// </summary>
[BsonElement("createdAt")]
[BsonRepresentation(BsonType.DateTime)]
[JsonPropertyName("createdAt")]
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
/// <summary>
/// Gets or sets the user who created the entity.
/// </summary>
[BsonElement("createdBy")]
[BsonRepresentation(BsonType.String)]
[JsonPropertyName("createdBy")]
public string? CreatedBy { get; set; }
/// <summary>
/// Gets or sets the date and time when the entity was last updated.
/// </summary>
[BsonElement("updatedAt")]
[BsonRepresentation(BsonType.DateTime)]
[JsonPropertyName("updatedAt")]
public DateTime? UpdatedAt { get; set; } = null;
/// <summary>
/// Gets or sets the user who last updated the entity.
/// </summary>
[BsonElement("updatedBy")]
[BsonRepresentation(BsonType.String)]
[JsonPropertyName("updatedBy")]
public string? UpdatedBy { get; set; } = null;
/// <summary>
/// Gets or sets the status of the entity.
/// </summary>
[BsonElement("status")]
[BsonRepresentation(BsonType.String)]
[JsonPropertyName("status")]
[JsonConverter(typeof(JsonStringEnumConverter))]
public StatusEnum Status { get; set; } = StatusEnum.Active;
} }
} }

View File

@@ -14,7 +14,7 @@ namespace Core.Thalos.Adapters
/// <summary> /// <summary>
/// Adapter representing a role. /// Adapter representing a role.
/// </summary> /// </summary>
public class RoleAdapter public class RoleAdapter : Document
{ {
/// <summary> /// <summary>
/// Gets or sets the unique identifier of the role. /// Gets or sets the unique identifier of the role.
@@ -62,46 +62,5 @@ namespace Core.Thalos.Adapters
[BsonElement("permissions")] [BsonElement("permissions")]
[JsonPropertyName("permissions")] [JsonPropertyName("permissions")]
public string[] Permissions { get; set; } = null!; public string[] Permissions { get; set; } = null!;
/// <summary>
/// Gets or sets the date and time when the entity was created.
/// </summary>
[BsonElement("createdAt")]
[BsonRepresentation(BsonType.DateTime)]
[JsonPropertyName("createdAt")]
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
/// <summary>
/// Gets or sets the user who created the entity.
/// </summary>
[BsonElement("createdBy")]
[BsonRepresentation(BsonType.String)]
[JsonPropertyName("createdBy")]
public string? CreatedBy { get; set; }
/// <summary>
/// Gets or sets the date and time when the entity was last updated.
/// </summary>
[BsonElement("updatedAt")]
[BsonRepresentation(BsonType.DateTime)]
[JsonPropertyName("updatedAt")]
public DateTime? UpdatedAt { get; set; } = null;
/// <summary>
/// Gets or sets the user who last updated the entity.
/// </summary>
[BsonElement("updatedBy")]
[BsonRepresentation(BsonType.String)]
[JsonPropertyName("updatedBy")]
public string? UpdatedBy { get; set; } = null;
/// <summary>
/// Gets or sets the status of the entity.
/// </summary>
[BsonElement("status")]
[BsonRepresentation(BsonType.String)]
[JsonPropertyName("status")]
[JsonConverter(typeof(JsonStringEnumConverter))]
public StatusEnum Status { get; set; } = StatusEnum.Active;
} }
} }

View File

@@ -13,7 +13,7 @@ namespace Core.Thalos.Adapters
/// <summary> /// <summary>
/// Adapter representing a user. /// Adapter representing a user.
/// </summary> /// </summary>
public class UserAdapter : BaseAdapterResponse public class UserAdapter : Document
{ {
/// <summary> /// <summary>
/// Gets or sets the unique identifier of the user. /// Gets or sets the unique identifier of the user.
@@ -126,46 +126,5 @@ namespace Core.Thalos.Adapters
[BsonRepresentation(BsonType.String)] [BsonRepresentation(BsonType.String)]
[JsonPropertyName("token")] [JsonPropertyName("token")]
public string? Token { get; set; } = null; public string? Token { get; set; } = null;
/// <summary>
/// Gets or sets the date and time when the entity was created.
/// </summary>
[BsonElement("createdAt")]
[BsonRepresentation(BsonType.DateTime)]
[JsonPropertyName("createdAt")]
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
/// <summary>
/// Gets or sets the user who created the entity.
/// </summary>
[BsonElement("createdBy")]
[BsonRepresentation(BsonType.String)]
[JsonPropertyName("createdBy")]
public string? CreatedBy { get; set; }
/// <summary>
/// Gets or sets the date and time when the entity was last updated.
/// </summary>
[BsonElement("updatedAt")]
[BsonRepresentation(BsonType.DateTime)]
[JsonPropertyName("updatedAt")]
public DateTime? UpdatedAt { get; set; } = null;
/// <summary>
/// Gets or sets the user who last updated the entity.
/// </summary>
[BsonElement("updatedBy")]
[BsonRepresentation(BsonType.String)]
[JsonPropertyName("updatedBy")]
public string? UpdatedBy { get; set; } = null;
/// <summary>
/// Gets or sets the status of the entity.
/// </summary>
[BsonElement("status")]
[BsonRepresentation(BsonType.String)]
[JsonPropertyName("status")]
[JsonConverter(typeof(JsonStringEnumConverter))]
public StatusEnum Status { get; set; } = StatusEnum.Active;
} }
} }

View File

@@ -12,6 +12,7 @@
<ItemGroup> <ItemGroup>
<PackageReference Include="Asp.Versioning.Mvc.ApiExplorer" Version="8.1.0" /> <PackageReference Include="Asp.Versioning.Mvc.ApiExplorer" Version="8.1.0" />
<PackageReference Include="Blueprint.Mongo" Version="0.0.3" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="8.0.10" /> <PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="8.0.10" />
<PackageReference Include="Microsoft.Extensions.Configuration.AzureAppConfiguration" Version="8.2.0" /> <PackageReference Include="Microsoft.Extensions.Configuration.AzureAppConfiguration" Version="8.2.0" />
<PackageReference Include="Microsoft.Identity.Web" Version="3.9.1" /> <PackageReference Include="Microsoft.Identity.Web" Version="3.9.1" />