ruby-brightpearl 0.10.0 → 0.11.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: b9e05da1a90bbe24c05beed8a083e43a77c4c22376af84e12f37d8ea3e6eeba8
4
- data.tar.gz: 5f06f50c457a8be89f53181353c77c91dccbcf7d782de0096af6183eaae4358f
3
+ metadata.gz: de2c63aae118383c79591261adf50e2c73511d3a3939591288937883892c3a76
4
+ data.tar.gz: f54a265866ae77e46343e6701801aa0c994431955850a31015bcea675b773d3a
5
5
  SHA512:
6
- metadata.gz: 5053255b92df81af25092d34b469b85bdf8a989c365f5654e018889b8de5e73aab963d5c7b6425849edcccab488ecab2d92f1bef2aa8c7a954d6bf96ab570e51
7
- data.tar.gz: 9e377fe15a59fa1db5593521f5ac56f9d138c6e8cd823dca0b83d821f28fdfb6c81bfc8f7bd230f339dddc40a3b6918e968747416e683705c5d3d94e8d78b112
6
+ metadata.gz: 0be98a97c29dbfe0239ee63fed3b270dcfd688d284e71178e192c5b3527c4d893e8bc9919a4b87de3d56bc086dd410ea50fba481f30d23bcbfc07b8aee9ca7ed
7
+ data.tar.gz: a721a3a87235c91a7520e0db43bbb00d91df3d4de7934bc5cf991e4a81644825cda5bbddca7fb9f24ed341a9ea61fcf82d455f3691b3c6952087ab8b1d4c8b32
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [0.11.0] - 2026-05-08
4
+
5
+ ### Added
6
+
7
+ - New resources `ContactCustomFieldMetadata`, `OrderCustomFieldMetadata`, and `ProductCustomFieldMetadata`
8
+ - Available operations: `GET`
9
+ - Useful to get the available custom fields for a contact, order, or product and their metadata (name, type, list of values, etc.)
10
+
3
11
  ## [0.10.0] - 2026-04-17
4
12
 
5
13
  ### Added
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ruby-brightpearl (0.10.0)
4
+ ruby-brightpearl (0.11.0)
5
5
  httparty (~> 0.20)
6
6
 
7
7
  GEM
@@ -10,7 +10,7 @@ GEM
10
10
  addressable (2.8.0)
11
11
  public_suffix (>= 2.0.2, < 5.0)
12
12
  base64 (0.3.0)
13
- bigdecimal (4.1.1)
13
+ bigdecimal (4.1.2)
14
14
  byebug (11.1.3)
15
15
  coderay (1.1.3)
16
16
  crack (0.4.5)
@@ -25,7 +25,7 @@ GEM
25
25
  multi_xml (>= 0.5.2)
26
26
  method_source (1.1.0)
27
27
  mini_mime (1.1.5)
28
- multi_xml (0.8.1)
28
+ multi_xml (0.9.1)
29
29
  bigdecimal (>= 3.1, < 5)
30
30
  pry (0.15.2)
31
31
  coderay (~> 1.1)
@@ -0,0 +1,26 @@
1
+ module Brightpearl
2
+ # https://api-docs.brightpearl.com/contact/custom-field-meta-data/get.html
3
+ class ContactCustomFieldMetadata < Resource
4
+ VALID_CONTACT_TYPES = ["customer", "supplier"].freeze
5
+
6
+ class << self
7
+ def get(contact_type, id_set = nil)
8
+ contact_type = contact_type.to_s
9
+ validate_contact_type!(contact_type)
10
+
11
+ path = "contact-service/#{contact_type}/custom-field-meta-data"
12
+ path = "#{path}/#{id_set}" if id_set
13
+
14
+ send_request(path: path, method: :get)
15
+ end
16
+
17
+ private
18
+
19
+ def validate_contact_type!(contact_type)
20
+ return if VALID_CONTACT_TYPES.include?(contact_type)
21
+
22
+ raise ArgumentError, "Invalid contact custom field metadata type: #{contact_type.inspect}. Valid types: #{VALID_CONTACT_TYPES.join(', ')}"
23
+ end
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,26 @@
1
+ module Brightpearl
2
+ # https://api-docs.brightpearl.com/order/customfield-metadata/get.html
3
+ class OrderCustomFieldMetadata < Resource
4
+ VALID_ORDER_TYPES = ["sale", "purchase"].freeze
5
+
6
+ class << self
7
+ def get(order_type, id_set = nil)
8
+ order_type = order_type.to_s
9
+ validate_order_type!(order_type)
10
+
11
+ path = "order-service/#{order_type}/custom-field-meta-data"
12
+ path = "#{path}/#{id_set}" if id_set
13
+
14
+ send_request(path: path, method: :get)
15
+ end
16
+
17
+ private
18
+
19
+ def validate_order_type!(order_type)
20
+ return if VALID_ORDER_TYPES.include?(order_type)
21
+
22
+ raise ArgumentError, "Invalid order custom field metadata type: #{order_type.inspect}. Valid types: #{VALID_ORDER_TYPES.join(', ')}"
23
+ end
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,13 @@
1
+ module Brightpearl
2
+ # https://api-docs.brightpearl.com/product/product-custom-field-metadata/get.html
3
+ class ProductCustomFieldMetadata < Resource
4
+ class << self
5
+ def get(id_set = nil)
6
+ path = "product-service/product/custom-field-meta-data"
7
+ path = "#{path}/#{id_set}" if id_set
8
+
9
+ send_request(path: path, method: :get)
10
+ end
11
+ end
12
+ end
13
+ end
@@ -2,6 +2,7 @@ require 'brightpearl/resource'
2
2
 
3
3
  require 'brightpearl/resources/contact'
4
4
  require 'brightpearl/resources/contact_custom_field'
5
+ require 'brightpearl/resources/contact_custom_field_metadata'
5
6
 
6
7
  require 'brightpearl/resources/order'
7
8
  require 'brightpearl/resources/order_row'
@@ -9,6 +10,7 @@ require 'brightpearl/resources/order_shipping_status'
9
10
  require 'brightpearl/resources/order_status'
10
11
  require 'brightpearl/resources/order_status_update'
11
12
  require 'brightpearl/resources/order_custom_field'
13
+ require 'brightpearl/resources/order_custom_field_metadata'
12
14
 
13
15
  require 'brightpearl/resources/goods_out_note'
14
16
 
@@ -16,6 +18,7 @@ require 'brightpearl/resources/product'
16
18
  require 'brightpearl/resources/product_price'
17
19
  require 'brightpearl/resources/price_list'
18
20
  require 'brightpearl/resources/product_availability'
21
+ require 'brightpearl/resources/product_custom_field_metadata'
19
22
 
20
23
  # Integration
21
24
  require 'brightpearl/resources/webhook'
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Brightpearl
4
- VERSION = "0.10.0"
4
+ VERSION = "0.11.0"
5
5
  end
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.10.0
4
+ version: 0.11.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - vicvans20
@@ -154,10 +154,12 @@ files:
154
154
  - lib/brightpearl/resources.rb
155
155
  - lib/brightpearl/resources/contact.rb
156
156
  - lib/brightpearl/resources/contact_custom_field.rb
157
+ - lib/brightpearl/resources/contact_custom_field_metadata.rb
157
158
  - lib/brightpearl/resources/customer_payment.rb
158
159
  - lib/brightpearl/resources/goods_out_note.rb
159
160
  - lib/brightpearl/resources/order.rb
160
161
  - lib/brightpearl/resources/order_custom_field.rb
162
+ - lib/brightpearl/resources/order_custom_field_metadata.rb
161
163
  - lib/brightpearl/resources/order_row.rb
162
164
  - lib/brightpearl/resources/order_shipping_status.rb
163
165
  - lib/brightpearl/resources/order_status.rb
@@ -165,6 +167,7 @@ files:
165
167
  - lib/brightpearl/resources/price_list.rb
166
168
  - lib/brightpearl/resources/product.rb
167
169
  - lib/brightpearl/resources/product_availability.rb
170
+ - lib/brightpearl/resources/product_custom_field_metadata.rb
168
171
  - lib/brightpearl/resources/product_price.rb
169
172
  - lib/brightpearl/resources/tax_code.rb
170
173
  - lib/brightpearl/resources/webhook.rb