crisphive 0.2.0 → 0.3.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/README.md +98 -10
- data/lib/crisphive/api/business_skill_api.rb +348 -0
- data/lib/crisphive/api/customer_api.rb +7 -4
- data/lib/crisphive/api/job_request_business_api.rb +243 -27
- data/lib/crisphive/api/job_types_api.rb +208 -0
- data/lib/crisphive/api/permission_api.rb +79 -0
- data/lib/crisphive/api/service_area_api.rb +208 -0
- data/lib/crisphive/api/technician_api.rb +8 -8
- data/lib/crisphive/api/technician_time_off_api.rb +240 -0
- data/lib/crisphive/api/vehicle_api.rb +208 -0
- data/lib/crisphive/api/webhooks_api.rb +213 -0
- data/lib/crisphive/models/api_internal_techtimeoff_actions.rb +232 -0
- data/lib/crisphive/models/api_internal_techtimeoff_status.rb +42 -0
- data/lib/crisphive/models/assignable_group.rb +289 -0
- data/lib/crisphive/models/book_and_confirm_job_request200_response.rb +253 -0
- data/lib/crisphive/models/commit_absence_resolve200_response.rb +253 -0
- data/lib/crisphive/models/create_job_type200_response.rb +253 -0
- data/lib/crisphive/models/create_service_area200_response.rb +253 -0
- data/lib/crisphive/models/create_skill200_response.rb +253 -0
- data/lib/crisphive/models/create_skill_category200_response.rb +253 -0
- data/lib/crisphive/models/create_technician_time_off200_response.rb +253 -0
- data/lib/crisphive/models/create_vehicle200_response.rb +253 -0
- data/lib/crisphive/models/create_webhook_endpoint200_response.rb +253 -0
- data/lib/crisphive/models/customer.rb +11 -1
- data/lib/crisphive/models/customer_contact.rb +25 -5
- data/lib/crisphive/models/customer_create_request.rb +12 -2
- data/lib/crisphive/models/customer_list_item.rb +11 -1
- data/lib/crisphive/models/customer_quick_books_link.rb +235 -0
- data/lib/crisphive/models/customer_service_area_ref.rb +225 -0
- data/lib/crisphive/models/customer_technician_ref.rb +225 -0
- data/lib/crisphive/models/customer_update_request.rb +23 -20
- data/lib/crisphive/models/internal_jobrequest_http_address_req.rb +475 -0
- data/lib/crisphive/models/job_request.rb +11 -1
- data/lib/crisphive/models/job_request_absence_alternative.rb +356 -0
- data/lib/crisphive/models/job_request_absence_alternative_cost.rb +275 -0
- data/lib/crisphive/models/job_request_absence_assignment.rb +319 -0
- data/lib/crisphive/models/job_request_absence_commit_request.rb +296 -0
- data/lib/crisphive/models/job_request_absence_notification.rb +283 -0
- data/lib/crisphive/models/job_request_absence_plan.rb +322 -0
- data/lib/crisphive/models/job_request_absence_preview_request.rb +280 -0
- data/lib/crisphive/models/job_request_absence_resolved_job.rb +499 -0
- data/lib/crisphive/models/job_request_absence_solver.rb +289 -0
- data/lib/crisphive/models/job_request_absence_time_off.rb +281 -0
- data/lib/crisphive/models/job_request_absence_unresolved_job.rb +364 -0
- data/lib/crisphive/models/job_request_action_summary.rb +1 -1
- data/lib/crisphive/models/job_request_attention_summary.rb +2 -2
- data/lib/crisphive/models/job_request_blocker.rb +363 -0
- data/lib/crisphive/models/job_request_blocker_ref.rb +223 -0
- data/lib/crisphive/models/job_request_book_and_confirm_customer.rb +302 -0
- data/lib/crisphive/models/job_request_book_and_confirm_emergency.rb +315 -0
- data/lib/crisphive/models/job_request_book_and_confirm_emergency_result.rb +279 -0
- data/lib/crisphive/models/job_request_book_and_confirm_refusal.rb +280 -0
- data/lib/crisphive/models/job_request_book_and_confirm_request.rb +466 -0
- data/lib/crisphive/models/job_request_book_and_confirm_response.rb +295 -0
- data/lib/crisphive/models/job_request_confirm_request.rb +14 -4
- data/lib/crisphive/models/job_request_create_request.rb +1 -1
- data/lib/crisphive/models/job_request_emergency_candidate.rb +26 -4
- data/lib/crisphive/models/job_request_emergency_candidates.rb +1 -1
- data/lib/crisphive/models/job_request_emergency_candidates_request.rb +24 -11
- data/lib/crisphive/models/job_request_emergency_commit_request.rb +11 -1
- data/lib/crisphive/models/job_request_emergency_inline_job.rb +353 -0
- data/lib/crisphive/models/job_request_emergency_plan.rb +25 -3
- data/lib/crisphive/models/job_request_emergency_preview_request.rb +24 -11
- data/lib/crisphive/models/job_request_move_commit_req.rb +11 -1
- data/lib/crisphive/models/job_request_move_plan.rb +11 -1
- data/lib/crisphive/models/job_request_move_preview_req.rb +11 -1
- data/lib/crisphive/models/job_request_move_warning.rb +32 -8
- data/lib/crisphive/models/job_request_priority_update_result.rb +217 -0
- data/lib/crisphive/models/job_request_quote_request.rb +14 -11
- data/lib/crisphive/models/job_request_reassign_fallback.rb +287 -0
- data/lib/crisphive/models/job_request_skill_summary.rb +1 -1
- data/lib/crisphive/models/job_request_status_summary.rb +1 -1
- data/lib/crisphive/models/job_request_time_segments.rb +2 -2
- data/lib/crisphive/models/job_type.rb +42 -2
- data/lib/crisphive/models/job_type_create_request.rb +399 -0
- data/lib/crisphive/models/job_type_create_response.rb +215 -0
- data/lib/crisphive/models/job_type_update_request.rb +400 -0
- data/lib/crisphive/models/list_assignable_groups200_response.rb +255 -0
- data/lib/crisphive/models/list_technician_time_off200_response.rb +253 -0
- data/lib/crisphive/models/list_webhook_event_types200_response.rb +255 -0
- data/lib/crisphive/models/quote_job_request200_response.rb +253 -0
- data/lib/crisphive/models/service_area.rb +21 -1
- data/lib/crisphive/models/service_area_create_request.rb +455 -0
- data/lib/crisphive/models/service_area_create_response.rb +215 -0
- data/lib/crisphive/models/service_area_update_request.rb +451 -0
- data/lib/crisphive/models/skill_category_create_request.rb +270 -0
- data/lib/crisphive/models/skill_category_create_response.rb +215 -0
- data/lib/crisphive/models/skill_create_request.rb +270 -0
- data/lib/crisphive/models/skill_create_response.rb +215 -0
- data/lib/crisphive/models/skill_update_request.rb +281 -0
- data/lib/crisphive/models/technician.rb +64 -2
- data/lib/crisphive/models/technician_create_request.rb +14 -11
- data/lib/crisphive/models/technician_time_off.rb +334 -0
- data/lib/crisphive/models/technician_time_off_create_request.rb +285 -0
- data/lib/crisphive/models/technician_time_off_create_response.rb +215 -0
- data/lib/crisphive/models/technician_time_off_list.rb +246 -0
- data/lib/crisphive/models/technician_update_request.rb +2 -2
- data/lib/crisphive/models/vehicle_create_request.rb +420 -0
- data/lib/crisphive/models/vehicle_create_response.rb +215 -0
- data/lib/crisphive/models/vehicle_update_request.rb +440 -0
- data/lib/crisphive/models/webhook_create_request.rb +320 -0
- data/lib/crisphive/models/webhook_create_response.rb +391 -0
- data/lib/crisphive/models/webhook_verification.rb +235 -0
- data/lib/crisphive/version.rb +1 -1
- data/lib/crisphive.rb +66 -0
- metadata +68 -2
|
@@ -0,0 +1,287 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Crisphive Developer API
|
|
3
|
+
|
|
4
|
+
#Public REST API for integrating Crisphive from your own backend. Authenticate every request with a secret API key as a Bearer token (`Authorization: Bearer chsk_live_…`). The key prefix selects the data environment: `chsk_live_…` → production (live), `chsk_test_…` → sandbox (isolated test). **Key scopes (restricted keys).** A key is either *full-access* (can call every endpoint below) or *restricted* to a set of permission codes chosen at creation — the same codes as the dashboard permission grid (e.g. `customers_view`, `job_create`, `team_manage`). A restricted key calling an endpoint outside its scope gets `403`. The full code list is the permission catalog (`GET /permission/modules` on the dashboard API). Create, scope, and revoke keys from the business dashboard. Every response is wrapped in the envelope `{ \"error_code\": 0, \"message\": \"Success\", \"data\": <payload> }`.
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.11.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module Crisphive
|
|
17
|
+
class JobRequestReassignFallback
|
|
18
|
+
# How many alternates the engine offered BEFORE in-plan occupancy was applied. 0 = nobody qualified/free at all; >0 = qualified alternates existed but each was taken by another displaced job in this same plan. The coordinator's fix differs between the two, so the count is served rather than folded into the code.
|
|
19
|
+
attr_accessor :feasible_count
|
|
20
|
+
|
|
21
|
+
attr_accessor :job_id
|
|
22
|
+
|
|
23
|
+
# Human sentence, window already rendered in the business timezone.
|
|
24
|
+
attr_accessor :message
|
|
25
|
+
|
|
26
|
+
# NO_QUALIFIED_TECH_FREE: the planner found no alternate for this window. JOB_UNREADABLE: the job's row could not be loaded, so no alternate was even considered — transient, worth retrying, unlike the other codes.
|
|
27
|
+
attr_accessor :reason_code
|
|
28
|
+
|
|
29
|
+
attr_accessor :short_code
|
|
30
|
+
|
|
31
|
+
class EnumAttributeValidator
|
|
32
|
+
attr_reader :datatype
|
|
33
|
+
attr_reader :allowable_values
|
|
34
|
+
|
|
35
|
+
def initialize(datatype, allowable_values)
|
|
36
|
+
@allowable_values = allowable_values.map do |value|
|
|
37
|
+
case datatype.to_s
|
|
38
|
+
when /Integer/i
|
|
39
|
+
value.to_i
|
|
40
|
+
when /Float/i
|
|
41
|
+
value.to_f
|
|
42
|
+
else
|
|
43
|
+
value
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
def valid?(value)
|
|
49
|
+
!value || allowable_values.include?(value)
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
54
|
+
def self.attribute_map
|
|
55
|
+
{
|
|
56
|
+
:'feasible_count' => :'feasible_count',
|
|
57
|
+
:'job_id' => :'job_id',
|
|
58
|
+
:'message' => :'message',
|
|
59
|
+
:'reason_code' => :'reason_code',
|
|
60
|
+
:'short_code' => :'short_code'
|
|
61
|
+
}
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
# Returns all the JSON keys this model knows about
|
|
65
|
+
def self.acceptable_attributes
|
|
66
|
+
attribute_map.values
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
# Attribute type mapping.
|
|
70
|
+
def self.openapi_types
|
|
71
|
+
{
|
|
72
|
+
:'feasible_count' => :'Integer',
|
|
73
|
+
:'job_id' => :'String',
|
|
74
|
+
:'message' => :'String',
|
|
75
|
+
:'reason_code' => :'String',
|
|
76
|
+
:'short_code' => :'String'
|
|
77
|
+
}
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
# List of attributes with nullable: true
|
|
81
|
+
def self.openapi_nullable
|
|
82
|
+
Set.new([
|
|
83
|
+
])
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
# Initializes the object
|
|
87
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
88
|
+
def initialize(attributes = {})
|
|
89
|
+
if (!attributes.is_a?(Hash))
|
|
90
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Crisphive::JobRequestReassignFallback` initialize method"
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
94
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
95
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
|
96
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Crisphive::JobRequestReassignFallback`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
|
97
|
+
end
|
|
98
|
+
h[k.to_sym] = v
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
if attributes.key?(:'feasible_count')
|
|
102
|
+
self.feasible_count = attributes[:'feasible_count']
|
|
103
|
+
end
|
|
104
|
+
|
|
105
|
+
if attributes.key?(:'job_id')
|
|
106
|
+
self.job_id = attributes[:'job_id']
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
if attributes.key?(:'message')
|
|
110
|
+
self.message = attributes[:'message']
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
if attributes.key?(:'reason_code')
|
|
114
|
+
self.reason_code = attributes[:'reason_code']
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
if attributes.key?(:'short_code')
|
|
118
|
+
self.short_code = attributes[:'short_code']
|
|
119
|
+
end
|
|
120
|
+
end
|
|
121
|
+
|
|
122
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
123
|
+
# @return Array for valid properties with the reasons
|
|
124
|
+
def list_invalid_properties
|
|
125
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
126
|
+
invalid_properties = Array.new
|
|
127
|
+
invalid_properties
|
|
128
|
+
end
|
|
129
|
+
|
|
130
|
+
# Check to see if the all the properties in the model are valid
|
|
131
|
+
# @return true if the model is valid
|
|
132
|
+
def valid?
|
|
133
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
134
|
+
reason_code_validator = EnumAttributeValidator.new('String', ["NO_QUALIFIED_TECH_FREE", "JOB_UNREADABLE"])
|
|
135
|
+
return false unless reason_code_validator.valid?(@reason_code)
|
|
136
|
+
true
|
|
137
|
+
end
|
|
138
|
+
|
|
139
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
140
|
+
# @param [Object] reason_code Object to be assigned
|
|
141
|
+
def reason_code=(reason_code)
|
|
142
|
+
validator = EnumAttributeValidator.new('String', ["NO_QUALIFIED_TECH_FREE", "JOB_UNREADABLE"])
|
|
143
|
+
unless validator.valid?(reason_code)
|
|
144
|
+
fail ArgumentError, "invalid value for \"reason_code\", must be one of #{validator.allowable_values}."
|
|
145
|
+
end
|
|
146
|
+
@reason_code = reason_code
|
|
147
|
+
end
|
|
148
|
+
|
|
149
|
+
# Checks equality by comparing each attribute.
|
|
150
|
+
# @param [Object] Object to be compared
|
|
151
|
+
def ==(o)
|
|
152
|
+
return true if self.equal?(o)
|
|
153
|
+
self.class == o.class &&
|
|
154
|
+
feasible_count == o.feasible_count &&
|
|
155
|
+
job_id == o.job_id &&
|
|
156
|
+
message == o.message &&
|
|
157
|
+
reason_code == o.reason_code &&
|
|
158
|
+
short_code == o.short_code
|
|
159
|
+
end
|
|
160
|
+
|
|
161
|
+
# @see the `==` method
|
|
162
|
+
# @param [Object] Object to be compared
|
|
163
|
+
def eql?(o)
|
|
164
|
+
self == o
|
|
165
|
+
end
|
|
166
|
+
|
|
167
|
+
# Calculates hash code according to all attributes.
|
|
168
|
+
# @return [Integer] Hash code
|
|
169
|
+
def hash
|
|
170
|
+
[feasible_count, job_id, message, reason_code, short_code].hash
|
|
171
|
+
end
|
|
172
|
+
|
|
173
|
+
# Builds the object from hash
|
|
174
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
175
|
+
# @return [Object] Returns the model itself
|
|
176
|
+
def self.build_from_hash(attributes)
|
|
177
|
+
return nil unless attributes.is_a?(Hash)
|
|
178
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
179
|
+
transformed_hash = {}
|
|
180
|
+
openapi_types.each_pair do |key, type|
|
|
181
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
182
|
+
transformed_hash["#{key}"] = nil
|
|
183
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
184
|
+
# check to ensure the input is an array given that the attribute
|
|
185
|
+
# is documented as an array but the input is not
|
|
186
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
187
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
188
|
+
end
|
|
189
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
190
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
191
|
+
end
|
|
192
|
+
end
|
|
193
|
+
new(transformed_hash)
|
|
194
|
+
end
|
|
195
|
+
|
|
196
|
+
# Deserializes the data based on type
|
|
197
|
+
# @param string type Data type
|
|
198
|
+
# @param string value Value to be deserialized
|
|
199
|
+
# @return [Object] Deserialized data
|
|
200
|
+
def self._deserialize(type, value)
|
|
201
|
+
case type.to_sym
|
|
202
|
+
when :Time
|
|
203
|
+
Time.parse(value)
|
|
204
|
+
when :Date
|
|
205
|
+
Date.parse(value)
|
|
206
|
+
when :String
|
|
207
|
+
value.to_s
|
|
208
|
+
when :Integer
|
|
209
|
+
value.to_i
|
|
210
|
+
when :Float
|
|
211
|
+
value.to_f
|
|
212
|
+
when :Boolean
|
|
213
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
214
|
+
true
|
|
215
|
+
else
|
|
216
|
+
false
|
|
217
|
+
end
|
|
218
|
+
when :Object
|
|
219
|
+
# generic object (usually a Hash), return directly
|
|
220
|
+
value
|
|
221
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
222
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
223
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
224
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
225
|
+
k_type = Regexp.last_match[:k_type]
|
|
226
|
+
v_type = Regexp.last_match[:v_type]
|
|
227
|
+
{}.tap do |hash|
|
|
228
|
+
value.each do |k, v|
|
|
229
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
230
|
+
end
|
|
231
|
+
end
|
|
232
|
+
else # model
|
|
233
|
+
# models (e.g. Pet) or oneOf
|
|
234
|
+
klass = Crisphive.const_get(type)
|
|
235
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
236
|
+
end
|
|
237
|
+
end
|
|
238
|
+
|
|
239
|
+
# Returns the string representation of the object
|
|
240
|
+
# @return [String] String presentation of the object
|
|
241
|
+
def to_s
|
|
242
|
+
to_hash.to_s
|
|
243
|
+
end
|
|
244
|
+
|
|
245
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
246
|
+
# @return [Hash] Returns the object in the form of hash
|
|
247
|
+
def to_body
|
|
248
|
+
to_hash
|
|
249
|
+
end
|
|
250
|
+
|
|
251
|
+
# Returns the object in the form of hash
|
|
252
|
+
# @return [Hash] Returns the object in the form of hash
|
|
253
|
+
def to_hash
|
|
254
|
+
hash = {}
|
|
255
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
256
|
+
value = self.send(attr)
|
|
257
|
+
if value.nil?
|
|
258
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
259
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
260
|
+
end
|
|
261
|
+
|
|
262
|
+
hash[param] = _to_hash(value)
|
|
263
|
+
end
|
|
264
|
+
hash
|
|
265
|
+
end
|
|
266
|
+
|
|
267
|
+
# Outputs non-array value in the form of hash
|
|
268
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
269
|
+
# @param [Object] value Any valid value
|
|
270
|
+
# @return [Hash] Returns the value in the form of hash
|
|
271
|
+
def _to_hash(value)
|
|
272
|
+
if value.is_a?(Array)
|
|
273
|
+
value.compact.map { |v| _to_hash(v) }
|
|
274
|
+
elsif value.is_a?(Hash)
|
|
275
|
+
{}.tap do |hash|
|
|
276
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
277
|
+
end
|
|
278
|
+
elsif value.respond_to? :to_hash
|
|
279
|
+
value.to_hash
|
|
280
|
+
else
|
|
281
|
+
value
|
|
282
|
+
end
|
|
283
|
+
end
|
|
284
|
+
|
|
285
|
+
end
|
|
286
|
+
|
|
287
|
+
end
|
|
@@ -27,7 +27,7 @@ module Crisphive
|
|
|
27
27
|
# Whether the skill is currently active.
|
|
28
28
|
attr_accessor :is_active
|
|
29
29
|
|
|
30
|
-
# Skill display name (resolved to the request locale).
|
|
30
|
+
# Skill display name (canonical; skill names carry no locale translations, so this is NOT resolved to the request locale).
|
|
31
31
|
attr_accessor :name
|
|
32
32
|
|
|
33
33
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
@@ -15,7 +15,7 @@ require 'time'
|
|
|
15
15
|
|
|
16
16
|
module Crisphive
|
|
17
17
|
class JobRequestStatusSummary
|
|
18
|
-
# Status display name
|
|
18
|
+
# Status display name as authored on the workflow (canonical; NOT resolved to the request locale).
|
|
19
19
|
attr_accessor :display_name
|
|
20
20
|
|
|
21
21
|
# Workflow status key (the business's workflow defines the set; first is always \"booking\", last always \"completed\").
|
|
@@ -27,10 +27,10 @@ module Crisphive
|
|
|
27
27
|
# IANA timezone of the customer (customer-facing slot times render in this zone).
|
|
28
28
|
attr_accessor :customer_timezone
|
|
29
29
|
|
|
30
|
-
# Offerable days in date order, each with its slot grid. Only slots with at least one feasible technician are offered.
|
|
30
|
+
# Offerable days in date order, each with its slot grid. Only future slots with at least one feasible technician are offered.
|
|
31
31
|
attr_accessor :days
|
|
32
32
|
|
|
33
|
-
#
|
|
33
|
+
# True when the customer's originally chosen dates yield NO offerable slot — either they are already in the past, or no technician is available on them. `days` then holds fresh SUGGESTED days instead: the same time-of-day periods, scanned from the day after their last chosen date (never before today) across at most 7 days, offering the first 3 days that have availability (may be empty when nothing was found — tell the customer no alternative exists within the week). The FE should surface that their chosen dates didn't work out and these are new suggestions.
|
|
34
34
|
attr_accessor :is_suggested
|
|
35
35
|
|
|
36
36
|
# Job identifier — the human-readable short code when present, else the job UUID.
|
|
@@ -21,10 +21,22 @@ module Crisphive
|
|
|
21
21
|
# When the job type was created (RFC3339).
|
|
22
22
|
attr_accessor :created_at
|
|
23
23
|
|
|
24
|
+
# Default demobilization minutes applied with the default duration. Absent = none.
|
|
25
|
+
attr_accessor :default_demobilization_minutes
|
|
26
|
+
|
|
27
|
+
# Default work duration in minutes used when a quote omits job_duration_minutes. Absent = no default: a quote for this type must send a duration.
|
|
28
|
+
attr_accessor :default_duration_minutes
|
|
29
|
+
|
|
30
|
+
# Default mobilization minutes applied with the default duration. Absent = none.
|
|
31
|
+
attr_accessor :default_mobilization_minutes
|
|
32
|
+
|
|
24
33
|
# Job type UUID — the stable identifier used in every job-type endpoint.
|
|
25
34
|
attr_accessor :id
|
|
26
35
|
|
|
27
|
-
# True for
|
|
36
|
+
# True for the business's DEFAULT job type (the seeded \"General\"): a job booked without a job_type_id gets it, and a job with no job type is quoted from its default bundle. It cannot be deleted or deactivated and its default duration cannot be cleared (it can be changed). Exactly one per business per environment (live and sandbox each have their own).
|
|
37
|
+
attr_accessor :is_default
|
|
38
|
+
|
|
39
|
+
# True for platform-seeded system rows: their name and status cannot be modified and they cannot be deleted; their default quote bundle is editable.
|
|
28
40
|
attr_accessor :is_system
|
|
29
41
|
|
|
30
42
|
# Job type name, localized server-side to the request locale.
|
|
@@ -63,7 +75,11 @@ module Crisphive
|
|
|
63
75
|
{
|
|
64
76
|
:'business_id' => :'business_id',
|
|
65
77
|
:'created_at' => :'created_at',
|
|
78
|
+
:'default_demobilization_minutes' => :'default_demobilization_minutes',
|
|
79
|
+
:'default_duration_minutes' => :'default_duration_minutes',
|
|
80
|
+
:'default_mobilization_minutes' => :'default_mobilization_minutes',
|
|
66
81
|
:'id' => :'id',
|
|
82
|
+
:'is_default' => :'is_default',
|
|
67
83
|
:'is_system' => :'is_system',
|
|
68
84
|
:'name' => :'name',
|
|
69
85
|
:'status' => :'status',
|
|
@@ -81,7 +97,11 @@ module Crisphive
|
|
|
81
97
|
{
|
|
82
98
|
:'business_id' => :'String',
|
|
83
99
|
:'created_at' => :'Time',
|
|
100
|
+
:'default_demobilization_minutes' => :'Integer',
|
|
101
|
+
:'default_duration_minutes' => :'Integer',
|
|
102
|
+
:'default_mobilization_minutes' => :'Integer',
|
|
84
103
|
:'id' => :'String',
|
|
104
|
+
:'is_default' => :'Boolean',
|
|
85
105
|
:'is_system' => :'Boolean',
|
|
86
106
|
:'name' => :'String',
|
|
87
107
|
:'status' => :'String',
|
|
@@ -118,10 +138,26 @@ module Crisphive
|
|
|
118
138
|
self.created_at = attributes[:'created_at']
|
|
119
139
|
end
|
|
120
140
|
|
|
141
|
+
if attributes.key?(:'default_demobilization_minutes')
|
|
142
|
+
self.default_demobilization_minutes = attributes[:'default_demobilization_minutes']
|
|
143
|
+
end
|
|
144
|
+
|
|
145
|
+
if attributes.key?(:'default_duration_minutes')
|
|
146
|
+
self.default_duration_minutes = attributes[:'default_duration_minutes']
|
|
147
|
+
end
|
|
148
|
+
|
|
149
|
+
if attributes.key?(:'default_mobilization_minutes')
|
|
150
|
+
self.default_mobilization_minutes = attributes[:'default_mobilization_minutes']
|
|
151
|
+
end
|
|
152
|
+
|
|
121
153
|
if attributes.key?(:'id')
|
|
122
154
|
self.id = attributes[:'id']
|
|
123
155
|
end
|
|
124
156
|
|
|
157
|
+
if attributes.key?(:'is_default')
|
|
158
|
+
self.is_default = attributes[:'is_default']
|
|
159
|
+
end
|
|
160
|
+
|
|
125
161
|
if attributes.key?(:'is_system')
|
|
126
162
|
self.is_system = attributes[:'is_system']
|
|
127
163
|
end
|
|
@@ -173,7 +209,11 @@ module Crisphive
|
|
|
173
209
|
self.class == o.class &&
|
|
174
210
|
business_id == o.business_id &&
|
|
175
211
|
created_at == o.created_at &&
|
|
212
|
+
default_demobilization_minutes == o.default_demobilization_minutes &&
|
|
213
|
+
default_duration_minutes == o.default_duration_minutes &&
|
|
214
|
+
default_mobilization_minutes == o.default_mobilization_minutes &&
|
|
176
215
|
id == o.id &&
|
|
216
|
+
is_default == o.is_default &&
|
|
177
217
|
is_system == o.is_system &&
|
|
178
218
|
name == o.name &&
|
|
179
219
|
status == o.status &&
|
|
@@ -189,7 +229,7 @@ module Crisphive
|
|
|
189
229
|
# Calculates hash code according to all attributes.
|
|
190
230
|
# @return [Integer] Hash code
|
|
191
231
|
def hash
|
|
192
|
-
[business_id, created_at, id, is_system, name, status, updated_at].hash
|
|
232
|
+
[business_id, created_at, default_demobilization_minutes, default_duration_minutes, default_mobilization_minutes, id, is_default, is_system, name, status, updated_at].hash
|
|
193
233
|
end
|
|
194
234
|
|
|
195
235
|
# Builds the object from hash
|