company 3.1.0 → 4.0.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 +20 -0
- data/README.md +5 -2
- data/lib/company/collection.rb +7 -4
- data/lib/company/collections/windows.rb +2 -2
- data/lib/company/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b4111f113a38cb47e0a7dcaeeb408f7a3bc3bfb112b53c756fd205e16c9f02da
|
|
4
|
+
data.tar.gz: '089082bab80c938007b47807f044d52247c65dc2885682a2f3a1c764947f72b3'
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 64b0d8713cc0d6b0cbe7deedcf6a3361dccec22b529375d36509374e83ef1c5ca21c1307e6374d12b38bc125247877f93c5c3e73e5bf65a24e4c1f463129ec8a
|
|
7
|
+
data.tar.gz: 0a10c7540536d401f17c6e1adea9f34bbecb08b5aa4e1da737f6098968bcde7acb2cb208b763f7cd90b5e235d34e8c4e2cb37807c9f0bb7573ff8b35f906ac29
|
data/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,26 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
For more information about changelogs, check [Keep a Changelog](http://keepachangelog.com) and
|
|
6
6
|
[Vandamme](http://tech-angels.github.io/vandamme).
|
|
7
7
|
|
|
8
|
+
## 4.0.0 - 2026-09-17
|
|
9
|
+
|
|
10
|
+
- [Breaking change] `of` takes the ID a platform files a technician under rather than the
|
|
11
|
+
technician: `account.visits.of(technician.id)` is what `account.visits.of(technician)` was.
|
|
12
|
+
The ID is the whole of what any platform narrows by -- every gem read `.id` off the object
|
|
13
|
+
and nothing else -- and taking it plainly is what stops a caller holding a record of its own
|
|
14
|
+
from dressing it up as a technician it does not have.
|
|
15
|
+
|
|
16
|
+
- [Note] The object invited a mistake that has already been made. An app passing its own
|
|
17
|
+
technician row had its database ID sent as the platform's, and the platform answered with
|
|
18
|
+
everybody's work rather than one person's -- quietly, and correctly as far as it knew. Named
|
|
19
|
+
as an ID, that is not something a caller can write by accident.
|
|
20
|
+
|
|
21
|
+
## 3.1.0 - 2026-09-17
|
|
22
|
+
|
|
23
|
+
- [Feature] `account.visits.for_work`, the stops of jobs and of leads together and the hours
|
|
24
|
+
held around them let go. A caller wanting both kinds had to ask twice and put the two lists
|
|
25
|
+
back together; a platform that files blocked-out time apart, and charges a sweep of every
|
|
26
|
+
page to read it, is now spared the sweep instead.
|
|
27
|
+
|
|
8
28
|
## 3.0.0 - 2026-09-16
|
|
9
29
|
|
|
10
30
|
- [Breaking change] `Collection#assigned_to` is `Collection#of`. It read as it should on booked
|
data/README.md
CHANGED
|
@@ -100,10 +100,10 @@ technician.id # => 't1'
|
|
|
100
100
|
technician.name # => 'Grace'
|
|
101
101
|
technician.surname # => 'Hopper'
|
|
102
102
|
|
|
103
|
-
week = account.visits.between(monday, sunday).of(technician)
|
|
103
|
+
week = account.visits.between(monday, sunday).of(technician.id)
|
|
104
104
|
week.ids # => ['v1', 'v2', ...]
|
|
105
105
|
|
|
106
|
-
free = account.windows.between(monday, sunday).of(technician)
|
|
106
|
+
free = account.windows.between(monday, sunday).of(technician.id)
|
|
107
107
|
free.first.starts_at # => 2026-09-16 13:00:00 UTC
|
|
108
108
|
free.first.ends_at # => 2026-09-16 17:00:00 UTC
|
|
109
109
|
|
|
@@ -130,6 +130,9 @@ priced yet -- Jobber calls it an assessment, Housecall Pro an estimate -- names
|
|
|
130
130
|
the same. `quote` stays the price, which is the other half of what Housecall Pro files as one
|
|
131
131
|
record.
|
|
132
132
|
|
|
133
|
+
`for_jobs`, `for_leads` and `for_work` narrow by what a stop was booked against: one kind, the
|
|
134
|
+
other, or both and not the hours held around them.
|
|
135
|
+
|
|
133
136
|
A window is the other half of the same question: not the hours somebody is out, but the ones
|
|
134
137
|
they are not. It names no work and nobody going, a list of them having been narrowed to one
|
|
135
138
|
technician already, and it is as long as it is -- cut it into offerable pieces where an offer is
|
data/lib/company/collection.rb
CHANGED
|
@@ -28,12 +28,15 @@ module Company
|
|
|
28
28
|
def includes(*names) = self
|
|
29
29
|
|
|
30
30
|
# A platform that can ask its server for one technician's work narrows the list there; one
|
|
31
|
-
# that cannot walks the list and keeps what
|
|
32
|
-
#
|
|
31
|
+
# that cannot walks the list and keeps what they turn out to be on. It takes the ID the
|
|
32
|
+
# platform files them under rather than the technician, that being the whole of what any
|
|
33
|
+
# platform asks by: a caller holding a record of its own then names the ID it knows, rather
|
|
34
|
+
# than dressing it up as a technician it does not have.
|
|
35
|
+
# @param id [String] ID the platform files whoever the work is booked for under.
|
|
33
36
|
# @return [Collection] the same list, narrowed to theirs.
|
|
34
|
-
def of(
|
|
37
|
+
def of(id)
|
|
35
38
|
Selection.new(collection: self) do |record|
|
|
36
|
-
record.technicians.any? { |
|
|
39
|
+
record.technicians.any? { |technician| technician.id == id }
|
|
37
40
|
end
|
|
38
41
|
end
|
|
39
42
|
|
|
@@ -7,9 +7,9 @@ module Company
|
|
|
7
7
|
# A window names nobody, a list of them having been narrowed to one technician already, so
|
|
8
8
|
# there is nothing here to walk and keep: only the platform can tell one person's free time
|
|
9
9
|
# from another's.
|
|
10
|
-
# @param
|
|
10
|
+
# @param id [String] ID the platform files whoever is free under.
|
|
11
11
|
# @return [Windows] the same list, as that technician's alone.
|
|
12
|
-
def of(
|
|
12
|
+
def of(id)
|
|
13
13
|
raise NotImplementedError, "#{self.class} does not answer one technician's windows"
|
|
14
14
|
end
|
|
15
15
|
end
|
data/lib/company/version.rb
CHANGED