- status: ResponseStatus.SUCCESS,
- hashIdsSucceeded: stationInfos.map(stationInfo => stationInfo.hashId)
- }
+ status: failedStationInfos.length > 0 ? ResponseStatus.FAILURE : ResponseStatus.SUCCESS,
+ hashIdsSucceeded: succeededStationInfos.map(stationInfo => stationInfo.hashId),
+ ...(failedStationInfos.length > 0 && {
+ hashIdsFailed: failedStationInfos.map(stationInfo => stationInfo.hashId)
+ }),
+ ...(err != null && { errorMessage: err.message, errorStack: err.stack })
+ } satisfies ResponsePayload