eddy 0.8.3 → 0.10.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (111) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +4 -4
  3. data/CHANGELOG.md +51 -1
  4. data/Gemfile.lock +8 -8
  5. data/README.md +1 -1
  6. data/data/code-lists/333.tsv +8 -0
  7. data/data/segments/amt.segment.yml +7 -0
  8. data/data/segments/bia.segment.yml +10 -0
  9. data/data/segments/cur.segment.yml +8 -0
  10. data/data/segments/dtm.segment.yml +1 -0
  11. data/data/segments/fob.segment.yml +8 -0
  12. data/data/segments/itd.segment.yml +13 -0
  13. data/data/segments/mtx.segment.yml +7 -0
  14. data/data/segments/n9.segment.yml +7 -0
  15. data/data/segments/per.segment.yml +13 -0
  16. data/data/segments/po1.segment.yml +6 -0
  17. data/data/segments/po3.segment.yml +13 -0
  18. data/data/segments/qty.segment.yml +10 -0
  19. data/data/segments/ref.segment.yml +1 -0
  20. data/data/segments/sac.segment.yml +4 -0
  21. data/data/segments/sch.segment.yml +7 -0
  22. data/data/segments/sdq.segment.yml +8 -0
  23. data/data/segments/txi.segment.yml +9 -0
  24. data/data/transaction_sets/810.edi.yml +93 -0
  25. data/data/transaction_sets/846.edi.yml +57 -0
  26. data/data/transaction_sets/850.edi.yml +73 -0
  27. data/data/transaction_sets/855.edi.yml +74 -0
  28. data/data/transaction_sets/856.edi.yml +54 -0
  29. data/eddy.gemspec +1 -1
  30. data/exe/eddy +1 -0
  31. data/lib/definitions/elements/generated/100.currency_code.rb +200 -0
  32. data/lib/definitions/elements/generated/146.shipment_method_of_payment.rb +65 -0
  33. data/lib/definitions/elements/generated/1551.message_text.rb +29 -0
  34. data/lib/definitions/elements/generated/280.exchange_rate.rb +29 -0
  35. data/lib/definitions/elements/generated/309.location_qualifier.rb +209 -0
  36. data/lib/definitions/elements/generated/310.location_identifier.rb +29 -0
  37. data/lib/definitions/elements/generated/311.shipment_type_code.rb +42 -0
  38. data/lib/definitions/elements/generated/322.load_empty_status_code.rb +40 -0
  39. data/lib/definitions/elements/generated/325.tax_identification_number.rb +29 -0
  40. data/lib/definitions/elements/generated/333.terms_basis_date_code.rb +44 -0
  41. data/lib/definitions/elements/generated/336.terms_type_code.rb +102 -0
  42. data/lib/definitions/elements/generated/338.terms_discount_percent.rb +29 -0
  43. data/lib/definitions/elements/generated/351.terms_discount_days_due.rb +30 -0
  44. data/lib/definitions/elements/generated/363.note_reference_code.rb +278 -0
  45. data/lib/definitions/elements/generated/364.communication_number.rb +29 -0
  46. data/lib/definitions/elements/generated/365.communication_number_qualifier.rb +77 -0
  47. data/lib/definitions/elements/generated/366.contact_function_code.rb +267 -0
  48. data/lib/definitions/elements/generated/369.free_form_description.rb +29 -0
  49. data/lib/definitions/elements/generated/370.terms_discount_due_date.rb +29 -0
  50. data/lib/definitions/elements/generated/371.change_reason_code.rb +67 -0
  51. data/lib/definitions/elements/generated/378.allowance_charge_percent_qualifier.rb +48 -0
  52. data/lib/definitions/elements/generated/386.terms_net_days.rb +30 -0
  53. data/lib/definitions/elements/generated/446.terms_net_due_date.rb +29 -0
  54. data/lib/definitions/elements/generated/522.amount_qualifier_code.rb +1510 -0
  55. data/lib/definitions/elements/generated/673.quantity_qualifier.rb +869 -0
  56. data/lib/definitions/elements/generated/755.report_type_code.rb +559 -0
  57. data/lib/definitions/elements/generated/954.percent.rb +29 -0
  58. data/lib/definitions/elements/generated/963.tax_type_code.rb +111 -0
  59. data/lib/definitions/elements/manual/156.state_or_province_code.rb +16 -1
  60. data/lib/definitions/elements/manual/i/I10.interchange_control_standards_identifier.rb +2 -2
  61. data/lib/definitions/elements/manual/i/I11.interchange_control_version_number.rb +1 -0
  62. data/lib/definitions/segments/generated/amt.rb +56 -0
  63. data/lib/definitions/segments/generated/bia.rb +107 -0
  64. data/lib/definitions/segments/generated/cur.rb +73 -0
  65. data/lib/definitions/segments/generated/dtm.rb +17 -0
  66. data/lib/definitions/segments/generated/fob.rb +73 -0
  67. data/lib/definitions/segments/generated/hl.rb +90 -0
  68. data/lib/definitions/segments/generated/itd.rb +158 -0
  69. data/lib/definitions/segments/generated/mtx.rb +56 -0
  70. data/lib/definitions/segments/generated/n2.rb +56 -0
  71. data/lib/definitions/segments/generated/n9.rb +56 -0
  72. data/lib/definitions/segments/generated/per.rb +158 -0
  73. data/lib/definitions/segments/generated/po1.rb +102 -0
  74. data/lib/definitions/segments/generated/po3.rb +158 -0
  75. data/lib/definitions/segments/generated/qty.rb +73 -0
  76. data/lib/definitions/segments/generated/ref.rb +17 -0
  77. data/lib/definitions/segments/generated/sac.rb +68 -0
  78. data/lib/definitions/segments/generated/sch.rb +56 -0
  79. data/lib/definitions/segments/generated/sdq.rb +73 -0
  80. data/lib/definitions/segments/generated/txi.rb +90 -0
  81. data/lib/definitions/transaction_sets/manual/846/846.rb +122 -0
  82. data/lib/definitions/transaction_sets/manual/846/loops/lin.rb +155 -0
  83. data/lib/definitions/transaction_sets/manual/846/loops/n1.rb +107 -0
  84. data/lib/definitions/transaction_sets/manual/846/loops/qty.rb +75 -0
  85. data/lib/definitions/transaction_sets/manual/846/loops/sch.rb +59 -0
  86. data/lib/definitions/transaction_sets/manual/846/loops/sln.rb +59 -0
  87. data/lib/definitions/transaction_sets/manual/850/850.rb +108 -1
  88. data/lib/definitions/transaction_sets/manual/850/loops/ctp.rb +47 -0
  89. data/lib/definitions/transaction_sets/manual/850/loops/n1.rb +31 -10
  90. data/lib/definitions/transaction_sets/manual/850/loops/n9.rb +59 -0
  91. data/lib/definitions/transaction_sets/manual/850/loops/pid.rb +47 -0
  92. data/lib/definitions/transaction_sets/manual/850/loops/po1.rb +78 -10
  93. data/lib/definitions/transaction_sets/manual/850/loops/sac.rb +47 -0
  94. data/lib/eddy.rb +49 -3
  95. data/lib/eddy/build/transaction_set_builder.rb +1 -1
  96. data/lib/eddy/config.rb +0 -21
  97. data/lib/eddy/data.rb +0 -40
  98. data/lib/eddy/data/persistence/base.rb +5 -11
  99. data/lib/eddy/data/persistence/memory.rb +14 -22
  100. data/lib/eddy/errors.rb +13 -9
  101. data/lib/eddy/models/element/composite.rb +2 -0
  102. data/lib/eddy/models/element/id.rb +1 -1
  103. data/lib/eddy/models/element/r.rb +1 -0
  104. data/lib/eddy/models/functional_group.rb +3 -2
  105. data/lib/eddy/models/interchange.rb +5 -1
  106. data/lib/eddy/parse.rb +4 -56
  107. data/lib/eddy/parse/interchange.rb +58 -0
  108. data/lib/eddy/summary/loop.rb +1 -1
  109. data/lib/eddy/summary/segment.rb +2 -1
  110. data/lib/eddy/version.rb +1 -1
  111. metadata +78 -5
@@ -0,0 +1,155 @@
1
+ module Eddy
2
+ module TransactionSets
3
+ module TS846
4
+ module Loops
5
+ module LIN
6
+
7
+ # ### Loop Summary:
8
+ #
9
+ # - Repeat: 10000
10
+ # - Components:
11
+ # - LIN
12
+ # - PID
13
+ # - DTM
14
+ # - CTP
15
+ # - REF
16
+ # - SDQ
17
+ # - SLN (loop)
18
+ # - QTY (loop)
19
+ # - N1 (loop)
20
+ class Base < Eddy::Models::Loop::Base
21
+ # @param store [Eddy::Data::Store]
22
+ # @return [void]
23
+ def initialize(store)
24
+ @repeat_limit = 10000
25
+ super(store, Repeat)
26
+ end
27
+ end
28
+
29
+ # (see Eddy::TransactionSets::TS846::Loops::LIN::Base)
30
+ class Repeat < Eddy::Models::Loop::Repeat
31
+ # @param store [Eddy::Data::Store]
32
+ # @return [void]
33
+ def initialize(store)
34
+ @lin = Eddy::Segments::LIN.new(store)
35
+ @pid = Eddy::Segments::PID.new(store)
36
+ @dtm = Eddy::Segments::DTM.new(store)
37
+ @ctp = Eddy::Segments::CTP.new(store)
38
+ @ref = Eddy::Segments::REF.new(store)
39
+ @sdq = Eddy::Segments::SDQ.new(store)
40
+ @l_sln = Eddy::TransactionSets::TS846::Loops::SLN::Base.new(store)
41
+ @l_qty = Eddy::TransactionSets::TS846::Loops::QTY::Base.new(store)
42
+ @l_n1 = Eddy::TransactionSets::TS846::Loops::N1::Base.new(store)
43
+ super(
44
+ store,
45
+ @lin,
46
+ @pid,
47
+ @dtm,
48
+ @ctp,
49
+ @ref,
50
+ @sdq,
51
+ @l_sln,
52
+ @l_qty,
53
+ @l_n1,
54
+ )
55
+ end
56
+
57
+ # (see Eddy::Segments::LIN)
58
+ #
59
+ # @yieldparam [Eddy::Segments::LIN]
60
+ # @return [Eddy::Segments::LIN]
61
+ def LIN()
62
+ yield(@lin) if block_given?
63
+ return @lin
64
+ end
65
+
66
+ # (see Eddy::Segments::PID)
67
+ #
68
+ # @yieldparam [Eddy::Segments::PID]
69
+ # @return [Eddy::Segments::PID]
70
+ def PID()
71
+ yield(@pid) if block_given?
72
+ return @pid
73
+ end
74
+
75
+ # (see Eddy::Segments::DTM)
76
+ #
77
+ # @yieldparam [Eddy::Segments::DTM]
78
+ # @return [Eddy::Segments::DTM]
79
+ def DTM()
80
+ yield(@dtm) if block_given?
81
+ return @dtm
82
+ end
83
+
84
+ # (see Eddy::Segments::CTP)
85
+ #
86
+ # @yieldparam [Eddy::Segments::CTP]
87
+ # @return [Eddy::Segments::CTP]
88
+ def CTP()
89
+ yield(@ctp) if block_given?
90
+ return @ctp
91
+ end
92
+
93
+ # (see Eddy::Segments::REF)
94
+ #
95
+ # @yieldparam [Eddy::Segments::REF]
96
+ # @return [Eddy::Segments::REF]
97
+ def REF()
98
+ yield(@ref) if block_given?
99
+ return @ref
100
+ end
101
+
102
+ # (see Eddy::Segments::SDQ)
103
+ #
104
+ # @yieldparam [Eddy::Segments::SDQ]
105
+ # @return [Eddy::Segments::SDQ]
106
+ def SDQ()
107
+ yield(@sdq) if block_given?
108
+ return @sdq
109
+ end
110
+
111
+ # (see Eddy::TransactionSets::TS846::Loops::SLN::Base)
112
+ #
113
+ # @yieldparam [Eddy::TransactionSets::TS846::Loops::SLN::Repeat]
114
+ # @return [void]
115
+ def L_SLN(&block)
116
+ if block_given?
117
+ @l_sln.repeat(&block)
118
+ else
119
+ raise Eddy::Errors::Error, "No block given in loop iteration"
120
+ end
121
+ return nil
122
+ end
123
+
124
+ # (see Eddy::TransactionSets::TS846::Loops::QTY::Base)
125
+ #
126
+ # @yieldparam [Eddy::TransactionSets::TS846::Loops::QTY::Repeat]
127
+ # @return [void]
128
+ def L_QTY(&block)
129
+ if block_given?
130
+ @l_qty.repeat(&block)
131
+ else
132
+ raise Eddy::Errors::Error, "No block given in loop iteration"
133
+ end
134
+ return nil
135
+ end
136
+
137
+ # (see Eddy::TransactionSets::TS846::Loops::N1::Base)
138
+ #
139
+ # @yieldparam [Eddy::TransactionSets::TS846::Loops::N1::Repeat]
140
+ # @return [void]
141
+ def L_N1(&block)
142
+ if block_given?
143
+ @l_n1.repeat(&block)
144
+ else
145
+ raise Eddy::Errors::Error, "No block given in loop iteration"
146
+ end
147
+ return nil
148
+ end
149
+ end
150
+
151
+ end
152
+ end
153
+ end
154
+ end
155
+ end
@@ -0,0 +1,107 @@
1
+ module Eddy
2
+ module TransactionSets
3
+ module TS846
4
+ module Loops
5
+ module N1
6
+
7
+ # ### Loop Summary:
8
+ #
9
+ # - Repeat: 5
10
+ # - Components:
11
+ # - N1
12
+ # - N2
13
+ # - N3
14
+ # - N4
15
+ # - REF
16
+ # - PER
17
+ class Base < Eddy::Models::Loop::Base
18
+ # @param store [Eddy::Data::Store]
19
+ # @return [void]
20
+ def initialize(store)
21
+ @repeat_limit = 5
22
+ super(store, Repeat)
23
+ end
24
+ end
25
+
26
+ # (see Eddy::TransactionSets::TS846::Loops::N1::Base)
27
+ class Repeat < Eddy::Models::Loop::Repeat
28
+ # @param store [Eddy::Data::Store]
29
+ # @return [void]
30
+ def initialize(store)
31
+ @n1 = Eddy::Segments::N1.new(store)
32
+ @n2 = Eddy::Segments::N2.new(store)
33
+ @n3 = Eddy::Segments::N3.new(store)
34
+ @n4 = Eddy::Segments::N4.new(store)
35
+ @ref = Eddy::Segments::REF.new(store)
36
+ @per = Eddy::Segments::PER.new(store)
37
+ super(
38
+ store,
39
+ @n1,
40
+ @n2,
41
+ @n3,
42
+ @n4,
43
+ @ref,
44
+ @per,
45
+ )
46
+ end
47
+
48
+ # (see Eddy::Segments::N1)
49
+ #
50
+ # @yieldparam [Eddy::Segments::N1]
51
+ # @return [Eddy::Segments::N1]
52
+ def N1()
53
+ yield(@n1) if block_given?
54
+ return @n1
55
+ end
56
+
57
+ # (see Eddy::Segments::N2)
58
+ #
59
+ # @yieldparam [Eddy::Segments::N2]
60
+ # @return [Eddy::Segments::N2]
61
+ def N2()
62
+ yield(@n2) if block_given?
63
+ return @n2
64
+ end
65
+
66
+ # (see Eddy::Segments::N3)
67
+ #
68
+ # @yieldparam [Eddy::Segments::N3]
69
+ # @return [Eddy::Segments::N3]
70
+ def N3()
71
+ yield(@n3) if block_given?
72
+ return @n3
73
+ end
74
+
75
+ # (see Eddy::Segments::N4)
76
+ #
77
+ # @yieldparam [Eddy::Segments::N4]
78
+ # @return [Eddy::Segments::N4]
79
+ def N4()
80
+ yield(@n4) if block_given?
81
+ return @n4
82
+ end
83
+
84
+ # (see Eddy::Segments::REF)
85
+ #
86
+ # @yieldparam [Eddy::Segments::REF]
87
+ # @return [Eddy::Segments::REF]
88
+ def REF()
89
+ yield(@ref) if block_given?
90
+ return @ref
91
+ end
92
+
93
+ # (see Eddy::Segments::PER)
94
+ #
95
+ # @yieldparam [Eddy::Segments::PER]
96
+ # @return [Eddy::Segments::PER]
97
+ def PER()
98
+ yield(@per) if block_given?
99
+ return @per
100
+ end
101
+ end
102
+
103
+ end
104
+ end
105
+ end
106
+ end
107
+ end
@@ -0,0 +1,75 @@
1
+ module Eddy
2
+ module TransactionSets
3
+ module TS846
4
+ module Loops
5
+ module QTY
6
+
7
+ # ### Loop Summary:
8
+ #
9
+ # - Repeat: 99
10
+ # - Components:
11
+ # - QTY
12
+ # - DTM
13
+ # - SCH (loop)
14
+ class Base < Eddy::Models::Loop::Base
15
+ # @param store [Eddy::Data::Store]
16
+ # @return [void]
17
+ def initialize(store)
18
+ @repeat_limit = 99
19
+ super(store, Repeat)
20
+ end
21
+ end
22
+
23
+ # (see Eddy::TransactionSets::TS846::Loops::QTY::Base)
24
+ class Repeat < Eddy::Models::Loop::Repeat
25
+ # @param store [Eddy::Data::Store]
26
+ # @return [void]
27
+ def initialize(store)
28
+ @qty = Eddy::Segments::QTY.new(store)
29
+ @dtm = Eddy::Segments::DTM.new(store)
30
+ @l_sch = Eddy::TransactionSets::TS846::Loops::SCH::Base.new(store)
31
+ super(
32
+ store,
33
+ @qty,
34
+ @dtm,
35
+ @l_sch,
36
+ )
37
+ end
38
+
39
+ # (see Eddy::Segments::QTY)
40
+ #
41
+ # @yieldparam [Eddy::Segments::QTY]
42
+ # @return [Eddy::Segments::QTY]
43
+ def QTY()
44
+ yield(@qty) if block_given?
45
+ return @qty
46
+ end
47
+
48
+ # (see Eddy::Segments::DTM)
49
+ #
50
+ # @yieldparam [Eddy::Segments::DTM]
51
+ # @return [Eddy::Segments::DTM]
52
+ def DTM()
53
+ yield(@dtm) if block_given?
54
+ return @dtm
55
+ end
56
+
57
+ # (see Eddy::TransactionSets::TS846::Loops::SCH::Base)
58
+ #
59
+ # @yieldparam [Eddy::TransactionSets::TS846::Loops::SCH::Repeat]
60
+ # @return [void]
61
+ def L_SCH(&block)
62
+ if block_given?
63
+ @l_sch.repeat(&block)
64
+ else
65
+ raise Eddy::Errors::Error, "No block given in loop iteration"
66
+ end
67
+ return nil
68
+ end
69
+ end
70
+
71
+ end
72
+ end
73
+ end
74
+ end
75
+ end
@@ -0,0 +1,59 @@
1
+ module Eddy
2
+ module TransactionSets
3
+ module TS846
4
+ module Loops
5
+ module SCH
6
+
7
+ # ### Loop Summary:
8
+ #
9
+ # - Repeat: 25
10
+ # - Components:
11
+ # - QTY
12
+ # - DTM
13
+ class Base < Eddy::Models::Loop::Base
14
+ # @param store [Eddy::Data::Store]
15
+ # @return [void]
16
+ def initialize(store)
17
+ @repeat_limit = 25
18
+ super(store, Repeat)
19
+ end
20
+ end
21
+
22
+ # (see Eddy::TransactionSets::TS846::Loops::SCH::Base)
23
+ class Repeat < Eddy::Models::Loop::Repeat
24
+ # @param store [Eddy::Data::Store]
25
+ # @return [void]
26
+ def initialize(store)
27
+ @qty = Eddy::Segments::QTY.new(store)
28
+ @dtm = Eddy::Segments::DTM.new(store)
29
+ super(
30
+ store,
31
+ @qty,
32
+ @dtm,
33
+ )
34
+ end
35
+
36
+ # (see Eddy::Segments::QTY)
37
+ #
38
+ # @yieldparam [Eddy::Segments::QTY]
39
+ # @return [Eddy::Segments::QTY]
40
+ def QTY()
41
+ yield(@qty) if block_given?
42
+ return @qty
43
+ end
44
+
45
+ # (see Eddy::Segments::DTM)
46
+ #
47
+ # @yieldparam [Eddy::Segments::DTM]
48
+ # @return [Eddy::Segments::DTM]
49
+ def DTM()
50
+ yield(@dtm) if block_given?
51
+ return @dtm
52
+ end
53
+ end
54
+
55
+ end
56
+ end
57
+ end
58
+ end
59
+ end
@@ -0,0 +1,59 @@
1
+ module Eddy
2
+ module TransactionSets
3
+ module TS846
4
+ module Loops
5
+ module SLN
6
+
7
+ # ### Loop Summary:
8
+ #
9
+ # - Repeat: 1000
10
+ # - Components:
11
+ # - SLN
12
+ # - PID
13
+ class Base < Eddy::Models::Loop::Base
14
+ # @param store [Eddy::Data::Store]
15
+ # @return [void]
16
+ def initialize(store)
17
+ @repeat_limit = 1000
18
+ super(store, Repeat)
19
+ end
20
+ end
21
+
22
+ # (see Eddy::TransactionSets::TS846::Loops::SLN::Base)
23
+ class Repeat < Eddy::Models::Loop::Repeat
24
+ # @param store [Eddy::Data::Store]
25
+ # @return [void]
26
+ def initialize(store)
27
+ @sln = Eddy::Segments::SLN.new(store)
28
+ @pid = Eddy::Segments::PID.new(store)
29
+ super(
30
+ store,
31
+ @sln,
32
+ @pid,
33
+ )
34
+ end
35
+
36
+ # (see Eddy::Segments::SLN)
37
+ #
38
+ # @yieldparam [Eddy::Segments::SLN]
39
+ # @return [Eddy::Segments::SLN]
40
+ def SLN()
41
+ yield(@sln) if block_given?
42
+ return @sln
43
+ end
44
+
45
+ # (see Eddy::Segments::PID)
46
+ #
47
+ # @yieldparam [Eddy::Segments::PID]
48
+ # @return [Eddy::Segments::PID]
49
+ def PID()
50
+ yield(@pid) if block_given?
51
+ return @pid
52
+ end
53
+ end
54
+
55
+ end
56
+ end
57
+ end
58
+ end
59
+ end