eddy 0.8.0 → 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (110) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +4 -4
  3. data/CHANGELOG.md +49 -0
  4. data/Gemfile.lock +8 -8
  5. data/README.md +2 -5
  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/segments/generated/amt.rb +56 -0
  60. data/lib/definitions/segments/generated/bia.rb +107 -0
  61. data/lib/definitions/segments/generated/cur.rb +73 -0
  62. data/lib/definitions/segments/generated/dtm.rb +17 -0
  63. data/lib/definitions/segments/generated/fob.rb +73 -0
  64. data/lib/definitions/segments/generated/hl.rb +90 -0
  65. data/lib/definitions/segments/generated/itd.rb +158 -0
  66. data/lib/definitions/segments/generated/mtx.rb +56 -0
  67. data/lib/definitions/segments/generated/n2.rb +56 -0
  68. data/lib/definitions/segments/generated/n9.rb +56 -0
  69. data/lib/definitions/segments/generated/per.rb +158 -0
  70. data/lib/definitions/segments/generated/po1.rb +102 -0
  71. data/lib/definitions/segments/generated/po3.rb +158 -0
  72. data/lib/definitions/segments/generated/qty.rb +73 -0
  73. data/lib/definitions/segments/generated/ref.rb +17 -0
  74. data/lib/definitions/segments/generated/sac.rb +68 -0
  75. data/lib/definitions/segments/generated/sch.rb +56 -0
  76. data/lib/definitions/segments/generated/sdq.rb +73 -0
  77. data/lib/definitions/segments/generated/txi.rb +90 -0
  78. data/lib/definitions/transaction_sets/manual/846/846.rb +122 -0
  79. data/lib/definitions/transaction_sets/manual/846/loops/lin.rb +155 -0
  80. data/lib/definitions/transaction_sets/manual/846/loops/n1.rb +107 -0
  81. data/lib/definitions/transaction_sets/manual/846/loops/qty.rb +75 -0
  82. data/lib/definitions/transaction_sets/manual/846/loops/sch.rb +59 -0
  83. data/lib/definitions/transaction_sets/manual/846/loops/sln.rb +59 -0
  84. data/lib/definitions/transaction_sets/manual/850/850.rb +108 -1
  85. data/lib/definitions/transaction_sets/manual/850/loops/ctp.rb +47 -0
  86. data/lib/definitions/transaction_sets/manual/850/loops/n1.rb +31 -10
  87. data/lib/definitions/transaction_sets/manual/850/loops/n9.rb +59 -0
  88. data/lib/definitions/transaction_sets/manual/850/loops/pid.rb +47 -0
  89. data/lib/definitions/transaction_sets/manual/850/loops/po1.rb +78 -10
  90. data/lib/definitions/transaction_sets/manual/850/loops/sac.rb +47 -0
  91. data/lib/eddy.rb +49 -3
  92. data/lib/eddy/build/transaction_set_builder.rb +1 -1
  93. data/lib/eddy/config.rb +0 -21
  94. data/lib/eddy/data.rb +0 -40
  95. data/lib/eddy/data/persistence/base.rb +5 -11
  96. data/lib/eddy/data/persistence/memory.rb +14 -22
  97. data/lib/eddy/data/store.rb +0 -18
  98. data/lib/eddy/errors.rb +13 -9
  99. data/lib/eddy/models/element/composite.rb +2 -0
  100. data/lib/eddy/models/element/id.rb +1 -1
  101. data/lib/eddy/models/element/r.rb +5 -3
  102. data/lib/eddy/models/functional_group.rb +10 -5
  103. data/lib/eddy/models/interchange.rb +12 -5
  104. data/lib/eddy/models/transaction_set.rb +19 -7
  105. data/lib/eddy/parse.rb +4 -56
  106. data/lib/eddy/parse/interchange.rb +58 -0
  107. data/lib/eddy/summary/loop.rb +1 -1
  108. data/lib/eddy/summary/segment.rb +2 -1
  109. data/lib/eddy/version.rb +1 -1
  110. metadata +78 -5
@@ -0,0 +1,65 @@
1
+ module Eddy
2
+ module Elements
3
+ # ### Element Summary:
4
+ #
5
+ # - Id: 146
6
+ # - Name: Shipment Method of Payment
7
+ # - Type: ID
8
+ # - Min/Max: 2/2
9
+ # - Description: Code identifying payment terms for transportation charges
10
+ class E146 < Eddy::Models::Element::ID
11
+
12
+ # @param val [String]
13
+ # @param req [String]
14
+ # @param ref [String]
15
+ # @return [void]
16
+ def initialize(val: nil, req: nil, ref: nil)
17
+ @id = "146"
18
+ @name = "Shipment Method of Payment"
19
+ @description = "Code identifying payment terms for transportation charges"
20
+ super(
21
+ min: 2,
22
+ max: 2,
23
+ req: req,
24
+ ref: ref,
25
+ val: val,
26
+ )
27
+ end
28
+
29
+ # @return [Array<String>]
30
+ def code_list()
31
+ return [
32
+ "11", # Rule 11 Shipment
33
+ "BP", # Paid by Buyer
34
+ "CA", # Advance Collect
35
+ "CC", # Collect
36
+ "CD", # Collect on Delivery
37
+ "CF", # Collect, Freight Credited Back to Customer
38
+ "DE", # Per Contract
39
+ "DF", # Defined by Buyer and Seller
40
+ "FO", # FOB Port of Call
41
+ "HP", # Half Prepaid
42
+ "MX", # Mixed
43
+ "NC", # Service Freight, No Charge
44
+ "NR", # Non Revenue
45
+ "PA", # Advance Prepaid
46
+ "PB", # Customer Pick-up/Backhaul
47
+ "PC", # Prepaid but Charged to Customer
48
+ "PD", # Prepaid by Processor
49
+ "PE", # Prepaid and Summary Bill
50
+ "PL", # Prepaid Local, Collect Outstate
51
+ "PO", # Prepaid Only
52
+ "PP", # Prepaid (by Seller)
53
+ "PS", # Paid by Seller
54
+ "PU", # Pickup
55
+ "RC", # Return Container Freight Paid by Customer
56
+ "RF", # Return Container Freight Free
57
+ "RS", # Return Container Freight Paid by Supplier
58
+ "TP", # Third Party Pay
59
+ "WC", # Weight Condition
60
+ ]
61
+ end
62
+
63
+ end
64
+ end
65
+ end
@@ -0,0 +1,29 @@
1
+ module Eddy
2
+ module Elements
3
+ # ### Element Summary:
4
+ #
5
+ # - Id: 1551
6
+ # - Name: Message Text
7
+ # - Type: AN
8
+ # - Min/Max: 1/4096
9
+ # - Description: To transmit large volumes of message text
10
+ class E1551 < Eddy::Models::Element::AN
11
+ # @param val [String]
12
+ # @param req [String]
13
+ # @param ref [String]
14
+ # @return [void]
15
+ def initialize(val: nil, req: nil, ref: nil)
16
+ @id = "1551"
17
+ @name = "Message Text"
18
+ @description = "To transmit large volumes of message text"
19
+ super(
20
+ min: 1,
21
+ max: 4096,
22
+ req: req,
23
+ ref: ref,
24
+ val: val,
25
+ )
26
+ end
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,29 @@
1
+ module Eddy
2
+ module Elements
3
+ # ### Element Summary:
4
+ #
5
+ # - Id: 280
6
+ # - Name: Exchange Rate
7
+ # - Type: R
8
+ # - Min/Max: 4/10
9
+ # - Description: Value to be used as a multiplier conversion factor to convert monetary value from one currency to another
10
+ class E280 < Eddy::Models::Element::R
11
+ # @param val [Float]
12
+ # @param req [String]
13
+ # @param ref [String]
14
+ # @return [void]
15
+ def initialize(val: nil, req: nil, ref: nil)
16
+ @id = "280"
17
+ @name = "Exchange Rate"
18
+ @description = "Value to be used as a multiplier conversion factor to convert monetary value from one currency to another"
19
+ super(
20
+ min: 4,
21
+ max: 10,
22
+ req: req,
23
+ ref: ref,
24
+ val: val,
25
+ )
26
+ end
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,209 @@
1
+ module Eddy
2
+ module Elements
3
+ # ### Element Summary:
4
+ #
5
+ # - Id: 309
6
+ # - Name: Location Qualifier
7
+ # - Type: ID
8
+ # - Min/Max: 1/2
9
+ # - Description: Code identifying type of location
10
+ class E309 < Eddy::Models::Element::ID
11
+
12
+ # @param val [String]
13
+ # @param req [String]
14
+ # @param ref [String]
15
+ # @return [void]
16
+ def initialize(val: nil, req: nil, ref: nil)
17
+ @id = "309"
18
+ @name = "Location Qualifier"
19
+ @description = "Code identifying type of location"
20
+ super(
21
+ min: 1,
22
+ max: 2,
23
+ req: req,
24
+ ref: ref,
25
+ val: val,
26
+ )
27
+ end
28
+
29
+ # @return [Array<String>]
30
+ def code_list()
31
+ return [
32
+ "A", # Jurisdiction to Receive Credit for Uniform Commercial Code Filing
33
+ "B", # Transmitting Utility
34
+ "C", # Consignor
35
+ "D", # Census Schedule D
36
+ "E", # Uniform Commercial Code Filing Office
37
+ "F", # Current Address
38
+ "H", # Home Address
39
+ "I", # Home Base Address
40
+ "K", # Census Schedule K
41
+ "L", # Local Address
42
+ "M", # Mailing Address
43
+ "O", # Office Address
44
+ "P", # Permanent Address
45
+ "W", # Worldwide Geographic Location Code
46
+ "10", # Nearest Cross Street
47
+ "11", # Secondary Cross Street
48
+ "12", # Range
49
+ "13", # Section
50
+ "14", # Quarter Section
51
+ "18", # Marker Identifier Location
52
+ "19", # Route
53
+ "20", # Route Subdivision
54
+ "21", # Grid Location
55
+ "22", # Page
56
+ "27", # Marker Type
57
+ "28", # Latitude-Longitude Source
58
+ "29", # Map Source
59
+ "30", # Map Reference
60
+ "31", # Grid Source
61
+ "32", # Aliquot
62
+ "33", # Block
63
+ "34", # District
64
+ "35", # Drainhole Number
65
+ "36", # City Block
66
+ "38", # Footage Call Direction
67
+ "39", # Location Direction
68
+ "40", # Outer Continental Lease Location
69
+ "41", # Lot
70
+ "42", # Map Quadrangle
71
+ "43", # Principal Meridian
72
+ "44", # Outer Continental Shelf Area
73
+ "45", # Outer Continental Shelf Block
74
+ "46", # Official Protraction Diagram
75
+ "47", # Quarter Quarter Quarter Section
76
+ "48", # Quarter Quarter Section
77
+ "49", # Section Type
78
+ "50", # Abstract
79
+ "52", # Labor
80
+ "53", # League
81
+ "54", # Survey
82
+ "55", # Tier
83
+ "57", # Tract
84
+ "58", # Universal Transverse Mercator Quadrant
85
+ "59", # Course Direction
86
+ "60", # Area
87
+ "93", # Sender's Location Code
88
+ "94", # Receiver's Location Code
89
+ "A1", # Office
90
+ "AA", # Annual Statements Mailing Address
91
+ "AC", # City and State
92
+ "AP", # All Points
93
+ "AR", # Armed Services Location Designation
94
+ "B1", # Branch
95
+ "BE", # Business Economic Area (BEA) Region Code
96
+ "BL", # Government Bill of Lading Office Code (GBLOC)
97
+ "BS", # Place of Business
98
+ "C2", # Geopolitical Name Code
99
+ "CA", # Country of Origin
100
+ "CB", # Confirmation Mailing Address
101
+ "CC", # Country
102
+ "CD", # Canadian Customs Office Code
103
+ "CE", # Correspondence Mailing Address
104
+ "CI", # City
105
+ "CL", # National Rate Basis (NRB)
106
+ "CO", # County/Parish and State
107
+ "CR", # In Tank Car
108
+ "CS", # Canadian SPLC
109
+ "CY", # County/Parish
110
+ "DC", # Distribution Center Number
111
+ "DE", # Destination (Shipping)
112
+ "DL", # Delivery Location
113
+ "DO", # District Office
114
+ "DP", # Department
115
+ "DR", # District of Residence
116
+ "DT", # Domicile Type Code
117
+ "EA", # Event Location
118
+ "EL", # Employer Location
119
+ "FA", # Factory
120
+ "FE", # Freight Equalization Point
121
+ "FF", # Foreign Freight Forwarder Location
122
+ "FI", # Federal Information Processing Standards (FIPS) 55 (Named Populated Places)
123
+ "FR", # U.S. Custom's Facilities Information and Resource Management Systems (FIRMS)
124
+ "FS", # Freight Station Accounting Code
125
+ "FT", # Foreign Trade Zone
126
+ "FV", # Free Alongside Vessel (Free On Board [F.O.B.] Point)
127
+ "GL", # Freight Station Geographic Location
128
+ "IA", # International Air Transport Association (IATA) Location Qualifier
129
+ "IB", # Issue Location
130
+ "IM", # Military Standard Movement Procedures (MILSTAMP)
131
+ "IP", # Postal
132
+ "IS", # In Store
133
+ "IT", # Intermediate FOB Point
134
+ "KE", # Port of Embarkation
135
+ "KL", # Port of Loading
136
+ "KP", # Government Furnished Property FOB Point
137
+ "LO", # Local Office
138
+ "MI", # Mill
139
+ "MS", # Metropolitan Sampling Area (MSA) Region Code
140
+ "MZ", # Mexican Postal Code
141
+ "NS", # City/State from Points
142
+ "OA", # Origin (After Loading on Equipment)
143
+ "OF", # Other Unlisted Free On Board (FOB) Point
144
+ "OL", # Open and Prepay Station List Code(SCAC & Number)
145
+ "OP", # Other Unlisted Acceptance Point
146
+ "OR", # Origin (Shipping Point)
147
+ "OV", # On Vessel (Free On Board [FOB] point)
148
+ "PA", # Port of Arrival
149
+ "PB", # Port of Discharge
150
+ "PC", # Policy Mailing Address
151
+ "PD", # Place of Delivery
152
+ "PE", # Port of Entry
153
+ "PF", # Parents Address
154
+ "PG", # Primary
155
+ "PH", # Prior Business
156
+ "PL", # Plant
157
+ "PO", # Principal Servicing Office
158
+ "PP", # Pool Point
159
+ "PQ", # 3 Digit U.S. ZIP
160
+ "PR", # 4 Digit U.S. ZIP
161
+ "PS", # 5 Digit U.S. ZIP
162
+ "PT", # 3 Digit Canadian Postal Code
163
+ "PU", # 6 Digit Canadian Postal Code
164
+ "RA", # Rate Area Code
165
+ "RC", # In Rail Car
166
+ "RE", # Regional Education Service Agency
167
+ "RG", # Region Code
168
+ "RJ", # Region
169
+ "RL", # Rural
170
+ "RS", # Standard Carrier Alpha Code
171
+ "RT", # Route Administrative Message To
172
+ "SA", # Secondary
173
+ "SB", # Suburban
174
+ "SC", # City/State and Points Within
175
+ "SD", # School District
176
+ "SE", # Summer
177
+ "SG", # Storage
178
+ "SH", # School Campus Code
179
+ "SL", # U.S. SPLC
180
+ "SN", # Store Number
181
+ "SP", # State/Province
182
+ "SS", # School
183
+ "ST", # In Storage Tank
184
+ "SW", # Switching District
185
+ "TA", # Tank
186
+ "TC", # Transcontinental Freight Bureau
187
+ "TL", # Terminal Cargo Location
188
+ "TM", # Terminal
189
+ "TN", # Township
190
+ "TP", # Temporary
191
+ "TR", # Rail Territory
192
+ "TX", # Taxing District
193
+ "UN", # United Nations Location Code (UNLOCODE)
194
+ "UR", # Urban
195
+ "UT", # Business Unit
196
+ "VA", # Vacation
197
+ "VI", # Village
198
+ "VS", # Vessel Stowage Location
199
+ "WF", # Wharf
200
+ "WH", # Warehouse
201
+ "WI", # Winter
202
+ "ZN", # Zone Code
203
+ "ZZ", # Mutually Defined
204
+ ]
205
+ end
206
+
207
+ end
208
+ end
209
+ end
@@ -0,0 +1,29 @@
1
+ module Eddy
2
+ module Elements
3
+ # ### Element Summary:
4
+ #
5
+ # - Id: 310
6
+ # - Name: Location Identifier
7
+ # - Type: AN
8
+ # - Min/Max: 1/30
9
+ # - Description: Code which identifies a specific location
10
+ class E310 < Eddy::Models::Element::AN
11
+ # @param val [String]
12
+ # @param req [String]
13
+ # @param ref [String]
14
+ # @return [void]
15
+ def initialize(val: nil, req: nil, ref: nil)
16
+ @id = "310"
17
+ @name = "Location Identifier"
18
+ @description = "Code which identifies a specific location"
19
+ super(
20
+ min: 1,
21
+ max: 30,
22
+ req: req,
23
+ ref: ref,
24
+ val: val,
25
+ )
26
+ end
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,42 @@
1
+ module Eddy
2
+ module Elements
3
+ # ### Element Summary:
4
+ #
5
+ # - Id: 311
6
+ # - Name: Shipment Type Code
7
+ # - Type: ID
8
+ # - Min/Max: 1/2
9
+ # - Description: Code identifying shipment type
10
+ class E311 < Eddy::Models::Element::ID
11
+
12
+ # @param val [String]
13
+ # @param req [String]
14
+ # @param ref [String]
15
+ # @return [void]
16
+ def initialize(val: nil, req: nil, ref: nil)
17
+ @id = "311"
18
+ @name = "Shipment Type Code"
19
+ @description = "Code identifying shipment type"
20
+ super(
21
+ min: 1,
22
+ max: 2,
23
+ req: req,
24
+ ref: ref,
25
+ val: val,
26
+ )
27
+ end
28
+
29
+ # @return [Array<String>]
30
+ def code_list()
31
+ return [
32
+ "AD", # Inventory Adjustment (+)
33
+ "AM", # Inventory Adjustment (-)
34
+ "CS", # Customer Shipment
35
+ "RJ", # Rejected Shipment
36
+ "ST", # Stock Transfer
37
+ ]
38
+ end
39
+
40
+ end
41
+ end
42
+ end
@@ -0,0 +1,40 @@
1
+ module Eddy
2
+ module Elements
3
+ # ### Element Summary:
4
+ #
5
+ # - Id: 322
6
+ # - Name: Load/Empty Status Code
7
+ # - Type: ID
8
+ # - Min/Max: 1/1
9
+ # - Description: Code which specifies the loaded condition of transportation equipment
10
+ class E322 < Eddy::Models::Element::ID
11
+
12
+ # @param val [String]
13
+ # @param req [String]
14
+ # @param ref [String]
15
+ # @return [void]
16
+ def initialize(val: nil, req: nil, ref: nil)
17
+ @id = "322"
18
+ @name = "Load/Empty Status Code"
19
+ @description = "Code which specifies the loaded condition of transportation equipment"
20
+ super(
21
+ min: 1,
22
+ max: 1,
23
+ req: req,
24
+ ref: ref,
25
+ val: val,
26
+ )
27
+ end
28
+
29
+ # @return [Array<String>]
30
+ def code_list()
31
+ return [
32
+ "E", # Empty
33
+ "L", # Loaded
34
+ "T", # Total
35
+ ]
36
+ end
37
+
38
+ end
39
+ end
40
+ end