]> Piment Noir Git Repositories - e-mobility-charging-stations-simulator.git/commitdiff
fix(common): include Date in JsonPrimitive, restore Date fields
authorJérôme Benoit <jerome.benoit@sap.com>
Wed, 15 Apr 2026 23:54:33 +0000 (01:54 +0200)
committerJérôme Benoit <jerome.benoit@sap.com>
Wed, 15 Apr 2026 23:54:33 +0000 (01:54 +0200)
ui/common/src/types/JsonType.ts
ui/web/src/types/ChargingStationType.ts
ui/web/tests/unit/constants.ts

index ace385f0b90b1494b00f200acf462b426a55e5d0..c70ea84fc90c1b3d7dac33309a25a8bd4ff93920 100644 (file)
@@ -2,6 +2,6 @@ export type JsonObject = {
   [K in string]?: (JsonObject | JsonPrimitive)[] | JsonObject | JsonPrimitive
 }
 
-export type JsonPrimitive = boolean | null | number | string
+export type JsonPrimitive = boolean | Date | null | number | string
 
 export type JsonType = (JsonObject | JsonPrimitive)[] | JsonObject | JsonPrimitive
index 1a98ce19be0bace3cd7bb889f71845a97482e954..bfce74dd93b3680bd75ffb0f2cf8a08cf63922c7 100644 (file)
@@ -323,7 +323,7 @@ export const IncomingRequestCommand = {
 export type IncomingRequestCommand = OCPP16IncomingRequestCommand
 
 export interface OCPP16BootNotificationResponse extends JsonObject {
-  currentTime: string
+  currentTime: Date
   interval: number
   status: OCPP16RegistrationStatus
 }
@@ -351,17 +351,17 @@ export interface Status extends JsonObject {
   acceptedStartTransactionRequests?: number
   acceptedStopTransactionRequests?: number
   authorizeRequests?: number
-  lastRunDate?: string
+  lastRunDate?: Date
   rejectedAuthorizeRequests?: number
   rejectedStartTransactionRequests?: number
   rejectedStopTransactionRequests?: number
   skippedConsecutiveTransactions?: number
   skippedTransactions?: number
   start?: boolean
-  startDate?: string
+  startDate?: Date
   startTransactionRequests?: number
-  stopDate?: string
-  stoppedDate?: string
+  stopDate?: Date
+  stoppedDate?: Date
   stopTransactionRequests?: number
 }
 
index 3b326f031affcf4d4a2ef5386146cecf91d1c8bc..ea1dd5b9f211245ad8d8f9c50644b01dedde8929 100644 (file)
@@ -38,7 +38,7 @@ export function createChargingStationData (
 ): ChargingStationData {
   return {
     bootNotificationResponse: {
-      currentTime: '2024-01-01T00:00:00.000Z',
+      currentTime: new Date('2024-01-01T00:00:00Z'),
       interval: 60,
       status: OCPP16RegistrationStatus.ACCEPTED,
     },