# Project Planning Calendar (cf.cplace.projektplanungCalendar)

## Overview

The **Project Planning Calendar** app enables the creation of calendars with non-working days (holidays, company closures, etc.) that can be assigned to tasks or milestones. When a calendar is assigned to planning elements, the non-working days are automatically taken into account when calculating dates in Gantt charts and schedule management.

**Key Use Cases:**
- Define company-wide or regional holiday calendars
- Create project-specific calendars with custom non-working days
- Support accurate scheduling that respects holidays and closures

## Dependencies

This app has **no additional dependencies** beyond the cplace platform:
- `cf.cplace.platform` (cplace Basis) - always pre-installed

## Singleton Restriction

**Important:** This app can only be installed in **one workspace per tenant**. It is designed to provide a central calendar repository that can be referenced from other workspaces using cross-workspace references.

## Types Provided

### cf.cplace.projektplanungCalendar.calendar

**Purpose:** Represents a named calendar that collects non-working days and can be assigned to schedules, tasks, or milestones.

| Attribute | Internal Name | Type | Required | Multiple | Description |
|-----------|---------------|------|----------|----------|-------------|
| Base Calendar | `cf.cplace.projektplanungCalendar.baseCalendar` | (Reference/Enum) | Yes | No | Basis calendar to inherit from - specifies the standard week structure |
| Description | `cf.cplace.projektplanungCalendar.description` | String | No | No | Description of the calendar's meaning and usage |
| Non Working Days | `cf.cplace.projektplanungCalendar.nonWorkingDays` | Reference | No | Yes | Collection of non-working day definitions |

**Configuration:**
- `namesAreUnique: true` - Calendar names must be unique
- `showInExplorer: false` - Not shown in workspace explorer
- `showInGlobalSearch: true` - Can be found via global search
- Icon: `fa-calendar`

### cf.cplace.projektplanungCalendar.nonWorkingDay

**Purpose:** Represents a single non-working day (holiday, closure, etc.) that belongs to a calendar.

| Attribute | Internal Name | Type | Required | Multiple | Description |
|-----------|---------------|------|----------|----------|-------------|
| Date | `cf.cplace.projektplanungCalendar.date` | Date | Yes | No | The specific date that is a non-working day |

**Configuration:**
- `namesAreUnique: false` - Names can repeat (e.g., "Christmas" each year)
- `showInExplorer: false` - Not shown in workspace explorer
- `showInGlobalSearch: false` - Not indexed for search (search the parent calendar instead)
- Icon: `fa-calendar`

## Widgets Provided

This app does **not provide any widgets**. It focuses purely on data types for calendar management.

## Integration with Project Planning

The calendars created with this app integrate with:
- **Project Planning (Basic)** - Tasks and milestones can reference calendars
- **Project Planning (Extended)** - Advanced scheduling respects calendar constraints
- **Schedule Management apps** - Calendar-aware date calculations

When a calendar is assigned to a planning element, the Gantt chart calculations automatically:
- Skip non-working days when calculating duration
- Adjust start/end dates to avoid landing on non-working days
- Provide accurate working-day-based scheduling

## Typical Setup

1. Install this app in a dedicated "Calendar" workspace
2. Create calendars for different regions/departments:
   - "Germany Holidays 2024"
   - "US Federal Holidays 2024"
   - "Company Shutdown Days"
3. Add Non Working Day pages as children of each calendar
4. Reference these calendars from schedules in other workspaces

## Usage Notes

- **Centralized Management:** Since this is a singleton app, plan to use one workspace as the central calendar repository
- **Cross-Workspace References:** Schedules in other workspaces can reference calendars via cross-workspace references
- **Annual Updates:** Non-working days typically need to be updated annually for holiday calendars
- **Base Calendar:** The Base Calendar attribute allows inheritance of standard weekly patterns (e.g., Mon-Fri working week)
