baldr 0.0.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
data/lib/baldr/builder.rb CHANGED
@@ -1,25 +1,62 @@
1
1
  class Baldr::Builder
2
2
 
3
- DEFAULT_SEPARATORS = {
4
- element: '*',
5
- segment: '~'
6
- }.freeze
7
-
8
- attr_accessor :separators
3
+ attr_accessor :envelope
9
4
 
10
5
  def initialize(params = {})
11
- @children = []
12
- @separators = params[:separators] || DEFAULT_SEPARATORS
6
+ @envelope = Baldr::Envelope.new
7
+ @transactions = []
8
+ @sender_id = params[:sender_id]
9
+ @receiver_id = params[:receiver_id]
10
+ @sender_id_qualifier = params[:sender_id_qualifier]
11
+ @receiver_id_qualifier = params[:receiver_id_qualifier]
12
+ @standard_version_number = params[:standard_version_number] || '00401'
13
+ @interchange_control_number = params[:interchange_control_number]
14
+ @date_time = params[:date_time] || DateTime.now
15
+ @functional_groups_control_numbers = params[:functional_groups_control_numbers] || {}
16
+ @acknowledgment_requested = params[:acknowledgment_requested] || '0'
13
17
  end
14
18
 
15
- def method_missing(method, *args, &block)
16
- child = VanillaX12::Segment.new(method, self)
17
- child.instance_eval &block
18
- @children << child
19
+ def ST(&block)
20
+ transaction = Baldr::Transaction.new
21
+ @transactions << transaction
22
+
23
+ transaction.instance_eval &block if block_given?
19
24
  end
20
25
 
21
- def draw
22
- @children.map(&:draw).join("\n")
26
+ def prepare!
27
+ @envelope.sender_id = @sender_id if @sender_id
28
+ @envelope.receiver_id = @receiver_id if @receiver_id
29
+ @envelope.sender_id_qualifier = @sender_id_qualifier if @sender_id_qualifier
30
+ @envelope.receiver_id_qualifier = @receiver_id_qualifier if @receiver_id_qualifier
31
+ @envelope.standard_version_number = @standard_version_number if @standard_version_number
32
+ @envelope.interchange_control_number = @interchange_control_number if @interchange_control_number
33
+ @envelope.date_time = @date_time
34
+ @envelope.acknowledgment_requested = @acknowledgment_requested
35
+
36
+ functional_groups = @transactions.group_by { |t| t.functional_group(version) }
37
+ functional_groups.each do |group_id, transactions|
38
+ group = Baldr::FunctionalGroup.new
39
+ group.functional_identifier_code = group_id
40
+ group.application_senders_code = @sender_id
41
+ group.application_receivers_code = @receiver_id
42
+ group.version_release_industry_code = "#{@standard_version_number}0"
43
+ group.date_time = @date_time
44
+ group.group_control_number = @functional_groups_control_numbers[group_id]
45
+ @envelope.add group
46
+ transactions.each do |t|
47
+ group.add t
48
+ t.prepare!
49
+ end
50
+ group.prepare!
51
+ end
52
+
53
+ @envelope.prepare!
54
+ end
55
+
56
+ protected
57
+
58
+ def version
59
+ @version ||= Baldr::Grammar.for_version(@standard_version_number)
23
60
  end
24
61
 
25
62
  end
@@ -0,0 +1,127 @@
1
+ class Baldr::Envelope < Baldr::Segment
2
+
3
+ helpers_for_elements(
4
+ 'ISA01' => :authorization_info_qualifier,
5
+ #'ISA02' => :authorization_info,
6
+ 'ISA03' => :security_info_qualifier,
7
+ #'ISA04' => :security_info,
8
+ 'ISA05' => :sender_id_qualifier,
9
+ #'ISA06' => :sender_id,
10
+ 'ISA07' => :receiver_id_qualifier,
11
+ #'ISA08' => :receiver_id,
12
+ 'ISA09' => :date,
13
+ 'ISA10' => :time,
14
+ 'ISA11' => :standard_id,
15
+ 'ISA12' => :standard_version_number,
16
+ 'ISA13' => :interchange_control_number,
17
+ 'ISA14' => :acknowledgment_requested,
18
+ 'ISA15' => :usage_indicator,
19
+ 'ISA16' => :component_separator,
20
+ )
21
+
22
+ def initialize(id = 'ISA')
23
+ super(id)
24
+
25
+ self.authorization_info_qualifier = '00'
26
+ self.authorization_info = ''
27
+ self.security_info_qualifier = '00'
28
+ self.security_info = ''
29
+ self.sender_id_qualifier = '00'
30
+ self.sender_id = ''
31
+ self.receiver_id_qualifier = '00'
32
+ self.receiver_id = ''
33
+ self.date_time = DateTime.now
34
+ self.standard_id = 'U'
35
+ self.standard_version_number = '00401'
36
+ self.acknowledgment_requested = '0'
37
+ self.usage_indicator = 'P'
38
+ self.component_separator = '>'
39
+ end
40
+
41
+ def prepare!
42
+ trailer = get_trailer('IEA')
43
+
44
+ trailer['IEA01'] = func_group_loop.segments.count.to_s
45
+
46
+ self.interchange_control_number ||= generate_control_number(9)
47
+ trailer['IEA02'] = interchange_control_number
48
+ end
49
+
50
+ def transactions
51
+ @transactions ||= func_group_loop.segments.map{ |f| f.transactions }.flatten
52
+ end
53
+
54
+ def GS(&block)
55
+ if @children.last && @children.last.id.to_s == 'GS'
56
+ loop = @children.last
57
+ loop.add_segment Baldr::FunctionalGroup.new
58
+ else
59
+ loop = Baldr::Loop.new('GS')
60
+ @children << loop
61
+ end
62
+
63
+ loop.current_segment.instance_eval &block if block_given?
64
+ end
65
+
66
+ def authorization_info
67
+ self['ISA02'].rstrip
68
+ end
69
+
70
+ def authorization_info=(value)
71
+ self['ISA02'] = value.to_s.ljust(record_def[1][:max])
72
+ end
73
+
74
+ def security_info
75
+ self['ISA04'].rstrip
76
+ end
77
+
78
+ def security_info=(value)
79
+ self['ISA04'] = value.to_s.ljust(record_def[3][:max])
80
+ end
81
+
82
+ def sender_id
83
+ self['ISA06'].rstrip
84
+ end
85
+
86
+ def sender_id=(value)
87
+ self['ISA06'] = value.to_s.ljust(record_def[5][:max])
88
+ end
89
+
90
+ def receiver_id
91
+ self['ISA08'].rstrip
92
+ end
93
+
94
+ def receiver_id=(value)
95
+ self['ISA08'] = value.to_s.ljust(record_def[7][:max])
96
+ end
97
+
98
+ def date_time
99
+ DateTime.parse "#{date} #{time}"
100
+ end
101
+
102
+ def date_time=(value)
103
+ self.date = value.strftime('%y%m%d')
104
+ self.time = value.strftime('%H%M')
105
+ end
106
+
107
+ def custom_validate!(version)
108
+ trailer = @children.last.segments.first
109
+ if trailer['IEA01'].to_i != func_group_loop.segments.count
110
+ raise "wrong functional groups number: #{trailer['IEA01']} in IEA01, but real number is #{func_group_loop.segments.count}"
111
+ end
112
+ if trailer['IEA02'] != interchange_control_number
113
+ raise "interchange control numbers don't match: #{trailer['IEA02']} in IEA02 and #{interchange_control_number} in ISA13"
114
+ end
115
+ end
116
+
117
+ protected
118
+
119
+ def func_group_loop
120
+ @func_group_loop ||= @children.select{ |c| c.id == 'GS' }.first
121
+ end
122
+
123
+ def record_def
124
+ Baldr::Grammar::Envelope::RECORD_DEFS['ISA']
125
+ end
126
+
127
+ end
@@ -0,0 +1,3 @@
1
+ class Baldr::Error < StandardError
2
+
3
+ end
@@ -0,0 +1,72 @@
1
+ class Baldr::FunctionalGroup < Baldr::Segment
2
+
3
+ helpers_for_elements(
4
+ 'GS01' => :functional_identifier_code,
5
+ 'GS02' => :application_senders_code,
6
+ 'GS03' => :application_receivers_code,
7
+ 'GS04' => :date,
8
+ 'GS05' => :time,
9
+ 'GS06' => :group_control_number,
10
+ 'GS07' => :responsible_agency_code,
11
+ 'GS08' => :version_release_industry_code,
12
+ )
13
+
14
+ def initialize(id = 'GS')
15
+ super(id)
16
+
17
+ #self.application_senders_code = ''
18
+ #self.application_receivers_code = ''
19
+ self.date_time = DateTime.now
20
+ self.responsible_agency_code = 'X'
21
+ self.version_release_industry_code = '004010'
22
+ end
23
+
24
+ def prepare!
25
+ trailer = get_trailer('GE')
26
+
27
+ trailer['GE01'] = transaction_loop.segments.count.to_s
28
+
29
+ self.group_control_number ||= generate_control_number(9)
30
+ trailer['GE02'] = group_control_number
31
+ end
32
+
33
+ def sub_version
34
+ Baldr::Grammar.for_version(version_release_industry_code)
35
+ end
36
+
37
+ def transactions
38
+ transaction_loop.segments
39
+ end
40
+
41
+ def date_time
42
+ DateTime.parse "#{date} #{time}"
43
+ end
44
+
45
+ def date_time=(value)
46
+ self.date = value.strftime('%Y%m%d')
47
+ self.time = value.strftime('%H%M')
48
+ end
49
+
50
+ def custom_validate!(version)
51
+ transaction_loop.segments.each do |transaction|
52
+ if version.for_transaction_set(transaction.transaction_set_code)::FUNCTIONAL_GROUP != functional_identifier_code
53
+ raise "wrong transaction #{transaction.transaction_set_code} in functional group #{functional_identifier_code}"
54
+ end
55
+ end
56
+
57
+ trailer = @children.second.segments.first
58
+ if trailer['GE01'].to_i != transaction_loop.segments.count
59
+ raise "wrong transactions number: #{trailer['GE01']} in GE01, but real number is #{transaction_loop.segments.count}"
60
+ end
61
+ if trailer['GE02'] != group_control_number
62
+ raise "group control numbers don't match: #{trailer['GE02']} in GE02 and #{group_control_number} in GS06"
63
+ end
64
+ end
65
+
66
+ protected
67
+
68
+ def transaction_loop
69
+ @children.first
70
+ end
71
+
72
+ end
@@ -0,0 +1,69 @@
1
+ module Baldr::Grammar::Envelope
2
+
3
+ STRUCTURE = {
4
+ id: 'ISA', min: 0, max: 99999, class: :envelope, level: [
5
+ {id: 'TA1', min: 0, max: 99999},
6
+ {id: 'GS', min: 0, class: :functional_group, max: 99999, level: [
7
+ {id: 'ST', min: 0, class: :transaction, max: 99999},
8
+ {id: 'GE', min: 1, max: 1},
9
+ ]},
10
+ {id: 'IEA', min: 1, max: 1}
11
+ ]
12
+ }.freeze
13
+
14
+ RECORD_DEFS = {
15
+ 'ISA' => [
16
+ {id: 'ISA01', required: true, min: 2, max: 2, type: :id},
17
+ {id: 'ISA02', required: true, min: 10, max: 10, type: :string},
18
+ {id: 'ISA03', required: true, min: 2, max: 2, type: :id},
19
+ {id: 'ISA04', required: true, min: 10, max: 10, type: :string},
20
+ {id: 'ISA05', required: true, min: 2, max: 2, type: :id},
21
+ {id: 'ISA06', required: true, min: 15, max: 15, type: :string},
22
+ {id: 'ISA07', required: true, min: 2, max: 2, type: :id},
23
+ {id: 'ISA08', required: true, min: 15, max: 15, type: :string},
24
+ {id: 'ISA09', required: true, min: 6, max: 6, type: :date},
25
+ {id: 'ISA10', required: true, min: 4, max: 4, type: :time},
26
+ {id: 'ISA11', required: true, min: 1, max: 1, type: :id},
27
+ {id: 'ISA12', required: true, min: 5, max: 5, type: :id},
28
+ {id: 'ISA13', required: true, min: 9, max: 9, type: :number, decimals: 0},
29
+ {id: 'ISA14', required: true, min: 1, max: 1, type: :id},
30
+ {id: 'ISA15', required: true, min: 1, max: 1, type: :id},
31
+ {id: 'ISA16', required: true, min: 1, max: 1, type: :string},
32
+ ],
33
+ 'GS' => [
34
+ {id: 'GS01', required: true, max: 2, type: :id},
35
+ {id: 'GS02', required: true, max: 15, type: :string},
36
+ {id: 'GS03', required: true, max: 15, type: :string},
37
+ {id: 'GS04', required: true, max: 8, type: :date},
38
+ {id: 'GS05', required: true, max: 8, type: :time},
39
+ {id: 'GS06', required: true, max: 9, type: :number, decimals: 0},
40
+ {id: 'GS07', required: true, max: 2, type: :id},
41
+ {id: 'GS08', required: true, max: 12, type: :string},
42
+ ],
43
+ 'ST' => [
44
+ {id: 'ST01', required: true, max: 3, type: :id},
45
+ {id: 'ST02', required: true, min: 4, max: 9, type: :string},
46
+ {id: 'ST03', required: false, max: 35, type: :string},
47
+ ],
48
+ 'SE' => [
49
+ {id: 'SE01', required: true, max: 10, type: :number, decimals: 0},
50
+ {id: 'SE02', required: true, min: 4, max: 9, type: :string},
51
+ ],
52
+ 'GE' => [
53
+ {id: 'GE01', required: true, max: 6, type: :number, decimals: 0},
54
+ {id: 'GE02', required: true, max: 9, type: :number, decimals: 0},
55
+ ],
56
+ 'IEA' => [
57
+ {id: 'IEA01', required: true, max: 5, type: :number, decimals: 0},
58
+ {id: 'IEA02', required: true, max: 9, type: :number, decimals: 0},
59
+ ],
60
+ 'TA1' => [
61
+ {id: 'TA101', required: true, max: 9, type: :number, decimals: 0},
62
+ {id: 'TA102', required: true, max: 6, type: :date},
63
+ {id: 'TA103', required: true, max: 4, type: :time},
64
+ {id: 'TA104', required: true, max: 1, type: :id},
65
+ {id: 'TA105', required: true, max: 3, type: :id},
66
+ ],
67
+ }.freeze
68
+
69
+ end
@@ -0,0 +1,88 @@
1
+ module Baldr::Grammar::Version4010::Set204
2
+
3
+ FUNCTIONAL_GROUP = 'SM'
4
+
5
+ STRUCTURE = {
6
+ id: 'ST', min: 1, max: 1, level: [
7
+ {id: 'B2', min: 1, max: 1},
8
+ {id: 'B2A', min: 1, max: 1},
9
+ {id: 'L11', min: 0, max: 50},
10
+ {id: 'G62', min: 0, max: 1},
11
+ {id: 'MS3', min: 0, max: 1},
12
+ {id: 'AT5', min: 0, max: 6},
13
+ {id: 'PLD', min: 0, max: 1},
14
+ {id: 'LH6', min: 0, max: 6},
15
+ {id: 'NTE', min: 0, max: 10},
16
+ {id: 'N1', min: 0, max: 5, level: [
17
+ {id: 'N2', min: 0, max: 1},
18
+ {id: 'N3', min: 0, max: 2},
19
+ {id: 'N4', min: 0, max: 1},
20
+ {id: 'L11', min: 0, max: 1},
21
+ {id: 'G61', min: 0, max: 3},
22
+ ]},
23
+ {id: 'N7', min: 0, max: 10, level: [
24
+ {id: 'N7A', min: 0, max: 1},
25
+ {id: 'N7B', min: 0, max: 1},
26
+ {id: 'MEA', min: 0, max: 1},
27
+ {id: 'M7', min: 0, max: 2},
28
+ ]},
29
+ {id: 'S5', min: 1, max: 999, level: [
30
+ {id: 'L11', min: 0, max: 50},
31
+ {id: 'G62', min: 0, max: 2},
32
+ {id: 'AT8', min: 0, max: 1},
33
+ {id: 'LAD', min: 0, max: 999},
34
+ {id: 'AT5', min: 0, max: 6},
35
+ {id: 'PLD', min: 0, max: 1},
36
+ {id: 'NTE', min: 0, max: 20},
37
+ {id: 'N1', min: 0, max: 1, level: [
38
+ {id: 'N2', min: 0, max: 1},
39
+ {id: 'N3', min: 0, max: 2},
40
+ {id: 'N4', min: 0, max: 1},
41
+ {id: 'G61', min: 0, max: 3},
42
+ ]},
43
+ {id: 'L5', min: 0, max: 99, level: [
44
+ {id: 'AT8', min: 0, max: 1},
45
+ {id: 'G61', min: 0, max: 99, level: [
46
+ {id: 'L11', min: 0, max: 5},
47
+ {id: 'LH6', min: 0, max: 6},
48
+ {id: 'LH1', min: 0, max: 25, level: [
49
+ {id: 'LH2', min: 0, max: 4},
50
+ {id: 'LH3', min: 0, max: 10},
51
+ {id: 'LFH', min: 0, max: 20},
52
+ {id: 'LEP', min: 0, max: 3},
53
+ {id: 'LH4', min: 0, max: 1},
54
+ {id: 'LHT', min: 0, max: 3},
55
+ ]},
56
+ ]},
57
+ ]},
58
+ {id: 'OID', min: 0, max: 999, level: [
59
+ {id: 'G62', min: 0, max: 2},
60
+ {id: 'LAD', min: 0, max: 999},
61
+ {id: 'L5', min: 0, max: 99, level: [
62
+ {id: 'AT8', min: 0, max: 1},
63
+ {id: 'G61', min: 0, max: 99, level: [
64
+ {id: 'L11', min: 0, max: 5},
65
+ {id: 'LH6', min: 0, max: 6},
66
+ {id: 'LH1', min: 0, max: 25, level: [
67
+ {id: 'LH2', min: 0, max: 4},
68
+ {id: 'LH3', min: 0, max: 10},
69
+ {id: 'LFH', min: 0, max: 20},
70
+ {id: 'LEP', min: 0, max: 3},
71
+ {id: 'LH4', min: 0, max: 1},
72
+ {id: 'LHT', min: 0, max: 3},
73
+ ]},
74
+ ]},
75
+ ]},
76
+ ]},
77
+ {id: 'N7', min: 0, max: 10, level: [
78
+ {id: 'N7A', min: 0, max: 1},
79
+ {id: 'N7B', min: 0, max: 1},
80
+ {id: 'MEA', min: 0, max: 1},
81
+ {id: 'M7', min: 0, max: 2},
82
+ ]},
83
+ ]},
84
+ {id: 'L3', min: 0, max: 1},
85
+ {id: 'SE', min: 1, max: 1},
86
+ ]
87
+ }.freeze
88
+ end
@@ -0,0 +1,80 @@
1
+ module Baldr::Grammar::Version4010::Set210
2
+
3
+ FUNCTIONAL_GROUP = 'IM'
4
+
5
+ STRUCTURE = {
6
+ id: 'ST', min: 1, max: 1, level: [
7
+ {id: 'B3', min: 1, max: 1},
8
+ {id: 'C2', min: 0, max: 1},
9
+ {id: 'C3', min: 0, max: 1},
10
+ {id: 'ITD', min: 0, max: 1},
11
+ {id: 'N9', min: 0, max: 300},
12
+ {id: 'G62', min: 0, max: 6},
13
+ {id: 'R3', min: 0, max: 12},
14
+ {id: 'H3', min: 0, max: 6},
15
+ {id: 'K1', min: 0, max: 10},
16
+ {id: 'N1', min: 0, max: 10, level: [
17
+ {id: 'N2', min: 0, max: 1},
18
+ {id: 'N3', min: 0, max: 2},
19
+ {id: 'N4', min: 0, max: 1},
20
+ {id: 'N9', min: 0, max: 5},
21
+ ]},
22
+ {id: 'N7', min: 0, max: 10, level: [
23
+ {id: 'M7', min: 0, max: 2},
24
+ ]},
25
+ {id: 'SPO', min: 0, max: 999999, level: [
26
+ {id: 'SDQ', min: 0, max: 10},
27
+ ]},
28
+ {id: 'S5', min: 0, max: 999, level: [
29
+ {id: 'N9', min: 0, max: 10},
30
+ {id: 'G62', min: 0, max: 10},
31
+ {id: 'H3', min: 0, max: 6},
32
+ {id: 'SPO', min: 0, max: 999999, level: [
33
+ {id: 'SDQ', min: 0, max: 10},
34
+ ]},
35
+ {id: 'N1', min: 0, max: 2, level: [
36
+ {id: 'N2', min: 0, max: 1},
37
+ {id: 'N3', min: 0, max: 2},
38
+ {id: 'N4', min: 0, max: 1},
39
+ {id: 'N9', min: 0, max: 5},
40
+ {id: 'N7', min: 0, max: 10, level: [
41
+ {id: 'M7', min: 0, max: 2},
42
+ ]},
43
+ ]},
44
+ ]},
45
+ {id: 'LX', min: 0, max: 9999, level: [
46
+ {id: 'N9', min: 0, max: 5},
47
+ {id: 'POD', min: 0, max: 1},
48
+ {id: 'L5', min: 0, max: 30},
49
+ {id: 'H1', min: 0, max: 3},
50
+ {id: 'H2', min: 0, max: 2},
51
+ {id: 'L0', min: 0, max: 10},
52
+ {id: 'L1', min: 0, max: 10},
53
+ {id: 'L4', min: 0, max: 10},
54
+ {id: 'L7', min: 0, max: 10},
55
+ {id: 'K1', min: 0, max: 10},
56
+ {id: 'SPO', min: 0, max: 999999, level: [
57
+ {id: 'SDQ', min: 0, max: 10},
58
+ ]},
59
+ {id: 'N1', min: 0, max: 999999, level: [
60
+ {id: 'N2', min: 0, max: 1},
61
+ {id: 'N3', min: 0, max: 2},
62
+ {id: 'N4', min: 0, max: 1},
63
+ {id: 'N9', min: 0, max: 10},
64
+ {id: 'CD3', min: 0, max: 999999, level: [
65
+ {id: 'N9', min: 0, max: 20},
66
+ {id: 'H6', min: 0, max: 10},
67
+ {id: 'L9', min: 0, max: 10},
68
+ {id: 'POD', min: 0, max: 1},
69
+ {id: 'G62', min: 0, max: 1},
70
+ ]},
71
+ {id: 'SPO', min: 0, max: 999999, level: [
72
+ {id: 'SDQ', min: 0, max: 10},
73
+ ]},
74
+ ]},
75
+ ]},
76
+ {id: 'L3', min: 0, max: 1},
77
+ {id: 'SE', min: 1, max: 1},
78
+ ]
79
+ }.freeze
80
+ end
@@ -0,0 +1,74 @@
1
+ module Baldr::Grammar::Version4010::Set214
2
+
3
+ FUNCTIONAL_GROUP = 'QM'
4
+
5
+ STRUCTURE = {
6
+ id: 'ST', min: 1, max: 1, level: [
7
+ {id: 'B10', min: 1, max: 1},
8
+ {id: 'L11', min: 0, max: 300},
9
+ {id: 'MAN', min: 0, max: 9999},
10
+ {id: 'K1', min: 0, max: 10},
11
+ {id: 'N1', min: 0, max: 10, level: [
12
+ {id: 'N2', min: 0, max: 1},
13
+ {id: 'N3', min: 0, max: 2},
14
+ {id: 'N4', min: 0, max: 1},
15
+ {id: 'G61', min: 0, max: 1},
16
+ {id: 'G62', min: 0, max: 1},
17
+ {id: 'L11', min: 0, max: 10},
18
+ ]},
19
+ {id: 'MS3', min: 0, max: 12},
20
+ {id: 'LX', min: 0, max: 999999, level: [
21
+ {id: 'AT7', min: 0, max: 10, level: [
22
+ {id: 'MS1', min: 0, max: 1},
23
+ {id: 'MS2', min: 0, max: 1},
24
+ ]},
25
+ {id: 'L11', min: 0, max: 10},
26
+ {id: 'MAN', min: 0, max: 9999},
27
+ {id: 'Q7', min: 0, max: 10},
28
+ {id: 'K1', min: 0, max: 10},
29
+ {id: 'AT5', min: 0, max: 10},
30
+ {id: 'AT8', min: 0, max: 10},
31
+ {id: 'CD3', min: 0, max: 999999, level: [
32
+ {id: 'L11', min: 0, max: 20},
33
+ {id: 'AT7', min: 0, max: 10, level: [
34
+ {id: 'MS1', min: 0, max: 1},
35
+ {id: 'MS2', min: 0, max: 1},
36
+ ]},
37
+ {id: 'NM1', min: 0, max: 1},
38
+ {id: 'Q7', min: 0, max: 10},
39
+ {id: 'AT8', min: 0, max: 1},
40
+ {id: 'MAN', min: 0, max: 9999},
41
+ {id: 'N1', min: 0, max: 999999, level: [
42
+ {id: 'N2', min: 0, max: 1},
43
+ {id: 'N3', min: 0, max: 3},
44
+ {id: 'N4', min: 0, max: 1},
45
+ {id: 'L11', min: 0, max: 10},
46
+ ]},
47
+ ]},
48
+ {id: 'PRF', min: 0, max: 999999, level: [
49
+ {id: 'N1', min: 0, max: 999999, level: [
50
+ {id: 'N2', min: 0, max: 1},
51
+ {id: 'N3', min: 0, max: 2},
52
+ {id: 'N4', min: 0, max: 1},
53
+ {id: 'L11', min: 0, max: 10},
54
+ ]},
55
+ {id: 'CD3', min: 0, max: 999999, level: [
56
+ {id: 'L11', min: 0, max: 20},
57
+ {id: 'AT7', min: 0, max: 10, level: [
58
+ {id: 'MS1', min: 0, max: 1},
59
+ {id: 'MS2', min: 0, max: 1},
60
+ ]},
61
+ {id: 'MAN', min: 0, max: 9999},
62
+ ]},
63
+ ]},
64
+ {id: 'SPO', min: 0, max: 999999, level: [
65
+ {id: 'SDQ', min: 0, max: 10},
66
+ ]},
67
+ {id: 'EFI', min: 0, max: 99999, level: [
68
+ {id: 'BIN', min: 1, max: 1},
69
+ ]},
70
+ ]},
71
+ {id: 'SE', min: 1, max: 1},
72
+ ]
73
+ }.freeze
74
+ end