Skip to content
This repository has been archived by the owner on Jun 13, 2023. It is now read-only.

Commit

Permalink
Merge branch 'release/1.3.0' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
pushnitsa committed Oct 29, 2020
2 parents de075ff + 820cfa9 commit ce76133
Show file tree
Hide file tree
Showing 26 changed files with 2,211 additions and 1,151 deletions.
20 changes: 9 additions & 11 deletions .github/workflows/release-alpha.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ name: Release alpha

on:
workflow_dispatch:
pull_request_review:
types:
- submitted

jobs:
ci:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -34,7 +32,7 @@ jobs:
id: image

- name: Add version suffix
uses: VirtoCommerce/vc-github-actions/add-version-suffix@VP-5059
uses: VirtoCommerce/vc-github-actions/add-version-suffix@master

- name: SonarCloud Begin
uses: VirtoCommerce/vc-github-actions/sonar-scanner-begin@master
Expand All @@ -54,7 +52,7 @@ jobs:
- name: Build Docker Image
# if: ${{ github.ref == 'refs/heads/master' || github.ref == 'refs/heads/dev' }}
id: dockerBuild
uses: VirtoCommerce/vc-github-actions/build-docker-image@VP-5059
uses: VirtoCommerce/vc-github-actions/build-docker-image@master
with:
imageName: "demo-storefront"
tag: ${{ steps.image.outputs.taggedVersion }}
Expand All @@ -71,7 +69,7 @@ jobs:

- name: Publish Docker Image
# if: ${{ github.ref == 'refs/heads/master' || github.ref == 'refs/heads/dev' }}
uses: VirtoCommerce/vc-github-actions/publish-docker-image@VP-5059
uses: VirtoCommerce/vc-github-actions/publish-docker-image@master
with:
image: ${{ steps.dockerBuild.outputs.imageName }}
tag: ${{ steps.image.outputs.taggedVersion }}
Expand All @@ -86,24 +84,24 @@ jobs:
# - name: Publish to Blob
# if: ${{ github.ref == 'refs/heads/dev' }}
# id: blobRelease
# uses: VirtoCommerce/vc-github-actions/publish-blob-release@VP-5059
# uses: VirtoCommerce/vc-github-actions/publish-blob-release@master
# with:
# blobSAS: ${{ secrets.BLOB_TOKEN }}

# - name: Publish Github Release
# if: ${{ github.ref == 'refs/heads/master' }}
# with:
# changelog: ${{ steps.changelog.outputs.changelog }}
# uses: VirtoCommerce/vc-github-actions/publish-github-release@VP-5059
# uses: VirtoCommerce/vc-github-actions/publish-github-release@master

# - name: Setup Git Credentials
# if: ${{ github.ref == 'refs/heads/dev' || github.ref == 'refs/heads/master'}}
# uses: VirtoCommerce/vc-github-actions/setup-git-credentials-github@VP-5059
# uses: VirtoCommerce/vc-github-actions/setup-git-credentials-github@master
# with:
# githubToken: ${{ secrets.REPO_TOKEN }}

# - name: Publish Manifest
# if: ${{ github.ref == 'refs/heads/dev' || github.ref == 'refs/heads/master'}}
# uses: VirtoCommerce/vc-github-actions/publish-manifest@VP-5059
# uses: VirtoCommerce/vc-github-actions/publish-manifest@master
# with:
# packageUrl: ${{ steps.blobRelease.outputs.packageUrl }}
# packageUrl: ${{ steps.blobRelease.outputs.packageUrl }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -270,3 +270,5 @@ __pycache__/
.vscode

VirtoCommerce.Storefront/wwwroot/js/designer.bundle.js*

core-model-v1
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<Authors>VirtoCommerce</Authors>
</PropertyGroup>
<PropertyGroup>
<VersionPrefix>1.2.0</VersionPrefix>
<VersionPrefix>1.3.0</VersionPrefix>
<VersionSuffix></VersionSuffix>
<VersionSuffix Condition=" '$(VersionSuffix)' != '' AND '$(BuildNumber)' != '' ">$(VersionSuffix)-$(BuildNumber)</VersionSuffix>
</PropertyGroup>
Expand Down
5 changes: 5 additions & 0 deletions VirtoCommerce.Storefront.Model/Cart/Demo/AddCartItem.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
using Newtonsoft.Json;

namespace VirtoCommerce.Storefront.Model.Cart
{
partial class AddCartItem
{
public string ConfiguredProductId { get; set; }

[JsonIgnore]
public string ConfiguredGroupId { get; set; }
}
}
84 changes: 84 additions & 0 deletions VirtoCommerce.Storefront.Model/Cart/Demo/ConfiguredGroup.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
using System;
using System.Collections.Generic;
using Newtonsoft.Json;
using VirtoCommerce.Storefront.Model.Catalog;
using VirtoCommerce.Storefront.Model.Common;

namespace VirtoCommerce.Storefront.Model.Cart.Demo
{
public class ConfiguredGroup : Entity
{
public ConfiguredGroup(int quantity, Currency currency, string productId)
{
Id = Guid.NewGuid().ToString("N");
ProductId = productId;
Quantity = quantity;
Currency = currency;

ExtendedPrice = new Money(currency);
ExtendedPriceWithTax = new Money(currency);
TaxTotal = new Money(currency);

ListPrice = new Money(currency);
ListPriceWithTax = new Money(currency);
SalePrice = new Money(currency);
SalePriceWithTax = new Money(currency);
PlacedPrice = new Money(currency);
PlacedPriceWithTax = new Money(currency);

Items = new List<LineItem>();
}

public string ProductId { get; set; }

public Product Product { get; set; }

public DateTime CreatedDate { get; set; }

public DateTime? ModifiedDate { get; set; }

public string CreatedBy { get; set; }

public string ModifiedBy { get; set; }

[JsonRequired]
public virtual IList<LineItem> Items { get; set; }

[JsonRequired]
public int Quantity { get; set; }

#region Pricing

[JsonRequired]
public Currency Currency { get; set; }

public Money ListPrice { get; set; }

public Money ListPriceWithTax { get; set; }

public Money SalePrice { get; set; }

public Money SalePriceWithTax { get; set; }

public Money PlacedPrice { get; set; }

public Money PlacedPriceWithTax { get; set; }

[JsonRequired]
public Money ExtendedPrice { get; set; }

[JsonRequired]
public Money ExtendedPriceWithTax { get; set; }

#endregion Pricing

#region Taxation

[JsonRequired]
public Money TaxTotal { get; set; }

#endregion Taxation

public ICollection<ProductPart> Parts { get; set; } = new List<ProductPart>();
}
}
17 changes: 0 additions & 17 deletions VirtoCommerce.Storefront.Model/Cart/Demo/ConfiguredItem.cs

This file was deleted.

2 changes: 1 addition & 1 deletion VirtoCommerce.Storefront.Model/Cart/Demo/LineItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ namespace VirtoCommerce.Storefront.Model.Cart
{
public partial class LineItem
{
public string ConfiguredProductId { get; set; }
public string ConfiguredGroupId { get; set; }
}
}
14 changes: 13 additions & 1 deletion VirtoCommerce.Storefront.Model/Cart/Demo/ShoppingCart.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,23 @@
using System.Collections.Generic;
using System.Linq;
using Newtonsoft.Json;
using VirtoCommerce.Storefront.Model.Cart.Demo;

namespace VirtoCommerce.Storefront.Model.Cart
{
public partial class ShoppingCart
{
[JsonRequired]
public LineItem[] UsualItems
{
get
{
var result = Items.Where(x => !ConfiguredGroups.Any(y => y.Items.Contains(x))).ToArray();

public ICollection<ConfiguredItem> ConfiguredItems { get; set; } = new List<ConfiguredItem>();
return result;
}
}

public ICollection<ConfiguredGroup> ConfiguredGroups { get; set; } = new List<ConfiguredGroup>();
}
}
77 changes: 77 additions & 0 deletions VirtoCommerce.Storefront.Model/Order/Demo/ConfiguredGroup.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
using System;
using System.Collections.Generic;
using Newtonsoft.Json;
using VirtoCommerce.Storefront.Model.Catalog;
using VirtoCommerce.Storefront.Model.Common;

namespace VirtoCommerce.Storefront.Model.Order.Demo
{
public class ConfiguredGroup : Entity
{
public ConfiguredGroup(int quantity, Currency currency, string productId)
{
Id = Guid.NewGuid().ToString("N");
Items = new List<LineItem>();
ProductId = productId;
Quantity = quantity;
Currency = currency;

ExtendedPrice = new Money(currency);
ExtendedPriceWithTax = new Money(currency);
TaxTotal = new Money(currency);

Price = new Money(currency);
PriceWithTax = new Money(currency);
PlacedPrice = new Money(currency);
PlacedPriceWithTax = new Money(currency);
}

public string ProductId { get; set; }

public Product Product { get; set; }

public DateTime CreatedDate { get; set; }

public DateTime? ModifiedDate { get; set; }

public string CreatedBy { get; set; }

public string ModifiedBy { get; set; }

[JsonRequired]
public virtual IList<LineItem> Items { get; set; }

[JsonRequired]
public int Quantity { get; set; }

#region Pricing

[JsonRequired]
public Currency Currency { get; set; }

public Money Price { get; set; }

public Money PriceWithTax { get; set; }

public Money PlacedPrice { get; set; }

public Money PlacedPriceWithTax { get; set; }

[JsonRequired]
public Money ExtendedPrice { get; set; }

[JsonRequired]
public Money ExtendedPriceWithTax { get; set; }

#endregion Pricing

#region Taxation

[JsonRequired]
public Money TaxTotal { get; set; }

#endregion Taxation

public ICollection<ProductPart> Parts { get; set; } = new List<ProductPart>();
}
}
15 changes: 15 additions & 0 deletions VirtoCommerce.Storefront.Model/Order/Demo/CustomerOrder.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
using System.Collections.Generic;
using System.Linq;
using Newtonsoft.Json;
using VirtoCommerce.Storefront.Model.Order.Demo;

namespace VirtoCommerce.Storefront.Model.Order
{
public partial class CustomerOrder
{
[JsonRequired]
public LineItem[] UsualItems => Items.Where(x => !ConfiguredGroups.Any(y => y.Items.Contains(x))).ToArray();

public ICollection<ConfiguredGroup> ConfiguredGroups { get; set; } = new List<ConfiguredGroup>();
}
}
11 changes: 11 additions & 0 deletions VirtoCommerce.Storefront.Model/Order/Demo/LineItem.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
using VirtoCommerce.Storefront.Model.Catalog;

namespace VirtoCommerce.Storefront.Model.Order
{
public partial class LineItem
{
public string ConfiguredGropupId { get; set; }

public Product Product { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
using System.Threading.Tasks;

namespace VirtoCommerce.Storefront.Model.Order.Services
{
public interface IDemoCustomerOrderService
{
Task LoadProductsAsync(params CustomerOrder[] orders);

void SelectConfiguredProductParts(params CustomerOrder[] orders);
}
}
Loading

0 comments on commit ce76133

Please sign in to comment.