This repository has been archived by the owner on Jun 13, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'release/1.3.0' into master
- Loading branch information
Showing
26 changed files
with
2,211 additions
and
1,151 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -270,3 +270,5 @@ __pycache__/ | |
.vscode | ||
|
||
VirtoCommerce.Storefront/wwwroot/js/designer.bundle.js* | ||
|
||
core-model-v1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
84
VirtoCommerce.Storefront.Model/Cart/Demo/ConfiguredGroup.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
17
VirtoCommerce.Storefront.Model/Cart/Demo/ConfiguredItem.cs
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
77
VirtoCommerce.Storefront.Model/Order/Demo/ConfiguredGroup.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
15
VirtoCommerce.Storefront.Model/Order/Demo/CustomerOrder.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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>(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; } | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
VirtoCommerce.Storefront.Model/Order/Demo/Services/IDemoCustomerOrderService.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
} |
Oops, something went wrong.