mirror of https://github.com/EasyAbp/EShop.git
51 changed files with 5982 additions and 414 deletions
@ -0,0 +1,16 @@ |
|||||
|
using System; |
||||
|
using System.ComponentModel; |
||||
|
namespace EasyAbp.EShop.Plugins.Booking.GrantedStores.Dtos |
||||
|
{ |
||||
|
[Serializable] |
||||
|
public class CreateUpdateGrantedStoreDto |
||||
|
{ |
||||
|
public Guid StoreId { get; set; } |
||||
|
|
||||
|
public Guid? AssetId { get; set; } |
||||
|
|
||||
|
public Guid? AssetCategoryId { get; set; } |
||||
|
|
||||
|
public bool AllowAll { get; set; } |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,16 @@ |
|||||
|
using System; |
||||
|
using Volo.Abp.Application.Dtos; |
||||
|
|
||||
|
namespace EasyAbp.EShop.Plugins.Booking.GrantedStores.Dtos; |
||||
|
|
||||
|
[Serializable] |
||||
|
public class GetGrantedStoreListDto : PagedAndSortedResultRequestDto |
||||
|
{ |
||||
|
public Guid? StoreId { get; set; } |
||||
|
|
||||
|
public Guid? AssetId { get; set; } |
||||
|
|
||||
|
public Guid? AssetCategoryId { get; set; } |
||||
|
|
||||
|
public bool? AllowAll { get; set; } |
||||
|
} |
||||
@ -0,0 +1,17 @@ |
|||||
|
using System; |
||||
|
using Volo.Abp.Application.Dtos; |
||||
|
|
||||
|
namespace EasyAbp.EShop.Plugins.Booking.GrantedStores.Dtos |
||||
|
{ |
||||
|
[Serializable] |
||||
|
public class GrantedStoreDto : AuditedEntityDto<Guid> |
||||
|
{ |
||||
|
public Guid StoreId { get; set; } |
||||
|
|
||||
|
public Guid? AssetId { get; set; } |
||||
|
|
||||
|
public Guid? AssetCategoryId { get; set; } |
||||
|
|
||||
|
public bool AllowAll { get; set; } |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,17 @@ |
|||||
|
using System; |
||||
|
using EasyAbp.EShop.Plugins.Booking.GrantedStores.Dtos; |
||||
|
using Volo.Abp.Application.Services; |
||||
|
|
||||
|
namespace EasyAbp.EShop.Plugins.Booking.GrantedStores |
||||
|
{ |
||||
|
public interface IGrantedStoreAppService : |
||||
|
ICrudAppService< |
||||
|
GrantedStoreDto, |
||||
|
Guid, |
||||
|
GetGrantedStoreListDto, |
||||
|
CreateUpdateGrantedStoreDto, |
||||
|
CreateUpdateGrantedStoreDto> |
||||
|
{ |
||||
|
|
||||
|
} |
||||
|
} |
||||
@ -1,12 +0,0 @@ |
|||||
using System; |
|
||||
using System.ComponentModel; |
|
||||
namespace EasyAbp.EShop.Plugins.Booking.StoreAssetCategories.Dtos |
|
||||
{ |
|
||||
[Serializable] |
|
||||
public class CreateUpdateStoreAssetCategoryDto |
|
||||
{ |
|
||||
public Guid StoreId { get; set; } |
|
||||
|
|
||||
public Guid AssetCategoryId { get; set; } |
|
||||
} |
|
||||
} |
|
||||
@ -1,12 +0,0 @@ |
|||||
using System; |
|
||||
using Volo.Abp.Application.Dtos; |
|
||||
|
|
||||
namespace EasyAbp.EShop.Plugins.Booking.StoreAssetCategories.Dtos; |
|
||||
|
|
||||
[Serializable] |
|
||||
public class GetStoreAssetCategoryListDto : PagedAndSortedResultRequestDto |
|
||||
{ |
|
||||
public Guid? StoreId { get; set; } |
|
||||
|
|
||||
public Guid? AssetCategoryId { get; set; } |
|
||||
} |
|
||||
@ -1,13 +0,0 @@ |
|||||
using System; |
|
||||
using Volo.Abp.Application.Dtos; |
|
||||
|
|
||||
namespace EasyAbp.EShop.Plugins.Booking.StoreAssetCategories.Dtos |
|
||||
{ |
|
||||
[Serializable] |
|
||||
public class StoreAssetCategoryDto : AuditedEntityDto<Guid> |
|
||||
{ |
|
||||
public Guid StoreId { get; set; } |
|
||||
|
|
||||
public Guid AssetCategoryId { get; set; } |
|
||||
} |
|
||||
} |
|
||||
@ -1,18 +0,0 @@ |
|||||
using System; |
|
||||
using EasyAbp.EShop.Plugins.Booking.StoreAssetCategories.Dtos; |
|
||||
using Volo.Abp.Application.Dtos; |
|
||||
using Volo.Abp.Application.Services; |
|
||||
|
|
||||
namespace EasyAbp.EShop.Plugins.Booking.StoreAssetCategories |
|
||||
{ |
|
||||
public interface IStoreAssetCategoryAppService : |
|
||||
ICrudAppService< |
|
||||
StoreAssetCategoryDto, |
|
||||
Guid, |
|
||||
GetStoreAssetCategoryListDto, |
|
||||
CreateUpdateStoreAssetCategoryDto, |
|
||||
CreateUpdateStoreAssetCategoryDto> |
|
||||
{ |
|
||||
|
|
||||
} |
|
||||
} |
|
||||
@ -0,0 +1,36 @@ |
|||||
|
using System; |
||||
|
using System.Linq; |
||||
|
using System.Threading.Tasks; |
||||
|
using EasyAbp.EShop.Plugins.Booking.Permissions; |
||||
|
using EasyAbp.EShop.Plugins.Booking.GrantedStores.Dtos; |
||||
|
using Volo.Abp.Application.Services; |
||||
|
|
||||
|
namespace EasyAbp.EShop.Plugins.Booking.GrantedStores |
||||
|
{ |
||||
|
public class GrantedStoreAppService : CrudAppService<GrantedStore, GrantedStoreDto, Guid, |
||||
|
GetGrantedStoreListDto, CreateUpdateGrantedStoreDto, CreateUpdateGrantedStoreDto>, |
||||
|
IGrantedStoreAppService |
||||
|
{ |
||||
|
protected override string GetPolicyName { get; set; } = null; |
||||
|
protected override string GetListPolicyName { get; set; } = null; |
||||
|
protected override string CreatePolicyName { get; set; } = BookingPermissions.GrantedStore.Create; |
||||
|
protected override string UpdatePolicyName { get; set; } = BookingPermissions.GrantedStore.Update; |
||||
|
protected override string DeletePolicyName { get; set; } = BookingPermissions.GrantedStore.Delete; |
||||
|
|
||||
|
private readonly IGrantedStoreRepository _repository; |
||||
|
|
||||
|
public GrantedStoreAppService(IGrantedStoreRepository repository) : base(repository) |
||||
|
{ |
||||
|
_repository = repository; |
||||
|
} |
||||
|
|
||||
|
protected override async Task<IQueryable<GrantedStore>> CreateFilteredQueryAsync(GetGrantedStoreListDto input) |
||||
|
{ |
||||
|
return (await base.CreateFilteredQueryAsync(input)) |
||||
|
.WhereIf(input.StoreId.HasValue, x => x.StoreId == input.StoreId) |
||||
|
.WhereIf(input.AssetId.HasValue, x => x.AssetId == input.AssetId) |
||||
|
.WhereIf(input.AssetCategoryId.HasValue, x => x.AssetCategoryId == input.AssetCategoryId) |
||||
|
.WhereIf(input.AllowAll.HasValue, x => x.AllowAll == input.AllowAll); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -1,34 +0,0 @@ |
|||||
using System; |
|
||||
using System.Linq; |
|
||||
using System.Threading.Tasks; |
|
||||
using EasyAbp.EShop.Plugins.Booking.Permissions; |
|
||||
using EasyAbp.EShop.Plugins.Booking.StoreAssetCategories.Dtos; |
|
||||
using Volo.Abp.Application.Services; |
|
||||
|
|
||||
namespace EasyAbp.EShop.Plugins.Booking.StoreAssetCategories |
|
||||
{ |
|
||||
public class StoreAssetCategoryAppService : CrudAppService<StoreAssetCategory, StoreAssetCategoryDto, Guid, |
|
||||
GetStoreAssetCategoryListDto, CreateUpdateStoreAssetCategoryDto, CreateUpdateStoreAssetCategoryDto>, |
|
||||
IStoreAssetCategoryAppService |
|
||||
{ |
|
||||
protected override string GetPolicyName { get; set; } = null; |
|
||||
protected override string GetListPolicyName { get; set; } = null; |
|
||||
protected override string CreatePolicyName { get; set; } = BookingPermissions.StoreAssetCategory.Create; |
|
||||
protected override string UpdatePolicyName { get; set; } = BookingPermissions.StoreAssetCategory.Update; |
|
||||
protected override string DeletePolicyName { get; set; } = BookingPermissions.StoreAssetCategory.Delete; |
|
||||
|
|
||||
private readonly IStoreAssetCategoryRepository _repository; |
|
||||
|
|
||||
public StoreAssetCategoryAppService(IStoreAssetCategoryRepository repository) : base(repository) |
|
||||
{ |
|
||||
_repository = repository; |
|
||||
} |
|
||||
|
|
||||
protected override async Task<IQueryable<StoreAssetCategory>> CreateFilteredQueryAsync(GetStoreAssetCategoryListDto input) |
|
||||
{ |
|
||||
return (await base.CreateFilteredQueryAsync(input)) |
|
||||
.WhereIf(input.StoreId.HasValue, x => x.StoreId == input.StoreId) |
|
||||
.WhereIf(input.AssetCategoryId.HasValue, x => x.AssetCategoryId == input.AssetCategoryId); |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
@ -0,0 +1,39 @@ |
|||||
|
using System; |
||||
|
using Volo.Abp.Domain.Entities.Auditing; |
||||
|
using Volo.Abp.MultiTenancy; |
||||
|
|
||||
|
namespace EasyAbp.EShop.Plugins.Booking.GrantedStores; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// Mapping of Store to Asset or AssetCategory.
|
||||
|
/// It determines which Asset or AssetCategory can a store owner set to provide booking service as a product of its store.
|
||||
|
/// </summary>
|
||||
|
public class GrantedStore : AuditedAggregateRoot<Guid>, IMultiTenant |
||||
|
{ |
||||
|
public virtual Guid? TenantId { get; protected set; } |
||||
|
|
||||
|
public virtual Guid StoreId { get; protected set; } |
||||
|
|
||||
|
public virtual Guid? AssetId { get; protected set; } |
||||
|
|
||||
|
public virtual Guid? AssetCategoryId { get; protected set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// Allow using any assets in any categories.
|
||||
|
/// </summary>
|
||||
|
public virtual bool AllowAll { get; protected set; } |
||||
|
|
||||
|
protected GrantedStore() |
||||
|
{ |
||||
|
} |
||||
|
|
||||
|
public GrantedStore(Guid id, Guid? tenantId, Guid storeId, Guid? assetId, Guid? assetCategoryId, |
||||
|
bool allowAll) : base(id) |
||||
|
{ |
||||
|
TenantId = tenantId; |
||||
|
StoreId = storeId; |
||||
|
AssetId = assetId; |
||||
|
AssetCategoryId = assetCategoryId; |
||||
|
AllowAll = allowAll; |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,9 @@ |
|||||
|
using System; |
||||
|
using Volo.Abp.Domain.Repositories; |
||||
|
|
||||
|
namespace EasyAbp.EShop.Plugins.Booking.GrantedStores |
||||
|
{ |
||||
|
public interface IGrantedStoreRepository : IRepository<GrantedStore, Guid> |
||||
|
{ |
||||
|
} |
||||
|
} |
||||
@ -1,9 +0,0 @@ |
|||||
using System; |
|
||||
using Volo.Abp.Domain.Repositories; |
|
||||
|
|
||||
namespace EasyAbp.EShop.Plugins.Booking.StoreAssetCategories |
|
||||
{ |
|
||||
public interface IStoreAssetCategoryRepository : IRepository<StoreAssetCategory, Guid> |
|
||||
{ |
|
||||
} |
|
||||
} |
|
||||
@ -1,30 +0,0 @@ |
|||||
using System; |
|
||||
using Volo.Abp.Domain.Entities.Auditing; |
|
||||
using Volo.Abp.MultiTenancy; |
|
||||
|
|
||||
namespace EasyAbp.EShop.Plugins.Booking.StoreAssetCategories; |
|
||||
|
|
||||
/// <summary>
|
|
||||
/// Mapping of Store to AssetCategory.
|
|
||||
/// It determines which AssetCategory can a store owner set to provide booking service as a product of its store.
|
|
||||
/// Stores can use all the sub-categories if you set a parent category for them.
|
|
||||
/// </summary>
|
|
||||
public class StoreAssetCategory : AuditedAggregateRoot<Guid>, IMultiTenant |
|
||||
{ |
|
||||
public virtual Guid? TenantId { get; protected set; } |
|
||||
|
|
||||
public virtual Guid StoreId { get; protected set; } |
|
||||
|
|
||||
public virtual Guid AssetCategoryId { get; protected set; } |
|
||||
|
|
||||
protected StoreAssetCategory() |
|
||||
{ |
|
||||
} |
|
||||
|
|
||||
public StoreAssetCategory(Guid id, Guid? tenantId, Guid storeId, Guid assetCategoryId) : base(id) |
|
||||
{ |
|
||||
TenantId = tenantId; |
|
||||
StoreId = storeId; |
|
||||
AssetCategoryId = assetCategoryId; |
|
||||
} |
|
||||
} |
|
||||
@ -0,0 +1,18 @@ |
|||||
|
using System.Linq; |
||||
|
using Microsoft.EntityFrameworkCore; |
||||
|
|
||||
|
namespace EasyAbp.EShop.Plugins.Booking.GrantedStores |
||||
|
{ |
||||
|
public static class GrantedStoreEfCoreQueryableExtensions |
||||
|
{ |
||||
|
public static IQueryable<GrantedStore> IncludeDetails(this IQueryable<GrantedStore> queryable, bool include = true) |
||||
|
{ |
||||
|
if (!include) |
||||
|
{ |
||||
|
return queryable; |
||||
|
} |
||||
|
|
||||
|
return queryable; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,21 @@ |
|||||
|
using System; |
||||
|
using System.Linq; |
||||
|
using System.Threading.Tasks; |
||||
|
using EasyAbp.EShop.Plugins.Booking.EntityFrameworkCore; |
||||
|
using Volo.Abp.Domain.Repositories.EntityFrameworkCore; |
||||
|
using Volo.Abp.EntityFrameworkCore; |
||||
|
|
||||
|
namespace EasyAbp.EShop.Plugins.Booking.GrantedStores |
||||
|
{ |
||||
|
public class GrantedStoreRepository : EfCoreRepository<IBookingDbContext, GrantedStore, Guid>, IGrantedStoreRepository |
||||
|
{ |
||||
|
public GrantedStoreRepository(IDbContextProvider<IBookingDbContext> dbContextProvider) : base(dbContextProvider) |
||||
|
{ |
||||
|
} |
||||
|
|
||||
|
public override async Task<IQueryable<GrantedStore>> WithDetailsAsync() |
||||
|
{ |
||||
|
return (await GetQueryableAsync()).IncludeDetails(); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -1,18 +0,0 @@ |
|||||
using System.Linq; |
|
||||
using Microsoft.EntityFrameworkCore; |
|
||||
|
|
||||
namespace EasyAbp.EShop.Plugins.Booking.StoreAssetCategories |
|
||||
{ |
|
||||
public static class StoreAssetCategoryEfCoreQueryableExtensions |
|
||||
{ |
|
||||
public static IQueryable<StoreAssetCategory> IncludeDetails(this IQueryable<StoreAssetCategory> queryable, bool include = true) |
|
||||
{ |
|
||||
if (!include) |
|
||||
{ |
|
||||
return queryable; |
|
||||
} |
|
||||
|
|
||||
return queryable; |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
@ -1,21 +0,0 @@ |
|||||
using System; |
|
||||
using System.Linq; |
|
||||
using System.Threading.Tasks; |
|
||||
using EasyAbp.EShop.Plugins.Booking.EntityFrameworkCore; |
|
||||
using Volo.Abp.Domain.Repositories.EntityFrameworkCore; |
|
||||
using Volo.Abp.EntityFrameworkCore; |
|
||||
|
|
||||
namespace EasyAbp.EShop.Plugins.Booking.StoreAssetCategories |
|
||||
{ |
|
||||
public class StoreAssetCategoryRepository : EfCoreRepository<IBookingDbContext, StoreAssetCategory, Guid>, IStoreAssetCategoryRepository |
|
||||
{ |
|
||||
public StoreAssetCategoryRepository(IDbContextProvider<IBookingDbContext> dbContextProvider) : base(dbContextProvider) |
|
||||
{ |
|
||||
} |
|
||||
|
|
||||
public override async Task<IQueryable<StoreAssetCategory>> WithDetailsAsync() |
|
||||
{ |
|
||||
return (await GetQueryableAsync()).IncludeDetails(); |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
@ -0,0 +1,28 @@ |
|||||
|
using System.Threading.Tasks; |
||||
|
using EasyAbp.EShop.Plugins.Booking.GrantedStores; |
||||
|
using EasyAbp.EShop.Plugins.Booking.GrantedStores.Dtos; |
||||
|
using EasyAbp.EShop.Plugins.Booking.Web.Pages.EShop.Plugins.Booking.GrantedStores.GrantedStore.ViewModels; |
||||
|
using Microsoft.AspNetCore.Mvc; |
||||
|
|
||||
|
namespace EasyAbp.EShop.Plugins.Booking.Web.Pages.EShop.Plugins.Booking.GrantedStores.GrantedStore |
||||
|
{ |
||||
|
public class CreateModalModel : BookingPageModel |
||||
|
{ |
||||
|
[BindProperty] |
||||
|
public CreateEditGrantedStoreViewModel ViewModel { get; set; } |
||||
|
|
||||
|
private readonly IGrantedStoreAppService _service; |
||||
|
|
||||
|
public CreateModalModel(IGrantedStoreAppService service) |
||||
|
{ |
||||
|
_service = service; |
||||
|
} |
||||
|
|
||||
|
public virtual async Task<IActionResult> OnPostAsync() |
||||
|
{ |
||||
|
var dto = ObjectMapper.Map<CreateEditGrantedStoreViewModel, CreateUpdateGrantedStoreDto>(ViewModel); |
||||
|
await _service.CreateAsync(dto); |
||||
|
return NoContent(); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -1,6 +1,6 @@ |
|||||
using System.Threading.Tasks; |
using System.Threading.Tasks; |
||||
|
|
||||
namespace EasyAbp.EShop.Plugins.Booking.Web.Pages.EShop.Plugins.Booking.StoreAssetCategories.StoreAssetCategory |
namespace EasyAbp.EShop.Plugins.Booking.Web.Pages.EShop.Plugins.Booking.GrantedStores.GrantedStore |
||||
{ |
{ |
||||
public class IndexModel : BookingPageModel |
public class IndexModel : BookingPageModel |
||||
{ |
{ |
||||
22
plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Web/Pages/EShop/Plugins/Booking/StoreAssetCategories/StoreAssetCategory/ViewModels/CreateEditStoreAssetCategoryViewModel.cs → plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Web/Pages/EShop/Plugins/Booking/GrantedStores/GrantedStore/ViewModels/CreateEditGrantedStoreViewModel.cs
22
plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Web/Pages/EShop/Plugins/Booking/StoreAssetCategories/StoreAssetCategory/ViewModels/CreateEditStoreAssetCategoryViewModel.cs → plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Web/Pages/EShop/Plugins/Booking/GrantedStores/GrantedStore/ViewModels/CreateEditGrantedStoreViewModel.cs
@ -1,28 +0,0 @@ |
|||||
using System.Threading.Tasks; |
|
||||
using EasyAbp.EShop.Plugins.Booking.StoreAssetCategories; |
|
||||
using EasyAbp.EShop.Plugins.Booking.StoreAssetCategories.Dtos; |
|
||||
using EasyAbp.EShop.Plugins.Booking.Web.Pages.EShop.Plugins.Booking.StoreAssetCategories.StoreAssetCategory.ViewModels; |
|
||||
using Microsoft.AspNetCore.Mvc; |
|
||||
|
|
||||
namespace EasyAbp.EShop.Plugins.Booking.Web.Pages.EShop.Plugins.Booking.StoreAssetCategories.StoreAssetCategory |
|
||||
{ |
|
||||
public class CreateModalModel : BookingPageModel |
|
||||
{ |
|
||||
[BindProperty] |
|
||||
public CreateEditStoreAssetCategoryViewModel ViewModel { get; set; } |
|
||||
|
|
||||
private readonly IStoreAssetCategoryAppService _service; |
|
||||
|
|
||||
public CreateModalModel(IStoreAssetCategoryAppService service) |
|
||||
{ |
|
||||
_service = service; |
|
||||
} |
|
||||
|
|
||||
public virtual async Task<IActionResult> OnPostAsync() |
|
||||
{ |
|
||||
var dto = ObjectMapper.Map<CreateEditStoreAssetCategoryViewModel, CreateUpdateStoreAssetCategoryDto>(ViewModel); |
|
||||
await _service.CreateAsync(dto); |
|
||||
return NoContent(); |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
@ -0,0 +1,28 @@ |
|||||
|
using Shouldly; |
||||
|
using System.Threading.Tasks; |
||||
|
using Xunit; |
||||
|
|
||||
|
namespace EasyAbp.EShop.Plugins.Booking.GrantedStores |
||||
|
{ |
||||
|
public class GrantedStoreAppServiceTests : BookingApplicationTestBase |
||||
|
{ |
||||
|
private readonly IGrantedStoreAppService _grantedStoreAppService; |
||||
|
|
||||
|
public GrantedStoreAppServiceTests() |
||||
|
{ |
||||
|
_grantedStoreAppService = GetRequiredService<IGrantedStoreAppService>(); |
||||
|
} |
||||
|
|
||||
|
/* |
||||
|
[Fact] |
||||
|
public async Task Test1() |
||||
|
{ |
||||
|
// Arrange
|
||||
|
|
||||
|
// Act
|
||||
|
|
||||
|
// Assert
|
||||
|
} |
||||
|
*/ |
||||
|
} |
||||
|
} |
||||
@ -1,28 +0,0 @@ |
|||||
using Shouldly; |
|
||||
using System.Threading.Tasks; |
|
||||
using Xunit; |
|
||||
|
|
||||
namespace EasyAbp.EShop.Plugins.Booking.StoreAssetCategories |
|
||||
{ |
|
||||
public class StoreAssetCategoryAppServiceTests : BookingApplicationTestBase |
|
||||
{ |
|
||||
private readonly IStoreAssetCategoryAppService _storeAssetCategoryAppService; |
|
||||
|
|
||||
public StoreAssetCategoryAppServiceTests() |
|
||||
{ |
|
||||
_storeAssetCategoryAppService = GetRequiredService<IStoreAssetCategoryAppService>(); |
|
||||
} |
|
||||
|
|
||||
/* |
|
||||
[Fact] |
|
||||
public async Task Test1() |
|
||||
{ |
|
||||
// Arrange
|
|
||||
|
|
||||
// Act
|
|
||||
|
|
||||
// Assert
|
|
||||
} |
|
||||
*/ |
|
||||
} |
|
||||
} |
|
||||
@ -0,0 +1,33 @@ |
|||||
|
using System; |
||||
|
using System.Threading.Tasks; |
||||
|
using EasyAbp.EShop.Plugins.Booking.GrantedStores; |
||||
|
using Volo.Abp.Domain.Repositories; |
||||
|
using Xunit; |
||||
|
|
||||
|
namespace EasyAbp.EShop.Plugins.Booking.EntityFrameworkCore.GrantedStores |
||||
|
{ |
||||
|
public class GrantedStoreRepositoryTests : BookingEntityFrameworkCoreTestBase |
||||
|
{ |
||||
|
private readonly IGrantedStoreRepository _grantedStoreRepository; |
||||
|
|
||||
|
public GrantedStoreRepositoryTests() |
||||
|
{ |
||||
|
_grantedStoreRepository = GetRequiredService<IGrantedStoreRepository>(); |
||||
|
} |
||||
|
|
||||
|
/* |
||||
|
[Fact] |
||||
|
public async Task Test1() |
||||
|
{ |
||||
|
await WithUnitOfWorkAsync(async () => |
||||
|
{ |
||||
|
// Arrange
|
||||
|
|
||||
|
// Act
|
||||
|
|
||||
|
//Assert
|
||||
|
}); |
||||
|
} |
||||
|
*/ |
||||
|
} |
||||
|
} |
||||
@ -1,33 +0,0 @@ |
|||||
using System; |
|
||||
using System.Threading.Tasks; |
|
||||
using EasyAbp.EShop.Plugins.Booking.StoreAssetCategories; |
|
||||
using Volo.Abp.Domain.Repositories; |
|
||||
using Xunit; |
|
||||
|
|
||||
namespace EasyAbp.EShop.Plugins.Booking.EntityFrameworkCore.StoreAssetCategories |
|
||||
{ |
|
||||
public class StoreAssetCategoryRepositoryTests : BookingEntityFrameworkCoreTestBase |
|
||||
{ |
|
||||
private readonly IStoreAssetCategoryRepository _storeAssetCategoryRepository; |
|
||||
|
|
||||
public StoreAssetCategoryRepositoryTests() |
|
||||
{ |
|
||||
_storeAssetCategoryRepository = GetRequiredService<IStoreAssetCategoryRepository>(); |
|
||||
} |
|
||||
|
|
||||
/* |
|
||||
[Fact] |
|
||||
public async Task Test1() |
|
||||
{ |
|
||||
await WithUnitOfWorkAsync(async () => |
|
||||
{ |
|
||||
// Arrange
|
|
||||
|
|
||||
// Act
|
|
||||
|
|
||||
//Assert
|
|
||||
}); |
|
||||
} |
|
||||
*/ |
|
||||
} |
|
||||
} |
|
||||
File diff suppressed because it is too large
@ -0,0 +1,64 @@ |
|||||
|
using System; |
||||
|
using Microsoft.EntityFrameworkCore.Migrations; |
||||
|
|
||||
|
#nullable disable |
||||
|
|
||||
|
namespace EShopSample.Migrations |
||||
|
{ |
||||
|
public partial class RefactoredToGrantedStore : Migration |
||||
|
{ |
||||
|
protected override void Up(MigrationBuilder migrationBuilder) |
||||
|
{ |
||||
|
migrationBuilder.DropTable( |
||||
|
name: "EasyAbpEShopPluginsBookingStoreAssetCategories"); |
||||
|
|
||||
|
migrationBuilder.CreateTable( |
||||
|
name: "EasyAbpEShopPluginsBookingGrantedStores", |
||||
|
columns: table => new |
||||
|
{ |
||||
|
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false), |
||||
|
TenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true), |
||||
|
StoreId = table.Column<Guid>(type: "uniqueidentifier", nullable: false), |
||||
|
AssetId = table.Column<Guid>(type: "uniqueidentifier", nullable: true), |
||||
|
AssetCategoryId = table.Column<Guid>(type: "uniqueidentifier", nullable: true), |
||||
|
AllowAll = table.Column<bool>(type: "bit", nullable: false), |
||||
|
ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: true), |
||||
|
ConcurrencyStamp = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: true), |
||||
|
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false), |
||||
|
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true), |
||||
|
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true), |
||||
|
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true) |
||||
|
}, |
||||
|
constraints: table => |
||||
|
{ |
||||
|
table.PrimaryKey("PK_EasyAbpEShopPluginsBookingGrantedStores", x => x.Id); |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
protected override void Down(MigrationBuilder migrationBuilder) |
||||
|
{ |
||||
|
migrationBuilder.DropTable( |
||||
|
name: "EasyAbpEShopPluginsBookingGrantedStores"); |
||||
|
|
||||
|
migrationBuilder.CreateTable( |
||||
|
name: "EasyAbpEShopPluginsBookingStoreAssetCategories", |
||||
|
columns: table => new |
||||
|
{ |
||||
|
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false), |
||||
|
AssetCategoryId = table.Column<Guid>(type: "uniqueidentifier", nullable: false), |
||||
|
ConcurrencyStamp = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: true), |
||||
|
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false), |
||||
|
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true), |
||||
|
ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: true), |
||||
|
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true), |
||||
|
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true), |
||||
|
StoreId = table.Column<Guid>(type: "uniqueidentifier", nullable: false), |
||||
|
TenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true) |
||||
|
}, |
||||
|
constraints: table => |
||||
|
{ |
||||
|
table.PrimaryKey("PK_EasyAbpEShopPluginsBookingStoreAssetCategories", x => x.Id); |
||||
|
}); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
Loading…
Reference in new issue