Skip to content

Commit

Permalink
Merge pull request #82 from patterninc/support-update-shipment-tracki…
Browse files Browse the repository at this point in the history
…ng-details

Support update shipment tracking details
  • Loading branch information
jwilkerson128 authored Nov 11, 2024
2 parents 4656673 + a2b1d3c commit 0484ab2
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
/pkg/
/spec/reports/
/tmp/
/.vscode/

# rspec failure tracking
.rspec_status
Expand Down
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
# 2.4.8

- Customer Feedback v2024-06-01 [#80] (https://github.com/patterninc/muffin_man/pull/80)
- Finances v2024-06-19 list_transactions [#81](https://github.com/patterninc/muffin_man/pull/81)
- FulFillment Inbound v2024-03-20 [#82](https://github.com/patterninc/muffin_man/pull/82)

# 2.4.7

- Finances V20240619 list_transactions [#81](https://github.com/patterninc/muffin_man/pull/81)
- Correct request type for cancel_inbound_plan

# 2.4.6 [#79](https://github.com/patterninc/muffin_man/pull/79)

Expand Down
7 changes: 7 additions & 0 deletions lib/muffin_man/fulfillment_inbound/v20240320.rb
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,13 @@ def list_inbound_plan_boxes(inbound_plan_id, page_size: nil, pagination_token: n
@request_type = "GET"
call_api
end

def update_shipment_tracking_details(inbound_plan_id, shipment_id, body)
@local_var_path = "#{INBOUND_PATH}/inboundPlans/#{inbound_plan_id}/shipments/#{shipment_id}/trackingDetails"
@request_body = body
@request_type = "PUT"
call_api
end
end
end
end
27 changes: 27 additions & 0 deletions spec/muffin_man/fulfillment_inbound/v20240320_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -662,4 +662,31 @@
expect(JSON.parse(response.body)["boxes"]).to be_an(Array)
end
end

describe "update_shipment_tracking_details" do
let(:body) do
{
trackingDetails: {
spdTrackingDetail: {
spdTrackingItems: [
{
boxId: "FBA10ABC0YY100001",
trackingId: "FBA10002000"
}
]
}
}
}
end

before do
stub_update_shipment_tracking_details
end

it "updates shipment tracking details" do
response = fba_inbound_client.update_shipment_tracking_details(inbound_plan_id, shipment_id, body)
expect(response.success?).to be true
expect(JSON.parse(response.body)["operationId"]).not_to be_nil
end
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,15 @@ def stub_list_inbound_plan_boxes
headers: {}
)
end

def stub_update_shipment_tracking_details
stub_request(:put, "https://#{hostname}/inbound/fba/2024-03-20/inboundPlans/#{inbound_plan_id}/shipments/#{shipment_id}/trackingDetails")
.to_return(
status: 200,
body: File.read("./spec/support/fulfillment_inbound/update_shipment_tracking_details.json"),
headers: {}
)
end
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"operationId": "ItFVVBrM2X7t8uSQ-whaf6dcKUVXuQV19tq1pB"
}

0 comments on commit 0484ab2

Please sign in to comment.