agris 0.4.10 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/agris.gemspec +1 -1
- data/lib/agris/api/document_query_response.rb +5 -23
- data/lib/agris/api/grain/grade_factors.rb +121 -0
- data/lib/agris/api/grain/grain_module.rb +13 -0
- data/lib/agris/api/grain/new_contract.rb +86 -0
- data/lib/agris/api/grain/new_contract_schedule.rb +120 -0
- data/lib/agris/api/grain.rb +5 -0
- data/lib/agris/client.rb +1 -0
- data/lib/agris/version.rb +1 -1
- metadata +9 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 9346aa5a634ee259b9700da186a851f10066701821027a7387807ebfc523ffde
|
4
|
+
data.tar.gz: a76a180c7dd9a47f524d019d532714a5eccf2a0824622690d36b89c06f5e8271
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f073b269b7842c8b63a73fc7b98e98e1764b2f4fded9c050254e1df5a2af38b95172fc645aefeb138efab8be35b94c2826040700da92a37a7b81039d82deb6c7
|
7
|
+
data.tar.gz: 8af741e013f9ef4b8c1631b958ed42af74c1dfac361e0b766966ca38480454d33919139532d86088031d5d80f623153e4a84c1bfa0c03ea423072c6aef1b4e37
|
data/agris.gemspec
CHANGED
@@ -22,7 +22,7 @@ Gem::Specification.new do |spec|
|
|
22
22
|
|
23
23
|
spec.add_dependency 'savon', '~> 2.11'
|
24
24
|
|
25
|
-
spec.add_development_dependency 'bundler', '~>
|
25
|
+
spec.add_development_dependency 'bundler', '~> 2.3.7'
|
26
26
|
spec.add_development_dependency 'pry-byebug'
|
27
27
|
spec.add_development_dependency 'rake', '~> 12.3.3'
|
28
28
|
spec.add_development_dependency 'rspec', '~> 3.0'
|
@@ -9,11 +9,7 @@ module Agris
|
|
9
9
|
end
|
10
10
|
|
11
11
|
def last_request_date_time
|
12
|
-
Time.parse(
|
13
|
-
@output_hash[pluralized_resource_name] \
|
14
|
-
['system'] \
|
15
|
-
['lastrequestdatetime']
|
16
|
-
)
|
12
|
+
Time.parse(@output_hash[pluralized_resource_name]['system']['lastrequestdatetime'])
|
17
13
|
end
|
18
14
|
|
19
15
|
def documents
|
@@ -27,18 +23,13 @@ module Agris
|
|
27
23
|
protected
|
28
24
|
|
29
25
|
def parse
|
30
|
-
resources
|
31
|
-
.map do |order_hash|
|
26
|
+
resources.map do |order_hash|
|
32
27
|
resource_type.from_xml_hash(order_hash)
|
33
28
|
end
|
34
29
|
end
|
35
30
|
|
36
31
|
def resource_name
|
37
|
-
@resource_name ||= resource_type
|
38
|
-
.name
|
39
|
-
.split('::')
|
40
|
-
.last
|
41
|
-
.downcase
|
32
|
+
@resource_name ||= resource_type.name.split('::').last.downcase
|
42
33
|
end
|
43
34
|
|
44
35
|
def pluralized_resource_name
|
@@ -46,21 +37,12 @@ module Agris
|
|
46
37
|
end
|
47
38
|
|
48
39
|
def resource_type
|
49
|
-
@resource_type ||= Object.const_get(
|
50
|
-
self
|
51
|
-
.class
|
52
|
-
.name
|
53
|
-
.split('::')
|
54
|
-
.last
|
55
|
-
.chomp('ExtractResponse')
|
56
|
-
)
|
40
|
+
@resource_type ||= Object.const_get(self.class.name.split('::').last.chomp('ExtractResponse'))
|
57
41
|
end
|
58
42
|
|
59
43
|
def resources
|
60
44
|
# Wrap and flatten for single responses
|
61
|
-
[@output_hash[pluralized_resource_name][resource_name]]
|
62
|
-
.compact
|
63
|
-
.flatten
|
45
|
+
[@output_hash[pluralized_resource_name][resource_name]].compact.flatten
|
64
46
|
end
|
65
47
|
end
|
66
48
|
end
|
@@ -0,0 +1,121 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
module Agris
|
3
|
+
module Api
|
4
|
+
module Grain
|
5
|
+
class GradeFactors
|
6
|
+
include XmlModel
|
7
|
+
|
8
|
+
ATTRIBUTE_NAMES = %w(
|
9
|
+
discount_code_1
|
10
|
+
discount_code_2
|
11
|
+
discount_code_3
|
12
|
+
discount_code_4
|
13
|
+
discount_code_5
|
14
|
+
discount_code_6
|
15
|
+
discount_code_7
|
16
|
+
discount_code_8
|
17
|
+
discount_code_9
|
18
|
+
discount_code_10
|
19
|
+
discount_code_11
|
20
|
+
discount_code_12
|
21
|
+
discount_code_13
|
22
|
+
discount_code_14
|
23
|
+
discount_code_15
|
24
|
+
discount_code_16
|
25
|
+
discount_code_17
|
26
|
+
discount_code_18
|
27
|
+
discount_code_19
|
28
|
+
discount_code_20
|
29
|
+
discount_code_21
|
30
|
+
discount_code_22
|
31
|
+
discount_code_23
|
32
|
+
discount_code_24
|
33
|
+
discount_code_25
|
34
|
+
discount_code_26
|
35
|
+
discount_code_27
|
36
|
+
discount_code_28
|
37
|
+
discount_code_29
|
38
|
+
discount_code_30
|
39
|
+
discount_code_31
|
40
|
+
discount_code_32
|
41
|
+
discount_code_33
|
42
|
+
grade_factor_1
|
43
|
+
grade_factor_2
|
44
|
+
grade_factor_3
|
45
|
+
grade_factor_4
|
46
|
+
grade_factor_5
|
47
|
+
grade_factor_6
|
48
|
+
grade_factor_7
|
49
|
+
grade_factor_8
|
50
|
+
grade_factor_9
|
51
|
+
grade_factor_10
|
52
|
+
grade_factor_11
|
53
|
+
grade_factor_12
|
54
|
+
grade_factor_13
|
55
|
+
grade_factor_14
|
56
|
+
grade_factor_15
|
57
|
+
grade_factor_16
|
58
|
+
grade_factor_17
|
59
|
+
grade_factor_18
|
60
|
+
grade_factor_19
|
61
|
+
grade_factor_20
|
62
|
+
grade_factor_21
|
63
|
+
grade_factor_22
|
64
|
+
grade_factor_23
|
65
|
+
grade_factor_24
|
66
|
+
grade_factor_25
|
67
|
+
grade_factor_26
|
68
|
+
grade_factor_27
|
69
|
+
grade_factor_28
|
70
|
+
grade_factor_29
|
71
|
+
grade_factor_30
|
72
|
+
grade_factor_31
|
73
|
+
grade_factor_32
|
74
|
+
grade_factor_33
|
75
|
+
reserved_1
|
76
|
+
reserved_2
|
77
|
+
reserved_3
|
78
|
+
reserved_4
|
79
|
+
reserved_5
|
80
|
+
reserved_6
|
81
|
+
reserved_7
|
82
|
+
reserved_8
|
83
|
+
reserved_9
|
84
|
+
reserved_10
|
85
|
+
reserved_11
|
86
|
+
reserved_12
|
87
|
+
reserved_13
|
88
|
+
reserved_14
|
89
|
+
reserved_15
|
90
|
+
reserved_16
|
91
|
+
reserved_17
|
92
|
+
reserved_18
|
93
|
+
reserved_19
|
94
|
+
reserved_20
|
95
|
+
reserved_21
|
96
|
+
reserved_22
|
97
|
+
reserved_23
|
98
|
+
reserved_24
|
99
|
+
reserved_25
|
100
|
+
reserved_26
|
101
|
+
reserved_27
|
102
|
+
reserved_28
|
103
|
+
reserved_29
|
104
|
+
reserved_30
|
105
|
+
reserved_31
|
106
|
+
reserved_32
|
107
|
+
reserved_33
|
108
|
+
).freeze
|
109
|
+
|
110
|
+
attr_reader :record_type
|
111
|
+
attr_accessor(*ATTRIBUTE_NAMES)
|
112
|
+
|
113
|
+
def initialize(hash = {})
|
114
|
+
super
|
115
|
+
|
116
|
+
@record_type = 'GRNT0G'
|
117
|
+
end
|
118
|
+
end
|
119
|
+
end
|
120
|
+
end
|
121
|
+
end
|
@@ -0,0 +1,86 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Agris
|
4
|
+
module Api
|
5
|
+
module Grain
|
6
|
+
class NewContract
|
7
|
+
include XmlModel
|
8
|
+
|
9
|
+
ATTRIBUTE_NAMES = %w(
|
10
|
+
purchase_sales
|
11
|
+
contract_location
|
12
|
+
contract_number
|
13
|
+
contract_type
|
14
|
+
commodity
|
15
|
+
variety
|
16
|
+
class
|
17
|
+
status
|
18
|
+
quantity_base
|
19
|
+
weight_base
|
20
|
+
grade_base
|
21
|
+
signed
|
22
|
+
date_written
|
23
|
+
contract_name_id
|
24
|
+
ship_to_from_id
|
25
|
+
misc_id
|
26
|
+
agent_broker_id
|
27
|
+
external_contract_no
|
28
|
+
delivery_terms
|
29
|
+
transport_mode
|
30
|
+
dp_table
|
31
|
+
invoice_terms
|
32
|
+
contract_quantity
|
33
|
+
contract_loads
|
34
|
+
advance_percent
|
35
|
+
qty_uom
|
36
|
+
).freeze
|
37
|
+
|
38
|
+
attr_reader :record_type
|
39
|
+
attr_accessor(*ATTRIBUTE_NAMES)
|
40
|
+
|
41
|
+
def initialize(hash = {})
|
42
|
+
super
|
43
|
+
|
44
|
+
@record_type = 'GRNC0'
|
45
|
+
end
|
46
|
+
|
47
|
+
def add_schedule(schedule)
|
48
|
+
@schedules ||= []
|
49
|
+
@schedules << schedule
|
50
|
+
|
51
|
+
self
|
52
|
+
end
|
53
|
+
|
54
|
+
def add_remark(remark)
|
55
|
+
@remarks ||= []
|
56
|
+
@remarks << remark
|
57
|
+
|
58
|
+
self
|
59
|
+
end
|
60
|
+
|
61
|
+
def records
|
62
|
+
[self] + schedules + remarks
|
63
|
+
end
|
64
|
+
|
65
|
+
def remarks
|
66
|
+
@remarks || []
|
67
|
+
end
|
68
|
+
|
69
|
+
def xml_ignore_attributes
|
70
|
+
%i(schedules remarks)
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
77
|
+
# I. reserved 1
|
78
|
+
# V. DISC TABLES
|
79
|
+
# X. ADD UPDATE OPTION
|
80
|
+
# Z. reserved 2
|
81
|
+
# AD. UPDATE FLD SELECT
|
82
|
+
# AF. FIRST 20 DISCOUNT TAB
|
83
|
+
# AG. LAST 20 DISCOUNT TABL
|
84
|
+
# AH. reserved 3
|
85
|
+
# AI. reserved 4
|
86
|
+
|
@@ -0,0 +1,120 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
module Agris
|
3
|
+
module Api
|
4
|
+
module Grain
|
5
|
+
class NewContractSchedule
|
6
|
+
include XmlModel
|
7
|
+
|
8
|
+
apply_status
|
9
|
+
|
10
|
+
ATTRIBUTE_NAMES = %w(
|
11
|
+
price_status
|
12
|
+
apply_name_id
|
13
|
+
other_name_id
|
14
|
+
inventory_location
|
15
|
+
item_number
|
16
|
+
state_county
|
17
|
+
board_name
|
18
|
+
futures_month
|
19
|
+
spread_from
|
20
|
+
spread_type
|
21
|
+
delivery_date
|
22
|
+
due_date
|
23
|
+
pricing_date
|
24
|
+
expire_date
|
25
|
+
scheduled_quantity
|
26
|
+
scheduled_loads
|
27
|
+
contract_price
|
28
|
+
futures_price
|
29
|
+
basis_price
|
30
|
+
freight_price
|
31
|
+
brokerage_price
|
32
|
+
other_price
|
33
|
+
misc_price_1
|
34
|
+
misc_price_2
|
35
|
+
misc_price_3
|
36
|
+
misc_price_4
|
37
|
+
misc_price_5
|
38
|
+
misc_price_6
|
39
|
+
misc_price_7
|
40
|
+
misc_price_8
|
41
|
+
misc_price_9
|
42
|
+
misc_price_10
|
43
|
+
misc_price_11
|
44
|
+
misc_price_12
|
45
|
+
defer_canceled_date
|
46
|
+
pricing_type
|
47
|
+
shipper_id
|
48
|
+
actual_freight_rate
|
49
|
+
additional_freight
|
50
|
+
exec_id
|
51
|
+
trade_id
|
52
|
+
variety
|
53
|
+
class
|
54
|
+
number
|
55
|
+
dp_table
|
56
|
+
schedule_code
|
57
|
+
weight_base
|
58
|
+
grade_base
|
59
|
+
signed
|
60
|
+
ship_to_from_id
|
61
|
+
misc_id
|
62
|
+
agent_broker_id
|
63
|
+
external_contract_no
|
64
|
+
delivery_terms
|
65
|
+
invoice_terms
|
66
|
+
advance_percent
|
67
|
+
under_fill_tolerance_percent
|
68
|
+
over_fill_tolerance_percent
|
69
|
+
under_fill_tolerance_units
|
70
|
+
over_fill_tolerance_units
|
71
|
+
price_uom
|
72
|
+
freight_uom
|
73
|
+
basis_uom
|
74
|
+
futures_currency
|
75
|
+
futures_exchange_rate
|
76
|
+
futures_exchange_rate_date
|
77
|
+
basis_currency
|
78
|
+
basis_exchange_rate
|
79
|
+
basis_exchange_rate_date
|
80
|
+
price_currency
|
81
|
+
exchange_rate
|
82
|
+
exchange_rate_date
|
83
|
+
freight_currency
|
84
|
+
freight_exchange_rate
|
85
|
+
freight_exchange_rate_date
|
86
|
+
primary_schedule
|
87
|
+
option_quantity
|
88
|
+
).freeze
|
89
|
+
|
90
|
+
attr_accessor(*ATTRIBUTE_NAMES)
|
91
|
+
|
92
|
+
def initialize(hash = {})
|
93
|
+
super
|
94
|
+
|
95
|
+
@record_type = 'GRNC1'
|
96
|
+
end
|
97
|
+
end
|
98
|
+
end
|
99
|
+
end
|
100
|
+
end
|
101
|
+
|
102
|
+
# salesperson_code
|
103
|
+
# merchandiser_code
|
104
|
+
|
105
|
+
# H. tran code 1
|
106
|
+
# I. tran code 2
|
107
|
+
# J. tran code 3
|
108
|
+
# K. tran code 4
|
109
|
+
# L. tran code 5
|
110
|
+
# AX. UPDATE FLD SELECT 1
|
111
|
+
# AY. UPDATE FLD SELECT 2
|
112
|
+
# AZ. UPDATE FLD SELECT 3
|
113
|
+
# BA. DISC TABLES
|
114
|
+
# BL. TRANSPORT MODE
|
115
|
+
# CH. FIRST 20 DISCOUNT TAB
|
116
|
+
# CK. LAST 20 DISCOUNT TABL
|
117
|
+
# CL. reserved 1
|
118
|
+
# CM. reserved 2
|
119
|
+
# CN. reserved 3
|
120
|
+
# CO. reserved 4
|
data/lib/agris/api/grain.rb
CHANGED
@@ -1,11 +1,16 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
+
|
2
3
|
module Agris
|
3
4
|
module Api
|
4
5
|
module Grain
|
5
6
|
autoload :Commodity, 'agris/api/grain/commodity'
|
6
7
|
autoload :CommodityCodes, 'agris/api/grain/commodity_codes'
|
7
8
|
autoload :Contract, 'agris/api/grain/contract'
|
9
|
+
autoload :GradeFactors, 'agris/api/grain/grade_factors'
|
10
|
+
autoload :GrainModule, 'agris/api/grain/grain_module'
|
8
11
|
autoload :PurchaseContracts, 'agris/api/grain/purchase_contracts'
|
12
|
+
autoload :NewContract, 'agris/api/grain/new_contract'
|
13
|
+
autoload :NewContractSchedule, 'agris/api/grain/new_contract_schedule'
|
9
14
|
autoload :NewTicket, 'agris/api/grain/new_ticket'
|
10
15
|
autoload :NewTicketApplication, 'agris/api/grain/new_ticket_application'
|
11
16
|
autoload :NewTicketRemark, 'agris/api/grain/new_ticket_remark'
|
data/lib/agris/client.rb
CHANGED
@@ -4,6 +4,7 @@ module Agris
|
|
4
4
|
include Api::AccountsPayables::Vouchers
|
5
5
|
include Api::AccountsReceivables::Invoices
|
6
6
|
include Api::Grain::CommodityCodes
|
7
|
+
include Api::Grain::GrainModule
|
7
8
|
include Api::Grain::PurchaseContracts
|
8
9
|
include Api::Grain::SalesContracts
|
9
10
|
include Api::Grain::Tickets
|
data/lib/agris/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: agris
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John Gray
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2024-02-24 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: savon
|
@@ -31,14 +31,14 @@ dependencies:
|
|
31
31
|
requirements:
|
32
32
|
- - "~>"
|
33
33
|
- !ruby/object:Gem::Version
|
34
|
-
version:
|
34
|
+
version: 2.3.7
|
35
35
|
type: :development
|
36
36
|
prerelease: false
|
37
37
|
version_requirements: !ruby/object:Gem::Requirement
|
38
38
|
requirements:
|
39
39
|
- - "~>"
|
40
40
|
- !ruby/object:Gem::Version
|
41
|
-
version:
|
41
|
+
version: 2.3.7
|
42
42
|
- !ruby/object:Gem::Dependency
|
43
43
|
name: pry-byebug
|
44
44
|
requirement: !ruby/object:Gem::Requirement
|
@@ -170,6 +170,10 @@ files:
|
|
170
170
|
- lib/agris/api/grain/commodity.rb
|
171
171
|
- lib/agris/api/grain/commodity_codes.rb
|
172
172
|
- lib/agris/api/grain/contract.rb
|
173
|
+
- lib/agris/api/grain/grade_factors.rb
|
174
|
+
- lib/agris/api/grain/grain_module.rb
|
175
|
+
- lib/agris/api/grain/new_contract.rb
|
176
|
+
- lib/agris/api/grain/new_contract_schedule.rb
|
173
177
|
- lib/agris/api/grain/new_ticket.rb
|
174
178
|
- lib/agris/api/grain/new_ticket_application.rb
|
175
179
|
- lib/agris/api/grain/new_ticket_remark.rb
|
@@ -243,8 +247,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
243
247
|
- !ruby/object:Gem::Version
|
244
248
|
version: '0'
|
245
249
|
requirements: []
|
246
|
-
|
247
|
-
rubygems_version: 2.5.2
|
250
|
+
rubygems_version: 3.3.7
|
248
251
|
signing_key:
|
249
252
|
specification_version: 4
|
250
253
|
summary: Ruby client library for Agris API
|