import type { ValidateFunction } from 'ajv'
import type { ChargingStation } from '../../../charging-station/index.js'
+import type { CertificateSigningUseEnumType } from '../../../types/index.js'
import type { OCPPResponseService } from '../OCPPResponseService.js'
import { OCPPError } from '../../../exception/index.js'
import {
- type CertificateSigningUseEnumType,
ErrorType,
type JsonObject,
type JsonType,
triggerReason: OCPP20TriggerReasonEnumType,
connectorId: number,
transactionId: string,
- options: OCPP20TransactionEventOptions = {}
+ options: Omit<OCPP20TransactionEventOptions, 'eventType'> = {}
): Promise<OCPP20TransactionEventResponse> {
try {
const connectorStatus = chargingStation.getConnectorStatus(connectorId)
commandParams: OCPP20TransactionEventOptions
): OCPP20TransactionEventRequest {
const eventType = commandParams.eventType
- if (eventType == null) {
- throw new OCPPError(
- ErrorType.PROPERTY_CONSTRAINT_VIOLATION,
- 'eventType is required for TransactionEvent'
- )
- }
const defaultTriggerReason =
eventType === OCPP20TransactionEventEnumType.Ended
? OCPP20TriggerReasonEnumType.RemoteStop
chargingState?: OCPP20ChargingStateEnumType
connectorId?: number
customData?: CustomDataType
- eventType?: OCPP20TransactionEventEnumType
+ eventType: OCPP20TransactionEventEnumType
evse?: Partial<OCPP20EVSEType>
evseId?: number
idToken?: OCPP20IdTokenType