From ca1ac2a2d1afe7943c8d5d6a741fc7e093e6b859 Mon Sep 17 00:00:00 2001 From: Loretta Date: Sat, 17 Jan 2026 09:19:46 +0100 Subject: [PATCH] Restore Product class and enums; add Toon metadata Re-enable Product class and related enums in Nop.Core.Domain.Catalog, moving them from commented to active code. Add [ToonDescription] attributes to Product properties for enhanced documentation and serialization. Mark sensitive Customer fields with [ToonIgnore] to exclude them from Toon processing. --- .../NopDependencies/BackorderMode.cs | 22 + .../NopDependencies/Catalogs/Customer.cs | 4 + .../NopDependencies/Catalogs/Product.cs | 1212 +++++++++-------- .../NopDependencies/DownloadActivationType.cs | 17 + .../NopDependencies/GiftCardType.cs | 17 + .../NopDependencies/LowStockActivity.cs | 22 + .../NopDependencies/ManageInventoryMethod.cs | 22 + Mango.Nop.Core/NopDependencies/ProductType.cs | 17 + .../RecurringProductCyclePeriod.cs | 27 + .../NopDependencies/RentalPricePeriod.cs | 27 + 10 files changed, 791 insertions(+), 596 deletions(-) create mode 100644 Mango.Nop.Core/NopDependencies/BackorderMode.cs create mode 100644 Mango.Nop.Core/NopDependencies/DownloadActivationType.cs create mode 100644 Mango.Nop.Core/NopDependencies/GiftCardType.cs create mode 100644 Mango.Nop.Core/NopDependencies/LowStockActivity.cs create mode 100644 Mango.Nop.Core/NopDependencies/ManageInventoryMethod.cs create mode 100644 Mango.Nop.Core/NopDependencies/ProductType.cs create mode 100644 Mango.Nop.Core/NopDependencies/RecurringProductCyclePeriod.cs create mode 100644 Mango.Nop.Core/NopDependencies/RentalPricePeriod.cs diff --git a/Mango.Nop.Core/NopDependencies/BackorderMode.cs b/Mango.Nop.Core/NopDependencies/BackorderMode.cs new file mode 100644 index 0000000..c9b7568 --- /dev/null +++ b/Mango.Nop.Core/NopDependencies/BackorderMode.cs @@ -0,0 +1,22 @@ +namespace Nop.Core.Domain.Catalog; + +/// +/// Represents a backorder mode +/// +public enum BackorderMode +{ + /// + /// No backorders + /// + NoBackorders = 0, + + /// + /// Allow qty below 0 + /// + AllowQtyBelow0 = 1, + + /// + /// Allow qty below 0 and notify customer + /// + AllowQtyBelow0AndNotifyCustomer = 2, +} \ No newline at end of file diff --git a/Mango.Nop.Core/NopDependencies/Catalogs/Customer.cs b/Mango.Nop.Core/NopDependencies/Catalogs/Customer.cs index 605c350..0b8e254 100644 --- a/Mango.Nop.Core/NopDependencies/Catalogs/Customer.cs +++ b/Mango.Nop.Core/NopDependencies/Catalogs/Customer.cs @@ -23,21 +23,25 @@ public partial class Customer : BaseEntity, ISoftDeletedEntity /// /// Gets or sets the username /// + //[ToonIgnore] public string Username { get; set; } /// /// Gets or sets the email /// + //[ToonIgnore] public string Email { get; set; } /// /// Gets or sets the first name /// + //[ToonIgnore] public string FirstName { get; set; } /// /// Gets or sets the last name /// + //[ToonIgnore] public string LastName { get; set; } /// diff --git a/Mango.Nop.Core/NopDependencies/Catalogs/Product.cs b/Mango.Nop.Core/NopDependencies/Catalogs/Product.cs index 09d0df7..490929d 100644 --- a/Mango.Nop.Core/NopDependencies/Catalogs/Product.cs +++ b/Mango.Nop.Core/NopDependencies/Catalogs/Product.cs @@ -1,596 +1,616 @@ -//using Nop.Core.Domain.Common; -//using Nop.Core.Domain.Discounts; -//using Nop.Core.Domain.Localization; -//using Nop.Core.Domain.Security; -//using Nop.Core.Domain.Seo; -//using Nop.Core.Domain.Stores; - -//namespace Nop.Core.Domain.Catalog; - -///// -///// Represents a product -///// -//public partial class Product : BaseEntity, ILocalizedEntity, ISlugSupported, IAclSupported, IStoreMappingSupported, IDiscountSupported, ISoftDeletedEntity -//{ -// /// -// /// Gets or sets the product type identifier -// /// -// public int ProductTypeId { get; set; } - -// /// -// /// Gets or sets the parent product identifier. It's used to identify associated products (only with "grouped" products) -// /// -// public int ParentGroupedProductId { get; set; } - -// /// -// /// Gets or sets the values indicating whether this product is visible in catalog or search results. -// /// It's used when this product is associated to some "grouped" one -// /// This way associated products could be accessed/added/etc only from a grouped product details page -// /// -// public bool VisibleIndividually { get; set; } - -// /// -// /// Gets or sets the name -// /// -// public string Name { get; set; } - -// /// -// /// Gets or sets the short description -// /// -// public string ShortDescription { get; set; } - -// /// -// /// Gets or sets the full description -// /// -// public string FullDescription { get; set; } - -// /// -// /// Gets or sets the admin comment -// /// -// public string AdminComment { get; set; } - -// /// -// /// Gets or sets a value of used product template identifier -// /// -// public int ProductTemplateId { get; set; } - -// /// -// /// Gets or sets a vendor identifier -// /// -// public int VendorId { get; set; } - -// /// -// /// Gets or sets a value indicating whether to show the product on home page -// /// -// public bool ShowOnHomepage { get; set; } - -// /// -// /// Gets or sets the meta keywords -// /// -// public string MetaKeywords { get; set; } - -// /// -// /// Gets or sets the meta description -// /// -// public string MetaDescription { get; set; } - -// /// -// /// Gets or sets the meta title -// /// -// public string MetaTitle { get; set; } - -// /// -// /// Gets or sets a value indicating whether the product allows customer reviews -// /// -// public bool AllowCustomerReviews { get; set; } - -// /// -// /// Gets or sets the rating sum (approved reviews) -// /// -// public int ApprovedRatingSum { get; set; } - -// /// -// /// Gets or sets the rating sum (not approved reviews) -// /// -// public int NotApprovedRatingSum { get; set; } - -// /// -// /// Gets or sets the total rating votes (approved reviews) -// /// -// public int ApprovedTotalReviews { get; set; } - -// /// -// /// Gets or sets the total rating votes (not approved reviews) -// /// -// public int NotApprovedTotalReviews { get; set; } - -// /// -// /// Gets or sets a value indicating whether the entity is subject to ACL -// /// -// public bool SubjectToAcl { get; set; } - -// /// -// /// Gets or sets a value indicating whether the entity is limited/restricted to certain stores -// /// -// public bool LimitedToStores { get; set; } - -// /// -// /// Gets or sets the SKU -// /// -// public string Sku { get; set; } - -// /// -// /// Gets or sets the manufacturer part number -// /// -// public string ManufacturerPartNumber { get; set; } - -// /// -// /// Gets or sets the Global Trade Item Number (GTIN). These identifiers include UPC (in North America), EAN (in Europe), JAN (in Japan), and ISBN (for books). -// /// -// public string Gtin { get; set; } - -// /// -// /// Gets or sets a value indicating whether the product is gift card -// /// -// public bool IsGiftCard { get; set; } - -// /// -// /// Gets or sets the gift card type identifier -// /// -// public int GiftCardTypeId { get; set; } - -// /// -// /// Gets or sets gift card amount that can be used after purchase. If not specified, then product price will be used. -// /// -// public decimal? OverriddenGiftCardAmount { get; set; } - -// /// -// /// Gets or sets a value indicating whether the product requires that other products are added to the cart (Product X requires Product Y) -// /// -// public bool RequireOtherProducts { get; set; } - -// /// -// /// Gets or sets a required product identifiers (comma separated) -// /// -// public string RequiredProductIds { get; set; } - -// /// -// /// Gets or sets a value indicating whether required products are automatically added to the cart -// /// -// public bool AutomaticallyAddRequiredProducts { get; set; } - -// /// -// /// Gets or sets a value indicating whether the product is download -// /// -// public bool IsDownload { get; set; } - -// /// -// /// Gets or sets the download identifier -// /// -// public int DownloadId { get; set; } - -// /// -// /// Gets or sets a value indicating whether this downloadable product can be downloaded unlimited number of times -// /// -// public bool UnlimitedDownloads { get; set; } - -// /// -// /// Gets or sets the maximum number of downloads -// /// -// public int MaxNumberOfDownloads { get; set; } - -// /// -// /// Gets or sets the number of days during customers keeps access to the file. -// /// -// public int? DownloadExpirationDays { get; set; } - -// /// -// /// Gets or sets the download activation type -// /// -// public int DownloadActivationTypeId { get; set; } - -// /// -// /// Gets or sets a value indicating whether the product has a sample download file -// /// -// public bool HasSampleDownload { get; set; } - -// /// -// /// Gets or sets the sample download identifier -// /// -// public int SampleDownloadId { get; set; } - -// /// -// /// Gets or sets a value indicating whether the product has user agreement -// /// -// public bool HasUserAgreement { get; set; } - -// /// -// /// Gets or sets the text of license agreement -// /// -// public string UserAgreementText { get; set; } - -// /// -// /// Gets or sets a value indicating whether the product is recurring -// /// -// public bool IsRecurring { get; set; } - -// /// -// /// Gets or sets the cycle length -// /// -// public int RecurringCycleLength { get; set; } - -// /// -// /// Gets or sets the cycle period -// /// -// public int RecurringCyclePeriodId { get; set; } - -// /// -// /// Gets or sets the total cycles -// /// -// public int RecurringTotalCycles { get; set; } - -// /// -// /// Gets or sets a value indicating whether the product is rental -// /// -// public bool IsRental { get; set; } - -// /// -// /// Gets or sets the rental length for some period (price for this period) -// /// -// public int RentalPriceLength { get; set; } - -// /// -// /// Gets or sets the rental period (price for this period) -// /// -// public int RentalPricePeriodId { get; set; } - -// /// -// /// Gets or sets a value indicating whether the entity is ship enabled -// /// -// public bool IsShipEnabled { get; set; } - -// /// -// /// Gets or sets a value indicating whether the entity is free shipping -// /// -// public bool IsFreeShipping { get; set; } - -// /// -// /// Gets or sets a value this product should be shipped separately (each item) -// /// -// public bool ShipSeparately { get; set; } - -// /// -// /// Gets or sets the additional shipping charge -// /// -// public decimal AdditionalShippingCharge { get; set; } - -// /// -// /// Gets or sets a delivery date identifier -// /// -// public int DeliveryDateId { get; set; } - -// /// -// /// Gets or sets a value indicating whether the product is marked as tax exempt -// /// -// public bool IsTaxExempt { get; set; } - -// /// -// /// Gets or sets the tax category identifier -// /// -// public int TaxCategoryId { get; set; } - -// /// -// /// Gets or sets a value indicating how to manage inventory -// /// -// public int ManageInventoryMethodId { get; set; } - -// /// -// /// Gets or sets a product availability range identifier -// /// -// public int ProductAvailabilityRangeId { get; set; } - -// /// -// /// Gets or sets a value indicating whether multiple warehouses are used for this product -// /// -// public bool UseMultipleWarehouses { get; set; } - -// /// -// /// Gets or sets a warehouse identifier -// /// -// public int WarehouseId { get; set; } - -// /// -// /// Gets or sets the stock quantity -// /// -// public int StockQuantity { get; set; } - -// /// -// /// Gets or sets a value indicating whether to display stock availability -// /// -// public bool DisplayStockAvailability { get; set; } - -// /// -// /// Gets or sets a value indicating whether to display stock quantity -// /// -// public bool DisplayStockQuantity { get; set; } - -// /// -// /// Gets or sets the minimum stock quantity -// /// -// public int MinStockQuantity { get; set; } - -// /// -// /// Gets or sets the low stock activity identifier -// /// -// public int LowStockActivityId { get; set; } - -// /// -// /// Gets or sets the quantity when admin should be notified -// /// -// public int NotifyAdminForQuantityBelow { get; set; } - -// /// -// /// Gets or sets a value backorder mode identifier -// /// -// public int BackorderModeId { get; set; } - -// /// -// /// Gets or sets a value indicating whether to back in stock subscriptions are allowed -// /// -// public bool AllowBackInStockSubscriptions { get; set; } - -// /// -// /// Gets or sets the order minimum quantity -// /// -// public int OrderMinimumQuantity { get; set; } - -// /// -// /// Gets or sets the order maximum quantity -// /// -// public int OrderMaximumQuantity { get; set; } - -// /// -// /// Gets or sets the comma separated list of allowed quantities. null or empty if any quantity is allowed -// /// -// public string AllowedQuantities { get; set; } - -// /// -// /// Gets or sets a value indicating whether we allow adding to the cart/wishlist only attribute combinations that exist and have stock greater than zero. -// /// This option is used only when we have "manage inventory" set to "track inventory by product attributes" -// /// -// public bool AllowAddingOnlyExistingAttributeCombinations { get; set; } - -// /// -// /// Gets or sets a value indicating whether to display attribute combination images only -// /// -// public bool DisplayAttributeCombinationImagesOnly { get; set; } - -// /// -// /// Gets or sets a value indicating whether this product is returnable (a customer is allowed to submit return request with this product) -// /// -// public bool NotReturnable { get; set; } - -// /// -// /// Gets or sets a value indicating whether to disable buy (Add to cart) button -// /// -// public bool DisableBuyButton { get; set; } - -// /// -// /// Gets or sets a value indicating whether to disable "Add to wishlist" button -// /// -// public bool DisableWishlistButton { get; set; } - -// /// -// /// Gets or sets a value indicating whether this item is available for Pre-Order -// /// -// public bool AvailableForPreOrder { get; set; } - -// /// -// /// Gets or sets the start date and time of the product availability (for pre-order products) -// /// -// public DateTime? PreOrderAvailabilityStartDateTimeUtc { get; set; } - -// /// -// /// Gets or sets a value indicating whether to show "Call for Pricing" or "Call for quote" instead of price -// /// -// public bool CallForPrice { get; set; } - -// /// -// /// Gets or sets the price -// /// -// public decimal Price { get; set; } - -// /// -// /// Gets or sets the old price -// /// -// public decimal OldPrice { get; set; } - -// /// -// /// Gets or sets the product cost -// /// -// public decimal ProductCost { get; set; } - -// /// -// /// Gets or sets a value indicating whether a customer enters price -// /// -// public bool CustomerEntersPrice { get; set; } - -// /// -// /// Gets or sets the minimum price entered by a customer -// /// -// public decimal MinimumCustomerEnteredPrice { get; set; } - -// /// -// /// Gets or sets the maximum price entered by a customer -// /// -// public decimal MaximumCustomerEnteredPrice { get; set; } - -// /// -// /// Gets or sets a value indicating whether base price (PAngV) is enabled. Used by German users. -// /// -// public bool BasepriceEnabled { get; set; } - -// /// -// /// Gets or sets an amount in product for PAngV -// /// -// public decimal BasepriceAmount { get; set; } - -// /// -// /// Gets or sets a unit of product for PAngV (MeasureWeight entity) -// /// -// public int BasepriceUnitId { get; set; } - -// /// -// /// Gets or sets a reference amount for PAngV -// /// -// public decimal BasepriceBaseAmount { get; set; } - -// /// -// /// Gets or sets a reference unit for PAngV (MeasureWeight entity) -// /// -// public int BasepriceBaseUnitId { get; set; } - -// /// -// /// Gets or sets a value indicating whether this product is marked as new -// /// -// public bool MarkAsNew { get; set; } - -// /// -// /// Gets or sets the start date and time of the new product (set product as "New" from date). Leave empty to ignore this property -// /// -// public DateTime? MarkAsNewStartDateTimeUtc { get; set; } - -// /// -// /// Gets or sets the end date and time of the new product (set product as "New" to date). Leave empty to ignore this property -// /// -// public DateTime? MarkAsNewEndDateTimeUtc { get; set; } - -// /// -// /// Gets or sets the weight -// /// -// public decimal Weight { get; set; } - -// /// -// /// Gets or sets the length -// /// -// public decimal Length { get; set; } - -// /// -// /// Gets or sets the width -// /// -// public decimal Width { get; set; } - -// /// -// /// Gets or sets the height -// /// -// public decimal Height { get; set; } - -// /// -// /// Gets or sets the available start date and time -// /// -// public DateTime? AvailableStartDateTimeUtc { get; set; } - -// /// -// /// Gets or sets the available end date and time -// /// -// public DateTime? AvailableEndDateTimeUtc { get; set; } - -// /// -// /// Gets or sets a display order. -// /// This value is used when sorting associated products (used with "grouped" products) -// /// This value is used when sorting home page products -// /// -// public int DisplayOrder { get; set; } - -// /// -// /// Gets or sets a value indicating whether the entity is published -// /// -// public bool Published { get; set; } - -// /// -// /// Gets or sets a value indicating whether the entity has been deleted -// /// -// public bool Deleted { get; set; } - -// /// -// /// Gets or sets the date and time of product creation -// /// -// public DateTime CreatedOnUtc { get; set; } - -// /// -// /// Gets or sets the date and time of product update -// /// -// public DateTime UpdatedOnUtc { get; set; } - -// /// -// /// Gets or sets the product type -// /// -// public ProductType ProductType -// { -// get => (ProductType)ProductTypeId; -// set => ProductTypeId = (int)value; -// } - -// /// -// /// Gets or sets the backorder mode -// /// -// public BackorderMode BackorderMode -// { -// get => (BackorderMode)BackorderModeId; -// set => BackorderModeId = (int)value; -// } - -// /// -// /// Gets or sets the download activation type -// /// -// public DownloadActivationType DownloadActivationType -// { -// get => (DownloadActivationType)DownloadActivationTypeId; -// set => DownloadActivationTypeId = (int)value; -// } - -// /// -// /// Gets or sets the gift card type -// /// -// public GiftCardType GiftCardType -// { -// get => (GiftCardType)GiftCardTypeId; -// set => GiftCardTypeId = (int)value; -// } - -// /// -// /// Gets or sets the low stock activity -// /// -// public LowStockActivity LowStockActivity -// { -// get => (LowStockActivity)LowStockActivityId; -// set => LowStockActivityId = (int)value; -// } - -// /// -// /// Gets or sets the value indicating how to manage inventory -// /// -// public ManageInventoryMethod ManageInventoryMethod -// { -// get => (ManageInventoryMethod)ManageInventoryMethodId; -// set => ManageInventoryMethodId = (int)value; -// } - -// /// -// /// Gets or sets the cycle period for recurring products -// /// -// public RecurringProductCyclePeriod RecurringCyclePeriod -// { -// get => (RecurringProductCyclePeriod)RecurringCyclePeriodId; -// set => RecurringCyclePeriodId = (int)value; -// } - -// /// -// /// Gets or sets the period for rental products -// /// -// public RentalPricePeriod RentalPricePeriod -// { -// get => (RentalPricePeriod)RentalPricePeriodId; -// set => RentalPricePeriodId = (int)value; -// } -//} \ No newline at end of file +using Nop.Core.Domain.Common; +using Nop.Core.Domain.Discounts; +using Nop.Core.Domain.Localization; +using Nop.Core.Domain.Security; +using Nop.Core.Domain.Seo; +using Nop.Core.Domain.Stores; +using AyCode.Core.Serializers.Toons; + +namespace Nop.Core.Domain.Catalog; + +/// +/// Represents a product +/// +[ToonDescription("Core nopCommerce product entity with catalog, pricing, and inventory management")] +public partial class Product : BaseEntity, ILocalizedEntity, ISlugSupported, IAclSupported, IStoreMappingSupported, IDiscountSupported, ISoftDeletedEntity +{ + /// + /// Gets or sets the product type identifier + /// + [ToonDescription(Purpose = "Defines if the product is Simple or Grouped", BusinessRule = "Enum: ProductType")] + public int ProductTypeId { get; set; } + + /// + /// Gets or sets the parent product identifier. It's used to identify associated products (only with "grouped" products) + /// + [ToonDescription(Purpose = "Hierarchical link for grouped product variants", BusinessRule = "Foreign Key to Product.Id")] + public int ParentGroupedProductId { get; set; } + + /// + /// Gets or sets the values indicating whether this product is visible in catalog or search results. + /// + [ToonDescription(Purpose = "Controls independent visibility in search/catalog", BusinessRule = "Used primarily for associated products")] + public bool VisibleIndividually { get; set; } + + /// + /// Gets or sets the name + /// + public string Name { get; set; } + + /// + /// Gets or sets the short description + /// + public string ShortDescription { get; set; } + + /// + /// Gets or sets the full description + /// + public string FullDescription { get; set; } + + /// + /// Gets or sets the admin comment + /// + [ToonDescription(Purpose = "Internal administrative notes", BusinessRule = "Never exposed to customer")] + public string AdminComment { get; set; } + + /// + /// Gets or sets a value of used product template identifier + /// + public int ProductTemplateId { get; set; } + + /// + /// Gets or sets a vendor identifier + /// + public int VendorId { get; set; } + + /// + /// Gets or sets a value indicating whether to show the product on home page + /// + public bool ShowOnHomepage { get; set; } + + /// + /// Gets or sets the meta keywords + /// + public string MetaKeywords { get; set; } + + /// + /// Gets or sets the meta description + /// + public string MetaDescription { get; set; } + + /// + /// Gets or sets the meta title + /// + public string MetaTitle { get; set; } + + /// + /// Gets or sets a value indicating whether the product allows customer reviews + /// + public bool AllowCustomerReviews { get; set; } + + /// + /// Gets or sets the rating sum (approved reviews) + /// + public int ApprovedRatingSum { get; set; } + + /// + /// Gets or sets the rating sum (not approved reviews) + /// + public int NotApprovedRatingSum { get; set; } + + /// + /// Gets or sets the total rating votes (approved reviews) + /// + public int ApprovedTotalReviews { get; set; } + + /// + /// Gets or sets the total rating votes (not approved reviews) + /// + public int NotApprovedTotalReviews { get; set; } + + /// + /// Gets or sets a value indicating whether the entity is subject to ACL + /// + public bool SubjectToAcl { get; set; } + + /// + /// Gets or sets a value indicating whether the entity is limited/restricted to certain stores + /// + public bool LimitedToStores { get; set; } + + /// + /// Gets or sets the SKU + /// + [ToonDescription(Purpose = "Stock Keeping Unit", BusinessRule = "Unique alphanumeric identifier")] + public string Sku { get; set; } + + /// + /// Gets or sets the manufacturer part number + /// + public string ManufacturerPartNumber { get; set; } + + /// + /// Gets or sets the Global Trade Item Number (GTIN). + /// + public string Gtin { get; set; } + + /// + /// Gets or sets a value indicating whether the product is gift card + /// + public bool IsGiftCard { get; set; } + + /// + /// Gets or sets the gift card type identifier + /// + public int GiftCardTypeId { get; set; } + + /// + /// Gets or sets gift card amount that can be used after purchase. + /// + public decimal? OverriddenGiftCardAmount { get; set; } + + /// + /// Gets or sets a value indicating whether the product requires that other products are added to the cart + /// + public bool RequireOtherProducts { get; set; } + + /// + /// Gets or sets a required product identifiers (comma separated) + /// + public string RequiredProductIds { get; set; } + + /// + /// Gets or sets a value indicating whether required products are automatically added to the cart + /// + public bool AutomaticallyAddRequiredProducts { get; set; } + + /// + /// Gets or sets a value indicating whether the product is download + /// + [ToonDescription(Purpose = "Digital good flag")] + public bool IsDownload { get; set; } + + /// + /// Gets or sets the download identifier + /// + public int DownloadId { get; set; } + + /// + /// Gets or sets a value indicating whether this downloadable product can be downloaded unlimited number of times + /// + public bool UnlimitedDownloads { get; set; } + + /// + /// Gets or sets the maximum number of downloads + /// + public int MaxNumberOfDownloads { get; set; } + + /// + /// Gets or sets the number of days during customers keeps access to the file. + /// + public int? DownloadExpirationDays { get; set; } + + /// + /// Gets or sets the download activation type + /// + public int DownloadActivationTypeId { get; set; } + + /// + /// Gets or sets a value indicating whether the product has a sample download file + /// + public bool HasSampleDownload { get; set; } + + /// + /// Gets or sets the sample download identifier + /// + public int SampleDownloadId { get; set; } + + /// + /// Gets or sets a value indicating whether the product has user agreement + /// + public bool HasUserAgreement { get; set; } + + /// + /// Gets or sets the text of license agreement + /// + public string UserAgreementText { get; set; } + + /// + /// Gets or sets a value indicating whether the product is recurring + /// + [ToonDescription(Purpose = "Subscription flag", BusinessRule = "Triggers automated billing cycles")] + public bool IsRecurring { get; set; } + + /// + /// Gets or sets the cycle length + /// + public int RecurringCycleLength { get; set; } + + /// + /// Gets or sets the cycle period + /// + public int RecurringCyclePeriodId { get; set; } + + /// + /// Gets or sets the total cycles + /// + public int RecurringTotalCycles { get; set; } + + /// + /// Gets or sets a value indicating whether the product is rental + /// + [ToonDescription(Purpose = "Rental flag", BusinessRule = "Requires date selection in UI")] + public bool IsRental { get; set; } + + /// + /// Gets or sets the rental length for some period (price for this period) + /// + public int RentalPriceLength { get; set; } + + /// + /// Gets or sets the rental period (price for this period) + /// + public int RentalPricePeriodId { get; set; } + + /// + /// Gets or sets a value indicating whether the entity is ship enabled + /// + [ToonDescription(Purpose = "Physical shipping toggle")] + public bool IsShipEnabled { get; set; } + + /// + /// Gets or sets a value indicating whether the entity is free shipping + /// + public bool IsFreeShipping { get; set; } + + /// + /// Gets or sets a value this product should be shipped separately (each item) + /// + public bool ShipSeparately { get; set; } + + /// + /// Gets or sets the additional shipping charge + /// + public decimal AdditionalShippingCharge { get; set; } + + /// + /// Gets or sets a delivery date identifier + /// + public int DeliveryDateId { get; set; } + + /// + /// Gets or sets a value indicating whether the product is marked as tax exempt + /// + public bool IsTaxExempt { get; set; } + + /// + /// Gets or sets the tax category identifier + /// + public int TaxCategoryId { get; set; } + + /// + /// Gets or sets a value indicating how to manage inventory + /// + [ToonDescription(Purpose = "Inventory logic selector", BusinessRule = "0:None, 1:Product, 2:Attributes")] + public int ManageInventoryMethodId { get; set; } + + /// + /// Gets or sets a product availability range identifier + /// + public int ProductAvailabilityRangeId { get; set; } + + /// + /// Gets or sets a value indicating whether multiple warehouses are used for this product + /// + public bool UseMultipleWarehouses { get; set; } + + /// + /// Gets or sets a warehouse identifier + /// + public int WarehouseId { get; set; } + + /// + /// Gets or sets the stock quantity + /// + [ToonDescription(Purpose = "Physical quantity in warehouse", BusinessRule = "Decremented on order placement or paid")] + public int StockQuantity { get; set; } + + /// + /// Gets or sets a value indicating whether to display stock availability + /// + public bool DisplayStockAvailability { get; set; } + + /// + /// Gets or sets a value indicating whether to display stock quantity + /// + public bool DisplayStockQuantity { get; set; } + + /// + /// Gets or sets the minimum stock quantity + /// + public int MinStockQuantity { get; set; } + + /// + /// Gets or sets the low stock activity identifier + /// + public int LowStockActivityId { get; set; } + + /// + /// Gets or sets the quantity when admin should be notified + /// + public int NotifyAdminForQuantityBelow { get; set; } + + /// + /// Gets or sets a value backorder mode identifier + /// + [ToonDescription(Purpose = "Handling of out-of-stock purchases", BusinessRule = "Controls if StockQuantity can go negative")] + public int BackorderModeId { get; set; } + + /// + /// Gets or sets a value indicating whether to back in stock subscriptions are allowed + /// + public bool AllowBackInStockSubscriptions { get; set; } + + /// + /// Gets or sets the order minimum quantity + /// + public int OrderMinimumQuantity { get; set; } + + /// + /// Gets or sets the order maximum quantity + /// + public int OrderMaximumQuantity { get; set; } + + /// + /// Gets or sets the comma separated list of allowed quantities. null or empty if any quantity is allowed + /// + public string AllowedQuantities { get; set; } + + /// + /// Gets or sets a value indicating whether we allow adding to the cart/wishlist only attribute combinations that exist and have stock greater than zero. + /// + public bool AllowAddingOnlyExistingAttributeCombinations { get; set; } + + /// + /// Gets or sets a value indicating whether to display attribute combination images only + /// + public bool DisplayAttributeCombinationImagesOnly { get; set; } + + /// + /// Gets or sets a value indicating whether this product is returnable + /// + public bool NotReturnable { get; set; } + + /// + /// Gets or sets a value indicating whether to disable buy (Add to cart) button + /// + public bool DisableBuyButton { get; set; } + + /// + /// Gets or sets a value indicating whether to disable "Add to wishlist" button + /// + public bool DisableWishlistButton { get; set; } + + /// + /// Gets or sets a value indicating whether this item is available for Pre-Order + /// + public bool AvailableForPreOrder { get; set; } + + /// + /// Gets or sets the start date and time of the product availability (for pre-order products) + /// + public DateTime? PreOrderAvailabilityStartDateTimeUtc { get; set; } + + /// + /// Gets or sets a value indicating whether to show "Call for Pricing" or "Call for quote" instead of price + /// + public bool CallForPrice { get; set; } + + /// + /// Gets or sets the price + /// + [ToonDescription(Purpose = "Base selling price", BusinessRule = "Used as primary value before discounts")] + public decimal Price { get; set; } + + /// + /// Gets or sets the old price + /// + public decimal OldPrice { get; set; } + + /// + /// Gets or sets the product cost + /// + [ToonDescription(Purpose = "Purchase price from vendor", BusinessRule = "Used for profit/margin calculation")] + public decimal ProductCost { get; set; } + + /// + /// Gets or sets a value indicating whether a customer enters price + /// + public bool CustomerEntersPrice { get; set; } + + /// + /// Gets or sets the minimum price entered by a customer + /// + public decimal MinimumCustomerEnteredPrice { get; set; } + + /// + /// Gets or sets the maximum price entered by a customer + /// + public decimal MaximumCustomerEnteredPrice { get; set; } + + /// + /// Gets or sets a value indicating whether base price (PAngV) is enabled. + /// + public bool BasepriceEnabled { get; set; } + + /// + /// Gets or sets an amount in product for PAngV + /// + public decimal BasepriceAmount { get; set; } + + /// + /// Gets or sets a unit of product for PAngV (MeasureWeight entity) + /// + public int BasepriceUnitId { get; set; } + + /// + /// Gets or sets a reference amount for PAngV + /// + public decimal BasepriceBaseAmount { get; set; } + + /// + /// Gets or sets a reference unit for PAngV (MeasureWeight entity) + /// + public int BasepriceBaseUnitId { get; set; } + + /// + /// Gets or sets a value indicating whether this product is marked as new + /// + public bool MarkAsNew { get; set; } + + /// + /// Gets or sets the start date and time of the new product + /// + public DateTime? MarkAsNewStartDateTimeUtc { get; set; } + + /// + /// Gets or sets the end date and time of the new product + /// + public DateTime? MarkAsNewEndDateTimeUtc { get; set; } + + /// + /// Gets or sets the weight + /// + public decimal Weight { get; set; } + + /// + /// Gets or sets the length + /// + public decimal Length { get; set; } + + /// + /// Gets or sets the width + /// + public decimal Width { get; set; } + + /// + /// Gets or sets the height + /// + public decimal Height { get; set; } + + /// + /// Gets or sets the available start date and time + /// + public DateTime? AvailableStartDateTimeUtc { get; set; } + + /// + /// Gets or sets the available end date and time + /// + public DateTime? AvailableEndDateTimeUtc { get; set; } + + /// + /// Gets or sets a display order. + /// + public int DisplayOrder { get; set; } + + /// + /// Gets or sets a value indicating whether the entity is published + /// + public bool Published { get; set; } + + /// + /// Gets or sets a value indicating whether the entity has been deleted + /// + [ToonDescription(Purpose = "Soft-delete flag", BusinessRule = "Records remain in DB but hidden from UI")] + public bool Deleted { get; set; } + + /// + /// Gets or sets the date and time of product creation + /// + public DateTime CreatedOnUtc { get; set; } + + /// + /// Gets or sets the date and time of product update + /// + public DateTime UpdatedOnUtc { get; set; } + + /// + /// Gets or sets the product type + /// + [ToonDescription(Purpose = "Enum wrapper", BusinessRule = "get, set => ProductTypeId")] + public ProductType ProductType + { + get => (ProductType)ProductTypeId; + set => ProductTypeId = (int)value; + } + + /// + /// Gets or sets the backorder mode + /// + [ToonDescription(Purpose = "Enum wrapper", BusinessRule = "get, set => BackorderModeId")] + public BackorderMode BackorderMode + { + get => (BackorderMode)BackorderModeId; + set => BackorderModeId = (int)value; + } + + /// + /// Gets or sets the download activation type + /// + [ToonDescription(Purpose = "Enum wrapper", BusinessRule = "get, set => DownloadActivationTypeId")] + public DownloadActivationType DownloadActivationType + { + get => (DownloadActivationType)DownloadActivationTypeId; + set => DownloadActivationTypeId = (int)value; + } + + /// + /// Gets or sets the gift card type + /// + [ToonDescription(Purpose = "Enum wrapper", BusinessRule = "get, set => GiftCardTypeId")] + public GiftCardType GiftCardType + { + get => (GiftCardType)GiftCardTypeId; + set => GiftCardTypeId = (int)value; + } + + /// + /// Gets or sets the low stock activity + /// + [ToonDescription(Purpose = "Enum wrapper", BusinessRule = "get, set => LowStockActivityId")] + public LowStockActivity LowStockActivity + { + get => (LowStockActivity)LowStockActivityId; + set => LowStockActivityId = (int)value; + } + + /// + /// Gets or sets the value indicating how to manage inventory + /// + [ToonDescription(Purpose = "Enum wrapper", BusinessRule = "get, set => ManageInventoryMethodId")] + public ManageInventoryMethod ManageInventoryMethod + { + get => (ManageInventoryMethod)ManageInventoryMethodId; + set => ManageInventoryMethodId = (int)value; + } + + /// + /// Gets or sets the cycle period for recurring products + /// + [ToonDescription(Purpose = "Enum wrapper", BusinessRule = "get, set => RecurringCyclePeriodId")] + public RecurringProductCyclePeriod RecurringCyclePeriod + { + get => (RecurringProductCyclePeriod)RecurringCyclePeriodId; + set => RecurringCyclePeriodId = (int)value; + } + + /// + /// Gets or sets the period for rental products + /// + [ToonDescription(Purpose = "Enum wrapper", BusinessRule = "get, set => RentalPricePeriod")] + public RentalPricePeriod RentalPricePeriod + { + get => (RentalPricePeriod)RentalPricePeriodId; + set => RentalPricePeriodId = (int)value; + } +} \ No newline at end of file diff --git a/Mango.Nop.Core/NopDependencies/DownloadActivationType.cs b/Mango.Nop.Core/NopDependencies/DownloadActivationType.cs new file mode 100644 index 0000000..5858158 --- /dev/null +++ b/Mango.Nop.Core/NopDependencies/DownloadActivationType.cs @@ -0,0 +1,17 @@ +namespace Nop.Core.Domain.Catalog; + +/// +/// Represents a download activation type +/// +public enum DownloadActivationType +{ + /// + /// When order is paid + /// + WhenOrderIsPaid = 0, + + /// + /// Manually + /// + Manually = 10, +} \ No newline at end of file diff --git a/Mango.Nop.Core/NopDependencies/GiftCardType.cs b/Mango.Nop.Core/NopDependencies/GiftCardType.cs new file mode 100644 index 0000000..d94f76b --- /dev/null +++ b/Mango.Nop.Core/NopDependencies/GiftCardType.cs @@ -0,0 +1,17 @@ +namespace Nop.Core.Domain.Catalog; + +/// +/// Represents a gift card type +/// +public enum GiftCardType +{ + /// + /// Virtual + /// + Virtual = 0, + + /// + /// Physical + /// + Physical = 1, +} \ No newline at end of file diff --git a/Mango.Nop.Core/NopDependencies/LowStockActivity.cs b/Mango.Nop.Core/NopDependencies/LowStockActivity.cs new file mode 100644 index 0000000..9f0946b --- /dev/null +++ b/Mango.Nop.Core/NopDependencies/LowStockActivity.cs @@ -0,0 +1,22 @@ +namespace Nop.Core.Domain.Catalog; + +/// +/// Represents a low stock activity +/// +public enum LowStockActivity +{ + /// + /// Nothing + /// + Nothing = 0, + + /// + /// Disable buy button + /// + DisableBuyButton = 1, + + /// + /// Unpublish + /// + Unpublish = 2, +} \ No newline at end of file diff --git a/Mango.Nop.Core/NopDependencies/ManageInventoryMethod.cs b/Mango.Nop.Core/NopDependencies/ManageInventoryMethod.cs new file mode 100644 index 0000000..cd95fac --- /dev/null +++ b/Mango.Nop.Core/NopDependencies/ManageInventoryMethod.cs @@ -0,0 +1,22 @@ +namespace Nop.Core.Domain.Catalog; + +/// +/// Represents a method of inventory management +/// +public enum ManageInventoryMethod +{ + /// + /// Don't track inventory for product + /// + DontManageStock = 0, + + /// + /// Track inventory for product + /// + ManageStock = 1, + + /// + /// Track inventory for product by product attributes + /// + ManageStockByAttributes = 2, +} \ No newline at end of file diff --git a/Mango.Nop.Core/NopDependencies/ProductType.cs b/Mango.Nop.Core/NopDependencies/ProductType.cs new file mode 100644 index 0000000..539e64a --- /dev/null +++ b/Mango.Nop.Core/NopDependencies/ProductType.cs @@ -0,0 +1,17 @@ +namespace Nop.Core.Domain.Catalog; + +/// +/// Represents a product type +/// +public enum ProductType +{ + /// + /// Simple + /// + SimpleProduct = 5, + + /// + /// Grouped (product with variants) + /// + GroupedProduct = 10, +} \ No newline at end of file diff --git a/Mango.Nop.Core/NopDependencies/RecurringProductCyclePeriod.cs b/Mango.Nop.Core/NopDependencies/RecurringProductCyclePeriod.cs new file mode 100644 index 0000000..970391a --- /dev/null +++ b/Mango.Nop.Core/NopDependencies/RecurringProductCyclePeriod.cs @@ -0,0 +1,27 @@ +namespace Nop.Core.Domain.Catalog; + +/// +/// Represents a recurring product cycle period +/// +public enum RecurringProductCyclePeriod +{ + /// + /// Days + /// + Days = 0, + + /// + /// Weeks + /// + Weeks = 10, + + /// + /// Months + /// + Months = 20, + + /// + /// Years + /// + Years = 30, +} \ No newline at end of file diff --git a/Mango.Nop.Core/NopDependencies/RentalPricePeriod.cs b/Mango.Nop.Core/NopDependencies/RentalPricePeriod.cs new file mode 100644 index 0000000..e828a5d --- /dev/null +++ b/Mango.Nop.Core/NopDependencies/RentalPricePeriod.cs @@ -0,0 +1,27 @@ +namespace Nop.Core.Domain.Catalog; + +/// +/// Represents a rental product period (for prices) +/// +public enum RentalPricePeriod +{ + /// + /// Days + /// + Days = 0, + + /// + /// Weeks + /// + Weeks = 10, + + /// + /// Months + /// + Months = 20, + + /// + /// Years + /// + Years = 30, +} \ No newline at end of file