Skip to main content

talawa-api / Exports / helpers/event/createEventHelpers/createRecurringEventInstancesDuringQuery

Module: helpers/event/createEventHelpers/createRecurringEventInstancesDuringQuery

Table of contents

Functions

Functions

createRecurringEventInstancesDuringQuery

createRecurringEventInstancesDuringQuery(organizationId): Promise<void>

This function creates the instances of a recurring event upto a certain date during queries.

Parameters

NameTypeDescription
organizationIdundefined | null | string_id of the organization the events belong to

Returns

Promise<void>

Remarks

The following steps are followed:

  1. Get the limit date upto which we would want to query the recurrenceRules and generate new instances.
  2. Get the recurrence rules to be used for instance generation during this query.
  3. For every recurrence rule found:
  • find the base recurring event to get the data to be used for new instance generation.
  • get the number of existing instances and how many more to generate based on the recurrenceRule's count (if specified).
  • generate new instances after their latestInstanceDates.
  • update the latestInstanceDate.

Defined in

src/helpers/event/createEventHelpers/createRecurringEventInstancesDuringQuery.ts:25