Skip to content

Instantly share code, notes, and snippets.

@cored cored/payload.rb Secret
Created Jun 27, 2017

Embed
What would you like to do?
module Back2bed
module Messages
module Types
include Dry::Types.module
end
class Payload < Dry::Struct
constructor_type :schema
LineItems = Types::Array.member(LineItem).default([])
attribute :unique_order_number, Types::String
attribute :purchase_order_number, Types::Coercible::Int
attribute :line_items, LineItems
class LineItem < Dry::Struct
attribute :variation_sku, Types::String
attribute :quantity, Types::Coercible::Int
attribute :purchase_price_per_each, Types::Coercible::Float
attribute :product_description, Types::String
attribute :upc, Types::String
attribute :department_class_code, Types::String
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.