11 Commits

Author SHA1 Message Date
4358891b24 Change type in dictionary 2025-06-27 20:51:57 -06:00
feee4ebdfa Fix type 2025-06-27 20:41:09 -06:00
6c11246733 fix Ids type 2025-06-27 20:21:47 -06:00
20776516fd Added bsontype 2025-06-27 20:15:51 -06:00
08cca3a9c0 Fix in inheritance 2025-06-27 19:34:39 -06:00
fcfb3e47e8 Fix in InventoryItem NameSpace 2025-06-22 02:23:35 -06:00
ad7b1bd983 re-factor in adapters 2025-06-22 01:58:31 -06:00
f6a80ba2ec Fix in namespace 2025-06-22 01:03:23 -06:00
e7b25ba91a Fixes in code 2025-06-22 01:00:28 -06:00
e33301f6af Fix in structure 2025-06-22 00:56:21 -06:00
18cb238b40 first version of inventory adapters 2025-06-22 00:47:44 -06:00
4 changed files with 118 additions and 29 deletions

View File

@@ -1,29 +0,0 @@
using Core.Blueprint.Mongo;
using MongoDB.Bson.Serialization.Attributes;
using System.Text.Json.Serialization;
namespace Core.Adapters.Lib.Inventory.Base
{
[CollectionAttributeName("Inventory")]
public class InventoryItem : Document
{
[BsonElement("name")]
[JsonPropertyName("name")]
public string Name { get; set; }
[BsonElement("description")]
[JsonPropertyName("description")]
public string Description { get; set; }
[BsonElement("stock")]
[JsonPropertyName("stock")]
public int Stock { get; set; }
[BsonElement("representation")]
[JsonPropertyName("representation")]
public string Representation { get; set; }
public string Company { get; set; }
}
}

View File

@@ -0,0 +1,57 @@
using Core.Blueprint.Mongo;
using MongoDB.Bson.Serialization.Attributes;
using System.Text.Json.Serialization;
namespace Core.Adapters.Lib
{
[CollectionAttributeName("Furniture")]
public class FurnitureBase : Document
{
[BsonElement("modelName")]
[JsonPropertyName("modelName")]
public string ModelName { get; set; } = null!;
[BsonElement("material")]
[JsonPropertyName("material")]
public string Material { get; set; } = null!;
[BsonElement("condition")]
[JsonPropertyName("condition")]
public string Condition { get; set; } = null!;
[BsonElement("dimensions")]
[JsonPropertyName("dimensions")]
public Dimensions Dimensions { get; set; } = null!;
[BsonElement("baseDescription")]
[JsonPropertyName("baseDescription")]
public string BaseDescription { get; set; } = null!;
[BsonElement("representation")]
[JsonPropertyName("representation")]
public string Representation { get; set; } = null!;
[BsonElement("maintenanceNotes")]
[JsonPropertyName("maintenanceNotes")]
public string MaintenanceNotes { get; set; } = null!;
[BsonElement("variantIds")]
[JsonPropertyName("variantIds")]
public List<string> VariantIds { get; set; } = new();
}
public class Dimensions
{
[BsonElement("width")]
[JsonPropertyName("width")]
public float Width { get; set; }
[BsonElement("height")]
[JsonPropertyName("height")]
public float Height { get; set; }
[BsonElement("depth")]
[JsonPropertyName("depth")]
public float Depth { get; set; }
}
}

View File

@@ -0,0 +1,26 @@
using Core.Blueprint.Mongo;
using MongoDB.Bson.Serialization.Attributes;
using System.Text.Json.Serialization;
namespace Core.Adapters.Lib
{
[CollectionAttributeName("FurnitureVariants")]
public class FurnitureVariant : InventoryItem
{
[BsonElement("modelId")]
[JsonPropertyName("modelId")]
public string ModelId { get; set; } = null!;
[BsonElement("name")]
[JsonPropertyName("name")]
public string Name { get; set; } = null!;
[BsonElement("color")]
[JsonPropertyName("color")]
public string Color { get; set; } = null!;
[BsonElement("line")]
[JsonPropertyName("line")]
public string Line { get; set; } = null!;
}
}

View File

@@ -0,0 +1,35 @@
using MongoDB.Bson;
using MongoDB.Bson.Serialization.Attributes;
using System.Text.Json.Serialization;
namespace Core.Adapters.Lib
{
public abstract class InventoryItem : Document
{
[BsonElement("stock")]
[JsonPropertyName("stock")]
public int Stock { get; set; }
[BsonElement("price")]
[JsonPropertyName("price")]
public decimal Price { get; set; }
[BsonElement("currency")]
[JsonPropertyName("currency")]
public string Currency { get; set; } = null!;
[BsonElement("categoryId")]
[BsonRepresentation(BsonType.String)]
[JsonPropertyName("categoryId")]
public string CategoryId { get; set; }
[BsonElement("providerId")]
[BsonRepresentation(BsonType.String)]
[JsonPropertyName("providerId")]
public string ProviderId { get; set; }
[BsonElement("attributes")]
[JsonPropertyName("attributes")]
public Dictionary<string, string> Attributes { get; set; } = [];
}
}