Skip to content
This repository has been archived by the owner on Aug 14, 2024. It is now read-only.

Commit

Permalink
Merge branch 'master' into mv-ch4739-pickup-objects
Browse files Browse the repository at this point in the history
  • Loading branch information
sfroehler authored Jul 28, 2020
2 parents 7d15b21 + cbf6bfc commit 32ea42a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
## [Unreleased]
### Added

- Support shipments with pickup requests as required for [TNT](https://developers.shipcloud.io/carriers/tnt.html).

### Changed

### Deprecated
Expand Down
2 changes: 1 addition & 1 deletion lib/shipcloud/shipment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class Shipment < Base

attr_accessor :from, :to, :carrier, :package, :reference_number, :metadata
attr_reader :id, :created_at, :carrier_tracking_no, :tracking_url, :label_url,
:packages, :pickup, :price, :customs_declaration
:packages, :price, :customs_declaration, :pickup

def self.index_response_root
"#{class_name.downcase}s"
Expand Down
8 changes: 8 additions & 0 deletions spec/shipcloud/shipment_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,12 @@
id: "123456",
contents_type: "commercial_goods",
},
pickup: {
pickup_time: {
earliest: "2020-07-24T13:59:58+23:57",
latest: "2020-07-24T18:59:58+23:57",
}
}
}
end

Expand Down Expand Up @@ -85,6 +91,8 @@

expect(shipment.customs_declaration[:id]).to eq "123456"
expect(shipment.customs_declaration[:contents_type]).to eq "commercial_goods"
expect(shipment.pickup[:pickup_time][:earliest]).to eq "2020-07-24T13:59:58+23:57"
expect(shipment.pickup[:pickup_time][:latest]).to eq "2020-07-24T18:59:58+23:57"
end

it "initializes the metadata correctly" do
Expand Down

0 comments on commit 32ea42a

Please sign in to comment.