ruby-brightpearl 0.7.0 → 0.9.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 +16 -0
- data/Gemfile.lock +1 -1
- data/lib/brightpearl/resources/{customer.rb → contact.rb} +4 -3
- data/lib/brightpearl/resources/{customer_custom_field.rb → contact_custom_field.rb} +3 -2
- data/lib/brightpearl/resources/goods_out_note.rb +52 -0
- data/lib/brightpearl/resources.rb +4 -2
- data/lib/brightpearl/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7812b15f9e154a4f456e4f240064d16fa996f28dd4b7de7db71c0755251fb3ac
|
|
4
|
+
data.tar.gz: '0733425239130ce0c62fc11467a7b5b285f7bc0838421aa3acf680b2ed959c78'
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2d449c53b725ee84d975c72cce202952b729a8448ff2860863657a0bddf4b71a7895beeb7d0815404ba7413fe537173e24213cc525145f19b39450856b6aedc5
|
|
7
|
+
data.tar.gz: 8fd551ae744bfca7f9e2ca1f73087edda0ea7a32d89ccd6f0fa467672cc139e9c271757480dcca99f912e3fec63597e1c64177274b4fd71e8d36c7b6793df081
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
## [Unreleased]
|
|
2
2
|
|
|
3
|
+
## [0.9.0] - 2025-12-10
|
|
4
|
+
|
|
5
|
+
### Changed
|
|
6
|
+
|
|
7
|
+
- **Renamed `Customer` resources to `Contact` to match Brightpearl API documentation**
|
|
8
|
+
- Renamed `Customer` to `Contact`
|
|
9
|
+
- Renamed `CustomerCustomField` to `ContactCustomField`
|
|
10
|
+
|
|
11
|
+
## [0.8.0] - 2025-11-05
|
|
12
|
+
|
|
13
|
+
### Added
|
|
14
|
+
|
|
15
|
+
- **New resource `GoodsOutNote`**
|
|
16
|
+
- Available operations: `GET`, `POST`, `PUT`, `DELETE`
|
|
17
|
+
- Search is still pending to be implemented
|
|
18
|
+
|
|
3
19
|
## [0.7.0] - 2025-11-03
|
|
4
20
|
|
|
5
21
|
### Added
|
data/Gemfile.lock
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
module Brightpearl
|
|
2
2
|
# https://api-docs.brightpearl.com/contact/contact/index.html
|
|
3
|
-
class
|
|
3
|
+
class Contact < Resource
|
|
4
4
|
extend Brightpearl::APIOperations::Get
|
|
5
5
|
extend Brightpearl::APIOperations::Post
|
|
6
6
|
extend Brightpearl::APIOperations::Patch
|
|
@@ -26,7 +26,7 @@ module Brightpearl
|
|
|
26
26
|
def search(query_params = {})
|
|
27
27
|
response = send_request(path: "contact-service/contact-search?#{to_query(query_params)}", method: :get)
|
|
28
28
|
return response.merge({ # modify final payload to set search results as objects
|
|
29
|
-
records: response[:payload]["response"]["results"].map { |item|
|
|
29
|
+
records: response[:payload]["response"]["results"].map { |item| Contact.new(item) },
|
|
30
30
|
})
|
|
31
31
|
end
|
|
32
32
|
end
|
|
@@ -57,4 +57,5 @@ module Brightpearl
|
|
|
57
57
|
end
|
|
58
58
|
|
|
59
59
|
end
|
|
60
|
-
end
|
|
60
|
+
end
|
|
61
|
+
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
module Brightpearl
|
|
2
2
|
# Contact custom fields are the user-defined data held against Brightpearl contacts. Several data types are available. Custom fields are separated between Supplier contacts and Customer contacts, and may only be assigned to one of these groups.
|
|
3
3
|
# https://api-docs.brightpearl.com/contact/custom-field/index.html
|
|
4
|
-
class
|
|
4
|
+
class ContactCustomField < Resource
|
|
5
5
|
class << self
|
|
6
6
|
# https://api-docs.brightpearl.com/contact/custom-field/get.html
|
|
7
7
|
def get(contact_id)
|
|
@@ -15,4 +15,5 @@ module Brightpearl
|
|
|
15
15
|
end
|
|
16
16
|
|
|
17
17
|
end
|
|
18
|
-
end
|
|
18
|
+
end
|
|
19
|
+
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
module Brightpearl
|
|
2
|
+
# Goods-Out Notes are used to represent stock permanently leaving your stock control system. The most common use of a Goods-Out Note is to facilitate the fulfilment of a Sales Order.
|
|
3
|
+
#
|
|
4
|
+
# When a Goods-Out Note is successfully created, stock is allocated to the specified Sales Order and is not available for the purposes of sales, Internal Transfers, External Transfers, Reservations or Stock Corrections.
|
|
5
|
+
#
|
|
6
|
+
# Unlike the majority of resources that can be manipulated via the warehouse service, Goods-Out Notes have a temporal component, represented by lifecycle events.
|
|
7
|
+
#
|
|
8
|
+
# A Goods-Out Note POST creates a Goods-Out Note with a created event, but for accounting and reporting purposes, the stock is still considered present in its original Warehouse and Locations
|
|
9
|
+
#
|
|
10
|
+
# You should issue one or more Goods-Out Note Event POSTs to add lifecycle events such as picked, packed and shipped to the Goods-Note Out. The stock is not considered to have left a Warehouse until the shipped event is added to the Goods-Note Out.
|
|
11
|
+
#
|
|
12
|
+
# A separate mechanism for creating a Goods-Out Note is provided by the External Transfer resource, which allows the movement of stock between two Warehouses
|
|
13
|
+
#
|
|
14
|
+
# https://api-docs.brightpearl.com/warehouse/goods-out-note/index.html
|
|
15
|
+
class GoodsOutNote < Resource
|
|
16
|
+
class << self
|
|
17
|
+
# You may query for goods-out notes in several different ways:
|
|
18
|
+
# * By goods-out note ID: `/order/*/goods-note/goods-out/4`
|
|
19
|
+
# * By an ID set of goods-out note IDs: `/order/*/goods-note/goods-out/4-99,1,2`
|
|
20
|
+
# * By an order ID: `/order/55/goods-note/goods-out/`
|
|
21
|
+
# * By a set of order IDs: `/order/55-90,45/goods-note/goods-out/`
|
|
22
|
+
# * By a combination of order IDs and goods-out note IDs: `/order/100-500/goods-note/goods-out/40-45`
|
|
23
|
+
# https://api-docs.brightpearl.com/warehouse/goods-out-note/get.html
|
|
24
|
+
def get(order_id_set:, gon_id_set: "")
|
|
25
|
+
url = "warehouse-service/order/#{order_id_set}/goods-note/goods-out/#{gon_id_set}"
|
|
26
|
+
send_request(path: url, method: :get)
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
# https://api-docs.brightpearl.com/warehouse/goods-out-note/post.html
|
|
30
|
+
def post(order_id:, **params)
|
|
31
|
+
url = "warehouse-service/order/#{order_id}/goods-note/goods-out"
|
|
32
|
+
send_request(path: url, method: :post, body: params)
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
# https://api-docs.brightpearl.com/warehouse/goods-out-note/put.html
|
|
36
|
+
def put(id:, **params)
|
|
37
|
+
url = "warehouse-service/goods-note/goods-out/#{id}"
|
|
38
|
+
send_request(path: url, method: :put, body: params)
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
# https://api-docs.brightpearl.com/warehouse/goods-out-note/delete.html
|
|
42
|
+
def delete(order_id:, gon_id:)
|
|
43
|
+
url = "warehouse-service/order/#{order_id}/goods-note/goods-out/#{gon_id}"
|
|
44
|
+
send_request(path: url, method: :delete)
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
# search (TODO)
|
|
48
|
+
# https://api-docs.brightpearl.com/warehouse/goods-out-note/search.html
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
end
|
|
52
|
+
end
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
require 'brightpearl/resource'
|
|
2
2
|
|
|
3
|
-
require 'brightpearl/resources/
|
|
4
|
-
require 'brightpearl/resources/
|
|
3
|
+
require 'brightpearl/resources/contact'
|
|
4
|
+
require 'brightpearl/resources/contact_custom_field'
|
|
5
5
|
|
|
6
6
|
require 'brightpearl/resources/order'
|
|
7
7
|
require 'brightpearl/resources/order_row'
|
|
@@ -10,6 +10,8 @@ require 'brightpearl/resources/order_status'
|
|
|
10
10
|
require 'brightpearl/resources/order_status_update'
|
|
11
11
|
require 'brightpearl/resources/order_custom_field'
|
|
12
12
|
|
|
13
|
+
require 'brightpearl/resources/goods_out_note'
|
|
14
|
+
|
|
13
15
|
require 'brightpearl/resources/product'
|
|
14
16
|
require 'brightpearl/resources/product_price'
|
|
15
17
|
require 'brightpearl/resources/price_list'
|
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.9.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- vicvans20
|
|
@@ -152,8 +152,9 @@ files:
|
|
|
152
152
|
- lib/brightpearl/errors.rb
|
|
153
153
|
- lib/brightpearl/resource.rb
|
|
154
154
|
- lib/brightpearl/resources.rb
|
|
155
|
-
- lib/brightpearl/resources/
|
|
156
|
-
- lib/brightpearl/resources/
|
|
155
|
+
- lib/brightpearl/resources/contact.rb
|
|
156
|
+
- lib/brightpearl/resources/contact_custom_field.rb
|
|
157
|
+
- lib/brightpearl/resources/goods_out_note.rb
|
|
157
158
|
- lib/brightpearl/resources/order.rb
|
|
158
159
|
- lib/brightpearl/resources/order_custom_field.rb
|
|
159
160
|
- lib/brightpearl/resources/order_row.rb
|