tag = 'PGI' Eancom.register_segment(tag: tag, klass: Eancom::Edifact::PGI) structure = Eancom::Edifact::Structure.new(tag: tag) #============================================================================== # Tag # #============================================================================== tag = Eancom::Edifact::Composite.new() data = Eancom::Edifact::Data.new( type: String, length: 3, dictionary: nil, description: "Message Header", required: true ) tag.add(:tag, data) structure << tag #============================================================================== # Product group type code # #============================================================================== product_group_type_code = Eancom::Edifact::Composite.new() data = Eancom::Edifact::Data.new( type: String, length: 1..3, dictionary: { '2' => { description: 'No price group used', identifier: 'no_price_group_used' }, '3' => { description: 'Catalogue', identifier: 'catalogue' }, '4' => { description: 'Group of products with same price', identifier: 'group_of_products_with_same_price' }, '9' => { description: 'No group used', identifier: 'no_group_uses' }, '10' => { description: 'Price group', identifier: 'price_group' }, '12' => { description: 'Promotional group', identifier: 'promotional_group' }, '14' => { description: 'Geographical target market devsion/subdivison code', identifier: 'geographical_targeg_marget_devision_subdivision_code' }, 'BAX' => { description: 'Base article execution rule group', identifier: 'base_article_execution_rule_group' }, '11' => { description: 'Product group', identifier: 'product_group' }, '10E' => { description: 'Group of complementary products', identifier: 'group_of_complementary_products' }, 'DEF' => { description: 'Definition Group', identifier: 'definition_group' }, 'MUL' => { description: 'Metadata linked to multi-media objects group', identifier: 'metadata_linked_to_multi_media_objects_group' }, 'PAX' => { description: 'Price allocation group', identifier: 'price_allocation_group' }, 'PXC' => { description: 'Price execution rule group', identifier: 'price_execution_rule_group' } }, description: 'Product group type code', required: true ) product_group_type_code.add(:product_group_type_code, data) structure << product_group_type_code #============================================================================== # Product group # #============================================================================== product_group = Eancom::Edifact::Composite.new() data = Eancom::Edifact::Data.new( type: String, length: 0..25, dictionary: nil, description: 'Product group name code', required: false ) product_group.add(:product_group_name_code, data) data = Eancom::Edifact::Data.new( type: String, length: 0..17, dictionary: nil, description: 'Code list identification code', required: false ) product_group.add(:code_list_idenfitifaction_code, data) data = Eancom::Edifact::Data.new( type: String, length: 0..3, dictionary: { '9' => { description: 'GS1', identifier: 'gsi', }, '91' => { description: 'Assigned by supplier or suppliers agent', identifier: 'assigned_by_supplier_or_suppliers_agent' }, '92' => { description: 'Assigned by buyer or buyers agent', identifier: 'assigned_by_buyer_or_buyers_agent' } }, description: 'Code list responsible agancy code', required: false ) product_group.add(:code_list_responsibility_agency_code, data) data = Eancom::Edifact::Data.new( type: String, length: 0..35, dictionary: nil, description: 'Product group name', required: false ) product_group.add(:product_group_name, data) structure << product_group #============================================================================== Eancom.register_structure(tag: 'PGI', structure: structure)