Skip to main content

AbstractCrmService

Stentor API Reference


Stentor API Reference / stentor-models/src / AbstractCrmService

Class: AbstractCrmService

Defined in: packages/stentor-models/src/Services/CrmService.ts:276

Implements​

Constructors​

Constructor​

new AbstractCrmService(props): AbstractCrmService

Defined in: packages/stentor-models/src/Services/CrmService.ts:285

Parameters​

props​

CrmServiceAvailabilitySettings

Returns​

AbstractCrmService

Properties​

availableDays?​

protected optional availableDays?: DayOfWeek[]

Defined in: packages/stentor-models/src/Services/CrmService.ts:277


blockedDays?​

protected optional blockedDays?: DateTime[]

Defined in: packages/stentor-models/src/Services/CrmService.ts:279


maxTotalDailyAppointments?​

protected optional maxTotalDailyAppointments?: number

Defined in: packages/stentor-models/src/Services/CrmService.ts:281


delayedJobTypes?​

protected optional delayedJobTypes?: string[]

Defined in: packages/stentor-models/src/Services/CrmService.ts:283

Methods​

send()​

send(externalLead, extras?): Promise<CrmResponse>

Defined in: packages/stentor-models/src/Services/CrmService.ts:303

Send information about a lead to the CRM.

This can be used to either create a lead or append data to an existing lead.

The existing lead can be determined by the refId on the ExternalLead information or by attempting to match data such as email or phone number.

Parameters​

externalLead​

ExternalLead

Lead information

extras?​

Record<string, unknown>

Optional additional metadata to pass to the CRM

Returns​

Promise<CrmResponse>

Implementation of​

CrmService.send


getAvailability()​

getAvailability(range, options?): Promise<CrmServiceAvailability>

Defined in: packages/stentor-models/src/Services/CrmService.ts:310

Returns availability for scheduling an appointment with the business.

Parameters​

range​

DateTimeRange

options?​

CrmServiceAvailabilityOptions

Returns​

Promise<CrmServiceAvailability>

Implementation of​

CrmService.getAvailability


getJobType()​

getJobType(message, externalLead?, options?): Promise<CrmServiceJobType>

Defined in: packages/stentor-models/src/Services/CrmService.ts:326

Returns the job type (id) for the free text job description (AI call usually)

Parameters​

message​

string

externalLead?​

ExternalLead

options?​

CrmServiceAvailabilitySettings

Availability settings in scope for this request (e.g. a widget's forceAvailabilityClass or jobTypeClasses), needed to resolve the job type's class.

Deliberately typed as the settings-only CrmServiceAvailabilitySettings rather than CrmServiceAvailabilityOptions: this method determines the job type, so the jobType member of the Options type would be meaningless (and misleading) here.

Returns​

Promise<CrmServiceJobType>

Implementation of​

CrmService.getJobType


update()?​

optional update(externalLead, extras?): Promise<CrmResponse>

Defined in: packages/stentor-models/src/Services/CrmService.ts:334

Updates a lead if the user provides more information after the lead has been sent.

It leverages the refId on the externalLead, which is originally provided in the CrmResponse to properly

Parameters​

externalLead​

ExternalLead

extras?​

Record<string, unknown>

Returns​

Promise<CrmResponse>

Deprecated​

Use send with a refId on the externalLead and call send() again. This will update.

Implementation of​

CrmService.update