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,73 @@
1
+ module Eddy
2
+ module Segments
3
+ # ### Segment Summary:
4
+ #
5
+ # - Id: FOB
6
+ # - Name: F.O.B. Related Instructions
7
+ # - Purpose: To specify transportation instructions relating to shipment.
8
+ class FOB < Eddy::Models::Segment
9
+
10
+ # @param store [Eddy::Data::Store]
11
+ # @return [void]
12
+ def initialize(store)
13
+ @id = "FOB"
14
+ @name = "F.O.B. Related Instructions"
15
+ @fob01 = Eddy::Elements::E146.new(ref: "FOB01", req: "M")
16
+ @fob02 = Eddy::Elements::E309.new(ref: "FOB02", req: "X")
17
+ @fob03 = Eddy::Elements::E352.new(ref: "FOB03", req: "O")
18
+ super(
19
+ store,
20
+ @fob01,
21
+ @fob02,
22
+ @fob03,
23
+ )
24
+ end
25
+
26
+ # ### FOB01
27
+ #
28
+ # - Id: 146
29
+ # - Name: Shipment Method of Payment
30
+ # - Type: ID
31
+ # - Min/Max: 2/2
32
+ # - Description: Code identifying payment terms for transportation charges
33
+ #
34
+ # @param arg [String]
35
+ # @return [void]
36
+ def FOB01=(arg)
37
+ @fob01.value = arg
38
+ end
39
+ alias ShipmentMethodOfPayment= FOB01=
40
+
41
+ # ### FOB02
42
+ #
43
+ # - Id: 309
44
+ # - Name: Location Qualifier
45
+ # - Type: ID
46
+ # - Min/Max: 1/2
47
+ # - Description: Code identifying type of location
48
+ #
49
+ # @param arg [String]
50
+ # @return [void]
51
+ def FOB02=(arg)
52
+ @fob02.value = arg
53
+ end
54
+ alias LocationQualifier= FOB02=
55
+
56
+ # ### FOB03
57
+ #
58
+ # - Id: 352
59
+ # - Name: Description
60
+ # - Type: AN
61
+ # - Min/Max: 1/80
62
+ # - Description: A free-form description to clarify the related data elements and their content
63
+ #
64
+ # @param arg [String]
65
+ # @return [void]
66
+ def FOB03=(arg)
67
+ @fob03.value = arg
68
+ end
69
+ alias Description= FOB03=
70
+
71
+ end
72
+ end
73
+ end
@@ -0,0 +1,90 @@
1
+ module Eddy
2
+ module Segments
3
+ # ### Segment Summary:
4
+ #
5
+ # - Id: HL
6
+ # - Name: Hierarchical Level
7
+ # - Purpose: To identify dependencies among and the content of hierarchically related groups of data segments.
8
+ class HL < Eddy::Models::Segment
9
+
10
+ # @param store [Eddy::Data::Store]
11
+ # @return [void]
12
+ def initialize(store)
13
+ @id = "HL"
14
+ @name = "Hierarchical Level"
15
+ @hl01 = Eddy::Elements::E628.new(ref: "HL01", req: "M")
16
+ @hl02 = Eddy::Elements::E734.new(ref: "HL02", req: "O")
17
+ @hl03 = Eddy::Elements::E735.new(ref: "HL03", req: "M")
18
+ @hl04 = Eddy::Elements::E736.new(ref: "HL04", req: "O")
19
+ super(
20
+ store,
21
+ @hl01,
22
+ @hl02,
23
+ @hl03,
24
+ @hl04,
25
+ )
26
+ end
27
+
28
+ # ### HL01
29
+ #
30
+ # - Id: 628
31
+ # - Name: Hierarchical ID Number
32
+ # - Type: AN
33
+ # - Min/Max: 1/12
34
+ # - Description: A unique number assigned by the sender to identify a particular data segment in a hierarchical structure
35
+ #
36
+ # @param arg [String]
37
+ # @return [void]
38
+ def HL01=(arg)
39
+ @hl01.value = arg
40
+ end
41
+ alias HierarchicalIdNumber= HL01=
42
+
43
+ # ### HL02
44
+ #
45
+ # - Id: 734
46
+ # - Name: Hierarchical Parent ID Number
47
+ # - Type: AN
48
+ # - Min/Max: 1/12
49
+ # - Description: Identification number of the next higher hierarchical data segment that the data segment being described is subordinate to
50
+ #
51
+ # @param arg [String]
52
+ # @return [void]
53
+ def HL02=(arg)
54
+ @hl02.value = arg
55
+ end
56
+ alias HierarchicalParentIdNumber= HL02=
57
+
58
+ # ### HL03
59
+ #
60
+ # - Id: 735
61
+ # - Name: Hierarchical Level Code
62
+ # - Type: ID
63
+ # - Min/Max: 1/2
64
+ # - Description: Code defining the characteristic of a level in a hierarchical structure
65
+ #
66
+ # @param arg [String]
67
+ # @return [void]
68
+ def HL03=(arg)
69
+ @hl03.value = arg
70
+ end
71
+ alias HierarchicalLevelCode= HL03=
72
+
73
+ # ### HL04
74
+ #
75
+ # - Id: 736
76
+ # - Name: Hierarchical Child Code
77
+ # - Type: ID
78
+ # - Min/Max: 1/1
79
+ # - Description: Code indicating if there are hierarchical child data segments subordinate to the level being described
80
+ #
81
+ # @param arg [String]
82
+ # @return [void]
83
+ def HL04=(arg)
84
+ @hl04.value = arg
85
+ end
86
+ alias HierarchicalChildCode= HL04=
87
+
88
+ end
89
+ end
90
+ end
@@ -0,0 +1,158 @@
1
+ module Eddy
2
+ module Segments
3
+ # ### Segment Summary:
4
+ #
5
+ # - Id: ITD
6
+ # - Name: Terms of Sale/Deferred Terms of Sale
7
+ # - Purpose: To specify terms of sale.
8
+ class ITD < Eddy::Models::Segment
9
+
10
+ # @param store [Eddy::Data::Store]
11
+ # @return [void]
12
+ def initialize(store)
13
+ @id = "ITD"
14
+ @name = "Terms of Sale/Deferred Terms of Sale"
15
+ @itd01 = Eddy::Elements::E336.new(ref: "ITD01", req: "O")
16
+ @itd02 = Eddy::Elements::E333.new(ref: "ITD02", req: "O")
17
+ @itd03 = Eddy::Elements::E338.new(ref: "ITD03", req: "O")
18
+ @itd04 = Eddy::Elements::E370.new(ref: "ITD04", req: "X")
19
+ @itd05 = Eddy::Elements::E351.new(ref: "ITD05", req: "X")
20
+ @itd06 = Eddy::Elements::E446.new(ref: "ITD06", req: "O")
21
+ @itd07 = Eddy::Elements::E386.new(ref: "ITD07", req: "O")
22
+ @itd12 = Eddy::Elements::E352.new(ref: "ITD12", req: "O")
23
+ super(
24
+ store,
25
+ @itd01,
26
+ @itd02,
27
+ @itd03,
28
+ @itd04,
29
+ @itd05,
30
+ @itd06,
31
+ @itd07,
32
+ @itd12,
33
+ )
34
+ end
35
+
36
+ # ### ITD01
37
+ #
38
+ # - Id: 336
39
+ # - Name: Terms Type Code
40
+ # - Type: ID
41
+ # - Min/Max: 2/2
42
+ # - Description: Code identifying type of payment terms
43
+ #
44
+ # @param arg [String]
45
+ # @return [void]
46
+ def ITD01=(arg)
47
+ @itd01.value = arg
48
+ end
49
+ alias TermsTypeCode= ITD01=
50
+
51
+ # ### ITD02
52
+ #
53
+ # - Id: 333
54
+ # - Name: Terms Basis Date Code
55
+ # - Type: ID
56
+ # - Min/Max: 1/2
57
+ # - Description: Code identifying the beginning of the terms period
58
+ #
59
+ # @param arg [String]
60
+ # @return [void]
61
+ def ITD02=(arg)
62
+ @itd02.value = arg
63
+ end
64
+ alias TermsBasisDateCode= ITD02=
65
+
66
+ # ### ITD03
67
+ #
68
+ # - Id: 338
69
+ # - Name: Terms Discount Percent
70
+ # - Type: R
71
+ # - Min/Max: 1/6
72
+ # - Description: Terms discount percentage, expressed as a percent, available to the purchaser if an invoice is paid on or before the Terms Discount Due Date
73
+ #
74
+ # @param arg [Float]
75
+ # @return [void]
76
+ def ITD03=(arg)
77
+ @itd03.value = arg
78
+ end
79
+ alias TermsDiscountPercent= ITD03=
80
+
81
+ # ### ITD04
82
+ #
83
+ # - Id: 370
84
+ # - Name: Terms Discount Due Date
85
+ # - Type: DT
86
+ # - Min/Max: 8/8
87
+ # - Description: Date payment is due if discount is to be earned expressed in format CCYYMMDD
88
+ #
89
+ # @param arg [Time]
90
+ # @return [void]
91
+ def ITD04=(arg)
92
+ @itd04.value = arg
93
+ end
94
+ alias TermsDiscountDueDate= ITD04=
95
+
96
+ # ### ITD05
97
+ #
98
+ # - Id: 351
99
+ # - Name: Terms Discount Days Due
100
+ # - Type: N0
101
+ # - Min/Max: 1/3
102
+ # - Description: Number of days in the terms discount period by which payment is due if terms discount is earned
103
+ #
104
+ # @param arg [Integer]
105
+ # @return [void]
106
+ def ITD05=(arg)
107
+ @itd05.value = arg
108
+ end
109
+ alias TermsDiscountDaysDue= ITD05=
110
+
111
+ # ### ITD06
112
+ #
113
+ # - Id: 446
114
+ # - Name: Terms Net Due Date
115
+ # - Type: DT
116
+ # - Min/Max: 8/8
117
+ # - Description: Date when total invoice amount becomes due expressed in format CCYYMMDD
118
+ #
119
+ # @param arg [Time]
120
+ # @return [void]
121
+ def ITD06=(arg)
122
+ @itd06.value = arg
123
+ end
124
+ alias TermsNetDueDate= ITD06=
125
+
126
+ # ### ITD07
127
+ #
128
+ # - Id: 386
129
+ # - Name: Terms Net Days
130
+ # - Type: N0
131
+ # - Min/Max: 1/3
132
+ # - Description: Number of days until total invoice amount is due (discount not applicable)
133
+ #
134
+ # @param arg [Integer]
135
+ # @return [void]
136
+ def ITD07=(arg)
137
+ @itd07.value = arg
138
+ end
139
+ alias TermsNetDays= ITD07=
140
+
141
+ # ### ITD12
142
+ #
143
+ # - Id: 352
144
+ # - Name: Description
145
+ # - Type: AN
146
+ # - Min/Max: 1/80
147
+ # - Description: A free-form description to clarify the related data elements and their content
148
+ #
149
+ # @param arg [String]
150
+ # @return [void]
151
+ def ITD12=(arg)
152
+ @itd12.value = arg
153
+ end
154
+ alias Description= ITD12=
155
+
156
+ end
157
+ end
158
+ end
@@ -0,0 +1,56 @@
1
+ module Eddy
2
+ module Segments
3
+ # ### Segment Summary:
4
+ #
5
+ # - Id: MTX
6
+ # - Name: Text
7
+ # - Purpose: To specify textual data.
8
+ class MTX < Eddy::Models::Segment
9
+
10
+ # @param store [Eddy::Data::Store]
11
+ # @return [void]
12
+ def initialize(store)
13
+ @id = "MTX"
14
+ @name = "Text"
15
+ @mtx01 = Eddy::Elements::E363.new(ref: "MTX01", req: "O")
16
+ @mtx02 = Eddy::Elements::E1551.new(ref: "MTX02", req: "X")
17
+ super(
18
+ store,
19
+ @mtx01,
20
+ @mtx02,
21
+ )
22
+ end
23
+
24
+ # ### MTX01
25
+ #
26
+ # - Id: 363
27
+ # - Name: Note Reference Code
28
+ # - Type: ID
29
+ # - Min/Max: 3/3
30
+ # - Description: Code identifying the functional area or purpose for which the note applies
31
+ #
32
+ # @param arg [String]
33
+ # @return [void]
34
+ def MTX01=(arg)
35
+ @mtx01.value = arg
36
+ end
37
+ alias NoteReferenceCode= MTX01=
38
+
39
+ # ### MTX02
40
+ #
41
+ # - Id: 1551
42
+ # - Name: Message Text
43
+ # - Type: AN
44
+ # - Min/Max: 1/4096
45
+ # - Description: To transmit large volumes of message text
46
+ #
47
+ # @param arg [String]
48
+ # @return [void]
49
+ def MTX02=(arg)
50
+ @mtx02.value = arg
51
+ end
52
+ alias MessageText= MTX02=
53
+
54
+ end
55
+ end
56
+ end
@@ -0,0 +1,56 @@
1
+ module Eddy
2
+ module Segments
3
+ # ### Segment Summary:
4
+ #
5
+ # - Id: N2
6
+ # - Name: Additional Name Information
7
+ # - Purpose: To identify a party by type of organization, name, and code.
8
+ class N2 < Eddy::Models::Segment
9
+
10
+ # @param store [Eddy::Data::Store]
11
+ # @return [void]
12
+ def initialize(store)
13
+ @id = "N2"
14
+ @name = "Additional Name Information"
15
+ @n201 = Eddy::Elements::E93.new(ref: "N201", req: "M")
16
+ @n202 = Eddy::Elements::E93.new(ref: "N202", req: "O")
17
+ super(
18
+ store,
19
+ @n201,
20
+ @n202,
21
+ )
22
+ end
23
+
24
+ # ### N201
25
+ #
26
+ # - Id: 93
27
+ # - Name: Name
28
+ # - Type: AN
29
+ # - Min/Max: 1/60
30
+ # - Description: Free-form name
31
+ #
32
+ # @param arg [String]
33
+ # @return [void]
34
+ def N201=(arg)
35
+ @n201.value = arg
36
+ end
37
+ alias Name1= N201=
38
+
39
+ # ### N202
40
+ #
41
+ # - Id: 93
42
+ # - Name: Name
43
+ # - Type: AN
44
+ # - Min/Max: 1/60
45
+ # - Description: Free-form name
46
+ #
47
+ # @param arg [String]
48
+ # @return [void]
49
+ def N202=(arg)
50
+ @n202.value = arg
51
+ end
52
+ alias Name2= N202=
53
+
54
+ end
55
+ end
56
+ end
@@ -0,0 +1,56 @@
1
+ module Eddy
2
+ module Segments
3
+ # ### Segment Summary:
4
+ #
5
+ # - Id: N9
6
+ # - Name: Extended Reference Information
7
+ # - Purpose: To transmit identifying information as specified by the Reference Identification Qualifier.
8
+ class N9 < Eddy::Models::Segment
9
+
10
+ # @param store [Eddy::Data::Store]
11
+ # @return [void]
12
+ def initialize(store)
13
+ @id = "N9"
14
+ @name = "Extended Reference Information"
15
+ @n901 = Eddy::Elements::E128.new(ref: "N901", req: "M")
16
+ @n903 = Eddy::Elements::E369.new(ref: "N903", req: "X")
17
+ super(
18
+ store,
19
+ @n901,
20
+ @n903,
21
+ )
22
+ end
23
+
24
+ # ### N901
25
+ #
26
+ # - Id: 128
27
+ # - Name: Reference Identification Qualifier
28
+ # - Type: ID
29
+ # - Min/Max: 2/3
30
+ # - Description: Code qualifying the Reference Identification
31
+ #
32
+ # @param arg [String]
33
+ # @return [void]
34
+ def N901=(arg)
35
+ @n901.value = arg
36
+ end
37
+ alias ReferenceIdentificationQualifier= N901=
38
+
39
+ # ### N903
40
+ #
41
+ # - Id: 369
42
+ # - Name: Free-form Description
43
+ # - Type: AN
44
+ # - Min/Max: 1/45
45
+ # - Description: Free-form descriptive text
46
+ #
47
+ # @param arg [String]
48
+ # @return [void]
49
+ def N903=(arg)
50
+ @n903.value = arg
51
+ end
52
+ alias FreeFormDescription= N903=
53
+
54
+ end
55
+ end
56
+ end