From e625b6ee30dffb96a104cd39376080d73499da23 Mon Sep 17 00:00:00 2001 From: gdlcf88 Date: Mon, 16 May 2022 02:07:05 +0800 Subject: [PATCH] Make ProductAsset and ProductAssetCategory belong to a specified PeriodScheme --- .../ProductAssetCategories/ProductAssetCategory.cs | 9 +++++++++ .../ProductAssetCategoryPeriod.cs | 11 +++++++++++ .../Plugins/Booking/ProductAssets/ProductAsset.cs | 11 +++++++++++ .../Booking/ProductAssets/ProductAssetPeriod.cs | 11 +++++++++++ 4 files changed, 42 insertions(+) create mode 100644 plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Domain/EasyAbp/EShop/Plugins/Booking/ProductAssetCategories/ProductAssetCategoryPeriod.cs create mode 100644 plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Domain/EasyAbp/EShop/Plugins/Booking/ProductAssets/ProductAssetPeriod.cs diff --git a/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Domain/EasyAbp/EShop/Plugins/Booking/ProductAssetCategories/ProductAssetCategory.cs b/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Domain/EasyAbp/EShop/Plugins/Booking/ProductAssetCategories/ProductAssetCategory.cs index d4fbd913..4b496c29 100644 --- a/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Domain/EasyAbp/EShop/Plugins/Booking/ProductAssetCategories/ProductAssetCategory.cs +++ b/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Domain/EasyAbp/EShop/Plugins/Booking/ProductAssetCategories/ProductAssetCategory.cs @@ -1,4 +1,5 @@ using System; +using System.Collections.Generic; using Volo.Abp.Domain.Entities.Auditing; using Volo.Abp.MultiTenancy; @@ -19,6 +20,8 @@ public class ProductAssetCategory : AuditedAggregateRoot, IMultiTenant public virtual Guid AssetCategoryId { get; protected set; } + public virtual Guid PeriodSchemeId { get; protected set; } + /// /// When will this mapping start taking effect. /// @@ -31,7 +34,13 @@ public class ProductAssetCategory : AuditedAggregateRoot, IMultiTenant public virtual DateTime? ToTime { get; protected set; } /// + /// Price for any period. /// Fall back to the price of ProductSku if null. /// public virtual decimal? Price { get; protected set; } + + /// + /// Customize prices for specified periods. + /// + public List Periods { get; protected set; } } \ No newline at end of file diff --git a/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Domain/EasyAbp/EShop/Plugins/Booking/ProductAssetCategories/ProductAssetCategoryPeriod.cs b/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Domain/EasyAbp/EShop/Plugins/Booking/ProductAssetCategories/ProductAssetCategoryPeriod.cs new file mode 100644 index 00000000..0a830e61 --- /dev/null +++ b/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Domain/EasyAbp/EShop/Plugins/Booking/ProductAssetCategories/ProductAssetCategoryPeriod.cs @@ -0,0 +1,11 @@ +using System; +using Volo.Abp.Domain.Entities; + +namespace EasyAbp.EShop.Plugins.Booking.ProductAssetCategories; + +public class ProductAssetCategoryPeriod : Entity +{ + public virtual Guid PeriodId { get; protected set; } + + public virtual decimal Price { get; protected set; } +} \ No newline at end of file diff --git a/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Domain/EasyAbp/EShop/Plugins/Booking/ProductAssets/ProductAsset.cs b/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Domain/EasyAbp/EShop/Plugins/Booking/ProductAssets/ProductAsset.cs index 0e2d1c8c..41b7d213 100644 --- a/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Domain/EasyAbp/EShop/Plugins/Booking/ProductAssets/ProductAsset.cs +++ b/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Domain/EasyAbp/EShop/Plugins/Booking/ProductAssets/ProductAsset.cs @@ -1,4 +1,6 @@ using System; +using System.Collections.Generic; +using EasyAbp.EShop.Plugins.Booking.ProductAssetCategories; using Volo.Abp.Domain.Entities.Auditing; using Volo.Abp.MultiTenancy; @@ -8,6 +10,7 @@ namespace EasyAbp.EShop.Plugins.Booking.ProductAssets; /// Mapping of ProductSku to Asset. /// Set which SKU can use to book a specified asset. /// The matched with the larger takes precedence. +/// Fall back to if the booking asset has no matched . /// public class ProductAsset : AuditedAggregateRoot, IMultiTenant { @@ -19,6 +22,8 @@ public class ProductAsset : AuditedAggregateRoot, IMultiTenant public virtual Guid AssetId { get; protected set; } + public virtual Guid PeriodSchemeId { get; protected set; } + /// /// When will this mapping start taking effect. /// @@ -31,7 +36,13 @@ public class ProductAsset : AuditedAggregateRoot, IMultiTenant public virtual DateTime? ToTime { get; protected set; } /// + /// Price for any period. /// Fall back to the price of ProductSku if null. /// public virtual decimal? Price { get; protected set; } + + /// + /// Customize prices for specified periods. + /// + public List Periods { get; protected set; } } \ No newline at end of file diff --git a/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Domain/EasyAbp/EShop/Plugins/Booking/ProductAssets/ProductAssetPeriod.cs b/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Domain/EasyAbp/EShop/Plugins/Booking/ProductAssets/ProductAssetPeriod.cs new file mode 100644 index 00000000..42ad6990 --- /dev/null +++ b/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Domain/EasyAbp/EShop/Plugins/Booking/ProductAssets/ProductAssetPeriod.cs @@ -0,0 +1,11 @@ +using System; +using Volo.Abp.Domain.Entities; + +namespace EasyAbp.EShop.Plugins.Booking.ProductAssets; + +public class ProductAssetPeriod : Entity +{ + public virtual Guid PeriodId { get; protected set; } + + public virtual decimal Price { get; protected set; } +} \ No newline at end of file