Added catalog and tenant adapter

This commit is contained in:
2025-07-31 18:45:08 -06:00
parent db10d185da
commit 8d1e218eb9
2 changed files with 83 additions and 0 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,51 @@
using MongoDB.Bson;
using MongoDB.Bson.Serialization.Attributes;
namespace Core.Thalos.BuildingBlocks
{
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; }
}
}