Browse Source

Make ProductAsset and ProductAssetCategory belong to a specified PeriodScheme

pull/157/head
gdlcf88 4 years ago
parent
commit
e625b6ee30
  1. 9
      plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Domain/EasyAbp/EShop/Plugins/Booking/ProductAssetCategories/ProductAssetCategory.cs
  2. 11
      plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Domain/EasyAbp/EShop/Plugins/Booking/ProductAssetCategories/ProductAssetCategoryPeriod.cs
  3. 11
      plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Domain/EasyAbp/EShop/Plugins/Booking/ProductAssets/ProductAsset.cs
  4. 11
      plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Domain/EasyAbp/EShop/Plugins/Booking/ProductAssets/ProductAssetPeriod.cs

9
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<Guid>, IMultiTenant
public virtual Guid AssetCategoryId { get; protected set; }
public virtual Guid PeriodSchemeId { get; protected set; }
/// <summary>
/// When will this mapping start taking effect.
/// </summary>
@ -31,7 +34,13 @@ public class ProductAssetCategory : AuditedAggregateRoot<Guid>, IMultiTenant
public virtual DateTime? ToTime { get; protected set; }
/// <summary>
/// Price for any period.
/// Fall back to the price of ProductSku if <c>null</c>.
/// </summary>
public virtual decimal? Price { get; protected set; }
/// <summary>
/// Customize prices for specified periods.
/// </summary>
public List<ProductAssetCategoryPeriod> Periods { get; protected set; }
}

11
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<Guid>
{
public virtual Guid PeriodId { get; protected set; }
public virtual decimal Price { get; protected set; }
}

11
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 <see cref="ProductAsset"/> with the larger <see cref="FromTime"/> takes precedence.
/// Fall back to <see cref="ProductAssetCategory"/> if the booking asset has no matched <see cref="ProductAsset"/>.
/// </summary>
public class ProductAsset : AuditedAggregateRoot<Guid>, IMultiTenant
{
@ -19,6 +22,8 @@ public class ProductAsset : AuditedAggregateRoot<Guid>, IMultiTenant
public virtual Guid AssetId { get; protected set; }
public virtual Guid PeriodSchemeId { get; protected set; }
/// <summary>
/// When will this mapping start taking effect.
/// </summary>
@ -31,7 +36,13 @@ public class ProductAsset : AuditedAggregateRoot<Guid>, IMultiTenant
public virtual DateTime? ToTime { get; protected set; }
/// <summary>
/// Price for any period.
/// Fall back to the price of ProductSku if <c>null</c>.
/// </summary>
public virtual decimal? Price { get; protected set; }
/// <summary>
/// Customize prices for specified periods.
/// </summary>
public List<ProductAssetPeriod> Periods { get; protected set; }
}

11
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<Guid>
{
public virtual Guid PeriodId { get; protected set; }
public virtual decimal Price { get; protected set; }
}
Loading…
Cancel
Save