Class: Edi::Wayfair::ProductAdditionGoodsDefaults
- Inherits:
-
Object
- Object
- Edi::Wayfair::ProductAdditionGoodsDefaults
- Defined in:
- app/services/edi/wayfair/product_addition_goods_defaults.rb
Overview
Selects optional or recommended Product Addition fields backed by inherited
X-Wayfair Goods specifications.
Product Addition normally emits only required taxonomy fields. These policy
fields are intentionally also sent when Wayfair marks them optional so a new
listing starts with the same compliance data as later Catalog Item Updates.
Constant Summary collapse
- SPECIFICATIONS =
Schema titles mapped to their inherited X-Wayfair specification tokens.
{ 'uniform packaging and labeling regulations (uplr) compliant' => :wayfair_uniform_packaging_and_labeling_regulations_uplr_compliant, 'hazardous material / dangerous goods' => :wayfair_hazardous_material_dangerous_goods, 'un or id number' => :wayfair_un_or_id_number, 'hazard class(es)' => :wayfair_hazard_class_es, 'packing group' => :wayfair_packing_group, 'hazardous material weight' => :wayfair_hazardous_material_weight }.freeze
Instance Method Summary collapse
-
#definitions ⇒ Array<Hash>
Returns active optional/recommended definitions for the Goods policy.
-
#initialize(schema) ⇒ ProductAdditionGoodsDefaults
constructor
A new instance of ProductAdditionGoodsDefaults.
Constructor Details
#initialize(schema) ⇒ ProductAdditionGoodsDefaults
Returns a new instance of ProductAdditionGoodsDefaults.
27 28 29 |
# File 'app/services/edi/wayfair/product_addition_goods_defaults.rb', line 27 def initialize(schema) @schema = schema end |
Instance Method Details
#definitions ⇒ Array<Hash>
Returns active optional/recommended definitions for the Goods policy.
Required definitions remain owned by Edi::Wayfair::ProductAdditionAttributes.
35 36 37 |
# File 'app/services/edi/wayfair/product_addition_goods_defaults.rb', line 35 def definitions Array(@schema&.attributes_list).select { |definition| applicable?(definition) } end |