Save 'reason' of Stop Transaction
MODIFY
src/server/ocpp/utils/OCPPUtils.ts
src/server/ocpp/utils/OCPPUtils.ts
@@ -645,6 +645,7 @@ export default class OCPPUtils {
stopTransaction: OCPPStopTransactionRequestExtended, user: User, alternateUser: User, tagId: string): void {
// Set final data
transaction.stop = {
+ reason: stopTransaction.reason,
meterStop: stopTransaction.meterStop,
timestamp: Utils.convertToDate(stopTransaction.timestamp),
userID: (alternateUser ? alternateUser.id : (user ? user.id : null)),

MODIFY
src/storage/mongodb/TransactionStorage.ts
src/storage/mongodb/TransactionStorage.ts
@@ -111,6 +111,7 @@ export default class TransactionStorage {
timestamp: Utils.convertToDate(transactionToSave.stop.timestamp),
tagID: transactionToSave.stop.tagID,
meterStop: transactionToSave.stop.meterStop,
+ reason: transactionToSave.stop.reason,
transactionData: transactionToSave.stop.transactionData,
stateOfCharge: Utils.convertToInt(transactionToSave.stop.stateOfCharge),
signedData: transactionToSave.stop.signedData,

MODIFY
src/types/Transaction.ts
src/types/Transaction.ts
@@ -122,6 +122,7 @@ export interface CSPhasesUsed {
export interface TransactionStop {
timestamp: Date;
meterStop: number;
+ reason?: string;
tagID: string;
userID: string;
user?: User;

Save 'reason' of Stop Transaction