re-factor in adapters
This commit is contained in:
		| @@ -5,7 +5,7 @@ using System.Text.Json.Serialization; | ||||
| namespace Core.Adapters.Lib | ||||
| { | ||||
|     [CollectionAttributeName("Furniture")] | ||||
|     public class FurnitureModel : Document | ||||
|     public class FurnitureBase : Document | ||||
|     { | ||||
|         [BsonElement("modelName")] | ||||
|         [JsonPropertyName("modelName")] | ||||
| @@ -34,6 +34,10 @@ namespace Core.Adapters.Lib | ||||
|         [BsonElement("maintenanceNotes")] | ||||
|         [JsonPropertyName("maintenanceNotes")] | ||||
|         public string MaintenanceNotes { get; set; } = null!; | ||||
| 
 | ||||
|         [BsonElement("variantIds")] | ||||
|         [JsonPropertyName("variantIds")] | ||||
|         public List<string> VariantIds { get; set; } = new(); | ||||
|     } | ||||
| 
 | ||||
|     public class Dimensions | ||||
							
								
								
									
										26
									
								
								Inventory/FurnitureVariant.cs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										26
									
								
								Inventory/FurnitureVariant.cs
									
									
									
									
									
										Normal 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 : Document | ||||
|     { | ||||
|         [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!; | ||||
|     } | ||||
| } | ||||
| @@ -1,27 +1,13 @@ | ||||
| using Core.Blueprint.Mongo; | ||||
| using MongoDB.Bson.Serialization.Attributes; | ||||
| using MongoDB.Bson.Serialization.Attributes; | ||||
| using System.Text.Json.Serialization; | ||||
|  | ||||
| namespace Core.Adapters.Lib | ||||
| namespace Core.Adapters.Lib.Inventory | ||||
| { | ||||
|     [CollectionAttributeName("Inventory")] | ||||
|     public class InventoryItem : FurnitureModel | ||||
|     public abstract class InventoryItem : Document | ||||
|     { | ||||
|         [BsonElement("modelId")] | ||||
|         [JsonPropertyName("modelId")] | ||||
|         public string ModelId { get; set; } = null!; // FK to FurnitureModel._id | ||||
|  | ||||
|         [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!; | ||||
|         [BsonElement("stock")] | ||||
|         [JsonPropertyName("stock")] | ||||
|         public int Stock { get; set; } | ||||
|  | ||||
|         [BsonElement("price")] | ||||
|         [JsonPropertyName("price")] | ||||
| @@ -31,10 +17,6 @@ namespace Core.Adapters.Lib | ||||
|         [JsonPropertyName("currency")] | ||||
|         public string Currency { get; set; } = null!; | ||||
|  | ||||
|         [BsonElement("stock")] | ||||
|         [JsonPropertyName("stock")] | ||||
|         public int Stock { get; set; } | ||||
|  | ||||
|         [BsonElement("categoryId")] | ||||
|         [JsonPropertyName("categoryId")] | ||||
|         public Guid CategoryId { get; set; } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user