ruby-brightpearl 0.12.0 → 0.14.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/CHANGELOG.md +28 -0
- data/Gemfile.lock +1 -1
- data/lib/brightpearl/resources/contact_group.rb +21 -0
- data/lib/brightpearl/resources/contact_tag.rb +21 -0
- data/lib/brightpearl/resources/currency.rb +27 -0
- data/lib/brightpearl/resources/exchange_rate.rb +20 -0
- data/lib/brightpearl/resources/lead_source.rb +21 -0
- data/lib/brightpearl/resources/nominal_code.rb +21 -0
- data/lib/brightpearl/resources/order_stock_status.rb +21 -0
- data/lib/brightpearl/resources/order_type.rb +21 -0
- data/lib/brightpearl/resources/payment_method.rb +21 -0
- data/lib/brightpearl/resources/shipping_method.rb +21 -0
- data/lib/brightpearl/resources.rb +10 -0
- data/lib/brightpearl/version.rb +1 -1
- metadata +11 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 635fe340ac23fbdbe781fdbf36b08c2d9922aa87c4faca34877a451678d70aa4
|
|
4
|
+
data.tar.gz: 5c1979dbfc570f161fd993a021012db22d43690162403ffe3f61866e62c63674
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 68575dc7b7c2099de4a8166b24ffa6276c3ccb1eb534d0e18f3d6b2c4aa6ea8839b9dfeb96c6be7d5d26969c37e217426e3afceb2bdcb81a97ed658b1c6a29eb
|
|
7
|
+
data.tar.gz: 0ec4fdc3afd8dd1f59849b3a0108b5692e4456f33535b21b3b712c4d987e0836975aa0fe2baec48c85ed821f869fe4203b0af5a5a3215828800c2c898141d045
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,33 @@
|
|
|
1
1
|
## [Unreleased]
|
|
2
2
|
|
|
3
|
+
## [0.14.0] - 2026-06-25
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
|
|
7
|
+
- New resource `ExchangeRate`
|
|
8
|
+
- Available operations: `GET`, `POST`, `PUT`
|
|
9
|
+
|
|
10
|
+
- New resource `Currency`
|
|
11
|
+
- Available operations: `SEARCH`
|
|
12
|
+
|
|
13
|
+
## [0.13.0] - 2026-06-03
|
|
14
|
+
|
|
15
|
+
### Added
|
|
16
|
+
|
|
17
|
+
- New contact reference resources `ContactTag`, `ContactGroup`, and `LeadSource`
|
|
18
|
+
- Available operations: `GET`
|
|
19
|
+
- Supports fetching the full list (no argument) or a specific record by id-set
|
|
20
|
+
- Note: `ContactTag` response is a Hash keyed by tag id, not an Array
|
|
21
|
+
- New order reference resources `OrderType` and `OrderStockStatus`
|
|
22
|
+
- Available operations: `GET`
|
|
23
|
+
- Supports fetching the full list (no argument) or a specific record by id-set
|
|
24
|
+
- New accounting reference resources `NominalCode` and `PaymentMethod`
|
|
25
|
+
- Available operations: `GET`
|
|
26
|
+
- Supports fetching the full list (no argument) or a specific record by id-set
|
|
27
|
+
- New warehouse reference resource `ShippingMethod`
|
|
28
|
+
- Available operations: `GET`
|
|
29
|
+
- Supports fetching the full list (no argument) or a specific record by id-set
|
|
30
|
+
|
|
3
31
|
## [0.12.0] - 2026-06-02
|
|
4
32
|
|
|
5
33
|
### Added
|
data/Gemfile.lock
CHANGED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
module Brightpearl
|
|
2
|
+
class ContactGroup < Resource
|
|
3
|
+
extend Brightpearl::APIOperations::Get
|
|
4
|
+
class << self
|
|
5
|
+
def resource_path
|
|
6
|
+
"contact-service/contact-group"
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
def get(id_set = nil)
|
|
10
|
+
if id_set
|
|
11
|
+
super
|
|
12
|
+
else
|
|
13
|
+
super(nil)
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
# https://api-docs.brightpearl.com/contact/contact-group/get.html
|
|
18
|
+
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
module Brightpearl
|
|
2
|
+
class ContactTag < Resource
|
|
3
|
+
extend Brightpearl::APIOperations::Get
|
|
4
|
+
class << self
|
|
5
|
+
def resource_path
|
|
6
|
+
"contact-service/tag"
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
def get(id_set = nil)
|
|
10
|
+
if id_set
|
|
11
|
+
super
|
|
12
|
+
else
|
|
13
|
+
super(nil)
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
# https://api-docs.brightpearl.com/contact/tag/get.html
|
|
18
|
+
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
module Brightpearl
|
|
2
|
+
class Currency < Resource
|
|
3
|
+
attr_accessor :id, :title, :code, :symbol, :exchange_rate, :is_default,
|
|
4
|
+
:exchange_rate_variance_nominal_code
|
|
5
|
+
|
|
6
|
+
class << self
|
|
7
|
+
# https://api-docs.brightpearl.com/accounting/currency/search.html
|
|
8
|
+
def search(query_params = {})
|
|
9
|
+
response = send_request(path: "accounting-service/currency-search?#{to_query(query_params)}", method: :get)
|
|
10
|
+
response.merge({
|
|
11
|
+
records: response[:payload]["response"]["results"].map { |item| Currency.new(item) }
|
|
12
|
+
})
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
# ARA => API Record Array
|
|
17
|
+
def initialize(ara)
|
|
18
|
+
@id = ara[0]
|
|
19
|
+
@title = ara[1]
|
|
20
|
+
@code = ara[2]
|
|
21
|
+
@symbol = ara[3]
|
|
22
|
+
@exchange_rate = ara[4]
|
|
23
|
+
@is_default = ara[5]
|
|
24
|
+
@exchange_rate_variance_nominal_code = ara[6]
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
module Brightpearl
|
|
2
|
+
class ExchangeRate < Resource
|
|
3
|
+
class << self
|
|
4
|
+
# https://api-docs.brightpearl.com/accounting/exchange-rate/get.html
|
|
5
|
+
def get
|
|
6
|
+
send_request(path: "accounting-service/exchange-rate/", method: :get)
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
# https://api-docs.brightpearl.com/accounting/exchange-rate/post.html
|
|
10
|
+
def post(currency_id:, **params)
|
|
11
|
+
send_request(path: "accounting-service/currency/#{currency_id}/exchange-rate", method: :post, body: params)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
# https://api-docs.brightpearl.com/accounting/exchange-rate/put.html
|
|
15
|
+
def put(currency_id:, **params)
|
|
16
|
+
send_request(path: "accounting-service/currency/#{currency_id}/exchange-rate", method: :put, body: params)
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
module Brightpearl
|
|
2
|
+
class LeadSource < Resource
|
|
3
|
+
extend Brightpearl::APIOperations::Get
|
|
4
|
+
class << self
|
|
5
|
+
def resource_path
|
|
6
|
+
"contact-service/lead-source"
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
def get(id_set = nil)
|
|
10
|
+
if id_set
|
|
11
|
+
super
|
|
12
|
+
else
|
|
13
|
+
super(nil)
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
# https://api-docs.brightpearl.com/contact/lead-source/get.html
|
|
18
|
+
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
module Brightpearl
|
|
2
|
+
class NominalCode < Resource
|
|
3
|
+
extend Brightpearl::APIOperations::Get
|
|
4
|
+
class << self
|
|
5
|
+
def resource_path
|
|
6
|
+
"accounting-service/nominal-code"
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
def get(id_set = nil)
|
|
10
|
+
if id_set
|
|
11
|
+
super
|
|
12
|
+
else
|
|
13
|
+
super(nil)
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
# https://api-docs.brightpearl.com/accounting/nominal-code/get.html
|
|
18
|
+
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
module Brightpearl
|
|
2
|
+
class OrderStockStatus < Resource
|
|
3
|
+
extend Brightpearl::APIOperations::Get
|
|
4
|
+
class << self
|
|
5
|
+
def resource_path
|
|
6
|
+
"order-service/order-stock-status"
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
def get(id_set = nil)
|
|
10
|
+
if id_set
|
|
11
|
+
super
|
|
12
|
+
else
|
|
13
|
+
super(nil)
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
# https://api-docs.brightpearl.com/order/order-stock-status/get.html
|
|
18
|
+
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
module Brightpearl
|
|
2
|
+
class OrderType < Resource
|
|
3
|
+
extend Brightpearl::APIOperations::Get
|
|
4
|
+
class << self
|
|
5
|
+
def resource_path
|
|
6
|
+
"order-service/order-type"
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
def get(id_set = nil)
|
|
10
|
+
if id_set
|
|
11
|
+
super
|
|
12
|
+
else
|
|
13
|
+
super(nil)
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
# https://api-docs.brightpearl.com/order/order-type/get.html
|
|
18
|
+
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
module Brightpearl
|
|
2
|
+
class PaymentMethod < Resource
|
|
3
|
+
extend Brightpearl::APIOperations::Get
|
|
4
|
+
class << self
|
|
5
|
+
def resource_path
|
|
6
|
+
"accounting-service/payment-method"
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
def get(id_set = nil)
|
|
10
|
+
if id_set
|
|
11
|
+
super
|
|
12
|
+
else
|
|
13
|
+
super(nil)
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
# https://api-docs.brightpearl.com/accounting/payment-method/get.html
|
|
18
|
+
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
module Brightpearl
|
|
2
|
+
class ShippingMethod < Resource
|
|
3
|
+
extend Brightpearl::APIOperations::Get
|
|
4
|
+
class << self
|
|
5
|
+
def resource_path
|
|
6
|
+
"warehouse-service/shipping-method"
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
def get(id_set = nil)
|
|
10
|
+
if id_set
|
|
11
|
+
super
|
|
12
|
+
else
|
|
13
|
+
super(nil)
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
# https://api-docs.brightpearl.com/warehouse/shipping-method/get.html
|
|
18
|
+
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
@@ -4,6 +4,9 @@ require 'brightpearl/resource'
|
|
|
4
4
|
require 'brightpearl/resources/contact'
|
|
5
5
|
require 'brightpearl/resources/contact_custom_field'
|
|
6
6
|
require 'brightpearl/resources/contact_custom_field_metadata'
|
|
7
|
+
require 'brightpearl/resources/contact_group'
|
|
8
|
+
require 'brightpearl/resources/contact_tag'
|
|
9
|
+
require 'brightpearl/resources/lead_source'
|
|
7
10
|
|
|
8
11
|
# Orders
|
|
9
12
|
require 'brightpearl/resources/order'
|
|
@@ -13,6 +16,8 @@ require 'brightpearl/resources/order_status'
|
|
|
13
16
|
require 'brightpearl/resources/order_status_update'
|
|
14
17
|
require 'brightpearl/resources/order_custom_field'
|
|
15
18
|
require 'brightpearl/resources/order_custom_field_metadata'
|
|
19
|
+
require 'brightpearl/resources/order_stock_status'
|
|
20
|
+
require 'brightpearl/resources/order_type'
|
|
16
21
|
|
|
17
22
|
require 'brightpearl/resources/goods_out_note'
|
|
18
23
|
|
|
@@ -29,6 +34,7 @@ require 'brightpearl/resources/channel'
|
|
|
29
34
|
require 'brightpearl/resources/product_category'
|
|
30
35
|
require 'brightpearl/resources/product_type'
|
|
31
36
|
require 'brightpearl/resources/warehouse'
|
|
37
|
+
require 'brightpearl/resources/shipping_method'
|
|
32
38
|
|
|
33
39
|
# Integration
|
|
34
40
|
require 'brightpearl/resources/webhook'
|
|
@@ -36,3 +42,7 @@ require 'brightpearl/resources/webhook'
|
|
|
36
42
|
# Accounting
|
|
37
43
|
require 'brightpearl/resources/tax_code'
|
|
38
44
|
require 'brightpearl/resources/customer_payment'
|
|
45
|
+
require 'brightpearl/resources/nominal_code'
|
|
46
|
+
require 'brightpearl/resources/payment_method'
|
|
47
|
+
require 'brightpearl/resources/exchange_rate'
|
|
48
|
+
require 'brightpearl/resources/currency'
|
data/lib/brightpearl/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: ruby-brightpearl
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.14.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- vicvans20
|
|
@@ -157,8 +157,14 @@ files:
|
|
|
157
157
|
- lib/brightpearl/resources/contact.rb
|
|
158
158
|
- lib/brightpearl/resources/contact_custom_field.rb
|
|
159
159
|
- lib/brightpearl/resources/contact_custom_field_metadata.rb
|
|
160
|
+
- lib/brightpearl/resources/contact_group.rb
|
|
161
|
+
- lib/brightpearl/resources/contact_tag.rb
|
|
162
|
+
- lib/brightpearl/resources/currency.rb
|
|
160
163
|
- lib/brightpearl/resources/customer_payment.rb
|
|
164
|
+
- lib/brightpearl/resources/exchange_rate.rb
|
|
161
165
|
- lib/brightpearl/resources/goods_out_note.rb
|
|
166
|
+
- lib/brightpearl/resources/lead_source.rb
|
|
167
|
+
- lib/brightpearl/resources/nominal_code.rb
|
|
162
168
|
- lib/brightpearl/resources/order.rb
|
|
163
169
|
- lib/brightpearl/resources/order_custom_field.rb
|
|
164
170
|
- lib/brightpearl/resources/order_custom_field_metadata.rb
|
|
@@ -166,6 +172,9 @@ files:
|
|
|
166
172
|
- lib/brightpearl/resources/order_shipping_status.rb
|
|
167
173
|
- lib/brightpearl/resources/order_status.rb
|
|
168
174
|
- lib/brightpearl/resources/order_status_update.rb
|
|
175
|
+
- lib/brightpearl/resources/order_stock_status.rb
|
|
176
|
+
- lib/brightpearl/resources/order_type.rb
|
|
177
|
+
- lib/brightpearl/resources/payment_method.rb
|
|
169
178
|
- lib/brightpearl/resources/price_list.rb
|
|
170
179
|
- lib/brightpearl/resources/product.rb
|
|
171
180
|
- lib/brightpearl/resources/product_availability.rb
|
|
@@ -173,6 +182,7 @@ files:
|
|
|
173
182
|
- lib/brightpearl/resources/product_custom_field_metadata.rb
|
|
174
183
|
- lib/brightpearl/resources/product_price.rb
|
|
175
184
|
- lib/brightpearl/resources/product_type.rb
|
|
185
|
+
- lib/brightpearl/resources/shipping_method.rb
|
|
176
186
|
- lib/brightpearl/resources/tax_code.rb
|
|
177
187
|
- lib/brightpearl/resources/warehouse.rb
|
|
178
188
|
- lib/brightpearl/resources/webhook.rb
|