fix: remove monthly recurring charging profiles
authorJérôme Benoit <jerome.benoit@sap.com>
Mon, 24 Jul 2023 12:09:50 +0000 (14:09 +0200)
committerJérôme Benoit <jerome.benoit@sap.com>
Mon, 24 Jul 2023 12:09:50 +0000 (14:09 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
src/charging-station/ChargingStationUtils.ts
src/types/ocpp/1.6/ChargingProfile.ts

index f6119f3da91580ae65aae62aa7abcb5651f54d6b..090ca65d1edcec3648c4fe9f6b3502d3e9097ae6 100644 (file)
@@ -6,19 +6,15 @@ import { fileURLToPath } from 'node:url';
 import chalk from 'chalk';
 import {
   addDays,
-  addMonths,
   addSeconds,
   addWeeks,
-  endOfMonth,
   endOfWeek,
   isAfter,
   isBefore,
   isTomorrow,
   isYesterday,
-  startOfMonth,
   startOfWeek,
   subDays,
-  subMonths,
   subWeeks,
 } from 'date-fns';
 
@@ -712,13 +708,6 @@ const getLimitFromChargingProfiles = (
             subWeeks(chargingSchedule.startSchedule, 1);
           }
           break;
-        case RecurrencyKindType.MONTHLY:
-          if (isBefore(chargingSchedule.startSchedule, startOfMonth(currentDate))) {
-            addMonths(chargingSchedule.startSchedule, 1);
-          } else if (isAfter(chargingSchedule.startSchedule, endOfMonth(currentDate))) {
-            subMonths(chargingSchedule.startSchedule, 1);
-          }
-          break;
       }
     }
     // Check if the charging profile is active
index b2909699d4856b90d93f7dce98a88012061a9802..430f6c2865d39a866f0714b8ba9bd36cec39e008 100644 (file)
@@ -46,5 +46,4 @@ export enum OCPP16ChargingProfilePurposeType {
 export enum OCPP16RecurrencyKindType {
   DAILY = 'Daily',
   WEEKLY = 'Weekly',
-  MONTHLY = 'Monthly',
 }