From df50e72359b2de1cdb7e6494f347714d7c3a2383 Mon Sep 17 00:00:00 2001 From: Oscar Morales Date: Thu, 31 Jul 2025 16:39:38 -0600 Subject: [PATCH] Add tags adapters --- Inventory/TagAdapter.cs | 38 +++++++++++++++++++++++++++++++++ Inventory/TagOverrideAdapter.cs | 22 +++++++++++++++++++ Inventory/TagTypeAdapter.cs | 26 ++++++++++++++++++++++ 3 files changed, 86 insertions(+) create mode 100644 Inventory/TagAdapter.cs create mode 100644 Inventory/TagOverrideAdapter.cs create mode 100644 Inventory/TagTypeAdapter.cs diff --git a/Inventory/TagAdapter.cs b/Inventory/TagAdapter.cs new file mode 100644 index 0000000..b45d48b --- /dev/null +++ b/Inventory/TagAdapter.cs @@ -0,0 +1,38 @@ +using Core.Blueprint.Mongo; +using MongoDB.Bson.Serialization.Attributes; +using System.Text.Json.Serialization; + +namespace Core.Adapters.Lib +{ + [CollectionAttributeName("Tag")] + public class TagAdapter : Document + { + [BsonElement("tenantId")] + [JsonPropertyName("tenantId")] + public string TenantId { get; set; } = null!; + + [BsonElement("tagName")] + [JsonPropertyName("tagName")] + public string TagName { get; set; } = null!; + + [BsonElement("typeId")] + [JsonPropertyName("typeId")] + public string TypeId { get; set; } = null!; + + [BsonElement("parentTagId")] + [JsonPropertyName("parentTagId")] + public string ParentTagId { get; set; } = null!; + + [BsonElement("slug")] + [JsonPropertyName("slug")] + public string Slug { get; set; } = null!; + + [BsonElement("displayOrder")] + [JsonPropertyName("displayOrder")] + public int DisplayOrder { get; set; } + + [BsonElement("icon")] + [JsonPropertyName("icon")] + public string Icon { get; set; } = null!; + } +} diff --git a/Inventory/TagOverrideAdapter.cs b/Inventory/TagOverrideAdapter.cs new file mode 100644 index 0000000..a95e8f2 --- /dev/null +++ b/Inventory/TagOverrideAdapter.cs @@ -0,0 +1,22 @@ +using Core.Blueprint.Mongo; +using MongoDB.Bson.Serialization.Attributes; +using System.Text.Json.Serialization; + +namespace Core.Adapters.Lib +{ + [CollectionAttributeName("TagOverride")] + public class TagOverrideAdapter : Document + { + [BsonElement("tenantId")] + [JsonPropertyName("tenantId")] + public string TenantId { get; set; } = null!; + + [BsonElement("baseTagId")] + [JsonPropertyName("baseTagId")] + public string BaseTagId { get; set; } = null!; + + [BsonElement("overrideTagId")] + [JsonPropertyName("overrideTagId")] + public string OverrideTagId { get; set; } = null!; + } +} diff --git a/Inventory/TagTypeAdapter.cs b/Inventory/TagTypeAdapter.cs new file mode 100644 index 0000000..13b9dce --- /dev/null +++ b/Inventory/TagTypeAdapter.cs @@ -0,0 +1,26 @@ +using Core.Blueprint.Mongo; +using MongoDB.Bson.Serialization.Attributes; +using System.Text.Json.Serialization; + +namespace Core.Adapters.Lib +{ + [CollectionAttributeName("TagType")] + public class TagTypeAdapter : Document + { + [BsonElement("tenantId")] + [JsonPropertyName("tenantId")] + public string TenantId { get; set; } = null!; + + [BsonElement("typeName")] + [JsonPropertyName("typeName")] + public string TypeName { get; set; } = null!; + + [BsonElement("level")] + [JsonPropertyName("level")] + public int Level { get; set; } + + [BsonElement("parentTypeId")] + [JsonPropertyName("parentTypeId")] + public string ParentTypeId { get; set; } = null!; + } +} -- 2.49.1