erp_integration 0.4.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/erp_integration/configuration.rb +36 -18
- data/lib/erp_integration/fulfil/query_methods.rb +16 -0
- data/lib/erp_integration/fulfil/resources/stock_move.rb +13 -0
- data/lib/erp_integration/fulfil/resources/supplier_shipment.rb +13 -0
- data/lib/erp_integration/fulfil/where_clause.rb +1 -1
- data/lib/erp_integration/stock_move.rb +12 -0
- data/lib/erp_integration/supplier_shipment.rb +14 -0
- data/lib/erp_integration/version.rb +1 -1
- data/lib/erp_integration.rb +2 -0
- metadata +6 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ad8a8ac7a7ae3e4fdf89fb54a43c1c40733db2c0c9cb1a56567bc4988d981f76
|
4
|
+
data.tar.gz: 7607c3e4822aeac9ee4d4977f256345bf53a74af8e4ef4a35dd030ba76ccf29f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d1266d8a100256536c54e4990514ee69a8e3ceb6b1d9f82d72d570e0965699469bebd9ef4717f500233f9129fba7ec57965afebfa081aa523227d378fe4b7011
|
7
|
+
data.tar.gz: 9c40ac462de22c038446633a23fc0b45327a4a1b879cf397c6cb0de3ea12103c83fc7a15ea7f70aec4a9e82c1ae9e4a3bf98c2c9d25f9d45258a90d836f0434e
|
@@ -22,16 +22,6 @@ module ErpIntegration
|
|
22
22
|
# @return [String] The merchant ID for Fulfil.
|
23
23
|
attr_accessor :fulfil_merchant_id
|
24
24
|
|
25
|
-
# Allows configuring an adapter for the `SalesOrder` resource. When none is
|
26
|
-
# configured, it will default to Fulfil.
|
27
|
-
# @return [Symbol] The configured adapter for the sales orders
|
28
|
-
attr_writer :sales_order_adapter
|
29
|
-
|
30
|
-
# Allows configuring an adapter for the `SalesOrderLine` resource. When none is
|
31
|
-
# configured, it will default to Fulfil.
|
32
|
-
# @return [Symbol] The configured adapter for the order lines.
|
33
|
-
attr_writer :sales_order_line_adapter
|
34
|
-
|
35
25
|
# Allows configuring an adapter for the `Product` resource. When none is
|
36
26
|
# configured, it will default to Fulfil.
|
37
27
|
# @return [Symbol] The configured adapter for the products.
|
@@ -52,20 +42,32 @@ module ErpIntegration
|
|
52
42
|
# @return [Symbol] The configured adapter for the purchase request.
|
53
43
|
attr_writer :purchase_request_adapter
|
54
44
|
|
45
|
+
# Allows configuring an adapter for the `SalesOrder` resource. When none is
|
46
|
+
# configured, it will default to Fulfil.
|
47
|
+
# @return [Symbol] The configured adapter for the sales orders
|
48
|
+
attr_writer :sales_order_adapter
|
49
|
+
|
50
|
+
# Allows configuring an adapter for the `SalesOrderLine` resource. When none is
|
51
|
+
# configured, it will default to Fulfil.
|
52
|
+
# @return [Symbol] The configured adapter for the order lines.
|
53
|
+
attr_writer :sales_order_line_adapter
|
54
|
+
|
55
|
+
# Allows configuring an adapter for the `SupplierShipment` resource. When
|
56
|
+
# none is configured, it will default to Fulfil.
|
57
|
+
# @return [Symbol] The configured adapter for the supplier shipment.
|
58
|
+
attr_writer :supplier_shipment_adapter
|
59
|
+
|
60
|
+
# Allows configuring an adapter for the `StockMove` resource. When
|
61
|
+
# none is configured, it will default to Fulfil.
|
62
|
+
# @return [Symbol] The configured adapter for the stock move.
|
63
|
+
attr_writer :stock_move_adapter
|
64
|
+
|
55
65
|
def initialize(**options)
|
56
66
|
options.each_pair do |key, value|
|
57
67
|
public_send("#{key}=", value) if respond_to?("#{key}=")
|
58
68
|
end
|
59
69
|
end
|
60
70
|
|
61
|
-
def sales_order_adapter
|
62
|
-
@sales_order_adapter || :fulfil
|
63
|
-
end
|
64
|
-
|
65
|
-
def sales_order_line_adapter
|
66
|
-
@sales_order_line_adapter || :fulfil
|
67
|
-
end
|
68
|
-
|
69
71
|
def product_adapter
|
70
72
|
@product_adapter || :fulfil
|
71
73
|
end
|
@@ -81,6 +83,22 @@ module ErpIntegration
|
|
81
83
|
def purchase_request_adapter
|
82
84
|
@purchase_request_adapter || :fulfil
|
83
85
|
end
|
86
|
+
|
87
|
+
def sales_order_line_adapter
|
88
|
+
@sales_order_line_adapter || :fulfil
|
89
|
+
end
|
90
|
+
|
91
|
+
def sales_order_adapter
|
92
|
+
@sales_order_adapter || :fulfil
|
93
|
+
end
|
94
|
+
|
95
|
+
def supplier_shipment_adapter
|
96
|
+
@supplier_shipment_adapter || :fulfil
|
97
|
+
end
|
98
|
+
|
99
|
+
def stock_move_adapter
|
100
|
+
@stock_move_adapter || :fulfil
|
101
|
+
end
|
84
102
|
end
|
85
103
|
|
86
104
|
# Returns ERP Integration's configuration.
|
@@ -74,10 +74,26 @@ module ErpIntegration
|
|
74
74
|
where(args.merge(comparison_operator: 'in'))
|
75
75
|
end
|
76
76
|
|
77
|
+
def where_less_than(args)
|
78
|
+
where(args.merge(comparison_operator: '<'))
|
79
|
+
end
|
80
|
+
|
81
|
+
def where_less_or_equal_to(args)
|
82
|
+
where(args.merge(comparison_operator: '<='))
|
83
|
+
end
|
84
|
+
|
77
85
|
def where_like(args)
|
78
86
|
where(args.merge(comparison_operator: 'like'))
|
79
87
|
end
|
80
88
|
|
89
|
+
def where_more_than(args)
|
90
|
+
where(args.merge(comparison_operator: '>'))
|
91
|
+
end
|
92
|
+
|
93
|
+
def where_more_or_equal_to(args)
|
94
|
+
where(args.merge(comparison_operator: '>='))
|
95
|
+
end
|
96
|
+
|
81
97
|
def where_not(args)
|
82
98
|
where(args.merge(comparison_operator: '!='))
|
83
99
|
end
|
@@ -18,7 +18,7 @@ module ErpIntegration
|
|
18
18
|
# # => <WhereClause @key="id" value="100" comparison_operator="=" />
|
19
19
|
class WhereClause
|
20
20
|
COMPARISON_OPERATORS = [
|
21
|
-
'=', '!=', '<', '<=', '
|
21
|
+
'=', '!=', '<', '<=', '>=', '>', 'like', 'ilike', 'in', 'not in'
|
22
22
|
].freeze
|
23
23
|
|
24
24
|
DEFAULT_COMPARISON_OPERATOR = '='
|
@@ -0,0 +1,12 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module ErpIntegration
|
4
|
+
class StockMove < Resource
|
5
|
+
attr_accessor :attachments, :children, :company, :cost_price, :create_date,
|
6
|
+
:create_uid, :currency, :effective_date, :from_location,
|
7
|
+
:from_sublocation, :id, :internal_quantity, :journal_entry,
|
8
|
+
:metadata, :planned_date, :quantity, :quantity_available,
|
9
|
+
:reference, :state, :to_location, :unit_price, :uom, :write_date,
|
10
|
+
:write_uid
|
11
|
+
end
|
12
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module ErpIntegration
|
4
|
+
class SupplierShipment < Resource
|
5
|
+
attr_accessor :acknowledged_by_3pl_at, :attachments, :carrier, :carrier_service,
|
6
|
+
:company, :contact_address, :cost, :cost_currency, :create_date,
|
7
|
+
:create_uidcustomer_shipments, :effective_date, :id, :incoming_moves,
|
8
|
+
:inventory_moves, :metadata, :moves, :number, :packages, :planned_date,
|
9
|
+
:reference, :sent_to_3pl_at, :shipping_instructions, :shipping_manifest,
|
10
|
+
:sscc_code, :state, :supplier, :supplier_location, :total_quantity,
|
11
|
+
:tpl_status, :tracking_number, :warehouse, :weight, :weight_uom,
|
12
|
+
:write_date, :write_uid
|
13
|
+
end
|
14
|
+
end
|
data/lib/erp_integration.rb
CHANGED
@@ -27,4 +27,6 @@ module ErpIntegration
|
|
27
27
|
autoload :Resource, 'erp_integration/resource'
|
28
28
|
autoload :SalesOrder, 'erp_integration/sales_order'
|
29
29
|
autoload :SalesOrderLine, 'erp_integration/sales_order_line'
|
30
|
+
autoload :StockMove, 'erp_integration/stock_move'
|
31
|
+
autoload :SupplierShipment, 'erp_integration/supplier_shipment'
|
30
32
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: erp_integration
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stefan Vermaas
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-10-
|
11
|
+
date: 2021-10-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -271,6 +271,8 @@ files:
|
|
271
271
|
- lib/erp_integration/fulfil/resources/purchase_request.rb
|
272
272
|
- lib/erp_integration/fulfil/resources/sales_order.rb
|
273
273
|
- lib/erp_integration/fulfil/resources/sales_order_line.rb
|
274
|
+
- lib/erp_integration/fulfil/resources/stock_move.rb
|
275
|
+
- lib/erp_integration/fulfil/resources/supplier_shipment.rb
|
274
276
|
- lib/erp_integration/fulfil/where_clause.rb
|
275
277
|
- lib/erp_integration/middleware/error_handling.rb
|
276
278
|
- lib/erp_integration/product.rb
|
@@ -280,6 +282,8 @@ files:
|
|
280
282
|
- lib/erp_integration/resource.rb
|
281
283
|
- lib/erp_integration/sales_order.rb
|
282
284
|
- lib/erp_integration/sales_order_line.rb
|
285
|
+
- lib/erp_integration/stock_move.rb
|
286
|
+
- lib/erp_integration/supplier_shipment.rb
|
283
287
|
- lib/erp_integration/version.rb
|
284
288
|
homepage: https://www.github.com/mejuri-inc/erp-integration
|
285
289
|
licenses:
|