Browse Source

Add ProductGroupName property to CouponTemplateScope entity

pull/103/head
gdlcf88 6 years ago
parent
commit
1f6a499fa2
  1. 4
      plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Application.Contracts/EasyAbp/EShop/Plugins/Coupons/CouponTemplates/Dtos/CouponTemplateScopeDto.cs
  2. 2
      plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Application.Contracts/EasyAbp/EShop/Plugins/Coupons/CouponTemplates/Dtos/CreateUpdateCouponTemplateScopeDto.cs
  3. 11
      plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Domain/EasyAbp/EShop/Plugins/Coupons/CouponTemplates/CouponTemplateScope.cs
  4. 4553
      samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200924065232_AddedProductGroupNameToCouponTemplateScope.Designer.cs
  5. 22
      samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200924065232_AddedProductGroupNameToCouponTemplateScope.cs
  6. 3
      samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/EShopSampleMigrationsDbContextModelSnapshot.cs

4
plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Application.Contracts/EasyAbp/EShop/Plugins/Coupons/CouponTemplates/Dtos/CouponTemplateScopeDto.cs

@ -7,7 +7,9 @@ namespace EasyAbp.EShop.Plugins.Coupons.CouponTemplates.Dtos
public class CouponTemplateScopeDto : FullAuditedEntityDto<Guid>
{
public Guid StoreId { get; set; }
public string ProductGroupName { get; set; }
public Guid? ProductId { get; set; }
public Guid? ProductSkuId { get; set; }

2
plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Application.Contracts/EasyAbp/EShop/Plugins/Coupons/CouponTemplates/Dtos/CreateUpdateCouponTemplateScopeDto.cs

@ -7,6 +7,8 @@ namespace EasyAbp.EShop.Plugins.Coupons.CouponTemplates.Dtos
{
public Guid StoreId { get; set; }
public string ProductGroupName { get; set; }
public Guid? ProductId { get; set; }
public Guid? ProductSkuId { get; set; }

11
plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Domain/EasyAbp/EShop/Plugins/Coupons/CouponTemplates/CouponTemplateScope.cs

@ -1,5 +1,6 @@
using System;
using EasyAbp.EShop.Stores.Stores;
using JetBrains.Annotations;
using Volo.Abp.Domain.Entities.Auditing;
namespace EasyAbp.EShop.Plugins.Coupons.CouponTemplates
@ -9,12 +10,18 @@ namespace EasyAbp.EShop.Plugins.Coupons.CouponTemplates
public virtual Guid StoreId { get; protected set; }
/// <summary>
/// If this property is set to null, the coupon can be used for all products in the store.
/// Specified product group can use the coupon if this property is set.
/// </summary>
[CanBeNull]
public virtual string ProductGroupName { get; protected set; }
/// <summary>
/// Specified product can use the coupon if this property is set.
/// </summary>
public virtual Guid? ProductId { get; protected set; }
/// <summary>
/// If this property is set to null, the coupon can be used for all SKUs in the product.
/// Specified product SKU can use the coupon if this property is set.
/// </summary>
public virtual Guid? ProductSkuId { get; protected set; }
}

4553
samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200924065232_AddedProductGroupNameToCouponTemplateScope.Designer.cs

File diff suppressed because it is too large

22
samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200924065232_AddedProductGroupNameToCouponTemplateScope.cs

@ -0,0 +1,22 @@
using Microsoft.EntityFrameworkCore.Migrations;
namespace EShopSample.Migrations
{
public partial class AddedProductGroupNameToCouponTemplateScope : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
name: "ProductGroupName",
table: "CouponTemplateScope",
nullable: true);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "ProductGroupName",
table: "CouponTemplateScope");
}
}
}

3
samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/EShopSampleMigrationsDbContextModelSnapshot.cs

@ -857,6 +857,9 @@ namespace EShopSample.Migrations
b.Property<Guid?>("LastModifierId")
.HasColumnType("uniqueidentifier");
b.Property<string>("ProductGroupName")
.HasColumnType("nvarchar(max)");
b.Property<Guid?>("ProductId")
.HasColumnType("uniqueidentifier");

Loading…
Cancel
Save