brightpearl_api 1.1.0 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/brightpearl_api/service.rb +4 -6
- data/lib/brightpearl_api/services/contact.rb +1 -1
- data/lib/brightpearl_api/services/order.rb +6 -6
- data/lib/brightpearl_api/services/product.rb +2 -2
- data/lib/brightpearl_api/services/warehouse.rb +17 -17
- data/lib/brightpearl_api/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a9ed4285f460bff1d9b32236d309e8318cded615
|
4
|
+
data.tar.gz: d2694f048357171046e5b2f847ae47a1e29c09f2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d9c6bd8cd38c48436a7c9babeecbebe0803c59079e99605d7eff36dc7af7d5c2e60902555489f5439cdde703f8c3ecbbcf79cf31587ceb8fc43230de755663ba
|
7
|
+
data.tar.gz: e6f587b08aaccddd1e39afde4af42ebe19a8eb0a8737b2a3e3434bd82946ca815ae506f2a1e48ad15943c8f4a6eac9c93c633c0c0d0fe4fb91bbf20feae75d5e
|
@@ -22,11 +22,9 @@ module BrightpearlApi
|
|
22
22
|
id_set = nil
|
23
23
|
case idset
|
24
24
|
when Range
|
25
|
-
id_set = "#{idset.min.
|
25
|
+
id_set = "#{idset.min.to_i}-#{idset.max.to_i}"
|
26
26
|
when Array
|
27
|
-
id_set = idset.collect{ |x| x.
|
28
|
-
else
|
29
|
-
id_set = idset.to_int
|
27
|
+
id_set = idset.collect{ |x| x.to_i }.join(',')
|
30
28
|
end
|
31
29
|
id_set
|
32
30
|
end
|
@@ -49,11 +47,11 @@ module BrightpearlApi
|
|
49
47
|
def update_resource(service, resource, resource_id)
|
50
48
|
body = {}
|
51
49
|
yield(body)
|
52
|
-
call(:put, "/#{service}-service/#{resource}/#{resource_id.
|
50
|
+
call(:put, "/#{service}-service/#{resource}/#{resource_id.to_i}", body)
|
53
51
|
end
|
54
52
|
|
55
53
|
def delete_resource(service, resource, resource_id)
|
56
|
-
call(:delete, "/#{service}-service/#{resource}/#{resource_id.
|
54
|
+
call(:delete, "/#{service}-service/#{resource}/#{resource_id.to_i}")
|
57
55
|
end
|
58
56
|
|
59
57
|
def get_resource_range(service, resource, idset = nil)
|
@@ -5,7 +5,7 @@ module BrightpearlApi
|
|
5
5
|
klass.class_eval do
|
6
6
|
def associate_tag(idset, tag_id)
|
7
7
|
id_set = parse_idset(idset)
|
8
|
-
call(:post, "/contact-service/contact/#{id_set}/tag/#{tag_id.
|
8
|
+
call(:post, "/contact-service/contact/#{id_set}/tag/#{tag_id.to_i}")
|
9
9
|
end
|
10
10
|
end
|
11
11
|
end
|
@@ -7,35 +7,35 @@ module BrightpearlApi
|
|
7
7
|
body = {
|
8
8
|
reference: "#{reference}"
|
9
9
|
}
|
10
|
-
call(:put, "/order-service/order/#{order_id.
|
10
|
+
call(:put, "/order-service/order/#{order_id.to_i}/acknowledgement", body)
|
11
11
|
end
|
12
12
|
|
13
13
|
def create_order_note(order_id)
|
14
14
|
body = {}
|
15
15
|
yield(body)
|
16
|
-
call(:post, "/order-service/order/#{order_id.
|
16
|
+
call(:post, "/order-service/order/#{order_id.to_i}/note", body)
|
17
17
|
end
|
18
18
|
|
19
19
|
def get_order_row(order_id, row_id)
|
20
|
-
call(:get, "/order-service/order/#{order_id.
|
20
|
+
call(:get, "/order-service/order/#{order_id.to_i}/row/#{row_id.to_i}")
|
21
21
|
end
|
22
22
|
|
23
23
|
def create_order_row(order_id)
|
24
24
|
body = {}
|
25
25
|
yield(body)
|
26
|
-
call(:post, "/order-service/order/#{order_id.
|
26
|
+
call(:post, "/order-service/order/#{order_id.to_i}/row", body)
|
27
27
|
end
|
28
28
|
|
29
29
|
def update_order_row(order_id, row_id)
|
30
30
|
body = {}
|
31
31
|
yield(body)
|
32
|
-
call(:put, "/order-service/order/#{order_id.
|
32
|
+
call(:put, "/order-service/order/#{order_id.to_i}/row/#{row_id.to_i}", body)
|
33
33
|
end
|
34
34
|
|
35
35
|
def update_order_status(order_id)
|
36
36
|
body = {}
|
37
37
|
yield(body)
|
38
|
-
call(:put, "/order-service/order/#{order_id.
|
38
|
+
call(:put, "/order-service/order/#{order_id.to_i}/status", body)
|
39
39
|
end
|
40
40
|
end
|
41
41
|
end
|
@@ -28,13 +28,13 @@ module BrightpearlApi
|
|
28
28
|
body = {
|
29
29
|
optionValueName: optionValueName
|
30
30
|
}
|
31
|
-
call(:post, "/product-service/option/#{option_id.
|
31
|
+
call(:post, "/product-service/option/#{option_id.to_i}/value", body)
|
32
32
|
end
|
33
33
|
|
34
34
|
def update_product_price(product_id)
|
35
35
|
body = {}
|
36
36
|
yield(body)
|
37
|
-
call(:put, "/product-service/product-service/#{product_id.
|
37
|
+
call(:put, "/product-service/product-service/#{product_id.to_i}/price-list", body)
|
38
38
|
end
|
39
39
|
|
40
40
|
def create_product_type(name)
|
@@ -6,30 +6,30 @@ module BrightpearlApi
|
|
6
6
|
def asset_value_correction(warehouse_id)
|
7
7
|
body = {}
|
8
8
|
yield(body)
|
9
|
-
call(:post, "/warehouse-service/warehouse/#{warehouse_id.
|
9
|
+
call(:post, "/warehouse-service/warehouse/#{warehouse_id.to_i}/asset-value-correction", body)
|
10
10
|
end
|
11
11
|
|
12
12
|
def get_default_location(warehouse_id)
|
13
|
-
call(:get, "/warehouse-service/warehouse/#{warehouse_id.
|
13
|
+
call(:get, "/warehouse-service/warehouse/#{warehouse_id.to_i}/location/default")
|
14
14
|
end
|
15
15
|
|
16
16
|
def get_quarantine_location(warehouse_id)
|
17
|
-
call(:get, "/warehouse-service/warehouse/#{warehouse_id.
|
17
|
+
call(:get, "/warehouse-service/warehouse/#{warehouse_id.to_i}/location/quarantine")
|
18
18
|
end
|
19
19
|
|
20
20
|
def get_location(warehouse_id, location_id_set = nil)
|
21
21
|
lid = location_id_set.nil? ? "" : parse_idset(location_id_set)
|
22
|
-
call(:get, "/warehouse-service/warehouse/#{warehouse_id.
|
22
|
+
call(:get, "/warehouse-service/warehouse/#{warehouse_id.to_i}/location/#{lid}")
|
23
23
|
end
|
24
24
|
|
25
25
|
def create_location(warehouse_id)
|
26
26
|
body = {}
|
27
27
|
yield(body)
|
28
|
-
call(:post, "/warehouse-service/warehouse/#{warehouse_id.
|
28
|
+
call(:post, "/warehouse-service/warehouse/#{warehouse_id.to_i}/location/", body)
|
29
29
|
end
|
30
30
|
|
31
31
|
def delete_location(warehouse_id, location_id)
|
32
|
-
call(:delete, "/warehouse-service/warehouse/#{warehouse_id.
|
32
|
+
call(:delete, "/warehouse-service/warehouse/#{warehouse_id.to_i}/location/#{location_id.to_i}")
|
33
33
|
end
|
34
34
|
|
35
35
|
def get_drop_ship_note(sales_id_set, drop_ship_note_id_set = nil)
|
@@ -41,33 +41,33 @@ module BrightpearlApi
|
|
41
41
|
def create_drop_ship_note(sales_order_id)
|
42
42
|
body = {}
|
43
43
|
yield(body)
|
44
|
-
call(:post, "/warehouse-service/order/#{sales_order_id.
|
44
|
+
call(:post, "/warehouse-service/order/#{sales_order_id.to_i}/goods-note/drop-ship", body)
|
45
45
|
end
|
46
46
|
|
47
47
|
def create_drop_ship_note_event(drop_ship_note_id)
|
48
48
|
body = {}
|
49
49
|
yield(body)
|
50
|
-
call(:post, "/warehouse-service/goods-note/drop-ship/#{drop_ship_note_id.
|
50
|
+
call(:post, "/warehouse-service/goods-note/drop-ship/#{drop_ship_note_id.to_i}/event", body)
|
51
51
|
end
|
52
52
|
|
53
53
|
def goods_in_note_correction(batch_id)
|
54
54
|
body = {}
|
55
55
|
yield(body)
|
56
|
-
call(:post, "/warehouse-service/goods-note/goods-in/#{batch_id.
|
56
|
+
call(:post, "/warehouse-service/goods-note/goods-in/#{batch_id.to_i}/correction", body)
|
57
57
|
end
|
58
58
|
|
59
59
|
def create_goods_in_note(order_id)
|
60
60
|
body = {}
|
61
61
|
yield(body)
|
62
|
-
call(:post, "/warehouse-service/order/#{order_id.
|
62
|
+
call(:post, "/warehouse-service/order/#{order_id.to_i}/goods-note/goods-in", body)
|
63
63
|
end
|
64
64
|
|
65
65
|
def delete_goods_in_note(goods_in_note_id)
|
66
|
-
call(:delete, "/warehouse-service/goods-note/goods-in/#{goods_in_note_id.
|
66
|
+
call(:delete, "/warehouse-service/goods-note/goods-in/#{goods_in_note_id.to_i}")
|
67
67
|
end
|
68
68
|
|
69
69
|
def delete_goods_out_note(order_id, goods_out_note_id)
|
70
|
-
call(:delete, "/warehouse-service/order/#{order_id.
|
70
|
+
call(:delete, "/warehouse-service/order/#{order_id.to_i}/goods-note/goods-out/#{goods_out_note_id.to_i}")
|
71
71
|
end
|
72
72
|
|
73
73
|
def get_goods_out_note(order_id_set, goods_out_note_id_set = nil)
|
@@ -79,31 +79,31 @@ module BrightpearlApi
|
|
79
79
|
def create_goods_out_note(order_id)
|
80
80
|
body = {}
|
81
81
|
yield(body)
|
82
|
-
call(:post, "/warehouse-service/order/#{order_id.
|
82
|
+
call(:post, "/warehouse-service/order/#{order_id.to_i}/goods-note/goods-out", body)
|
83
83
|
end
|
84
84
|
|
85
85
|
def update_goods_out_note(goods_out_note_id)
|
86
86
|
body = {}
|
87
87
|
yield(body)
|
88
|
-
call(:put, "/warehouse-service/goods-note/goods-out/#{goods_out_note_id.
|
88
|
+
call(:put, "/warehouse-service/goods-note/goods-out/#{goods_out_note_id.to_i}", body)
|
89
89
|
end
|
90
90
|
|
91
91
|
def create_goods_out_note_event(goods_out_note_id)
|
92
92
|
body = {}
|
93
93
|
yield(body)
|
94
|
-
call(:post, "/warehouse-service/goods-note/goods-out/#{goods_out_note_id.
|
94
|
+
call(:post, "/warehouse-service/goods-note/goods-out/#{goods_out_note_id.to_i}/event", body)
|
95
95
|
end
|
96
96
|
|
97
97
|
def create_internal_transfer(warehouse_id)
|
98
98
|
body = {}
|
99
99
|
yield(body)
|
100
|
-
call(:post, "/warehouse-service/warehouse/#{warehouse_id.
|
100
|
+
call(:post, "/warehouse-service/warehouse/#{warehouse_id.to_i}/internal-transfer", body)
|
101
101
|
end
|
102
102
|
|
103
103
|
def quarantine_release(warehouse_id)
|
104
104
|
body = {}
|
105
105
|
yield(body)
|
106
|
-
call(:post, "/warehouse-service/warehouse/#{warehouse_id.
|
106
|
+
call(:post, "/warehouse-service/warehouse/#{warehouse_id.to_i}/quarantine/release", body)
|
107
107
|
end
|
108
108
|
end
|
109
109
|
end
|