ruby-brightpearl 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 898c21eda2183ad39766aed1a0973d4d3501df69c572bedc50cbe55497de8bfc
4
- data.tar.gz: 6f9bcc5638f5fdce7f58f0d6d0a7f8611d86ff3b5a89dd0bd447b036bdf6a73b
3
+ metadata.gz: fdb848704f153ae9ba26d219cf41f6fb2837e47e7aacb4c7f2780d4abfa7e6ce
4
+ data.tar.gz: 693496443c266b56693804e2909672306298035e7caf3d266d2b5fa808d446dc
5
5
  SHA512:
6
- metadata.gz: 523f4ca185fff9c6622cbb06e32469eb95f039d878ebe015fe1631926d9f17c54b5285aa5338397a7bcfe6cd35509b2f96536b93617e1640c28d222be91b2085
7
- data.tar.gz: bd89d6e7a680e41092cb74d3f9be7a47870bf71a5de4017401f8845f25ac835db959d9fd614ae03dd8d9f7580e4de664d3cf1d37a1e5b2cf12240e70d329ce6a
6
+ metadata.gz: a8ec1a268a3bc9cc761d7f72f04e7f3130e3edbda988e369945d3fd4c8c7fcd96d22e8c59bed0d9329805bb9c3fe9dc517d8ef2a791bc1fc493eb52bf87714a6
7
+ data.tar.gz: 45a15dfbb0f95446c6cbb0625c0ea6998a7786e2e5f39ea917689df2e67e17f05f089aa4b6d29d06a05c4f753f3ae394cb5620f9c0c8d1aff5a2ff0542b8f8a1
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
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
+
3
7
  ## [0.3.0] - 2022-02-03
4
8
  - New resource TaxCode
5
9
  - Fix minor typos
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ruby-brightpearl (0.4.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.20.0)
18
- mime-types (~> 3.0)
19
+ httparty (0.23.0)
20
+ csv
21
+ mini_mime (>= 1.0.0)
19
22
  multi_xml (>= 0.5.2)
20
- mime-types (3.4.1)
21
- mime-types-data (~> 3.2015)
22
- mime-types-data (3.2022.0105)
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).
@@ -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
@@ -4,6 +4,7 @@ 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'
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Brightpearl
4
- VERSION = "0.4.0"
4
+ VERSION = "0.5.0"
5
5
  end
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.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: 2022-02-09 00:00:00.000000000 Z
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
@@ -133,7 +134,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
133
134
  - !ruby/object:Gem::Version
134
135
  version: '0'
135
136
  requirements: []
136
- rubygems_version: 3.2.32
137
+ rubygems_version: 3.5.3
137
138
  signing_key:
138
139
  specification_version: 4
139
140
  summary: Brightpearl API ruby client.