definitions/segments/loc.rb in eancom-1.6.3 vs definitions/segments/loc.rb in eancom-2.0.0

- old
+ new

@@ -6,11 +6,11 @@ # Tag # #============================================================================== tag = Eancom::Edifact::Composite.new() data = Eancom::Edifact::Data.new( type: String, - length: 3, + length: 1..3, dictionary: nil, description: "Message Header", required: true ) tag.add(:tag, data) @@ -21,16 +21,36 @@ #============================================================================== location_function_qualifier = Eancom::Edifact::Composite.new() data = Eancom::Edifact::Data.new( type: String, - length: 3, + length: 1..3, dictionary: { + '1' => { + description: 'Place of terms of delivery', + identifier: 'place_of_terms_of_delivery' + }, + '5' => { + description: 'Place of departure', + identifier: 'place_of_departure' + }, '7' => { description: 'Place of Delivery', identifier: 'place_of_delivery' }, + '14' => { + description: 'Location of goods', + identifier: 'location_of_goods' + }, + '18' => { + description: 'Warehouse', + identifier: 'warehouse' + }, + '19' => { + description: 'Factory/plant', + identifier: 'factory_plant' + }, '150' => { description: 'Container stack position', identifier: 'container_stack_position' }, '162' => { @@ -42,11 +62,11 @@ required: true ) location_function_qualifier.add(:location_function_qualifier, data) structure << location_function_qualifier #============================================================================== -# Location Identification # +# First Location Identification # #============================================================================== location_identification = Eancom::Edifact::Composite.new() data = Eancom::Edifact::Data.new( type: String, @@ -68,10 +88,14 @@ data = Eancom::Edifact::Data.new( type: String, length: 0..3, dictionary: { + '3' => { + description: 'IATA (International Air Transport Association', + identifier: 'iata' + }, '9' => { description: 'GS1', identifier: 'gs1' }, '92' => { @@ -80,10 +104,34 @@ }, }, description: "Code list responsible agency code", required: false ) -location_identification.add(:code_list_responsible_agancy_code, data) +location_identification.add(:code_list_responsible_agency_code, data) +data = Eancom::Edifact::Data.new( + type: String, + length: 1..25, + dictionary: nil, + description: 'First related location name code', + required: false +) +location_identification.add(:first_related_name_code, data) + structure << location_identification +#============================================================================== +# Second Location Identification # +#============================================================================== +second_location_identification = Eancom::Edifact::Composite.new + +data = Eancom::Edifact::Data.new( + type: String, + length: 1..25, + dictionary: nil, + description: 'Second related location name code', + required: false +) +second_location_identification.add(:second_location_identification, data) + +structure << second_location_identification #============================================================================== Eancom.register_structure(tag: 'LOC', structure: structure)