From 5698b55e8d450c893bf0c095f4e71e21b5f0ef36 Mon Sep 17 00:00:00 2001 From: Artem Dudarev Date: Thu, 19 Dec 2024 19:01:28 +0200 Subject: [PATCH] VCST-2305: Add listTotal and showPlacedPrice to LineItem (#16) --- src/VirtoCommerce.XOrder.Core/Schemas/OrderLineItemType.cs | 7 +++++++ .../VirtoCommerce.XOrder.Core.csproj | 6 +++--- src/VirtoCommerce.XOrder.Web/module.manifest | 6 +++--- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/VirtoCommerce.XOrder.Core/Schemas/OrderLineItemType.cs b/src/VirtoCommerce.XOrder.Core/Schemas/OrderLineItemType.cs index 758c081..bc78e63 100644 --- a/src/VirtoCommerce.XOrder.Core/Schemas/OrderLineItemType.cs +++ b/src/VirtoCommerce.XOrder.Core/Schemas/OrderLineItemType.cs @@ -65,6 +65,10 @@ public OrderLineItemType( resolve: context => new Money(context.Source.Price, context.GetOrderCurrency())); Field>(nameof(LineItem.PriceWithTax).ToCamelCase(), resolve: context => new Money(context.Source.PriceWithTax, context.GetOrderCurrency())); + Field>(nameof(LineItem.ListTotal).ToCamelCase(), + resolve: context => context.Source.ListTotal.ToMoney(context.GetOrderCurrency())); + Field>(nameof(LineItem.ListTotalWithTax).ToCamelCase(), + resolve: context => context.Source.ListTotalWithTax.ToMoney(context.GetOrderCurrency())); Field(x => x.TaxType, nullable: true); Field(x => x.TaxPercentRate, nullable: false); Field(x => x.ReserveQuantity, nullable: false); @@ -85,6 +89,9 @@ public OrderLineItemType( resolve: context => new Money(context.Source.ExtendedPrice, context.GetOrderCurrency())); Field>(nameof(LineItem.ExtendedPriceWithTax).ToCamelCase(), resolve: context => new Money(context.Source.ExtendedPriceWithTax, context.GetOrderCurrency())); + Field>("showPlacedPrice", + "Indicates whether the PlacedPrice should be visible to the customer", + resolve: context => context.Source.IsDiscountAmountRounded); Field>(nameof(LineItem.PlacedPrice).ToCamelCase(), resolve: context => new Money(context.Source.PlacedPrice, context.GetOrderCurrency())); Field>(nameof(LineItem.PlacedPriceWithTax).ToCamelCase(), diff --git a/src/VirtoCommerce.XOrder.Core/VirtoCommerce.XOrder.Core.csproj b/src/VirtoCommerce.XOrder.Core/VirtoCommerce.XOrder.Core.csproj index cd0b03e..23322e9 100644 --- a/src/VirtoCommerce.XOrder.Core/VirtoCommerce.XOrder.Core.csproj +++ b/src/VirtoCommerce.XOrder.Core/VirtoCommerce.XOrder.Core.csproj @@ -9,9 +9,9 @@ + - - - + + \ No newline at end of file diff --git a/src/VirtoCommerce.XOrder.Web/module.manifest b/src/VirtoCommerce.XOrder.Web/module.manifest index 6e46dcd..e5971a2 100644 --- a/src/VirtoCommerce.XOrder.Web/module.manifest +++ b/src/VirtoCommerce.XOrder.Web/module.manifest @@ -6,10 +6,10 @@ 3.867.0 - + - - + + Order Experience API