Added catalog and tenant adapter
This commit is contained in:
32
Core.Thalos.BuildingBlocks/Adapters/CatalogAdapter.cs
Normal file
32
Core.Thalos.BuildingBlocks/Adapters/CatalogAdapter.cs
Normal 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!;
|
||||||
|
}
|
||||||
|
}
|
||||||
51
Core.Thalos.BuildingBlocks/Adapters/TenantAdapter.cs
Normal file
51
Core.Thalos.BuildingBlocks/Adapters/TenantAdapter.cs
Normal 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; }
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user