ruby-brightpearl 0.13.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 +10 -0
- data/Gemfile.lock +1 -1
- data/lib/brightpearl/resources/currency.rb +27 -0
- data/lib/brightpearl/resources/exchange_rate.rb +20 -0
- data/lib/brightpearl/resources.rb +2 -0
- data/lib/brightpearl/version.rb +1 -1
- metadata +3 -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,15 @@
|
|
|
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
|
+
|
|
3
13
|
## [0.13.0] - 2026-06-03
|
|
4
14
|
|
|
5
15
|
### Added
|
data/Gemfile.lock
CHANGED
|
@@ -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
|
|
@@ -44,3 +44,5 @@ require 'brightpearl/resources/tax_code'
|
|
|
44
44
|
require 'brightpearl/resources/customer_payment'
|
|
45
45
|
require 'brightpearl/resources/nominal_code'
|
|
46
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
|
|
@@ -159,7 +159,9 @@ files:
|
|
|
159
159
|
- lib/brightpearl/resources/contact_custom_field_metadata.rb
|
|
160
160
|
- lib/brightpearl/resources/contact_group.rb
|
|
161
161
|
- lib/brightpearl/resources/contact_tag.rb
|
|
162
|
+
- lib/brightpearl/resources/currency.rb
|
|
162
163
|
- lib/brightpearl/resources/customer_payment.rb
|
|
164
|
+
- lib/brightpearl/resources/exchange_rate.rb
|
|
163
165
|
- lib/brightpearl/resources/goods_out_note.rb
|
|
164
166
|
- lib/brightpearl/resources/lead_source.rb
|
|
165
167
|
- lib/brightpearl/resources/nominal_code.rb
|