4 Commits

Author SHA1 Message Date
a025bd87c1 fix id route 2025-07-31 19:56:56 -06:00
ff404ec105 Add collection attribute name 2025-07-31 19:43:46 -06:00
8d1e218eb9 Added catalog and tenant adapter 2025-07-31 18:45:08 -06:00
db10d185da Remove unnecessary properties from user adapter 2025-07-25 23:53:00 -06:00
4 changed files with 86 additions and 23 deletions

View File

@@ -0,0 +1,32 @@
using Core.Blueprint.Mongo;
using MongoDB.Bson;
using MongoDB.Bson.Serialization.Attributes;
namespace Core.Thalos.BuildingBlocks.Adapters
{
[CollectionAttributeName("Catalogs")]
public class CatalogAdapter : Document
{
[BsonElement("name")]
public string Name { get; set; } = null!;
[BsonElement("key")]
public string? Key { get; set; } = null!;
[BsonElement("description")]
public string? Description { get; set; }
public IEnumerable<CatalogValue>? Values { get; set; }
}
public class CatalogValue
{
[BsonId]
[BsonElement("_id")]
[BsonRepresentation(BsonType.ObjectId)]
public string _Id { get; set; } = null!;
[BsonElement("value")]
public string Value { get; set; } = null!;
}
}

View File

@@ -0,0 +1,53 @@
using Core.Blueprint.Mongo;
using MongoDB.Bson;
using MongoDB.Bson.Serialization.Attributes;
namespace Core.Thalos.BuildingBlocks
{
[CollectionAttributeName("Tenants")]
public class TenantAdapter : Document
{
[BsonElement("name")]
public string Name { get; set; } = null!;
[BsonElement("taxIdentifier")]
public string TaxIdentifier { get; set; } = null!;
[BsonElement("addressLine1")]
public string AddressLine1 { get; set; } = null!;
[BsonElement("addressLine2")]
[BsonIgnoreIfNull]
public string? AddressLine2 { get; set; }
[BsonElement("city")]
public string City { get; set; } = null!;
[BsonElement("state")]
public string State { get; set; } = null!;
[BsonElement("country")]
public string Country { get; set; } = null!;
[BsonElement("postalCode")]
public string PostalCode { get; set; } = null!;
[BsonElement("contactEmail")]
public string ContactEmail { get; set; } = null!;
[BsonElement("contactPhone")]
public string ContactPhone { get; set; } = null!;
[BsonElement("website")]
[BsonIgnoreIfNull]
public string? Website { get; set; }
[BsonElement("connectionString")]
[BsonIgnoreIfNull]
public string? ConnectionString { get; set; }
[BsonElement("isolated")]
public bool Isolated { get; set; }
}
}

View File

@@ -72,28 +72,6 @@ namespace Core.Thalos.BuildingBlocks
[JsonPropertyName("roleId")]
public string RoleId { get; set; } = null!;
/// <summary>
/// Gets or sets the array of companies associated with the user.
/// </summary>
[BsonElement("companies")]
[JsonPropertyName("companies")]
public string[] Companies { get; set; } = null!;
/// <summary>
/// Gets or sets the array of projects associated with the user.
/// </summary>
[BsonElement("projects")]
[JsonPropertyName("projects")]
public string[]? Projects { get; set; }
/// <summary>
/// Gets or sets the boolean of the consent form accepted by the user.
/// </summary>
[BsonElement("consentFormAccepted")]
[JsonPropertyName("consentFormAccepted")]
[BsonIgnoreIfNull]
public bool ConsentFormAccepted { get; set; }
/// <summary>
/// Gets or sets the timestamp of the last login of the user.
/// </summary>

View File

@@ -24,7 +24,7 @@ namespace Core.Thalos.BuildingBlocks
/// <summary>
/// The identifier route.
/// </summary>
public const string Id = "{id}";
public const string Id = "{_id}";
/// <summary>
/// The Authentication route.