+ const reservationExists = !isUndefined(this.getReservationBy('reservationId', reservationId));
+ if (arguments.length === 1) {
+ return !reservationExists;
+ } else if (arguments.length > 1) {
+ const userReservationExists =
+ !isUndefined(idTag) && isUndefined(this.getReservationBy('idTag', idTag!)) ? false : true;
+ const notConnectorZero = isUndefined(connectorId) ? true : connectorId! > 0;
+ const freeConnectorsAvailable = this.getNumberOfReservableConnectors() > 0;
+ return (
+ !reservationExists && !userReservationExists && notConnectorZero && freeConnectorsAvailable
+ );