BlueprintTimeslotsRequest - gomeddo/js-sdk GitHub Wiki

Object used to retrieve generated blueprint timeslot possibilities that match this request.

Example

const blueprintRequest = gm.buildBlueprintTimeSlotsRequest()
    .setBlueprintName('Parent Blueprint')
    .setDuration(60)
    .setInterval(60)
    .setTimeslotRange(new DateRange(new Date(), 7, 0))
    .setMDARange(new DateRange(new Date(), 7, 0))
    .setPrototype({ B25__Resource__c: 'YOUR_SALESFORCE_RESOURCE_ID' })
    .getResults()

setTimeslotRange

Syntax

setTimeslotRange(startDate, durationDays, offsetDays)

Parameters:

  • startDate The start date of the configured date range.
  • durationDays The amount of days that the date range should cover after the start date.
  • offsetDays Number of days to offset the date range from the startDate. If not specified, defaults to zero.

Return value: The updated blueprint timeslots record request.

Description Set the date range to be used for generating possible blueprint-based timeslot combinations.


setMDARange

Syntax

setMDARange(startDate, durationDays, offsetDays)

Parameters:

  • startDate The start date of the configured date range.
  • durationDays The amount of days that the date range should cover after the start date.
  • offsetDays Number of days to offset the date range from the startDate. If not specified, defaults to zero.

Return value: The updated blueprint timeslots record request.

Description Set an optional date range to be used for additional context in multi dimensional availability blueprint-based timeslot combinations. If not specified, will default to the dates specified in the timeslot range.


setBlueprintName

Syntax

setBlueprintName(blueprintName)

Parameters:

  • blueprintName The name of the existing blueprint to use as the basis for generation of timeslot possibilities.

Return value: The updated blueprint timeslots record request.

Description Set the name of the blueprint to use for generating timeslots.


setDuration

Syntax

setDuration(duration)

Parameters:

  • duration The duration in minutes of each possible timeslot generated.

Return value: The updated blueprint timeslots record request.

Description Set the desired duration for the generated possible timeslots.


setInterval

Syntax

setInterval(interval)

Parameters:

  • interval The gap between the start times of each generated timeslot option.

Return value: The updated blueprint timeslots record request.

Description Set the desired gap between the start times of each generated timeslot option.


setPrototype

Syntax

setPrototype(prototype)

Parameters:

  • prototype A prototype Reservation to be used as the basis for the timeslot combinations

Return value: The updated blueprint timeslots record request.

Description Set the prototype Reservation to use as the basis for generating timeslot possibilities. For example, if a Resource and a Staff are specified on the prototype, only timeslot possibilities that will work for that combination of Resource and Staff should be returned.