Skip to content

Instantly share code, notes, and snippets.

@cored

cored/types.rb Secret

Created July 13, 2017 15:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cored/6c852fe3253157f0bb58d6565a488067 to your computer and use it in GitHub Desktop.
Save cored/6c852fe3253157f0bb58d6565a488067 to your computer and use it in GitHub Desktop.
{:purchase_orders=>[{:retail_fulfillment_order_id=>"Some FLEXE internal id", :bill_of_lading_number=>"Some BOL number", :purchase_order_uuid=>"The UUID of the fulfillment purchase order", :tags=>["consolidator_bound"]}],
:master_bill_of_lading_number=>"Some master BOL number",
:scac=>"Some code",
:pro_number=>"Some number",
:lading_quantity=>{:num_pallets=>2}}
Dry::Struct::Error: [Flexe::NotificationHandler::BulkShipments::RetailFulfilmentOrderInfo::PurchaseOrder.new] :retail_fulfilment_order_id is missing in Hash input
class RetailFulfilmentOrderInfo < Dry::Struct¬
class PurchaseOrder < Dry::Struct¬
attribute :purchase_order_uuid, Dry::Types["string"]¬
attribute :bill_of_lading_number, Dry::Types["string"]¬
attribute :retail_fulfilment_order_id, Dry::Types["string"]¬
attribute :tags, Dry::Types["array"].member(Dry::Types["coercible.string"])¬
end¬
¬
PurchaseOrders = Dry::Types["array"].member(PurchaseOrder).default([])¬
attribute :purchase_orders, PurchaseOrders¬
attribute :master_bill_of_lading_number, Dry::Types["string"].default("")¬
+ 1 def purchase_order_uuids¬
purchase_orders.map(&:purchase_order_uuids)¬
end¬
end¬
end¬
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment