Class: Hcp::Job
- Extended by:
- Queryable
- Includes:
- Scheduled, Statused, Timestamped
- Defined in:
- lib/hcp/resources/job.rb
Overview
Work a Housecall Pro user accepted: what it is, who it is for, and what it comes to.
Defined Under Namespace
Classes: Appointment, Invoice
Constant Summary collapse
- FILTERS =
What a list of jobs may be narrowed by, against the parameters Housecall Pro takes.
{ scheduled_at: %i[scheduled_start_min scheduled_start_max], ends_at: %i[scheduled_end_min scheduled_end_max], customer_id: %i[customer_id], employee_ids: %i[employee_ids], work_status: %i[work_status], location_ids: %i[location_ids], }
- MANY =
The conditions Housecall Pro takes more than one of, and refuses one of.
%i[employee_ids work_status location_ids]
- SORTS =
What Housecall Pro will put a list of jobs in order of.
%i[created_at updated_at invoice_number id description work_status]
- EXPANDS =
What a job brings back beside itself where it is asked to.
%i[attachments appointments]
Constants included from Statused
Class Method Summary collapse
-
.key ⇒ Object
What Housecall Pro calls a page of them.
-
.path ⇒ Object
Where Housecall Pro keeps them.
Instance Method Summary collapse
-
#address ⇒ Address?
Where the work happens.
-
#appointments ⇒ Relation
The visits the job is booked for.
-
#assigned_employees ⇒ Array<Employee>
The pros the job is assigned to.
- #canceled_at ⇒ Time?
-
#customer ⇒ Customer?
Whose job it is.
-
#description ⇒ String?
The description, as Housecall Pro answers it.
-
#invoice_number ⇒ String?
The invoice_number, as Housecall Pro answers it.
-
#invoices ⇒ Relation
The invoices raised for the job.
-
#lead_source ⇒ String?
The lead_source, as Housecall Pro answers it.
-
#line_items ⇒ Relation
What the job is billed as.
- #locked_at ⇒ Time?
-
#notes ⇒ Array<Note>
What the pros wrote on the job.
- #original_estimate_id ⇒ String?
-
#outstanding_balance ⇒ BigDecimal?
The outstanding_balance, which Housecall Pro counts in cents.
-
#subtotal ⇒ BigDecimal?
The subtotal, which Housecall Pro counts in cents.
-
#tags ⇒ Array<String>
What the job is tagged with.
-
#total_amount ⇒ BigDecimal?
The total_amount, which Housecall Pro counts in cents.
Methods included from Queryable
all, count, expands, filters, find, first, includes, limit, many, order, sorts, where
Methods included from Scheduled
#completed_at, #on_my_way_at, #schedule, #started_at
Methods included from Statused
Methods included from Timestamped
Methods inherited from Resource
amount, attribute, #id, #initialize, timestamp
Constructor Details
This class inherits a constructor from Hcp::Resource
Class Method Details
.key ⇒ Object
What Housecall Pro calls a page of them.
30 |
# File 'lib/hcp/resources/job.rb', line 30 def self.key = 'jobs' |
.path ⇒ Object
Where Housecall Pro keeps them.
27 |
# File 'lib/hcp/resources/job.rb', line 27 def self.path = 'jobs' |
Instance Method Details
#address ⇒ Address?
Returns where the work happens.
56 |
# File 'lib/hcp/resources/job.rb', line 56 def address = record Address, 'address' |
#appointments ⇒ Relation
Returns the visits the job is booked for.
65 |
# File 'lib/hcp/resources/job.rb', line 65 def appointments = nested Job::Appointment, 'appointments' |
#assigned_employees ⇒ Array<Employee>
Returns the pros the job is assigned to.
62 |
# File 'lib/hcp/resources/job.rb', line 62 def assigned_employees = records Employee, 'assigned_employees' |
#canceled_at ⇒ Time?
47 |
# File 'lib/hcp/resources/job.rb', line 47 :canceled_at |
#customer ⇒ Customer?
Returns whose job it is.
53 |
# File 'lib/hcp/resources/job.rb', line 53 def customer = record Customer, 'customer' |
#description ⇒ String?
Returns the description, as Housecall Pro answers it.
33 |
# File 'lib/hcp/resources/job.rb', line 33 attribute :description |
#invoice_number ⇒ String?
Returns the invoice_number, as Housecall Pro answers it.
32 |
# File 'lib/hcp/resources/job.rb', line 32 attribute :invoice_number |
#invoices ⇒ Relation
Returns the invoices raised for the job.
71 |
# File 'lib/hcp/resources/job.rb', line 71 def invoices = nested Job::Invoice, 'invoices' |
#lead_source ⇒ String?
Returns the lead_source, as Housecall Pro answers it.
34 |
# File 'lib/hcp/resources/job.rb', line 34 attribute :lead_source |
#line_items ⇒ Relation
Returns what the job is billed as.
68 |
# File 'lib/hcp/resources/job.rb', line 68 def line_items = nested LineItem, 'line_items' |
#locked_at ⇒ Time?
44 |
# File 'lib/hcp/resources/job.rb', line 44 :locked_at |
#notes ⇒ Array<Note>
Returns what the pros wrote on the job.
59 |
# File 'lib/hcp/resources/job.rb', line 59 def notes = records Note, 'notes' |
#original_estimate_id ⇒ String?
37 |
# File 'lib/hcp/resources/job.rb', line 37 attribute :original_estimate_id |
#outstanding_balance ⇒ BigDecimal?
Returns the outstanding_balance, which Housecall Pro counts in cents.
41 |
# File 'lib/hcp/resources/job.rb', line 41 amount :outstanding_balance |
#subtotal ⇒ BigDecimal?
Returns the subtotal, which Housecall Pro counts in cents.
39 |
# File 'lib/hcp/resources/job.rb', line 39 amount :subtotal |
#tags ⇒ Array<String>
Returns what the job is tagged with.
50 |
# File 'lib/hcp/resources/job.rb', line 50 def = Array(@node['tags']) |
#total_amount ⇒ BigDecimal?
Returns the total_amount, which Housecall Pro counts in cents.
40 |
# File 'lib/hcp/resources/job.rb', line 40 amount :total_amount |