# createWeeklyRecurringEvent

**Kind:** Function

**Source:** `Outlook_plugin/src/calendar/calendar.model.ts` (line 376)

**Part of:** [Calendar](subsystem-outlook-plugin-src-calendar)

Helper function to create recurring weekly meeting

`createWeeklyRecurringEvent` creates the calendar event data needed for a meeting that repeats every week. It centralizes recurring-meeting setup in the calendar model so Outlook calendar flows can use a consistent event shape.

## Signature

```ts
function createWeeklyRecurringEvent(subject: string, startDate: Date, duration: number, dayOfWeek: DayOfWeek, numberOfOccurrences: number, location: string, attendees: string[]): CreateEventRequest
```

## Parameters

| Name | Type |
|---|---|
| `subject` | `string` |
| `startDate` | `Date` |
| `duration` | `number` |
| `dayOfWeek` | `DayOfWeek` |
| `numberOfOccurrences` | `number` |
| `location` | `string` |
| `attendees` | `string[]` |

**Returns:** `CreateEventRequest`

## Diagram

```mermaid
graph LR
  A[Calendar UI or command] --> B[createWeeklyRecurringEvent]
  B --> C[Weekly recurrence data]
  C --> D[Outlook event request]
  D --> E[Recurring calendar meeting]
```

## Usage

```ts
import { createWeeklyRecurringEvent } from "./calendar.model";

const weeklyMeeting = createWeeklyRecurringEvent();

await createOutlookCalendarEvent(weeklyMeeting);
```

## AI Coding Instructions

- Keep recurrence construction inside `calendar.model.ts` rather than duplicating recurrence objects in UI code.
- Preserve the event shape expected by the Outlook calendar API when changing this helper.
- Check that meeting start and end values remain compatible with the recurrence range.
- Reuse this helper for weekly meetings so recurrence behavior stays consistent across calendar actions.
