Compare commits
21 Commits
4a241e401e
...
developmen
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
051ce0c89e | ||
| d66a0241df | |||
| f8fbcfe26d | |||
| e81551e5d1 | |||
| 0fcf1146f8 | |||
| d713359512 | |||
|
|
163eb0e5aa | ||
| 7866ef07d5 | |||
|
|
df50e72359 | ||
|
|
a266aa5001 | ||
| 4358891b24 | |||
| feee4ebdfa | |||
| 6c11246733 | |||
| 20776516fd | |||
| 08cca3a9c0 | |||
| fcfb3e47e8 | |||
| ad7b1bd983 | |||
| f6a80ba2ec | |||
| e7b25ba91a | |||
| e33301f6af | |||
| 18cb238b40 |
61
Inventory/FurnitureBase.cs
Normal file
61
Inventory/FurnitureBase.cs
Normal file
@@ -0,0 +1,61 @@
|
|||||||
|
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();
|
||||||
|
|
||||||
|
[BsonElement("icon")]
|
||||||
|
[JsonPropertyName("icon")]
|
||||||
|
public string Icon { get; set; } = null!;
|
||||||
|
}
|
||||||
|
|
||||||
|
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; }
|
||||||
|
}
|
||||||
|
}
|
||||||
30
Inventory/FurnitureVariant.cs
Normal file
30
Inventory/FurnitureVariant.cs
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
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!;
|
||||||
|
|
||||||
|
[BsonElement("icon")]
|
||||||
|
[JsonPropertyName("icon")]
|
||||||
|
public string Icon { get; set; } = null!;
|
||||||
|
}
|
||||||
|
}
|
||||||
35
Inventory/InventoryItem.cs
Normal file
35
Inventory/InventoryItem.cs
Normal 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; } = [];
|
||||||
|
}
|
||||||
|
}
|
||||||
59
Inventory/ProductAdapter.cs
Normal file
59
Inventory/ProductAdapter.cs
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
using Core.Blueprint.Mongo;
|
||||||
|
using MongoDB.Bson;
|
||||||
|
using MongoDB.Bson.Serialization.Attributes;
|
||||||
|
using System.Text.Json.Serialization;
|
||||||
|
|
||||||
|
namespace Core.Adapters.Lib.Inventory
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Represents the possible statuses of a product.
|
||||||
|
/// </summary>
|
||||||
|
public enum ProductStatus
|
||||||
|
{
|
||||||
|
Active,
|
||||||
|
Inactive,
|
||||||
|
Discontinued
|
||||||
|
}
|
||||||
|
|
||||||
|
[CollectionAttributeName("Product")]
|
||||||
|
public class ProductAdapter : Document
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the foreign key to the owning Tenant.
|
||||||
|
/// </summary>
|
||||||
|
[BsonElement("tenantId")]
|
||||||
|
[JsonPropertyName("tenantId")]
|
||||||
|
public string TenantId { get; set; } = null!;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the name of the product.
|
||||||
|
/// </summary>
|
||||||
|
[BsonElement("productName")]
|
||||||
|
[JsonPropertyName("productName")]
|
||||||
|
public string ProductName { get; set; } = null!;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the description of the product.
|
||||||
|
/// </summary>
|
||||||
|
[BsonElement("description")]
|
||||||
|
[JsonPropertyName("description")]
|
||||||
|
public string Description { get; set; } = null!;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the status of the product. Stored as a string in MongoDB.
|
||||||
|
/// </summary>
|
||||||
|
[BsonElement("productStatus")]
|
||||||
|
[JsonPropertyName("productStatus")]
|
||||||
|
[BsonRepresentation(BsonType.String)]
|
||||||
|
public ProductStatus ProductStatus { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the list of Tag Ids associated with this product.
|
||||||
|
/// This follows the standard MongoDB practice for many-to-many relationships
|
||||||
|
/// by embedding an array of references.
|
||||||
|
/// </summary>
|
||||||
|
[BsonElement("tagIds")]
|
||||||
|
[JsonPropertyName("tagIds")]
|
||||||
|
public List<ObjectId> TagIds { get; set; } = new List<ObjectId>();
|
||||||
|
}
|
||||||
|
}
|
||||||
38
Inventory/TagAdapter.cs
Normal file
38
Inventory/TagAdapter.cs
Normal file
@@ -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!;
|
||||||
|
}
|
||||||
|
}
|
||||||
22
Inventory/TagOverrideAdapter.cs
Normal file
22
Inventory/TagOverrideAdapter.cs
Normal file
@@ -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!;
|
||||||
|
}
|
||||||
|
}
|
||||||
26
Inventory/TagTypeAdapter.cs
Normal file
26
Inventory/TagTypeAdapter.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("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!;
|
||||||
|
}
|
||||||
|
}
|
||||||
9
nuget.config
Normal file
9
nuget.config
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<configuration>
|
||||||
|
<packageSources>
|
||||||
|
<!-- Tu BaGet primero -->
|
||||||
|
<add key="BaGet" value="https://nuget.dream-views.com/v3/index.json" protocolVersion="3" />
|
||||||
|
<!-- NuGet oficial como fallback (si quieres) -->
|
||||||
|
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
|
||||||
|
</packageSources>
|
||||||
|
</configuration>
|
||||||
Reference in New Issue
Block a user