Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fulfillment order move object #810

Merged
merged 2 commits into from
Dec 7, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Update for FulfillmentOrder Move
  • Loading branch information
judah4 committed Nov 23, 2022
commit b16dd8cd449e2ea3244ed9bf377bd93d753f01cb
31 changes: 31 additions & 0 deletions ShopifySharp/Entities/FulfillmentOrderMove.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
using System;
using System.Collections.Generic;
using Newtonsoft.Json;

namespace ShopifySharp
{
/// <summary>
/// Fulfillment Order Move object
/// </summary>
public class FulfillmentOrderMove
{
/// <summary>
/// Original fulfillment order
/// </summary>
[JsonProperty("original_fulfillment_order")]
public FulfillmentOrder OriginalFulfillmentOrder { get; set; }

/// <summary>
/// Moved fulfillment order
/// </summary>
[JsonProperty("moved_fulfillment_order")]
public FulfillmentOrder MovedFulfillmentOrder { get; set; }

/// <summary>
/// Remaining fulfillment order if anything remains.
/// </summary>
[JsonProperty("remaining_fulfillment_order")]
public FulfillmentOrder RemainingFulfillmentOrder { get; set; }

}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System.Net.Http;
using System.Net.Http;
using ShopifySharp.Filters;
using System.Collections.Generic;
using System.Threading.Tasks;
Expand Down Expand Up @@ -83,7 +83,7 @@ public virtual async Task<FulfillmentOrder> HoldAsync(long fulfillmentOrderId, F
/// <param name="fulfillmentOrderId">The fulfillment order id.</param>
/// <param name="newLocationId">The new fulfillment order location.</param>
/// <param name="cancellationToken">Cancellation Token</param>
public virtual async Task<FulfillmentOrder> MoveAsync(long fulfillmentOrderId, long newLocationId, CancellationToken cancellationToken = default)
public virtual async Task<FulfillmentOrderMove> MoveAsync(long fulfillmentOrderId, long newLocationId, CancellationToken cancellationToken = default)
{
var body = new
{
Expand All @@ -97,7 +97,7 @@ public virtual async Task<FulfillmentOrder> MoveAsync(long fulfillmentOrderId, l
var req = PrepareRequest($"fulfillment_orders/{fulfillmentOrderId}/move.json");

//needs to be original_fulfillment_order
var response = await ExecuteRequestAsync<FulfillmentOrder>(req, HttpMethod.Post, cancellationToken, content, rootElement: "fulfillment_order");
var response = await ExecuteRequestAsync<FulfillmentOrderMove>(req, HttpMethod.Post, cancellationToken, content);

return response.Result;
}
Expand Down