ruby-brightpearl 0.3.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/CHANGELOG.md +8 -0
- data/Gemfile.lock +9 -7
- data/README.md +24 -0
- data/lib/brightpearl/client.rb +1 -1
- data/lib/brightpearl/config.rb +2 -0
- data/lib/brightpearl/errors.rb +0 -2
- data/lib/brightpearl/resources/order_custom_field.rb +19 -0
- data/lib/brightpearl/resources/product_availability.rb +1 -1
- data/lib/brightpearl/resources/tax_code.rb +21 -0
- data/lib/brightpearl/resources.rb +4 -1
- data/lib/brightpearl/version.rb +1 -1
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fdb848704f153ae9ba26d219cf41f6fb2837e47e7aacb4c7f2780d4abfa7e6ce
|
4
|
+
data.tar.gz: 693496443c266b56693804e2909672306298035e7caf3d266d2b5fa808d446dc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a8ec1a268a3bc9cc761d7f72f04e7f3130e3edbda988e369945d3fd4c8c7fcd96d22e8c59bed0d9329805bb9c3fe9dc517d8ef2a791bc1fc493eb52bf87714a6
|
7
|
+
data.tar.gz: 45a15dfbb0f95446c6cbb0625c0ea6998a7786e2e5f39ea917689df2e67e17f05f089aa4b6d29d06a05c4f753f3ae394cb5620f9c0c8d1aff5a2ff0542b8f8a1
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,13 @@
|
|
1
1
|
## [Unreleased]
|
2
2
|
|
3
|
+
## [0.5.0]
|
4
|
+
- Add new resource OrderCustomField
|
5
|
+
- Improve test environment to use different bp credentials without breaking the cassettes
|
6
|
+
|
7
|
+
## [0.3.0] - 2022-02-03
|
8
|
+
- New resource TaxCode
|
9
|
+
- Fix minor typos
|
10
|
+
- New optional config `debug_mode`
|
3
11
|
## [0.3.0] - 2022-02-03
|
4
12
|
- New resource ProductAvailability
|
5
13
|
## [0.2.0] - 2022-02-02
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
ruby-brightpearl (0.
|
4
|
+
ruby-brightpearl (0.5.0)
|
5
5
|
httparty (~> 0.20)
|
6
6
|
|
7
7
|
GEM
|
@@ -9,18 +9,20 @@ GEM
|
|
9
9
|
specs:
|
10
10
|
addressable (2.8.0)
|
11
11
|
public_suffix (>= 2.0.2, < 5.0)
|
12
|
+
bigdecimal (3.1.9)
|
12
13
|
byebug (11.1.3)
|
13
14
|
crack (0.4.5)
|
14
15
|
rexml
|
16
|
+
csv (3.3.3)
|
15
17
|
diff-lcs (1.5.0)
|
16
18
|
hashdiff (1.0.1)
|
17
|
-
httparty (0.
|
18
|
-
|
19
|
+
httparty (0.23.0)
|
20
|
+
csv
|
21
|
+
mini_mime (>= 1.0.0)
|
19
22
|
multi_xml (>= 0.5.2)
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
multi_xml (0.6.0)
|
23
|
+
mini_mime (1.1.5)
|
24
|
+
multi_xml (0.7.1)
|
25
|
+
bigdecimal (~> 3.1)
|
24
26
|
public_suffix (4.0.6)
|
25
27
|
rake (13.0.6)
|
26
28
|
rexml (3.2.5)
|
data/README.md
CHANGED
@@ -119,6 +119,30 @@ After checking out the repo, run `bin/setup` to install dependencies. Then, run
|
|
119
119
|
|
120
120
|
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
121
121
|
|
122
|
+
## Testing
|
123
|
+
|
124
|
+
Before you can you tests, you have to setup some env variables:
|
125
|
+
* RUBY_BRIGHTPEARL_ENDPOINT: The API endpoint to use, e.g. https://ws-use.brightpearl.com
|
126
|
+
* RUBY_BRIGHTPEARL_APP_REF: The app ref to use, e.g. barulu
|
127
|
+
* RUBY_BRIGHTPEARL_DEV_REF: The dev ref to use, e.g. barulu
|
128
|
+
* RUBY_BRIGHTPEARL_ACCOUNT: The account to use, e.g. barulu
|
129
|
+
* RUBY_BRIGHTPEARL_TOKEN: The token to use, e.g. barulu
|
130
|
+
|
131
|
+
You have to fetch these yourself.
|
132
|
+
|
133
|
+
## Release
|
134
|
+
|
135
|
+
To release a new version follow these steps:,
|
136
|
+
1. Update CHANGELOG.md with the new version changes
|
137
|
+
2. Update the version number in `version.rb`
|
138
|
+
3. Execute bundle to update version on `Gemfile.lock` automatically
|
139
|
+
4. Commit the changes and change the branch to `main`
|
140
|
+
5. Run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
141
|
+
|
142
|
+
> Remember to execute `bundle exec rake release` on `main` branch
|
143
|
+
> `Gemfile.lock` update for version is done after running `bundle install` with the `version.rb` updated
|
144
|
+
|
145
|
+
|
122
146
|
## Contributing
|
123
147
|
|
124
148
|
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/ruby-brightpearl. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/[USERNAME]/ruby-brightpearl/blob/master/CODE_OF_CONDUCT.md).
|
data/lib/brightpearl/client.rb
CHANGED
data/lib/brightpearl/config.rb
CHANGED
@@ -12,5 +12,7 @@ module Brightpearl
|
|
12
12
|
attr_accessor :token # API token
|
13
13
|
attr_accessor :api_domain # API URL base. Depends on instance region. Obtained after auth process
|
14
14
|
attr_accessor :refresh_token # API refresh token
|
15
|
+
|
16
|
+
attr_accessor :debug_mode # Display log data for request done when true
|
15
17
|
end
|
16
18
|
end
|
data/lib/brightpearl/errors.rb
CHANGED
@@ -0,0 +1,19 @@
|
|
1
|
+
module Brightpearl
|
2
|
+
# Order custom fields are user-defined data held against an order.
|
3
|
+
# Custom fields are defined separately for sales and purchase orders.
|
4
|
+
# Field names and data types are shared between every order of the same type. Several data types are available.
|
5
|
+
class OrderCustomField < Resource
|
6
|
+
class << self
|
7
|
+
# https://api-docs.brightpearl.com/order/order-customfields/get.html
|
8
|
+
def get(order_id)
|
9
|
+
send_request(path: "order-service/order/#{order_id}/custom-field", method: :get)
|
10
|
+
end
|
11
|
+
|
12
|
+
# https://api-docs.brightpearl.com/order/order-customfields/patch.html
|
13
|
+
def patch(order_id, params)
|
14
|
+
send_request(path: "order-service/order/#{order_id}/custom-field", method: :patch, body: params)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
module Brightpearl
|
2
|
+
class TaxCode < Resource
|
3
|
+
extend Brightpearl::APIOperations::Get
|
4
|
+
class << self
|
5
|
+
def resource_path
|
6
|
+
"accounting-service/tax-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/tax-code/get.html
|
18
|
+
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -4,7 +4,10 @@ require 'brightpearl/resources/order_row'
|
|
4
4
|
require 'brightpearl/resources/order_shipping_status'
|
5
5
|
require 'brightpearl/resources/order_status'
|
6
6
|
require 'brightpearl/resources/order_status_update'
|
7
|
+
require 'brightpearl/resources/order_custom_field'
|
7
8
|
require 'brightpearl/resources/product'
|
8
9
|
require 'brightpearl/resources/product_price'
|
9
10
|
require 'brightpearl/resources/price_list'
|
10
|
-
require 'brightpearl/resources/product_availability'
|
11
|
+
require 'brightpearl/resources/product_availability'
|
12
|
+
# Accounting
|
13
|
+
require 'brightpearl/resources/tax_code'
|
data/lib/brightpearl/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby-brightpearl
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- vicvans20
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2025-03-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|
@@ -97,6 +97,7 @@ files:
|
|
97
97
|
- lib/brightpearl/resource.rb
|
98
98
|
- lib/brightpearl/resources.rb
|
99
99
|
- lib/brightpearl/resources/order.rb
|
100
|
+
- lib/brightpearl/resources/order_custom_field.rb
|
100
101
|
- lib/brightpearl/resources/order_row.rb
|
101
102
|
- lib/brightpearl/resources/order_shipping_status.rb
|
102
103
|
- lib/brightpearl/resources/order_status.rb
|
@@ -105,6 +106,7 @@ files:
|
|
105
106
|
- lib/brightpearl/resources/product.rb
|
106
107
|
- lib/brightpearl/resources/product_availability.rb
|
107
108
|
- lib/brightpearl/resources/product_price.rb
|
109
|
+
- lib/brightpearl/resources/tax_code.rb
|
108
110
|
- lib/brightpearl/version.rb
|
109
111
|
- playground.rb
|
110
112
|
- ruby-brightpearl.gemspec
|
@@ -132,7 +134,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
132
134
|
- !ruby/object:Gem::Version
|
133
135
|
version: '0'
|
134
136
|
requirements: []
|
135
|
-
rubygems_version: 3.
|
137
|
+
rubygems_version: 3.5.3
|
136
138
|
signing_key:
|
137
139
|
specification_version: 4
|
138
140
|
summary: Brightpearl API ruby client.
|