import type { JSONSchemaType } from 'ajv'
import {
- type Interval,
addSeconds,
areIntervalsOverlapping,
differenceInSeconds,
+ type Interval,
isAfter,
isBefore,
isWithinInterval
} from 'date-fns'
-import { OCPP16Constants } from './OCPP16Constants.js'
import {
type ChargingStation,
hasFeatureProfile,
} from '../../../types/index.js'
import { convertToDate, isNotEmptyArray, logger, roundTo } from '../../../utils/index.js'
import { OCPPServiceUtils } from '../OCPPServiceUtils.js'
+import { OCPP16Constants } from './OCPP16Constants.js'
export class OCPP16ServiceUtils extends OCPPServiceUtils {
public static checkFeatureProfile (
.filter((schedulePeriod, index) => {
if (
isWithinInterval(
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
- addSeconds(chargingScheduleInterval.start, schedulePeriod.startPeriod)!,
+ addSeconds(chargingScheduleInterval.start, schedulePeriod.startPeriod),
compositeInterval
)
) {
),
chargingSchedulePeriod: chargingSchedule.chargingSchedulePeriod.filter(schedulePeriod =>
isWithinInterval(
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
- addSeconds(chargingScheduleInterval.start, schedulePeriod.startPeriod)!,
+ addSeconds(chargingScheduleInterval.start, schedulePeriod.startPeriod),
compositeInterval
)
)