Skip to content

Instantly share code, notes, and snippets.

@cored

cored/payload.rb Secret

Created June 27, 2017 16:12
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/3ca30c869c152fa1c10eba6e860b8809 to your computer and use it in GitHub Desktop.
Save cored/3ca30c869c152fa1c10eba6e860b8809 to your computer and use it in GitHub Desktop.
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