shedcloud-partner_api 0.2.1 → 0.4.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: ef147c587026c0e669b48177eff919ed647ba9220351c2fcb233caa960f57d84
4
- data.tar.gz: 14e6b2a150cf3604feb9523705bbba744af9515533cca38a204f7d3c26e0419a
3
+ metadata.gz: b54129db36438f7ef29fb770ca5981b2c0d3f814836458aa9c9eba376aa1fda8
4
+ data.tar.gz: 76bcf7bb7c7ff8794b479f85881bbb447ab5d5bb00e7d4889b465973f337c30a
5
5
  SHA512:
6
- metadata.gz: b1adcf401a3a46f25bc75b750e884a59743ac7d721d071f8f92606a621a51c7f44a0095996b5ca4944222bc5eea8c354e8601142311a7865e5fe6184ada71829
7
- data.tar.gz: 0fa3865cffaf2a7f55ac5829b4e2bea56d06e202cc18953b624694a3756fe0687e9b46c99543aa3dec5cb8789970b035e658eac7c61a1b292b6f7b31cd94e296
6
+ metadata.gz: f2e3ed9212d6fb716bd505eb3d44ffa76a376162f4bbf90add00b016ce1ccc9ec86e70fa99a339262ae4f39277d0655f424856ea5d5c3894a871c79ca755986e
7
+ data.tar.gz: a6a9cb6e146c4ccd7daa06b024888dc7fefcb6e6ebdebc6a914e79c3c3db52803a2dea1733b9c3af11c1d47a40229a0258b7ee3994782a84b8f48386fd763653
data/CHANGELOG.md CHANGED
@@ -1,5 +1,39 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.4.0 — 2026-07-27
4
+
5
+ - **Orders: sale date + sold pricing.** Order GET/list responses may include
6
+ `saleDate` and `soldPricing`. List with `saleDateFrom` / `saleDateTo`.
7
+ PATCH body accepts `saleDate` (`nil` clears) and `soldPricing` (partial
8
+ hash; top-level `nil` clears every sold amount). Wire keys are camelCase in
9
+ the hashes this gem passes through.
10
+ - Parity with `@shedcloud/partner-api` 0.8.0 and the `shedcloud-api-go`
11
+ Partner API changelog entry (2026-07-27).
12
+
13
+ ## Unreleased
14
+
15
+ - **Parametric products** — `client.orders.create` accepts `dimensions` in place of
16
+ `sizeId`, and `client.work_orders.create` accepts `productId` + `dimensions`, for
17
+ products whose bill of materials is a set of rules rather than one bill per size.
18
+ The fields are mutually exclusive (`dimensions` also requires `productId` on work
19
+ orders); both rules are enforced server-side as a `400` and are not duplicated
20
+ client-side. Keys inside `dimensions` are sent verbatim — no key transform, since
21
+ an unrecognised key is a `400` rather than a dropped field.
22
+ - **New `client.bom`** — `dimension_variables` for
23
+ `GET /partner/v1/bom/dimension-variables` (existing scope
24
+ `partner-api.products.read`), listing the accepted keys with their unit, category
25
+ and `isSystem` flag. Read-only: authoring variables is a portal modelling
26
+ decision. Resolve the list per company rather than hard-coding the ten built-ins.
27
+ - Parity with the `shedcloud-api-go` Partner API changelog entry (2026-07-25).
28
+
29
+ ## 0.3.0 — 2026-07-26
30
+
31
+ - **Location sales budgets** — `client.location_budgets.list/get/create/update`
32
+ for `GET/POST/PUT /partner/v1/location-budgets` (scopes
33
+ `partner-api.location-budgets.read` / `.write`).
34
+ - Parity with `@shedcloud/partner-api` 0.7.0 and the `shedcloud-api-go` Partner
35
+ API changelog entry (2026-07-25).
36
+
3
37
  ## 0.2.0 — 2026-07-19
4
38
 
5
39
  - **Site events** — `client.site_events.track`, `list`, and `each` for
data/README.md CHANGED
@@ -108,7 +108,12 @@ quote = client.quotes.create(
108
108
 
109
109
  client.orders.update(
110
110
  order['id'],
111
- { customerPhone: '555-0100' },
111
+ {
112
+ customerPhone: '555-0100'
113
+ # Optional Sold-by fields (camelCase on the wire):
114
+ # saleDate: '2026-07-15', # or nil to clear
115
+ # soldPricing: { total: 12_500 } # partial; nil clears all
116
+ },
112
117
  options: ShedCloud::PartnerApi::RequestOptions.with_if_match(order['version'])
113
118
  )
114
119
  ```
@@ -11,6 +11,7 @@ module ShedCloud
11
11
  :orders,
12
12
  :work_orders,
13
13
  :locations,
14
+ :location_budgets,
14
15
  :customers,
15
16
  :domains,
16
17
  :agreements,
@@ -50,6 +51,7 @@ module ShedCloud
50
51
  @orders = Resources::Orders.new(@http)
51
52
  @work_orders = Resources::WorkOrders.new(@http)
52
53
  @locations = Resources::Locations.new(@http)
54
+ @location_budgets = Resources::LocationBudgets.new(@http)
53
55
  @customers = Resources::Customers.new(@http)
54
56
  @domains = Resources::Domains.new(@http)
55
57
  @agreements = Resources::Agreements.new(@http)
@@ -0,0 +1,30 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ShedCloud
4
+ module PartnerApi
5
+ module Resources
6
+ class LocationBudgets < Base
7
+ def list(params = {})
8
+ @http.request('GET', '/partner/v1/location-budgets', query: params) || {}
9
+ end
10
+
11
+ def get(id)
12
+ @http.request('GET', "/partner/v1/location-budgets/#{path_segment(id)}") || {}
13
+ end
14
+
15
+ def create(body, options: nil)
16
+ @http.request(
17
+ 'POST',
18
+ '/partner/v1/location-budgets',
19
+ body: body,
20
+ headers: option_headers(options),
21
+ ) || {}
22
+ end
23
+
24
+ def update(id, body)
25
+ @http.request('PUT', "/partner/v1/location-budgets/#{path_segment(id)}", body: body) || {}
26
+ end
27
+ end
28
+ end
29
+ end
30
+ end
@@ -14,6 +14,8 @@ module ShedCloud
14
14
  WORK_ORDERS_WRITE = 'partner-api.work-orders.write'
15
15
  LOCATIONS_READ = 'partner-api.locations.read'
16
16
  LOCATIONS_WRITE = 'partner-api.locations.write'
17
+ LOCATION_BUDGETS_READ = 'partner-api.location-budgets.read'
18
+ LOCATION_BUDGETS_WRITE = 'partner-api.location-budgets.write'
17
19
  CUSTOMERS_READ = 'partner-api.customers.read'
18
20
  CUSTOMERS_WRITE = 'partner-api.customers.write'
19
21
  PRODUCTS_READ = 'partner-api.products.read'
@@ -43,6 +45,8 @@ module ShedCloud
43
45
  WORK_ORDERS_WRITE,
44
46
  LOCATIONS_READ,
45
47
  LOCATIONS_WRITE,
48
+ LOCATION_BUDGETS_READ,
49
+ LOCATION_BUDGETS_WRITE,
46
50
  CUSTOMERS_READ,
47
51
  CUSTOMERS_WRITE,
48
52
  PRODUCTS_READ,
@@ -2,6 +2,6 @@
2
2
 
3
3
  module ShedCloud
4
4
  module PartnerApi
5
- VERSION = '0.2.1'
5
+ VERSION = '0.4.0'
6
6
  end
7
7
  end
@@ -18,6 +18,7 @@ require_relative 'partner_api/resources/quotes'
18
18
  require_relative 'partner_api/resources/orders'
19
19
  require_relative 'partner_api/resources/work_orders'
20
20
  require_relative 'partner_api/resources/locations'
21
+ require_relative 'partner_api/resources/location_budgets'
21
22
  require_relative 'partner_api/resources/customers'
22
23
  require_relative 'partner_api/resources/domains'
23
24
  require_relative 'partner_api/resources/agreements'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shedcloud-partner_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Corland Partners LLC
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-07-23 00:00:00.000000000 Z
11
+ date: 2026-07-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -71,6 +71,7 @@ files:
71
71
  - lib/shedcloud/partner_api/resources/domains.rb
72
72
  - lib/shedcloud/partner_api/resources/events.rb
73
73
  - lib/shedcloud/partner_api/resources/leads.rb
74
+ - lib/shedcloud/partner_api/resources/location_budgets.rb
74
75
  - lib/shedcloud/partner_api/resources/locations.rb
75
76
  - lib/shedcloud/partner_api/resources/lot_stock.rb
76
77
  - lib/shedcloud/partner_api/resources/orders.rb