Skip to content

Commit

Permalink
Merge branch 'master' into chore/add-integration-tests-00
Browse files Browse the repository at this point in the history
  • Loading branch information
jenschude authored Feb 16, 2024
2 parents c843045 + 6623504 commit 90a1efa
Show file tree
Hide file tree
Showing 12 changed files with 97 additions and 22 deletions.
28 changes: 18 additions & 10 deletions changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<details>
<summary>Added Type(s)</summary>

- added type `DiscountedLineItemPortionDraft`
- added type `DiscountCodeSetKeyAction`
- added type `CartDiscountCreatedMessage`
- added type `CartDiscountDeletedMessage`
Expand All @@ -23,6 +24,23 @@
</details>


<details>
<summary>Changed Property(s)</summary>

- :warning: changed property `includedDiscounts` of type `DiscountedLineItemPriceDraft` from type `DiscountedLineItemPortion[]` to `DiscountedLineItemPortionDraft[]`
</details>


<details>
<summary>Added Property(s)</summary>

- added property `perMethodExternalTaxRate` to type `CartAddLineItemAction`
- added property `key` to type `DiscountCode`
- added property `key` to type `DiscountCodeDraft`
- added property `shippingMode` to type `MyCartDraft`
</details>


<details>
<summary>Added Method(s)</summary>

Expand All @@ -39,13 +57,3 @@
- added resource `/{projectKey}/discount-codes/key={key}`
</details>


<details>
<summary>Added Property(s)</summary>

- added property `perMethodExternalTaxRate` to type `CartAddLineItemAction`
- added property `key` to type `DiscountCode`
- added property `key` to type `DiscountCodeDraft`
- added property `shippingMode` to type `MyCartDraft`
</details>

Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public ServiceProviderFixture()
Build();
var useStreamClient = Enum.Parse<ClientType>(configuration.GetValue("ClientType", "String")) == ClientType.Stream;

services.UseCommercetoolsApi(configuration, "Client", options: new ClientOptions { ReadResponseAsStream = useStreamClient});
services.UseCommercetoolsApi(configuration, "Client", options: new ClientOptions { ReadResponseAsStream = useStreamClient });
services.AddLogging(c => c.AddProvider(new InMemoryLoggerProvider()));
services.SetupClient(
"MeClient",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public ServiceProviderFixture()
Build();

var useStreamClient = Enum.Parse<ClientType>(configuration.GetValue("ClientType", "String")) == ClientType.Stream;
services.UseCommercetoolsImportApi(configuration, "ImportClient", options: new ClientOptions { ReadResponseAsStream = useStreamClient});
services.UseCommercetoolsImportApi(configuration, "ImportClient", options: new ClientOptions { ReadResponseAsStream = useStreamClient });
this.serviceProvider = services.BuildServiceProvider();

//set default ProjectKey
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System;
using System.IO;
using System.IO;

namespace commercetools.Base.Serialization
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ private static ApiHttpException CreateServerException(HttpRequestMessage request
{
var statusCode = (int)response.StatusCode;
var body = response.ExtractResponseBody();
var message = $"Server error response {request.RequestUri} {statusCode} {response.ReasonPhrase}";
var message = $"Server error response {request.RequestUri} {statusCode} {response.ReasonPhrase} {body}";
List<KeyValuePair<string, string>> t = new List<KeyValuePair<string, string>>();
var headers = new ApiHttpHeaders(response.Headers.SelectMany(pair => pair.Value.Select(v => new KeyValuePair<string, string>(pair.Key, v))).ToList());
switch (statusCode)
Expand All @@ -60,7 +60,7 @@ private static ApiHttpException CreateClientException(HttpRequestMessage request
{
var statusCode = (int)response.StatusCode;
var body = response.ExtractResponseBody();
var message = $"Client error response {request.RequestUri} {statusCode} {response.ReasonPhrase}";
var message = $"Client error response {request.RequestUri} {statusCode} {response.ReasonPhrase} {body}";
var headers = new ApiHttpHeaders(response.Headers.SelectMany(pair => pair.Value.Select(v => new KeyValuePair<string, string>(pair.Key, v))).ToList());
switch (statusCode)
{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
using commercetools.Sdk.Api.Models.Common;


namespace commercetools.Sdk.Api.Models.Carts
{

public partial class DiscountedLineItemPortionDraft : IDiscountedLineItemPortionDraft
{
public IReference Discount { get; set; }

public ITypedMoneyDraft DiscountedAmount { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
using commercetools.Sdk.Api.Models.Common;
using commercetools.Base.CustomAttributes;

// ReSharper disable CheckNamespace
namespace commercetools.Sdk.Api.Models.Carts
{
[DeserializeAs(typeof(commercetools.Sdk.Api.Models.Carts.DiscountedLineItemPortionDraft))]
public partial interface IDiscountedLineItemPortionDraft
{
IReference Discount { get; set; }

ITypedMoneyDraft DiscountedAmount { get; set; }

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ public partial class DiscountedLineItemPriceDraft : IDiscountedLineItemPriceDraf
{
public IMoney Value { get; set; }

public IList<IDiscountedLineItemPortion> IncludedDiscounts { get; set; }
public IEnumerable<IDiscountedLineItemPortion> IncludedDiscountsEnumerable { set => IncludedDiscounts = value.ToList(); }
public IList<IDiscountedLineItemPortionDraft> IncludedDiscounts { get; set; }
public IEnumerable<IDiscountedLineItemPortionDraft> IncludedDiscountsEnumerable { set => IncludedDiscounts = value.ToList(); }

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ public partial interface IDiscountedLineItemPriceDraft
{
IMoney Value { get; set; }

IList<IDiscountedLineItemPortion> IncludedDiscounts { get; set; }
IEnumerable<IDiscountedLineItemPortion> IncludedDiscountsEnumerable { set => IncludedDiscounts = value.ToList(); }
IList<IDiscountedLineItemPortionDraft> IncludedDiscounts { get; set; }
IEnumerable<IDiscountedLineItemPortionDraft> IncludedDiscountsEnumerable { set => IncludedDiscounts = value.ToList(); }


}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
using System;

// ReSharper disable CheckNamespace
namespace commercetools.Sdk.Api.Predicates.Query.Carts
{

public partial class DiscountedLineItemPortionDraftQueryBuilderDsl
{
public DiscountedLineItemPortionDraftQueryBuilderDsl()
{
}

public static DiscountedLineItemPortionDraftQueryBuilderDsl Of()
{
return new DiscountedLineItemPortionDraftQueryBuilderDsl();
}

public CombinationQueryPredicate<DiscountedLineItemPortionDraftQueryBuilderDsl> Discount(
Func<commercetools.Sdk.Api.Predicates.Query.Common.ReferenceQueryBuilderDsl, CombinationQueryPredicate<commercetools.Sdk.Api.Predicates.Query.Common.ReferenceQueryBuilderDsl>> fn)
{
return new CombinationQueryPredicate<DiscountedLineItemPortionDraftQueryBuilderDsl>(ContainerQueryPredicate.Of()
.Parent(ConstantQueryPredicate.Of().Constant("discount"))
.Inner(fn.Invoke(commercetools.Sdk.Api.Predicates.Query.Common.ReferenceQueryBuilderDsl.Of())),
DiscountedLineItemPortionDraftQueryBuilderDsl.Of);
}

public CombinationQueryPredicate<DiscountedLineItemPortionDraftQueryBuilderDsl> DiscountedAmount(
Func<commercetools.Sdk.Api.Predicates.Query.Common.TypedMoneyDraftQueryBuilderDsl, CombinationQueryPredicate<commercetools.Sdk.Api.Predicates.Query.Common.TypedMoneyDraftQueryBuilderDsl>> fn)
{
return new CombinationQueryPredicate<DiscountedLineItemPortionDraftQueryBuilderDsl>(ContainerQueryPredicate.Of()
.Parent(ConstantQueryPredicate.Of().Constant("discountedAmount"))
.Inner(fn.Invoke(commercetools.Sdk.Api.Predicates.Query.Common.TypedMoneyDraftQueryBuilderDsl.Of())),
DiscountedLineItemPortionDraftQueryBuilderDsl.Of);
}


}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ public CombinationQueryPredicate<DiscountedLineItemPriceDraftQueryBuilderDsl> Va
}

public CombinationQueryPredicate<DiscountedLineItemPriceDraftQueryBuilderDsl> IncludedDiscounts(
Func<commercetools.Sdk.Api.Predicates.Query.Carts.DiscountedLineItemPortionQueryBuilderDsl, CombinationQueryPredicate<commercetools.Sdk.Api.Predicates.Query.Carts.DiscountedLineItemPortionQueryBuilderDsl>> fn)
Func<commercetools.Sdk.Api.Predicates.Query.Carts.DiscountedLineItemPortionDraftQueryBuilderDsl, CombinationQueryPredicate<commercetools.Sdk.Api.Predicates.Query.Carts.DiscountedLineItemPortionDraftQueryBuilderDsl>> fn)
{
return new CombinationQueryPredicate<DiscountedLineItemPriceDraftQueryBuilderDsl>(ContainerQueryPredicate.Of()
.Parent(ConstantQueryPredicate.Of().Constant("includedDiscounts"))
.Inner(fn.Invoke(commercetools.Sdk.Api.Predicates.Query.Carts.DiscountedLineItemPortionQueryBuilderDsl.Of())),
.Inner(fn.Invoke(commercetools.Sdk.Api.Predicates.Query.Carts.DiscountedLineItemPortionDraftQueryBuilderDsl.Of())),
DiscountedLineItemPriceDraftQueryBuilderDsl.Of);
}
public ICollectionPredicateBuilder<DiscountedLineItemPriceDraftQueryBuilderDsl> IncludedDiscounts()
Expand Down
2 changes: 2 additions & 0 deletions references.txt
Original file line number Diff line number Diff line change
Expand Up @@ -218,3 +218,5 @@ d10443de67d8c8e684b4e63415b5720fc3bcf169
5b5166eedb28e48364c82c3fcf2d795983fe9fa8
941e8656001becbc52907ad541f2c61e461d865d
be578831c2178be70f96067afc7f51dc08a513e3
3ac46e79b1cfbcb5f09ff4306b26075dd60d14e0
ffed231e91d01608e1bb08ecc1883cf00d9d9293

0 comments on commit 90a1efa

Please sign in to comment.