jbr 3.12.0 → 3.13.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: c97671522675aa1f7ae29743d5edb7188a49251adb4d485c50b144bfa64f27cf
4
- data.tar.gz: 12c24e22c88f4880ed86c6b8377b34dafda2939e6ffd46b95a2f329cdcbc8c03
3
+ metadata.gz: eff06d450e1e4c357e208ca25d49eec46229009623dac5fab0d2316784b10ddc
4
+ data.tar.gz: 85cd26058f5eec17b84f143e61c1d366f2ac7702d44d0cd8b6fb80694041f6d3
5
5
  SHA512:
6
- metadata.gz: 814518f518e0a4fb14f738462991b675c2f249f88e652fa76cb36e4685d00fd393250d8b4ec12256541ddd5318ecb30b23c712384fda2a6ee588b0ff2c2ba1fb
7
- data.tar.gz: 9d8755f3c9ccab26b72f18d76d465f23fd949bf36b2f5d2dfe2a3a96d6f99d500c5e8fefb9ab019044205934dd0eb6dd1111762853087a9605e40257e13490f5
6
+ metadata.gz: 8cef0ee9b3d02ec476d890d6d34367d896e77ab374fa75f923d77fb6535415c3958c43aefea6ee7512e09606eb75cf92583c8c0ddf79e2ccf7d111b49a858af4
7
+ data.tar.gz: 1bdaf92404d72cf9ad5abaf26711e9cba47fa0054e1ab1e4b53114bfe0d157ed073959783ef8a23cdf101ac6ea95da798ca0e4723ffb06d907600b3857018aef
data/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ ## [3.13.0] - 2026-08-31
2
+
3
+ - [New] `Jbr::LineItem#id`, `#description` and `#amount`, beside the `#quantity` and `#name` a
4
+ line already answered. The ID is how an app tells a line it has seen before from a new one,
5
+ the description is what the line says beyond what it is called, and the amount is what
6
+ Jobber calls `totalPrice`. Every query that lists lines now asks for all five, and a mocked
7
+ line answers whatever a test names for each
8
+
1
9
  ## [3.12.0] - 2026-08-28
2
10
 
3
11
  - [New] `Jbr::Account#name` and `#phone`, beside the `#id` it already answered. An app storing
data/README.md CHANGED
@@ -159,7 +159,10 @@ job.line_items # => an Array of the lines the job is made of
159
159
  line = job.line_items.first
160
160
  line.quantity # => 3, whole where Jobber's own Float has nothing after the point, and 3.5
161
161
  # where it has: `3 Faucets`, or `3.5 Hours` for what was really billed
162
+ line.id # => 'Njc5MjAw', the ID Jobber files the line by
162
163
  line.name # => 'Bathroom Faucet Installation'
164
+ line.description # => 'Replace washers and reseat', what the line says beyond its name
165
+ line.amount # => 285.0, what the line comes to -- what Jobber calls totalPrice
163
166
  line.to_s # => '3 Bathroom Faucet Installation', how many of what, and the name alone where
164
167
  # Jobber holds no quantity for the line
165
168
  ```
data/lib/jbr/line_item.rb CHANGED
@@ -1,8 +1,10 @@
1
1
  module Jbr
2
- # One line of the work a job is made of: how many of a thing, and what it is called.
2
+ # One line of the work a job is made of: how many of a thing, what it is called,
3
+ # what it says, and what it comes to.
3
4
  class LineItem < Resource
4
- # What Jobber calls each field of a line.
5
- FIELDS = %w[quantity name]
5
+ # What Jobber calls each field of a line. The ID reads through {Resource#id}, so an app
6
+ # can tell a line it has seen before from a new one.
7
+ FIELDS = %w[id quantity name description totalPrice]
6
8
 
7
9
  # The most lines to read off one record. Bounded because Jobber prices a connection by the
8
10
  # page it is asked for and prices an unbounded one at its own maximum, so the lines of a
@@ -22,6 +24,12 @@ module Jbr
22
24
  # @return [String, nil] what the line is called.
23
25
  def name = @node['name']
24
26
 
27
+ # @return [String, nil] what the line says, beyond what it is called.
28
+ def description = @node['description']
29
+
30
+ # @return [Float, nil] what the line comes to — what Jobber calls `totalPrice`.
31
+ def amount = @node['totalPrice']
32
+
25
33
  # @return [String] how many of what: `3 Bathroom Faucet Installation`, and the name alone
26
34
  # where Jobber holds no quantity for the line.
27
35
  def to_s = [ quantity, name ].compact.join ' '
@@ -3,8 +3,14 @@ module Jbr
3
3
  class Mock::LineItem < LineItem
4
4
  # @return [Object, nil] the values the app asked for. The quantity is still read whole,
5
5
  # so an app that mocks `3.0` of a thing sees the `3` a page would show.
6
+ def id = @node[:id]
7
+
6
8
  def quantity = whole @node[:quantity]
7
9
 
8
10
  def name = @node[:name]
11
+
12
+ def description = @node[:description]
13
+
14
+ def amount = @node[:amount]
9
15
  end
10
16
  end
data/lib/jbr/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # A Ruby client for the Jobber API.
2
2
  module Jbr
3
3
  # The version of this gem.
4
- VERSION = '3.12.0'
4
+ VERSION = '3.13.0'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jbr
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.12.0
4
+ version: 3.13.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Claudio Baccigalupo