Beispiel #1
0
    public virtual async Task SeedAsync(DataSeedContext context)
    {
        using var change = _currentTenant.Change(context?.TenantId);

        await _grantedStoreRepository.InsertAsync(new GrantedStore(_guidGenerator.Create(), _currentTenant.Id,
                                                                   BookingTestConsts.Store1Id, BookingTestConsts.Asset1Id, null, false));

        await _grantedStoreRepository.InsertAsync(new GrantedStore(_guidGenerator.Create(), _currentTenant.Id,
                                                                   BookingTestConsts.Store1Id, null, BookingTestConsts.AssetCategory1Id, false));

        await _productAssetRepository.InsertAsync(await _productAssetManager.CreateAsync(BookingTestConsts.Store1Id,
                                                                                         BookingTestConsts.BookingProduct1Id, BookingTestConsts.BookingProduct1Sku1Id, BookingTestConsts.Asset1Id,
                                                                                         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,
                                                              "USD", 10m));
    }
 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.Currency, input.Price));
 }