Skip to content

Commit

Permalink
VCST-2305: Add listTotal and showPlacedPrice to LineItem (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
artem-dudarev authored Dec 19, 2024
1 parent c2ba508 commit 5698b55
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
7 changes: 7 additions & 0 deletions src/VirtoCommerce.XOrder.Core/Schemas/OrderLineItemType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ public OrderLineItemType(
resolve: context => new Money(context.Source.Price, context.GetOrderCurrency()));
Field<NonNullGraphType<MoneyType>>(nameof(LineItem.PriceWithTax).ToCamelCase(),
resolve: context => new Money(context.Source.PriceWithTax, context.GetOrderCurrency()));
Field<NonNullGraphType<MoneyType>>(nameof(LineItem.ListTotal).ToCamelCase(),
resolve: context => context.Source.ListTotal.ToMoney(context.GetOrderCurrency()));
Field<NonNullGraphType<MoneyType>>(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);
Expand All @@ -85,6 +89,9 @@ public OrderLineItemType(
resolve: context => new Money(context.Source.ExtendedPrice, context.GetOrderCurrency()));
Field<NonNullGraphType<MoneyType>>(nameof(LineItem.ExtendedPriceWithTax).ToCamelCase(),
resolve: context => new Money(context.Source.ExtendedPriceWithTax, context.GetOrderCurrency()));
Field<NonNullGraphType<BooleanGraphType>>("showPlacedPrice",
"Indicates whether the PlacedPrice should be visible to the customer",
resolve: context => context.Source.IsDiscountAmountRounded);
Field<NonNullGraphType<MoneyType>>(nameof(LineItem.PlacedPrice).ToCamelCase(),
resolve: context => new Money(context.Source.PlacedPrice, context.GetOrderCurrency()));
Field<NonNullGraphType<MoneyType>>(nameof(LineItem.PlacedPriceWithTax).ToCamelCase(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All" />
<PackageReference Include="VirtoCommerce.OrdersModule.Core" Version="3.838.0" />
<PackageReference Include="VirtoCommerce.Xapi.Core" Version="3.815.0" />
<PackageReference Include="VirtoCommerce.XCatalog.Core" Version="3.817.0" />
<PackageReference Include="VirtoCommerce.XCart.Core" Version="3.816.0" />
<PackageReference Include="VirtoCommerce.OrdersModule.Core" Version="3.836.0" />
<PackageReference Include="VirtoCommerce.XCart.Core" Version="3.820.0" />
<PackageReference Include="VirtoCommerce.XCatalog.Core" Version="3.820.0" />
</ItemGroup>
</Project>
6 changes: 3 additions & 3 deletions src/VirtoCommerce.XOrder.Web/module.manifest
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@

<platformVersion>3.867.0</platformVersion>
<dependencies>
<dependency id="VirtoCommerce.Orders" version="3.836.0" />
<dependency id="VirtoCommerce.Orders" version="3.838.0" />
<dependency id="VirtoCommerce.Xapi" version="3.815.0" />
<dependency id="VirtoCommerce.XCart" version="3.816.0" />
<dependency id="VirtoCommerce.XCatalog" version="3.817.0" />
<dependency id="VirtoCommerce.XCart" version="3.820.0" />
<dependency id="VirtoCommerce.XCatalog" version="3.820.0" />
</dependencies>

<title>Order Experience API</title>
Expand Down

0 comments on commit 5698b55

Please sign in to comment.