Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/deadlines/deadlines-library/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ Comprehensive documentation and background information are available in the 👉

This library is provided as an open-source contribution to the community to support flexibility when building custom systems around the epilot Energy XRM. It is not intended as a standalone product. Support is only provided for epilot customers.

If you are an active epilot contract, you can alternatively use our [Switching Deadlines REST API](https://docs.epilot.io/api/deadlines), which offers the same logic as a web service.
If you are an active epilot customer, you can alternatively use our [Switching Deadlines REST API](https://docs.epilot.io/api/deadlines), which offers the same logic as a web service.

For questions or feedback regarding this library, please reach out to the epilot team.

Expand Down
9 changes: 9 additions & 0 deletions docs/deadlines/deadlines-library/documents/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,12 @@
***

[@epilot/switching-deadlines](../modules.md) / CHANGELOG

# Changelog

## [v2025.1.0] - 2025-09-30

Initial release 🎉

Full Changelog:
https://github.com/epilot-dev/switching-deadlines/commits/v2025.1.0
26 changes: 13 additions & 13 deletions docs/deadlines/deadlines-library/index/classes/CalendarProvider.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

# Class: CalendarProvider

Defined in: [calendar-provider.ts:68](https://github.com/epilot-dev/switching-deadlines/blob/3e728b5f762c5b978f43c05453d07a8b73878933/src/calendar-provider.ts#L68)
Defined in: [calendar-provider.ts:68](https://github.com/epilot-dev/switching-deadlines/blob/399b2cc39d63ef20d5c31e06d92ee448511e691c/src/calendar-provider.ts#L68)

Calendar provider that manages holidays, working days, and date calculations.

Expand Down Expand Up @@ -39,7 +39,7 @@ const nextWorking = calendar.getNextWorkingDay('2024-12-25');

> **new CalendarProvider**(`options?`): `CalendarProvider`

Defined in: [calendar-provider.ts:104](https://github.com/epilot-dev/switching-deadlines/blob/3e728b5f762c5b978f43c05453d07a8b73878933/src/calendar-provider.ts#L104)
Defined in: [calendar-provider.ts:104](https://github.com/epilot-dev/switching-deadlines/blob/399b2cc39d63ef20d5c31e06d92ee448511e691c/src/calendar-provider.ts#L104)

Creates a new CalendarProvider instance.

Expand Down Expand Up @@ -80,7 +80,7 @@ const provider = new CalendarProvider({

> **addWorkingDays**(`startDate`, `workingDays`): `Date`

Defined in: [calendar-provider.ts:295](https://github.com/epilot-dev/switching-deadlines/blob/3e728b5f762c5b978f43c05453d07a8b73878933/src/calendar-provider.ts#L295)
Defined in: [calendar-provider.ts:295](https://github.com/epilot-dev/switching-deadlines/blob/399b2cc39d63ef20d5c31e06d92ee448511e691c/src/calendar-provider.ts#L295)

Adds a specified number of working days to a date, skipping weekends and holidays.

Expand Down Expand Up @@ -121,7 +121,7 @@ const beforeHoliday = provider.addWorkingDays('2024-12-20', 3); // Skips Christm

> **countWorkingDays**(`startDate`, `endDate`): `number`

Defined in: [calendar-provider.ts:404](https://github.com/epilot-dev/switching-deadlines/blob/3e728b5f762c5b978f43c05453d07a8b73878933/src/calendar-provider.ts#L404)
Defined in: [calendar-provider.ts:404](https://github.com/epilot-dev/switching-deadlines/blob/399b2cc39d63ef20d5c31e06d92ee448511e691c/src/calendar-provider.ts#L404)

Counts the number of working days between two dates (inclusive).

Expand Down Expand Up @@ -161,7 +161,7 @@ const projectDays = provider.countWorkingDays('2024-01-15', '2024-03-15');

> **getCalendarVersion**(): [`CalendarVersion`](../interfaces/CalendarVersion.md)

Defined in: [calendar-provider.ts:477](https://github.com/epilot-dev/switching-deadlines/blob/3e728b5f762c5b978f43c05453d07a8b73878933/src/calendar-provider.ts#L477)
Defined in: [calendar-provider.ts:477](https://github.com/epilot-dev/switching-deadlines/blob/399b2cc39d63ef20d5c31e06d92ee448511e691c/src/calendar-provider.ts#L477)

Gets the current calendar version information.

Expand All @@ -185,7 +185,7 @@ console.log(`Last updated: ${version.lastUpdated}`);

> **getDayInfo**(`date`): [`DayInfo`](../interfaces/DayInfo.md)

Defined in: [calendar-provider.ts:252](https://github.com/epilot-dev/switching-deadlines/blob/3e728b5f762c5b978f43c05453d07a8b73878933/src/calendar-provider.ts#L252)
Defined in: [calendar-provider.ts:252](https://github.com/epilot-dev/switching-deadlines/blob/399b2cc39d63ef20d5c31e06d92ee448511e691c/src/calendar-provider.ts#L252)

Gets detailed information about a specific day including working day status and holiday information.

Expand Down Expand Up @@ -221,7 +221,7 @@ console.log(dayInfo);

> **getNextWorkingDay**(`date`): `Date`

Defined in: [calendar-provider.ts:427](https://github.com/epilot-dev/switching-deadlines/blob/3e728b5f762c5b978f43c05453d07a8b73878933/src/calendar-provider.ts#L427)
Defined in: [calendar-provider.ts:427](https://github.com/epilot-dev/switching-deadlines/blob/399b2cc39d63ef20d5c31e06d92ee448511e691c/src/calendar-provider.ts#L427)

Gets the next working day from a given date.

Expand Down Expand Up @@ -256,7 +256,7 @@ const afterChristmas = provider.getNextWorkingDay('2024-12-25');

> **getNonWorkingDaysInRange**(`startDate`, `endDate`): [`DayInfo`](../interfaces/DayInfo.md)[]

Defined in: [calendar-provider.ts:368](https://github.com/epilot-dev/switching-deadlines/blob/3e728b5f762c5b978f43c05453d07a8b73878933/src/calendar-provider.ts#L368)
Defined in: [calendar-provider.ts:368](https://github.com/epilot-dev/switching-deadlines/blob/399b2cc39d63ef20d5c31e06d92ee448511e691c/src/calendar-provider.ts#L368)

Gets all non-working days (weekends and holidays) between two dates (inclusive).

Expand Down Expand Up @@ -299,7 +299,7 @@ nonWorkingDays.forEach(day => {

> **getPreviousWorkingDay**(`date`): `Date`

Defined in: [calendar-provider.ts:454](https://github.com/epilot-dev/switching-deadlines/blob/3e728b5f762c5b978f43c05453d07a8b73878933/src/calendar-provider.ts#L454)
Defined in: [calendar-provider.ts:454](https://github.com/epilot-dev/switching-deadlines/blob/399b2cc39d63ef20d5c31e06d92ee448511e691c/src/calendar-provider.ts#L454)

Gets the previous working day from a given date.

Expand Down Expand Up @@ -334,7 +334,7 @@ const beforeNewYear = provider.getPreviousWorkingDay('2024-01-02');

> **getWorkingDaysInRange**(`startDate`, `endDate`): [`DayInfo`](../interfaces/DayInfo.md)[]

Defined in: [calendar-provider.ts:329](https://github.com/epilot-dev/switching-deadlines/blob/3e728b5f762c5b978f43c05453d07a8b73878933/src/calendar-provider.ts#L329)
Defined in: [calendar-provider.ts:329](https://github.com/epilot-dev/switching-deadlines/blob/399b2cc39d63ef20d5c31e06d92ee448511e691c/src/calendar-provider.ts#L329)

Gets all working days between two dates (inclusive).

Expand Down Expand Up @@ -375,7 +375,7 @@ workingDays.forEach(day => {

> **isHoliday**(`date`): `false` \| [`Holiday`](../interfaces/Holiday.md)

Defined in: [calendar-provider.ts:195](https://github.com/epilot-dev/switching-deadlines/blob/3e728b5f762c5b978f43c05453d07a8b73878933/src/calendar-provider.ts#L195)
Defined in: [calendar-provider.ts:195](https://github.com/epilot-dev/switching-deadlines/blob/399b2cc39d63ef20d5c31e06d92ee448511e691c/src/calendar-provider.ts#L195)

Checks if a specific date is a holiday.

Expand Down Expand Up @@ -410,7 +410,7 @@ const dateHoliday = provider.isHoliday(new Date('2024-01-01'));

> **isWorkingDay**(`date`): `boolean`

Defined in: [calendar-provider.ts:219](https://github.com/epilot-dev/switching-deadlines/blob/3e728b5f762c5b978f43c05453d07a8b73878933/src/calendar-provider.ts#L219)
Defined in: [calendar-provider.ts:219](https://github.com/epilot-dev/switching-deadlines/blob/399b2cc39d63ef20d5c31e06d92ee448511e691c/src/calendar-provider.ts#L219)

Checks if a specific date is a working day (not a weekend or holiday).

Expand Down Expand Up @@ -442,7 +442,7 @@ const isHoliday = provider.isWorkingDay('2024-12-25'); // false (Christmas)

> **updateCustomHolidays**(`customHolidays`): `void`

Defined in: [calendar-provider.ts:504](https://github.com/epilot-dev/switching-deadlines/blob/3e728b5f762c5b978f43c05453d07a8b73878933/src/calendar-provider.ts#L504)
Defined in: [calendar-provider.ts:504](https://github.com/epilot-dev/switching-deadlines/blob/399b2cc39d63ef20d5c31e06d92ee448511e691c/src/calendar-provider.ts#L504)

Updates the custom holidays configuration and clears the holiday cache.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

# Class: DeadlineCalculator

Defined in: [deadlines-calculator.ts:47](https://github.com/epilot-dev/switching-deadlines/blob/3e728b5f762c5b978f43c05453d07a8b73878933/src/deadlines-calculator.ts#L47)
Defined in: [deadlines-calculator.ts:47](https://github.com/epilot-dev/switching-deadlines/blob/399b2cc39d63ef20d5c31e06d92ee448511e691c/src/deadlines-calculator.ts#L47)

Calculator for determining deadline dates and validating start dates for utility switching cases.

Expand Down Expand Up @@ -35,7 +35,7 @@ console.log(result.earliestStartDate)

> **new DeadlineCalculator**(`options?`): `DeadlineCalculator`

Defined in: [deadlines-calculator.ts:68](https://github.com/epilot-dev/switching-deadlines/blob/3e728b5f762c5b978f43c05453d07a8b73878933/src/deadlines-calculator.ts#L68)
Defined in: [deadlines-calculator.ts:68](https://github.com/epilot-dev/switching-deadlines/blob/399b2cc39d63ef20d5c31e06d92ee448511e691c/src/deadlines-calculator.ts#L68)

Creates a new DeadlineCalculator instance.

Expand Down Expand Up @@ -70,7 +70,7 @@ const calcCustom = new DeadlineCalculator({

> **calculateEarliestStartDate**(`switchingCase`, `fromDate?`): `object`

Defined in: [deadlines-calculator.ts:91](https://github.com/epilot-dev/switching-deadlines/blob/3e728b5f762c5b978f43c05453d07a8b73878933/src/deadlines-calculator.ts#L91)
Defined in: [deadlines-calculator.ts:91](https://github.com/epilot-dev/switching-deadlines/blob/399b2cc39d63ef20d5c31e06d92ee448511e691c/src/deadlines-calculator.ts#L91)

Calculate the earliest possible start date for a contract

Expand Down Expand Up @@ -142,7 +142,7 @@ When no applicable rule is found for the switching case

> **getRule**(`switchingCase`): `undefined` \| [`DeadlineRule`](../interfaces/DeadlineRule.md)

Defined in: [deadlines-calculator.ts:220](https://github.com/epilot-dev/switching-deadlines/blob/3e728b5f762c5b978f43c05453d07a8b73878933/src/deadlines-calculator.ts#L220)
Defined in: [deadlines-calculator.ts:220](https://github.com/epilot-dev/switching-deadlines/blob/399b2cc39d63ef20d5c31e06d92ee448511e691c/src/deadlines-calculator.ts#L220)

Get a specific rule for a switching case

Expand All @@ -169,7 +169,7 @@ The matching deadline rule or undefined if none found

> **getRules**(): [`DeadlineRule`](../interfaces/DeadlineRule.md)[]

Defined in: [deadlines-calculator.ts:204](https://github.com/epilot-dev/switching-deadlines/blob/3e728b5f762c5b978f43c05453d07a8b73878933/src/deadlines-calculator.ts#L204)
Defined in: [deadlines-calculator.ts:204](https://github.com/epilot-dev/switching-deadlines/blob/399b2cc39d63ef20d5c31e06d92ee448511e691c/src/deadlines-calculator.ts#L204)

Get all configured rules

Expand All @@ -188,7 +188,7 @@ Array of all configured deadline rules

> **validateStartDate**(`switchingCase`, `proposedDate`, `fromDate?`): `object`

Defined in: [deadlines-calculator.ts:167](https://github.com/epilot-dev/switching-deadlines/blob/3e728b5f762c5b978f43c05453d07a8b73878933/src/deadlines-calculator.ts#L167)
Defined in: [deadlines-calculator.ts:167](https://github.com/epilot-dev/switching-deadlines/blob/399b2cc39d63ef20d5c31e06d92ee448511e691c/src/deadlines-calculator.ts#L167)

Validate if a proposed start date is valid

Expand Down
34 changes: 17 additions & 17 deletions docs/deadlines/deadlines-library/index/enumerations/Bundesland.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,132 +6,132 @@

# Enumeration: Bundesland

Defined in: [holidays/types.ts:8](https://github.com/epilot-dev/switching-deadlines/blob/3e728b5f762c5b978f43c05453d07a8b73878933/src/holidays/types.ts#L8)
Defined in: [holidays/types.ts:8](https://github.com/epilot-dev/switching-deadlines/blob/399b2cc39d63ef20d5c31e06d92ee448511e691c/src/holidays/types.ts#L8)

## Enumeration Members

### BB

> **BB**: `"Brandenburg"`

Defined in: [holidays/types.ts:12](https://github.com/epilot-dev/switching-deadlines/blob/3e728b5f762c5b978f43c05453d07a8b73878933/src/holidays/types.ts#L12)
Defined in: [holidays/types.ts:12](https://github.com/epilot-dev/switching-deadlines/blob/399b2cc39d63ef20d5c31e06d92ee448511e691c/src/holidays/types.ts#L12)

***

### BE

> **BE**: `"Berlin"`

Defined in: [holidays/types.ts:11](https://github.com/epilot-dev/switching-deadlines/blob/3e728b5f762c5b978f43c05453d07a8b73878933/src/holidays/types.ts#L11)
Defined in: [holidays/types.ts:11](https://github.com/epilot-dev/switching-deadlines/blob/399b2cc39d63ef20d5c31e06d92ee448511e691c/src/holidays/types.ts#L11)

***

### BW

> **BW**: `"Baden-Württemberg"`

Defined in: [holidays/types.ts:9](https://github.com/epilot-dev/switching-deadlines/blob/3e728b5f762c5b978f43c05453d07a8b73878933/src/holidays/types.ts#L9)
Defined in: [holidays/types.ts:9](https://github.com/epilot-dev/switching-deadlines/blob/399b2cc39d63ef20d5c31e06d92ee448511e691c/src/holidays/types.ts#L9)

***

### BY

> **BY**: `"Bayern"`

Defined in: [holidays/types.ts:10](https://github.com/epilot-dev/switching-deadlines/blob/3e728b5f762c5b978f43c05453d07a8b73878933/src/holidays/types.ts#L10)
Defined in: [holidays/types.ts:10](https://github.com/epilot-dev/switching-deadlines/blob/399b2cc39d63ef20d5c31e06d92ee448511e691c/src/holidays/types.ts#L10)

***

### HB

> **HB**: `"Bremen"`

Defined in: [holidays/types.ts:13](https://github.com/epilot-dev/switching-deadlines/blob/3e728b5f762c5b978f43c05453d07a8b73878933/src/holidays/types.ts#L13)
Defined in: [holidays/types.ts:13](https://github.com/epilot-dev/switching-deadlines/blob/399b2cc39d63ef20d5c31e06d92ee448511e691c/src/holidays/types.ts#L13)

***

### HE

> **HE**: `"Hessen"`

Defined in: [holidays/types.ts:15](https://github.com/epilot-dev/switching-deadlines/blob/3e728b5f762c5b978f43c05453d07a8b73878933/src/holidays/types.ts#L15)
Defined in: [holidays/types.ts:15](https://github.com/epilot-dev/switching-deadlines/blob/399b2cc39d63ef20d5c31e06d92ee448511e691c/src/holidays/types.ts#L15)

***

### HH

> **HH**: `"Hamburg"`

Defined in: [holidays/types.ts:14](https://github.com/epilot-dev/switching-deadlines/blob/3e728b5f762c5b978f43c05453d07a8b73878933/src/holidays/types.ts#L14)
Defined in: [holidays/types.ts:14](https://github.com/epilot-dev/switching-deadlines/blob/399b2cc39d63ef20d5c31e06d92ee448511e691c/src/holidays/types.ts#L14)

***

### MV

> **MV**: `"Mecklenburg-Vorpommern"`

Defined in: [holidays/types.ts:16](https://github.com/epilot-dev/switching-deadlines/blob/3e728b5f762c5b978f43c05453d07a8b73878933/src/holidays/types.ts#L16)
Defined in: [holidays/types.ts:16](https://github.com/epilot-dev/switching-deadlines/blob/399b2cc39d63ef20d5c31e06d92ee448511e691c/src/holidays/types.ts#L16)

***

### NI

> **NI**: `"Niedersachsen"`

Defined in: [holidays/types.ts:17](https://github.com/epilot-dev/switching-deadlines/blob/3e728b5f762c5b978f43c05453d07a8b73878933/src/holidays/types.ts#L17)
Defined in: [holidays/types.ts:17](https://github.com/epilot-dev/switching-deadlines/blob/399b2cc39d63ef20d5c31e06d92ee448511e691c/src/holidays/types.ts#L17)

***

### NW

> **NW**: `"Nordrhein-Westfalen"`

Defined in: [holidays/types.ts:18](https://github.com/epilot-dev/switching-deadlines/blob/3e728b5f762c5b978f43c05453d07a8b73878933/src/holidays/types.ts#L18)
Defined in: [holidays/types.ts:18](https://github.com/epilot-dev/switching-deadlines/blob/399b2cc39d63ef20d5c31e06d92ee448511e691c/src/holidays/types.ts#L18)

***

### RP

> **RP**: `"Rheinland-Pfalz"`

Defined in: [holidays/types.ts:19](https://github.com/epilot-dev/switching-deadlines/blob/3e728b5f762c5b978f43c05453d07a8b73878933/src/holidays/types.ts#L19)
Defined in: [holidays/types.ts:19](https://github.com/epilot-dev/switching-deadlines/blob/399b2cc39d63ef20d5c31e06d92ee448511e691c/src/holidays/types.ts#L19)

***

### SH

> **SH**: `"Schleswig-Holstein"`

Defined in: [holidays/types.ts:23](https://github.com/epilot-dev/switching-deadlines/blob/3e728b5f762c5b978f43c05453d07a8b73878933/src/holidays/types.ts#L23)
Defined in: [holidays/types.ts:23](https://github.com/epilot-dev/switching-deadlines/blob/399b2cc39d63ef20d5c31e06d92ee448511e691c/src/holidays/types.ts#L23)

***

### SL

> **SL**: `"Saarland"`

Defined in: [holidays/types.ts:20](https://github.com/epilot-dev/switching-deadlines/blob/3e728b5f762c5b978f43c05453d07a8b73878933/src/holidays/types.ts#L20)
Defined in: [holidays/types.ts:20](https://github.com/epilot-dev/switching-deadlines/blob/399b2cc39d63ef20d5c31e06d92ee448511e691c/src/holidays/types.ts#L20)

***

### SN

> **SN**: `"Sachsen"`

Defined in: [holidays/types.ts:21](https://github.com/epilot-dev/switching-deadlines/blob/3e728b5f762c5b978f43c05453d07a8b73878933/src/holidays/types.ts#L21)
Defined in: [holidays/types.ts:21](https://github.com/epilot-dev/switching-deadlines/blob/399b2cc39d63ef20d5c31e06d92ee448511e691c/src/holidays/types.ts#L21)

***

### ST

> **ST**: `"Sachsen-Anhalt"`

Defined in: [holidays/types.ts:22](https://github.com/epilot-dev/switching-deadlines/blob/3e728b5f762c5b978f43c05453d07a8b73878933/src/holidays/types.ts#L22)
Defined in: [holidays/types.ts:22](https://github.com/epilot-dev/switching-deadlines/blob/399b2cc39d63ef20d5c31e06d92ee448511e691c/src/holidays/types.ts#L22)

***

### TH

> **TH**: `"Thüringen"`

Defined in: [holidays/types.ts:24](https://github.com/epilot-dev/switching-deadlines/blob/3e728b5f762c5b978f43c05453d07a8b73878933/src/holidays/types.ts#L24)
Defined in: [holidays/types.ts:24](https://github.com/epilot-dev/switching-deadlines/blob/399b2cc39d63ef20d5c31e06d92ee448511e691c/src/holidays/types.ts#L24)
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,20 @@

# Enumeration: Commodity

Defined in: [rules/types.ts:1](https://github.com/epilot-dev/switching-deadlines/blob/3e728b5f762c5b978f43c05453d07a8b73878933/src/rules/types.ts#L1)
Defined in: [rules/types.ts:1](https://github.com/epilot-dev/switching-deadlines/blob/399b2cc39d63ef20d5c31e06d92ee448511e691c/src/rules/types.ts#L1)

## Enumeration Members

### GAS

> **GAS**: `"gas"`

Defined in: [rules/types.ts:3](https://github.com/epilot-dev/switching-deadlines/blob/3e728b5f762c5b978f43c05453d07a8b73878933/src/rules/types.ts#L3)
Defined in: [rules/types.ts:3](https://github.com/epilot-dev/switching-deadlines/blob/399b2cc39d63ef20d5c31e06d92ee448511e691c/src/rules/types.ts#L3)

***

### POWER

> **POWER**: `"power"`

Defined in: [rules/types.ts:2](https://github.com/epilot-dev/switching-deadlines/blob/3e728b5f762c5b978f43c05453d07a8b73878933/src/rules/types.ts#L2)
Defined in: [rules/types.ts:2](https://github.com/epilot-dev/switching-deadlines/blob/399b2cc39d63ef20d5c31e06d92ee448511e691c/src/rules/types.ts#L2)
Loading
Loading