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