agris 0.5.0 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/agris.gemspec +1 -1
- data/lib/agris/api/document_query_response.rb +5 -23
- 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 +4 -0
- data/lib/agris/client.rb +1 -0
- data/lib/agris/version.rb +1 -1
- metadata +8 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
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,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,4 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
+
|
2
3
|
module Agris
|
3
4
|
module Api
|
4
5
|
module Grain
|
@@ -6,7 +7,10 @@ module Agris
|
|
6
7
|
autoload :CommodityCodes, 'agris/api/grain/commodity_codes'
|
7
8
|
autoload :Contract, 'agris/api/grain/contract'
|
8
9
|
autoload :GradeFactors, 'agris/api/grain/grade_factors'
|
10
|
+
autoload :GrainModule, 'agris/api/grain/grain_module'
|
9
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'
|
10
14
|
autoload :NewTicket, 'agris/api/grain/new_ticket'
|
11
15
|
autoload :NewTicketApplication, 'agris/api/grain/new_ticket_application'
|
12
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
|
@@ -171,6 +171,9 @@ files:
|
|
171
171
|
- lib/agris/api/grain/commodity_codes.rb
|
172
172
|
- lib/agris/api/grain/contract.rb
|
173
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
|
174
177
|
- lib/agris/api/grain/new_ticket.rb
|
175
178
|
- lib/agris/api/grain/new_ticket_application.rb
|
176
179
|
- lib/agris/api/grain/new_ticket_remark.rb
|
@@ -244,8 +247,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
244
247
|
- !ruby/object:Gem::Version
|
245
248
|
version: '0'
|
246
249
|
requirements: []
|
247
|
-
|
248
|
-
rubygems_version: 2.7.6.2
|
250
|
+
rubygems_version: 3.3.7
|
249
251
|
signing_key:
|
250
252
|
specification_version: 4
|
251
253
|
summary: Ruby client library for Agris API
|