README
@epilot/switching-deadlines
epilot Contract Switching Deadlines Utilities
A TypeScript library for handling German energy market compliance requirements, specifically supplier switching deadlines as defined by GPKE (power) and GeLi Gas (gas).
This library is regularly updated to reflect the latest calendar updates. You can find the changelog at here.
β¨ Featuresβ
π Automatic calculation of switching deadlines
Handles supplier switching deadlines for power and gas according to GPKE and GeLi Gas.
π Use-case and commodity-aware
Separate rules for power (Strom) and gas (Gas), covering multiple switching scenarios:
- Supplier switch (Lieferantenwechsel)
- Relocation (Umzug)
- New connection / initial supply (Neuanlage / Erstbelieferung)
π Public and special holidays included
Accounts for one-time public holidays and special holidays (Sonderfeiertage), e.g.:
- 8 May 2025 (Tag der Befreiung, Berlin public holiday)
- 6 June 2025 (Einmaliger Sonderfeiertag zur EinfΓΌhrung des LFW24)
π Quick Startβ
Install via npm
, yarn
, or pnpm
:
npm install @epilot/switching-deadlines
The library provides helper functions for simple calculations.
With calculateDeadline
, you can calculate the deadline for a given commodity, use case, and date:
import { calculateDeadline, Commodity, UseCase } from '@epilot/switching-deadlines';
const result = calculateDeadline({
commodity: Commodity.POWER,
useCase: UseCase.SWITCH,
requiresTermination: true,
fromDate: '2025-10-01'
});
console.log(result); // '2025-10-07'
For multiple calculations, use the DeadlineCalculator
class directly:
import { DeadlineCalculator, Commodity, UseCase } from '@epilot/switching-deadlines';
const calculator = new DeadlineCalculator()
const today = new Date()
const relocationResult = calculator.calculateEarliestStartDate(
{
commodity: Commodity.POWER,
useCase: UseCase.RELOCATION,
requiresTermination: false
},
today
)
const switchResult = calculator.calculateEarliestStartDate(
{
commodity: Commodity.POWER,
useCase: UseCase.SWITCH,
requiresTermination: true
},
today
)
console.log(
`${`The earliest start date is ${relocationResult.earliestStartDate} for relocation and ${switchResult.earliestStartDate} for switching`}`
)
You can find more information in the π usage examples.
Comprehensive documentation and background information are available in the π epilot dev center.
π Disclaimerβ
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, which offers the same logic as a web service.
For questions or feedback regarding this library, please reach out to the epilot team.
Built with β€οΈ love & dedication π₯ by team Tauro at epilot.