Browse Source

Add Currency properties

pull/150/head
gdlcf88 4 years ago
parent
commit
826f0711f8
  1. 34
      plugins/Booking/src/EasyAbp.EShop.Orders.Booking.Application/EasyAbp/EShop/Orders/Booking/BookingOrderLinePriceOverrider.cs
  2. 17
      plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Application.Contracts/EasyAbp/EShop/Plugins/Booking/ProductAssetCategories/Dtos/CreateProductAssetCategoryDto.cs
  3. 4
      plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Application.Contracts/EasyAbp/EShop/Plugins/Booking/ProductAssetCategories/Dtos/CreateProductAssetCategoryPeriodDto.cs
  4. 2
      plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Application.Contracts/EasyAbp/EShop/Plugins/Booking/ProductAssetCategories/Dtos/ProductAssetCategoryDto.cs
  5. 2
      plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Application.Contracts/EasyAbp/EShop/Plugins/Booking/ProductAssetCategories/Dtos/ProductAssetCategoryPeriodDto.cs
  6. 3
      plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Application.Contracts/EasyAbp/EShop/Plugins/Booking/ProductAssetCategories/Dtos/UpdateProductAssetCategoryDto.cs
  7. 3
      plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Application.Contracts/EasyAbp/EShop/Plugins/Booking/ProductAssetCategories/Dtos/UpdateProductAssetCategoryPeriodDto.cs
  8. 16
      plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Application.Contracts/EasyAbp/EShop/Plugins/Booking/ProductAssets/Dtos/CreateProductAssetDto.cs
  9. 3
      plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Application.Contracts/EasyAbp/EShop/Plugins/Booking/ProductAssets/Dtos/CreateProductAssetPeriodDto.cs
  10. 2
      plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Application.Contracts/EasyAbp/EShop/Plugins/Booking/ProductAssets/Dtos/ProductAssetDto.cs
  11. 2
      plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Application.Contracts/EasyAbp/EShop/Plugins/Booking/ProductAssets/Dtos/ProductAssetPeriodDto.cs
  12. 3
      plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Application.Contracts/EasyAbp/EShop/Plugins/Booking/ProductAssets/Dtos/UpdateProductAssetDto.cs
  13. 3
      plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Application.Contracts/EasyAbp/EShop/Plugins/Booking/ProductAssets/Dtos/UpdateProductAssetPeriodDto.cs
  14. 12
      plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Application/EasyAbp/EShop/Plugins/Booking/ProductAssetCategories/ProductAssetCategoryAppService.cs
  15. 8
      plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Application/EasyAbp/EShop/Plugins/Booking/ProductAssets/ProductAssetAppService.cs
  16. 4
      plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Domain.Shared/EasyAbp/EShop/Plugins/Booking/Localization/en.json
  17. 4
      plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Domain.Shared/EasyAbp/EShop/Plugins/Booking/Localization/zh-Hans.json
  18. 4
      plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Domain.Shared/EasyAbp/EShop/Plugins/Booking/Localization/zh-Hant.json
  19. 48
      plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Domain/EasyAbp/EShop/Plugins/Booking/ProductAssetCategories/ProductAssetCategory.cs
  20. 10
      plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Domain/EasyAbp/EShop/Plugins/Booking/ProductAssetCategories/ProductAssetCategoryPeriod.cs
  21. 18
      plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Domain/EasyAbp/EShop/Plugins/Booking/ProductAssetCategories/ProductAssetManager.cs
  22. 28
      plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Domain/EasyAbp/EShop/Plugins/Booking/ProductAssets/ProductAsset.cs
  23. 12
      plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Domain/EasyAbp/EShop/Plugins/Booking/ProductAssets/ProductAssetManager.cs
  24. 10
      plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Domain/EasyAbp/EShop/Plugins/Booking/ProductAssets/ProductAssetPeriod.cs
  25. 3
      plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Web/Pages/EShop/Plugins/Booking/ProductAssetCategories/ProductAssetCategory/ViewModels/CreateProductAssetCategoryViewModel.cs
  26. 6
      plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Web/Pages/EShop/Plugins/Booking/ProductAssetCategories/ProductAssetCategory/ViewModels/EditProductAssetCategoryViewModel.cs
  27. 4
      plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Web/Pages/EShop/Plugins/Booking/ProductAssetCategories/ProductAssetCategory/index.js
  28. 7
      plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Web/Pages/EShop/Plugins/Booking/ProductAssetCategories/ProductAssetCategoryPeriod/ViewModels/CreateProductAssetCategoryPeriodViewModel.cs
  29. 8
      plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Web/Pages/EShop/Plugins/Booking/ProductAssetCategories/ProductAssetCategoryPeriod/ViewModels/EditProductAssetCategoryPeriodViewModel.cs
  30. 4
      plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Web/Pages/EShop/Plugins/Booking/ProductAssetCategories/ProductAssetCategoryPeriod/index.js
  31. 3
      plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Web/Pages/EShop/Plugins/Booking/ProductAssets/ProductAsset/ViewModels/CreateProductAssetViewModel.cs
  32. 4
      plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Web/Pages/EShop/Plugins/Booking/ProductAssets/ProductAsset/ViewModels/EditProductAssetViewModel.cs
  33. 4
      plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Web/Pages/EShop/Plugins/Booking/ProductAssets/ProductAsset/index.js
  34. 5
      plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Web/Pages/EShop/Plugins/Booking/ProductAssets/ProductAssetPeriod/ViewModels/CreateProductAssetPeriodViewModel.cs
  35. 6
      plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Web/Pages/EShop/Plugins/Booking/ProductAssets/ProductAssetPeriod/ViewModels/EditProductAssetPeriodViewModel.cs
  36. 4
      plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Web/Pages/EShop/Plugins/Booking/ProductAssets/ProductAssetPeriod/index.js
  37. 4
      plugins/Booking/test/EasyAbp.EShop.Plugins.Booking.TestBase/BookingDataSeedContributor.cs
  38. 5440
      samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore/Migrations/20220701165019_AddedCurrencyProperties.Designer.cs
  39. 55
      samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore/Migrations/20220701165019_AddedCurrencyProperties.cs
  40. 14
      samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore/Migrations/EShopSampleDbContextModelSnapshot.cs

34
plugins/Booking/src/EasyAbp.EShop.Orders.Booking.Application/EasyAbp/EShop/Orders/Booking/BookingOrderLinePriceOverrider.cs

@ -61,10 +61,19 @@ public class BookingOrderLinePriceOverrider : IOrderLinePriceOverrider, ITransie
if (productAssetPeriod is not null)
{
await CheckCurrencyAsync(productAssetPeriod.Currency, effectiveCurrency);
return new Money(productAssetPeriod.Price, effectiveCurrency);
}
return productAsset.Price.HasValue ? new Money(productAsset.Price.Value, effectiveCurrency) : null;
if (productAsset.Price.HasValue)
{
await CheckCurrencyAsync(productAsset.Currency, effectiveCurrency);
return new Money(productAsset.Price.Value, effectiveCurrency);
}
return null;
}
public virtual async Task<Money?> GetAssetCategoryBookingUnitPriceAsync(CreateOrderDto input,
@ -87,11 +96,28 @@ public class BookingOrderLinePriceOverrider : IOrderLinePriceOverrider, ITransie
if (productAssetCategoryPeriod is not null)
{
await CheckCurrencyAsync(productAssetCategoryPeriod.Currency, effectiveCurrency);
return new Money(productAssetCategoryPeriod.Price, effectiveCurrency);
}
return productAssetCategory.Price.HasValue
? new Money(productAssetCategory.Price.Value, effectiveCurrency)
: null;
if (productAssetCategory.Price.HasValue)
{
await CheckCurrencyAsync(productAssetCategory.Currency, effectiveCurrency);
return new Money(productAssetCategory.Price.Value, effectiveCurrency);
}
return null;
}
protected virtual Task CheckCurrencyAsync(string currency, Currency effectiveCurrency)
{
if (currency != effectiveCurrency.Code)
{
throw new UnexpectedCurrencyException(effectiveCurrency.Code);
}
return Task.CompletedTask;
}
}

17
plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Application.Contracts/EasyAbp/EShop/Plugins/Booking/ProductAssetCategories/Dtos/CreateProductAssetCategoryDto.cs

@ -1,12 +1,12 @@
using System;
using System.ComponentModel;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using EasyAbp.EShop.Stores.Stores;
namespace EasyAbp.EShop.Plugins.Booking.ProductAssetCategories.Dtos
{
[Serializable]
public class CreateProductAssetCategoryDto : IMultiStore
public class CreateProductAssetCategoryDto : IMultiStore, IValidatableObject
{
public Guid StoreId { get; set; }
@ -22,7 +22,20 @@ namespace EasyAbp.EShop.Plugins.Booking.ProductAssetCategories.Dtos
public DateTime? ToTime { get; set; }
public string Currency { get; set; }
[Range(BookingConsts.MinimumPrice, BookingConsts.MaximumPrice)]
public decimal? Price { get; set; }
public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
{
if (Price is not null && Currency.IsNullOrWhiteSpace())
{
yield return new ValidationResult(
"Currency should not be empty when the Price has a value!",
new[] { nameof(Currency) }
);
}
}
}
}

4
plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Application.Contracts/EasyAbp/EShop/Plugins/Booking/ProductAssetCategories/Dtos/CreateProductAssetCategoryPeriodDto.cs

@ -1,5 +1,4 @@
using System;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
namespace EasyAbp.EShop.Plugins.Booking.ProductAssetCategories.Dtos
@ -9,6 +8,9 @@ namespace EasyAbp.EShop.Plugins.Booking.ProductAssetCategories.Dtos
{
public Guid PeriodId { get; set; }
[Required]
public string Currency { get; set; }
[Range(BookingConsts.MinimumPrice, BookingConsts.MaximumPrice)]
public decimal Price { get; set; }
}

2
plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Application.Contracts/EasyAbp/EShop/Plugins/Booking/ProductAssetCategories/Dtos/ProductAssetCategoryDto.cs

@ -21,6 +21,8 @@ namespace EasyAbp.EShop.Plugins.Booking.ProductAssetCategories.Dtos
public DateTime? ToTime { get; set; }
public string Currency { get; set; }
public decimal? Price { get; set; }
public List<ProductAssetCategoryPeriodDto> Periods { get; set; }

2
plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Application.Contracts/EasyAbp/EShop/Plugins/Booking/ProductAssetCategories/Dtos/ProductAssetCategoryPeriodDto.cs

@ -8,6 +8,8 @@ namespace EasyAbp.EShop.Plugins.Booking.ProductAssetCategories.Dtos
{
public Guid PeriodId { get; set; }
public string Currency { get; set; }
public decimal Price { get; set; }
}
}

3
plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Application.Contracts/EasyAbp/EShop/Plugins/Booking/ProductAssetCategories/Dtos/UpdateProductAssetCategoryDto.cs

@ -11,6 +11,9 @@ namespace EasyAbp.EShop.Plugins.Booking.ProductAssetCategories.Dtos
public DateTime? ToTime { get; set; }
[Required]
public string Currency { get; set; }
[Range(BookingConsts.MinimumPrice, BookingConsts.MaximumPrice)]
public decimal? Price { get; set; }
}

3
plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Application.Contracts/EasyAbp/EShop/Plugins/Booking/ProductAssetCategories/Dtos/UpdateProductAssetCategoryPeriodDto.cs

@ -7,6 +7,9 @@ namespace EasyAbp.EShop.Plugins.Booking.ProductAssetCategories.Dtos
[Serializable]
public class UpdateProductAssetCategoryPeriodDto
{
[Required]
public string Currency { get; set; }
[Range(BookingConsts.MinimumPrice, BookingConsts.MaximumPrice)]
public decimal Price { get; set; }
}

16
plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Application.Contracts/EasyAbp/EShop/Plugins/Booking/ProductAssets/Dtos/CreateProductAssetDto.cs

@ -1,11 +1,12 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using EasyAbp.EShop.Stores.Stores;
namespace EasyAbp.EShop.Plugins.Booking.ProductAssets.Dtos
{
[Serializable]
public class CreateProductAssetDto : IMultiStore
public class CreateProductAssetDto : IMultiStore, IValidatableObject
{
public Guid StoreId { get; set; }
@ -21,7 +22,20 @@ namespace EasyAbp.EShop.Plugins.Booking.ProductAssets.Dtos
public DateTime? ToTime { get; set; }
public string Currency { get; set; }
[Range(BookingConsts.MinimumPrice, BookingConsts.MaximumPrice)]
public decimal? Price { get; set; }
public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
{
if (Price is not null && Currency.IsNullOrWhiteSpace())
{
yield return new ValidationResult(
"Currency should not be empty when the Price has a value!",
new[] { nameof(Currency) }
);
}
}
}
}

3
plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Application.Contracts/EasyAbp/EShop/Plugins/Booking/ProductAssets/Dtos/CreateProductAssetPeriodDto.cs

@ -8,6 +8,9 @@ namespace EasyAbp.EShop.Plugins.Booking.ProductAssets.Dtos
{
public Guid PeriodId { get; set; }
[Required]
public string Currency { get; set; }
[Range(BookingConsts.MinimumPrice, BookingConsts.MaximumPrice)]
public decimal Price { get; set; }
}

2
plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Application.Contracts/EasyAbp/EShop/Plugins/Booking/ProductAssets/Dtos/ProductAssetDto.cs

@ -21,6 +21,8 @@ namespace EasyAbp.EShop.Plugins.Booking.ProductAssets.Dtos
public DateTime? ToTime { get; set; }
public string Currency { get; set; }
public decimal? Price { get; set; }
public List<ProductAssetPeriodDto> Periods { get; set; }

2
plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Application.Contracts/EasyAbp/EShop/Plugins/Booking/ProductAssets/Dtos/ProductAssetPeriodDto.cs

@ -8,6 +8,8 @@ namespace EasyAbp.EShop.Plugins.Booking.ProductAssets.Dtos
{
public Guid PeriodId { get; set; }
public string Currency { get; set; }
public decimal Price { get; set; }
}
}

3
plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Application.Contracts/EasyAbp/EShop/Plugins/Booking/ProductAssets/Dtos/UpdateProductAssetDto.cs

@ -12,6 +12,9 @@ namespace EasyAbp.EShop.Plugins.Booking.ProductAssets.Dtos
public DateTime? ToTime { get; set; }
[Required]
public string Currency { get; set; }
[Range(BookingConsts.MinimumPrice, BookingConsts.MaximumPrice)]
public decimal? Price { get; set; }
}

3
plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Application.Contracts/EasyAbp/EShop/Plugins/Booking/ProductAssets/Dtos/UpdateProductAssetPeriodDto.cs

@ -6,6 +6,9 @@ namespace EasyAbp.EShop.Plugins.Booking.ProductAssets.Dtos
[Serializable]
public class UpdateProductAssetPeriodDto
{
[Required]
public string Currency { get; set; }
[Range(BookingConsts.MinimumPrice, BookingConsts.MaximumPrice)]
public decimal Price { get; set; }
}

12
plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Application/EasyAbp/EShop/Plugins/Booking/ProductAssetCategories/ProductAssetCategoryAppService.cs

@ -43,7 +43,8 @@ namespace EasyAbp.EShop.Plugins.Booking.ProductAssetCategories
_productAssetCategoryManager = productAssetCategoryManager;
}
protected override async Task<IQueryable<ProductAssetCategory>> CreateFilteredQueryAsync(GetProductAssetCategoryListDto input)
protected override async Task<IQueryable<ProductAssetCategory>> CreateFilteredQueryAsync(
GetProductAssetCategoryListDto input)
{
return (await base.CreateFilteredQueryAsync(input))
.WhereIf(input.StoreId.HasValue, x => x.StoreId == input.StoreId)
@ -57,7 +58,7 @@ namespace EasyAbp.EShop.Plugins.Booking.ProductAssetCategories
GetProductAssetCategoryListDto input)
{
await CheckMultiStorePolicyAsync(input.StoreId, GetListPolicyName);
var query = await CreateFilteredQueryAsync(input);
var totalCount = await AsyncExecuter.CountAsync(query);
@ -118,12 +119,13 @@ namespace EasyAbp.EShop.Plugins.Booking.ProductAssetCategories
protected override async Task<ProductAssetCategory> MapToEntityAsync(CreateProductAssetCategoryDto input)
{
return await _productAssetCategoryManager.CreateAsync(input.StoreId, input.ProductId, input.ProductSkuId,
input.AssetCategoryId, input.PeriodSchemeId, input.FromTime, input.ToTime, input.Price);
input.AssetCategoryId, input.PeriodSchemeId, input.FromTime, input.ToTime, input.Currency, input.Price);
}
protected override async Task MapToEntityAsync(UpdateProductAssetCategoryDto input, ProductAssetCategory entity)
{
await _productAssetCategoryManager.UpdateAsync(entity, input.FromTime, input.ToTime, input.Price);
await _productAssetCategoryManager.UpdateAsync(
entity, input.FromTime, input.ToTime, input.Currency, input.Price);
}
public virtual async Task<ProductAssetCategoryDto> CreatePeriodAsync(Guid productAssetCategoryId,
@ -170,4 +172,4 @@ namespace EasyAbp.EShop.Plugins.Booking.ProductAssetCategories
return await MapToGetOutputDtoAsync(productAssetCategory);
}
}
}
}

8
plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Application/EasyAbp/EShop/Plugins/Booking/ProductAssets/ProductAssetAppService.cs

@ -57,7 +57,7 @@ namespace EasyAbp.EShop.Plugins.Booking.ProductAssets
GetProductAssetListDto input)
{
await CheckMultiStorePolicyAsync(input.StoreId, GetListPolicyName);
var query = await CreateFilteredQueryAsync(input);
var totalCount = await AsyncExecuter.CountAsync(query);
@ -118,12 +118,12 @@ namespace EasyAbp.EShop.Plugins.Booking.ProductAssets
protected override async Task<ProductAsset> MapToEntityAsync(CreateProductAssetDto input)
{
return await _productAssetManager.CreateAsync(input.StoreId, input.ProductId, input.ProductSkuId,
input.AssetId, input.PeriodSchemeId, input.FromTime, input.ToTime, input.Price);
input.AssetId, input.PeriodSchemeId, input.FromTime, input.ToTime, input.Currency, input.Price);
}
protected override async Task MapToEntityAsync(UpdateProductAssetDto input, ProductAsset entity)
{
await _productAssetManager.UpdateAsync(entity, input.FromTime, input.ToTime, input.Price);
await _productAssetManager.UpdateAsync(entity, input.FromTime, input.ToTime, input.Currency, input.Price);
}
public virtual async Task<ProductAssetDto> CreatePeriodAsync(Guid productAssetId,
@ -170,4 +170,4 @@ namespace EasyAbp.EShop.Plugins.Booking.ProductAssets
return await MapToGetOutputDtoAsync(productAsset);
}
}
}
}

4
plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Domain.Shared/EasyAbp/EShop/Plugins/Booking/Localization/en.json

@ -15,6 +15,7 @@
"ProductAssetPeriodSchemeId": "Period Scheme ID",
"ProductAssetFromTime": "From time",
"ProductAssetToTime": "To time",
"ProductAssetCurrency": "Currency",
"ProductAssetPrice": "Price",
"ProductAssetPeriods": "Period prices",
"CreateProductAsset": "New",
@ -24,6 +25,7 @@
"Menu:ProductAssetPeriod": "Asset period prices",
"ProductAssetPeriod": "Asset period prices",
"ProductAssetPeriodPeriodId": "Period ID",
"ProductAssetPeriodCurrency": "Currency",
"ProductAssetPeriodPrice": "Price",
"CreateProductAssetPeriod": "New",
"EditProductAssetPeriod": "Edit",
@ -38,6 +40,7 @@
"ProductAssetCategoryPeriodSchemeId": "Period Scheme ID",
"ProductAssetCategoryFromTime": "From time",
"ProductAssetCategoryToTime": "To time",
"ProductAssetCategoryCurrency": "Currency",
"ProductAssetCategoryPrice": "Price",
"ProductAssetCategoryPeriods": "Period prices",
"CreateProductAssetCategory": "New",
@ -46,6 +49,7 @@
"Menu:ProductAssetCategoryPeriod": "Asset category period prices",
"ProductAssetCategoryPeriod": "Asset category period prices",
"ProductAssetCategoryPeriodPeriodId": "Period ID",
"ProductAssetCategoryPeriodCurrency": "Currency",
"ProductAssetCategoryPeriodPrice": "Price",
"CreateProductAssetCategoryPeriod": "New",
"EditProductAssetCategoryPeriod": "Edit",

4
plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Domain.Shared/EasyAbp/EShop/Plugins/Booking/Localization/zh-Hans.json

@ -15,6 +15,7 @@
"ProductAssetPeriodSchemeId": "时段方案 ID",
"ProductAssetFromTime": "生效时间",
"ProductAssetToTime": "结束时间",
"ProductAssetCurrency": "币种",
"ProductAssetPrice": "价格",
"ProductAssetPeriods": "时段价格",
"CreateProductAsset": "新建",
@ -24,6 +25,7 @@
"Menu:ProductAssetPeriod": "资产时段价格",
"ProductAssetPeriod": "资产时段价格",
"ProductAssetPeriodPeriodId": "时段 ID",
"ProductAssetPeriodCurrency": "币种",
"ProductAssetPeriodPrice": "价格",
"CreateProductAssetPeriod": "新建",
"EditProductAssetPeriod": "编辑",
@ -38,6 +40,7 @@
"ProductAssetCategoryPeriodSchemeId": "时段方案 ID",
"ProductAssetCategoryFromTime": "生效时间",
"ProductAssetCategoryToTime": "结束时间",
"ProductAssetCategoryCurrency": "币种",
"ProductAssetCategoryPrice": "价格",
"ProductAssetCategoryPeriods": "时段价格",
"CreateProductAssetCategory": "新建",
@ -46,6 +49,7 @@
"Menu:ProductAssetCategoryPeriod": "资产类目时段价格",
"ProductAssetCategoryPeriod": "资产类目时段价格",
"ProductAssetCategoryPeriodPeriodId": "时段 ID",
"ProductAssetCategoryPeriodCurrency": "币种",
"ProductAssetCategoryPeriodPrice": "价格",
"CreateProductAssetCategoryPeriod": "新建",
"EditProductAssetCategoryPeriod": "编辑",

4
plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Domain.Shared/EasyAbp/EShop/Plugins/Booking/Localization/zh-Hant.json

@ -15,6 +15,7 @@
"ProductAssetPeriodSchemeId": "時段方案 ID",
"ProductAssetFromTime": "生效時間",
"ProductAssetToTime": "結束時間",
"ProductAssetCurrency": "幣種",
"ProductAssetPrice": "價格",
"ProductAssetPeriods": "時段價格",
"CreateProductAsset": "新建",
@ -24,6 +25,7 @@
"Menu:ProductAssetPeriod": "資產時段價格",
"ProductAssetPeriod": "資產時段價格",
"ProductAssetPeriodPeriodId": "時段 ID",
"ProductAssetPeriodCurrency": "幣種",
"ProductAssetPeriodPrice": "價格",
"CreateProductAssetPeriod": "新建",
"EditProductAssetPeriod": "編輯",
@ -38,6 +40,7 @@
"ProductAssetCategoryPeriodSchemeId": "時段方案 ID",
"ProductAssetCategoryFromTime": "生效時間",
"ProductAssetCategoryToTime": "結束時間",
"ProductAssetCategoryCurrency": "幣種",
"ProductAssetCategoryPrice": "價格",
"ProductAssetCategoryPeriods": "時段價格",
"CreateProductAssetCategory": "新建",
@ -46,6 +49,7 @@
"Menu:ProductAssetCategoryPeriod": "資產類目時段價格",
"ProductAssetCategoryPeriod": "資產類目時段價格",
"ProductAssetCategoryPeriodPeriodId": "時段 ID",
"ProductAssetCategoryPeriodCurrency": "幣種",
"ProductAssetCategoryPeriodPrice": "價格",
"CreateProductAssetCategoryPeriod": "新建",
"EditProductAssetCategoryPeriod": "編輯",

48
plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Domain/EasyAbp/EShop/Plugins/Booking/ProductAssetCategories/ProductAssetCategory.cs

@ -3,6 +3,8 @@ using System.Collections.Generic;
using System.Linq;
using EasyAbp.EShop.Plugins.Booking.Shared;
using EasyAbp.EShop.Stores.Stores;
using JetBrains.Annotations;
using Volo.Abp;
using Volo.Abp.Domain.Entities.Auditing;
using Volo.Abp.MultiTenancy;
@ -16,34 +18,40 @@ namespace EasyAbp.EShop.Plugins.Booking.ProductAssetCategories;
public class ProductAssetCategory : AuditedAggregateRoot<Guid>, IMultiStore, IMultiTenant
{
public virtual Guid? TenantId { get; protected set; }
public virtual Guid StoreId { get; protected set; }
public virtual Guid ProductId { get; protected set; }
public virtual Guid ProductSkuId { get; protected set; }
public virtual Guid AssetCategoryId { get; protected set; }
public virtual Guid PeriodSchemeId { get; protected set; }
/// <summary>
/// When will this mapping start taking effect.
/// </summary>
public virtual DateTime FromTime { get; protected set; }
/// <summary>
/// When will this mapping stop taking effect.
/// Setting to <c>null</c> means until forever.
/// </summary>
public virtual DateTime? ToTime { get; protected set; }
/// <summary>
/// Should set if the <see cref="Price"/> is not <c>null</c>.
/// </summary>
[CanBeNull]
public virtual string Currency { 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>
@ -63,6 +71,7 @@ public class ProductAssetCategory : AuditedAggregateRoot<Guid>, IMultiStore, IMu
Guid periodSchemeId,
DateTime fromTime,
DateTime? toTime,
[CanBeNull] string currency,
decimal? price,
List<ProductAssetCategoryPeriod> periods
) : base(id)
@ -75,18 +84,29 @@ public class ProductAssetCategory : AuditedAggregateRoot<Guid>, IMultiStore, IMu
PeriodSchemeId = periodSchemeId;
FromTime = fromTime;
ToTime = toTime;
Price = price;
SetPrice(currency, price);
Periods = periods ?? new List<ProductAssetCategoryPeriod>();
}
internal void Update(DateTime fromTime, DateTime? toTime, decimal? price)
internal void Update(DateTime fromTime, DateTime? toTime, [CanBeNull] string currency, decimal? price)
{
FromTime = fromTime;
ToTime = toTime;
SetPrice(currency, price);
}
protected void SetPrice([CanBeNull] string currency, decimal? price)
{
if (price is not null)
{
Check.NotNull(currency, nameof(currency));
}
Currency = currency;
Price = price;
}
public void AddPeriod(ProductAssetCategoryPeriod productAssetCategoryPeriod)
{
if (FindPeriod(productAssetCategoryPeriod.PeriodId) is not null)
@ -111,4 +131,4 @@ public class ProductAssetCategory : AuditedAggregateRoot<Guid>, IMultiStore, IMu
{
return Periods.FirstOrDefault(x => x.PeriodId == periodId);
}
}
}

10
plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Domain/EasyAbp/EShop/Plugins/Booking/ProductAssetCategories/ProductAssetCategoryPeriod.cs

@ -1,4 +1,5 @@
using System;
using JetBrains.Annotations;
using Volo.Abp.Domain.Entities;
namespace EasyAbp.EShop.Plugins.Booking.ProductAssetCategories;
@ -6,7 +7,10 @@ namespace EasyAbp.EShop.Plugins.Booking.ProductAssetCategories;
public class ProductAssetCategoryPeriod : Entity<Guid>
{
public virtual Guid PeriodId { get; protected set; }
[NotNull]
public virtual string Currency { get; protected set; }
public virtual decimal Price { get; protected set; }
protected ProductAssetCategoryPeriod()
@ -16,10 +20,12 @@ public class ProductAssetCategoryPeriod : Entity<Guid>
public ProductAssetCategoryPeriod(
Guid id,
Guid periodId,
[NotNull] string currency,
decimal price
) : base(id)
{
PeriodId = periodId;
Currency = currency;
Price = price;
}
}
}

18
plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Domain/EasyAbp/EShop/Plugins/Booking/ProductAssetCategories/ProductAssetManager.cs

@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using JetBrains.Annotations;
using Volo.Abp;
using Volo.Abp.Domain.Services;
@ -15,22 +16,25 @@ public class ProductAssetCategoryManager : DomainService
_repository = repository;
}
public virtual async Task<ProductAssetCategory> CreateAsync(Guid storeId, Guid productId, Guid productSkuId, Guid assetCategoryId,
Guid periodSchemeId, DateTime fromTime, DateTime? toTime, decimal? price)
public virtual async Task<ProductAssetCategory> CreateAsync(Guid storeId, Guid productId, Guid productSkuId,
Guid assetCategoryId,
Guid periodSchemeId, DateTime fromTime, DateTime? toTime, [CanBeNull] string currency, decimal? price)
{
var id = GuidGenerator.Create();
if (await _repository.ExistConflictAsync(
id, storeId, productId, productSkuId, assetCategoryId, periodSchemeId, fromTime))
{
throw new BusinessException(BookingErrorCodes.ConflictingProductAssetCategory);
}
return new ProductAssetCategory(GuidGenerator.Create(), CurrentTenant.Id, storeId, productId, productSkuId, assetCategoryId,
periodSchemeId, fromTime, toTime, price, new List<ProductAssetCategoryPeriod>());
return new ProductAssetCategory(GuidGenerator.Create(), CurrentTenant.Id, storeId, productId, productSkuId,
assetCategoryId,
periodSchemeId, fromTime, toTime, currency, price, new List<ProductAssetCategoryPeriod>());
}
public virtual async Task UpdateAsync(ProductAssetCategory entity, DateTime fromTime, DateTime? toTime, decimal? price)
public virtual async Task UpdateAsync(ProductAssetCategory entity, DateTime fromTime, DateTime? toTime,
[NotNull] string currency, decimal? price)
{
if (await _repository.ExistConflictAsync(entity.Id, entity.StoreId, entity.ProductId, entity.ProductSkuId,
entity.AssetCategoryId, entity.PeriodSchemeId, fromTime))
@ -38,6 +42,6 @@ public class ProductAssetCategoryManager : DomainService
throw new BusinessException(BookingErrorCodes.ConflictingProductAssetCategory);
}
entity.Update(fromTime, toTime, price);
entity.Update(fromTime, toTime, currency, price);
}
}

28
plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Domain/EasyAbp/EShop/Plugins/Booking/ProductAssets/ProductAsset.cs

@ -4,6 +4,8 @@ using System.Linq;
using EasyAbp.EShop.Plugins.Booking.ProductAssetCategories;
using EasyAbp.EShop.Plugins.Booking.Shared;
using EasyAbp.EShop.Stores.Stores;
using JetBrains.Annotations;
using Volo.Abp;
using Volo.Abp.Domain.Entities.Auditing;
using Volo.Abp.MultiTenancy;
@ -40,6 +42,12 @@ public class ProductAsset : AuditedAggregateRoot<Guid>, IMultiStore, IMultiTenan
/// </summary>
public virtual DateTime? ToTime { get; protected set; }
/// <summary>
/// Should set if the <see cref="Price"/> is not <c>null</c>.
/// </summary>
[CanBeNull]
public virtual string Currency { get; protected set; }
/// <summary>
/// Price for any period.
/// Fall back to the price of ProductSku if <c>null</c>.
@ -65,6 +73,7 @@ public class ProductAsset : AuditedAggregateRoot<Guid>, IMultiStore, IMultiTenan
Guid periodSchemeId,
DateTime fromTime,
DateTime? toTime,
[CanBeNull] string currency,
decimal? price,
List<ProductAssetPeriod> periods
) : base(id)
@ -77,15 +86,26 @@ public class ProductAsset : AuditedAggregateRoot<Guid>, IMultiStore, IMultiTenan
PeriodSchemeId = periodSchemeId;
FromTime = fromTime;
ToTime = toTime;
Price = price;
SetPrice(currency, price);
Periods = periods ?? new List<ProductAssetPeriod>();
}
internal void Update(DateTime fromTime, DateTime? toTime, decimal? price)
internal void Update(DateTime fromTime, DateTime? toTime, [CanBeNull] string currency, decimal? price)
{
FromTime = fromTime;
ToTime = toTime;
SetPrice(currency, price);
}
protected void SetPrice([CanBeNull] string currency, decimal? price)
{
if (price is not null)
{
Check.NotNull(currency, nameof(currency));
}
Currency = currency;
Price = price;
}
@ -113,4 +133,4 @@ public class ProductAsset : AuditedAggregateRoot<Guid>, IMultiStore, IMultiTenan
{
return Periods.FirstOrDefault(x => x.PeriodId == periodId);
}
}
}

12
plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Domain/EasyAbp/EShop/Plugins/Booking/ProductAssets/ProductAssetManager.cs

@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using JetBrains.Annotations;
using Volo.Abp;
using Volo.Abp.Domain.Services;
@ -16,10 +17,10 @@ public class ProductAssetManager : DomainService
}
public virtual async Task<ProductAsset> CreateAsync(Guid storeId, Guid productId, Guid productSkuId, Guid assetId,
Guid periodSchemeId, DateTime fromTime, DateTime? toTime, decimal? price)
Guid periodSchemeId, DateTime fromTime, DateTime? toTime, [CanBeNull] string currency, decimal? price)
{
var id = GuidGenerator.Create();
if (await _repository.ExistConflictAsync(
id, storeId, productId, productSkuId, assetId, periodSchemeId, fromTime))
{
@ -27,10 +28,11 @@ public class ProductAssetManager : DomainService
}
return new ProductAsset(GuidGenerator.Create(), CurrentTenant.Id, storeId, productId, productSkuId, assetId,
periodSchemeId, fromTime, toTime, price, new List<ProductAssetPeriod>());
periodSchemeId, fromTime, toTime, currency, price, new List<ProductAssetPeriod>());
}
public virtual async Task UpdateAsync(ProductAsset entity, DateTime fromTime, DateTime? toTime, decimal? price)
public virtual async Task UpdateAsync(ProductAsset entity, DateTime fromTime, DateTime? toTime,
[NotNull] string currency, decimal? price)
{
if (await _repository.ExistConflictAsync(entity.Id, entity.StoreId, entity.ProductId, entity.ProductSkuId,
entity.AssetId, entity.PeriodSchemeId, fromTime))
@ -38,6 +40,6 @@ public class ProductAssetManager : DomainService
throw new BusinessException(BookingErrorCodes.ConflictingProductAsset);
}
entity.Update(fromTime, toTime, price);
entity.Update(fromTime, toTime, currency, price);
}
}

10
plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Domain/EasyAbp/EShop/Plugins/Booking/ProductAssets/ProductAssetPeriod.cs

@ -1,4 +1,5 @@
using System;
using JetBrains.Annotations;
using Volo.Abp.Domain.Entities;
namespace EasyAbp.EShop.Plugins.Booking.ProductAssets;
@ -6,7 +7,10 @@ namespace EasyAbp.EShop.Plugins.Booking.ProductAssets;
public class ProductAssetPeriod : Entity<Guid>
{
public virtual Guid PeriodId { get; protected set; }
[NotNull]
public virtual string Currency { get; protected set; }
public virtual decimal Price { get; protected set; }
protected ProductAssetPeriod()
@ -16,10 +20,12 @@ public class ProductAssetPeriod : Entity<Guid>
public ProductAssetPeriod(
Guid id,
Guid periodId,
[NotNull] string currency,
decimal price
) : base(id)
{
PeriodId = periodId;
Currency = currency;
Price = price;
}
}
}

3
plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Web/Pages/EShop/Plugins/Booking/ProductAssetCategories/ProductAssetCategory/ViewModels/CreateProductAssetCategoryViewModel.cs

@ -28,6 +28,9 @@ namespace EasyAbp.EShop.Plugins.Booking.Web.Pages.EShop.Plugins.Booking.ProductA
[Display(Name = "ProductAssetCategoryToTime")]
public DateTime? ToTime { get; set; }
[Display(Name = "ProductAssetCategoryCurrency")]
public string Currency { get; set; }
[Display(Name = "ProductAssetCategoryPrice")]
[Range(BookingConsts.MinimumPrice, BookingConsts.MaximumPrice)]
public decimal? Price { get; set; }

6
plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Web/Pages/EShop/Plugins/Booking/ProductAssetCategories/ProductAssetCategory/ViewModels/EditProductAssetCategoryViewModel.cs

@ -1,7 +1,8 @@
using System;
using System.ComponentModel.DataAnnotations;
namespace EasyAbp.EShop.Plugins.Booking.Web.Pages.EShop.Plugins.Booking.ProductAssetCategories.ProductAssetCategory.ViewModels
namespace EasyAbp.EShop.Plugins.Booking.Web.Pages.EShop.Plugins.Booking.ProductAssetCategories.ProductAssetCategory.
ViewModels
{
public class EditProductAssetCategoryViewModel
{
@ -11,6 +12,9 @@ namespace EasyAbp.EShop.Plugins.Booking.Web.Pages.EShop.Plugins.Booking.ProductA
[Display(Name = "ProductAssetCategoryToTime")]
public DateTime? ToTime { get; set; }
[Display(Name = "ProductAssetCategoryCurrency")]
public string Currency { get; set; }
[Display(Name = "ProductAssetCategoryPrice")]
[Range(BookingConsts.MinimumPrice, BookingConsts.MaximumPrice)]
public decimal? Price { get; set; }

4
plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Web/Pages/EShop/Plugins/Booking/ProductAssetCategories/ProductAssetCategory/index.js

@ -56,6 +56,10 @@ $(function () {
title: l('ProductAssetCategoryAssetCategoryId'),
data: "assetCategoryId"
},
{
title: l('ProductAssetCategoryCurrency'),
data: "currency"
},
{
title: l('ProductAssetCategoryPrice'),
data: "price"

7
plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Web/Pages/EShop/Plugins/Booking/ProductAssetCategories/ProductAssetCategoryPeriod/ViewModels/CreateProductAssetCategoryPeriodViewModel.cs

@ -1,13 +1,18 @@
using System;
using System.ComponentModel.DataAnnotations;
namespace EasyAbp.EShop.Plugins.Booking.Web.Pages.EShop.Plugins.Booking.ProductAssetCategories.ProductAssetCategoryPeriod.ViewModels
namespace EasyAbp.EShop.Plugins.Booking.Web.Pages.EShop.Plugins.Booking.ProductAssetCategories.
ProductAssetCategoryPeriod.ViewModels
{
public class CreateProductAssetCategoryPeriodViewModel
{
[Display(Name = "ProductAssetCategoryPeriodPeriodId")]
public Guid PeriodId { get; set; }
[Display(Name = "ProductAssetCategoryPeriodCurrency")]
[Required]
public string Currency { get; set; }
[Display(Name = "ProductAssetCategoryPeriodPrice")]
[Range(BookingConsts.MinimumPrice, BookingConsts.MaximumPrice)]
public decimal Price { get; set; }

8
plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Web/Pages/EShop/Plugins/Booking/ProductAssetCategories/ProductAssetCategoryPeriod/ViewModels/EditProductAssetCategoryPeriodViewModel.cs

@ -1,10 +1,14 @@
using System;
using System.ComponentModel.DataAnnotations;
namespace EasyAbp.EShop.Plugins.Booking.Web.Pages.EShop.Plugins.Booking.ProductAssetCategories.ProductAssetCategoryPeriod.ViewModels
namespace EasyAbp.EShop.Plugins.Booking.Web.Pages.EShop.Plugins.Booking.ProductAssetCategories.
ProductAssetCategoryPeriod.ViewModels
{
public class EditProductAssetCategoryPeriodViewModel
{
[Display(Name = "ProductAssetCategoryPeriodCurrency")]
[Required]
public string Currency { get; set; }
[Display(Name = "ProductAssetCategoryPeriodPrice")]
[Range(BookingConsts.MinimumPrice, BookingConsts.MaximumPrice)]
public decimal Price { get; set; }

4
plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Web/Pages/EShop/Plugins/Booking/ProductAssetCategories/ProductAssetCategoryPeriod/index.js

@ -58,6 +58,10 @@ $(function () {
title: l('ProductAssetCategoryPeriodPeriodId'),
data: "periodId"
},
{
title: l('ProductAssetCategoryPeriodCurrency'),
data: "currency"
},
{
title: l('ProductAssetCategoryPeriodPrice'),
data: "price"

3
plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Web/Pages/EShop/Plugins/Booking/ProductAssets/ProductAsset/ViewModels/CreateProductAssetViewModel.cs

@ -28,6 +28,9 @@ namespace EasyAbp.EShop.Plugins.Booking.Web.Pages.EShop.Plugins.Booking.ProductA
[Display(Name = "ProductAssetToTime")]
public DateTime? ToTime { get; set; }
[Display(Name = "ProductAssetCurrency")]
public string Currency { get; set; }
[Display(Name = "ProductAssetPrice")]
[Range(BookingConsts.MinimumPrice, BookingConsts.MaximumPrice)]
public decimal? Price { get; set; }

4
plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Web/Pages/EShop/Plugins/Booking/ProductAssets/ProductAsset/ViewModels/EditProductAssetViewModel.cs

@ -1,5 +1,4 @@
using System;
using System.ComponentModel.DataAnnotations;
namespace EasyAbp.EShop.Plugins.Booking.Web.Pages.EShop.Plugins.Booking.ProductAssets.ProductAsset.ViewModels
@ -12,6 +11,9 @@ namespace EasyAbp.EShop.Plugins.Booking.Web.Pages.EShop.Plugins.Booking.ProductA
[Display(Name = "ProductAssetToTime")]
public DateTime? ToTime { get; set; }
[Display(Name = "ProductAssetCurrency")]
public string Currency { get; set; }
[Display(Name = "ProductAssetPrice")]
[Range(BookingConsts.MinimumPrice, BookingConsts.MaximumPrice)]
public decimal? Price { get; set; }

4
plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Web/Pages/EShop/Plugins/Booking/ProductAssets/ProductAsset/index.js

@ -56,6 +56,10 @@ $(function () {
title: l('ProductAssetAssetId'),
data: "assetId"
},
{
title: l('ProductAssetCurrency'),
data: "currency"
},
{
title: l('ProductAssetPrice'),
data: "price"

5
plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Web/Pages/EShop/Plugins/Booking/ProductAssets/ProductAssetPeriod/ViewModels/CreateProductAssetPeriodViewModel.cs

@ -1,5 +1,4 @@
using System;
using System.ComponentModel.DataAnnotations;
namespace EasyAbp.EShop.Plugins.Booking.Web.Pages.EShop.Plugins.Booking.ProductAssets.ProductAssetPeriod.ViewModels
@ -9,6 +8,10 @@ namespace EasyAbp.EShop.Plugins.Booking.Web.Pages.EShop.Plugins.Booking.ProductA
[Display(Name = "ProductAssetPeriodPeriodId")]
public Guid PeriodId { get; set; }
[Display(Name = "ProductAssetPeriodCurrency")]
[Required]
public string Currency { get; set; }
[Display(Name = "ProductAssetPeriodPrice")]
[Range(BookingConsts.MinimumPrice, BookingConsts.MaximumPrice)]
public decimal Price { get; set; }

6
plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Web/Pages/EShop/Plugins/Booking/ProductAssets/ProductAssetPeriod/ViewModels/EditProductAssetPeriodViewModel.cs

@ -1,11 +1,13 @@
using System;
using System.ComponentModel.DataAnnotations;
namespace EasyAbp.EShop.Plugins.Booking.Web.Pages.EShop.Plugins.Booking.ProductAssets.ProductAssetPeriod.ViewModels
{
public class EditProductAssetPeriodViewModel
{
[Display(Name = "ProductAssetPeriodCurrency")]
[Required]
public string Currency { get; set; }
[Display(Name = "ProductAssetPeriodPrice")]
[Range(BookingConsts.MinimumPrice, BookingConsts.MaximumPrice)]
public decimal Price { get; set; }

4
plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Web/Pages/EShop/Plugins/Booking/ProductAssets/ProductAssetPeriod/index.js

@ -58,6 +58,10 @@ $(function () {
title: l('ProductAssetPeriodPeriodId'),
data: "periodId"
},
{
title: l('ProductAssetPeriodCurrency'),
data: "currency"
},
{
title: l('ProductAssetPeriodPrice'),
data: "price"

4
plugins/Booking/test/EasyAbp.EShop.Plugins.Booking.TestBase/BookingDataSeedContributor.cs

@ -52,11 +52,11 @@ public class BookingDataSeedContributor : IDataSeedContributor, ITransientDepend
await _productAssetRepository.InsertAsync(await _productAssetManager.CreateAsync(BookingTestConsts.Store1Id,
BookingTestConsts.BookingProduct1Id, BookingTestConsts.BookingProduct1Sku1Id, BookingTestConsts.Asset1Id,
BookingTestConsts.PeriodScheme1Id, DateTime.Parse("1970-1-1"), null, 5m));
BookingTestConsts.PeriodScheme1Id, DateTime.Parse("1970-1-1"), null, "USD", 5m));
await _productAssetCategoryRepository.InsertAsync(await _productAssetCategoryManager.CreateAsync(
BookingTestConsts.Store1Id, BookingTestConsts.BookingProduct1Id, BookingTestConsts.BookingProduct1Sku1Id,
BookingTestConsts.AssetCategory1Id, BookingTestConsts.PeriodScheme1Id, DateTime.Parse("1970-1-1"), null,
10m));
"USD", 10m));
}
}

5440
samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore/Migrations/20220701165019_AddedCurrencyProperties.Designer.cs

File diff suppressed because it is too large

55
samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore/Migrations/20220701165019_AddedCurrencyProperties.cs

@ -0,0 +1,55 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace EShopSample.Migrations
{
public partial class AddedCurrencyProperties : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
name: "Currency",
table: "EasyAbpEShopPluginsBookingProductAssets",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "Currency",
table: "EasyAbpEShopPluginsBookingProductAssetPeriods",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "Currency",
table: "EasyAbpEShopPluginsBookingProductAssetCategoryPeriods",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "Currency",
table: "EasyAbpEShopPluginsBookingProductAssetCategories",
type: "nvarchar(max)",
nullable: true);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "Currency",
table: "EasyAbpEShopPluginsBookingProductAssets");
migrationBuilder.DropColumn(
name: "Currency",
table: "EasyAbpEShopPluginsBookingProductAssetPeriods");
migrationBuilder.DropColumn(
name: "Currency",
table: "EasyAbpEShopPluginsBookingProductAssetCategoryPeriods");
migrationBuilder.DropColumn(
name: "Currency",
table: "EasyAbpEShopPluginsBookingProductAssetCategories");
}
}
}

14
samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore/Migrations/EShopSampleDbContextModelSnapshot.cs

@ -19,7 +19,7 @@ namespace EShopSample.Migrations
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.SqlServer)
.HasAnnotation("ProductVersion", "6.0.5")
.HasAnnotation("ProductVersion", "6.0.6")
.HasAnnotation("Relational:MaxIdentifierLength", 128);
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder, 1L, 1);
@ -873,6 +873,9 @@ namespace EShopSample.Migrations
.HasColumnType("uniqueidentifier")
.HasColumnName("CreatorId");
b.Property<string>("Currency")
.HasColumnType("nvarchar(max)");
b.Property<string>("ExtraProperties")
.HasColumnType("nvarchar(max)")
.HasColumnName("ExtraProperties");
@ -921,6 +924,9 @@ namespace EShopSample.Migrations
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<string>("Currency")
.HasColumnType("nvarchar(max)");
b.Property<Guid>("PeriodId")
.HasColumnType("uniqueidentifier");
@ -960,6 +966,9 @@ namespace EShopSample.Migrations
.HasColumnType("uniqueidentifier")
.HasColumnName("CreatorId");
b.Property<string>("Currency")
.HasColumnType("nvarchar(max)");
b.Property<string>("ExtraProperties")
.HasColumnType("nvarchar(max)")
.HasColumnName("ExtraProperties");
@ -1008,6 +1017,9 @@ namespace EShopSample.Migrations
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<string>("Currency")
.HasColumnType("nvarchar(max)");
b.Property<Guid>("PeriodId")
.HasColumnType("uniqueidentifier");

Loading…
Cancel
Save