diff --git a/src/services/enedisMonthlyAnalysisData.service.ts b/src/services/enedisMonthlyAnalysisData.service.ts index f8a2af62788fcfaaee295a1f3f3a2e3910c7e090..70af4e00a46a9e7a73bb58922b001a60d9ac797c 100644 --- a/src/services/enedisMonthlyAnalysisData.service.ts +++ b/src/services/enedisMonthlyAnalysisData.service.ts @@ -56,7 +56,7 @@ export default class EnedisMonthlyAnalysisDataService { } /** - * Aggregates Enedis Analysis data in order to create Dataload inhjectable in graph component + * Aggregates Enedis Analysis data in order to create Dataload injectable in graph component * @param {EnedisMonthlyAnalysisData} data * @returns {AggregatedEnedisMonthlyDataloads} */ diff --git a/src/targets/services/enedisHalfHourMonthlyAnalysis.ts b/src/targets/services/enedisHalfHourMonthlyAnalysis.ts index 4309efcf7607835ca7a31ca0749ce04cc2a3d11e..980b2cb71745fd88172b8279b185fa3398817319 100644 --- a/src/targets/services/enedisHalfHourMonthlyAnalysis.ts +++ b/src/targets/services/enedisHalfHourMonthlyAnalysis.ts @@ -69,8 +69,9 @@ const populateArrayWithTotalData = ( if (halfHourValue >= 0) { if (!monthlyArray[index]) { monthlyArray.push([]) + } else { + monthlyArray[index] = [...monthlyArray[index], halfHourValue] } - monthlyArray[index] = [...monthlyArray[index], halfHourValue] } }) } @@ -134,7 +135,7 @@ const getEnedisMonthAnalysisData = async ( year: year, } if (data) { - // 48 is the number of halfhour entries in a day + // 48 is the number of half-hour entries in a day const weekEndValuesArray: number[][] = new Array([]) const weekValuesArray: number[][] = new Array([]) @@ -231,7 +232,7 @@ const syncEnedisMonthlyAnalysisDataDoctype = async ({ ) } } - logStack('info', 'Getting first endis half hour data date') + logStack('info', 'Getting first enedis half hour data date') if (lastEnedisMonthlyAnalysis.length > 0) { // If user has more than one entry (already synced), fetch the full history @@ -242,12 +243,12 @@ const syncEnedisMonthlyAnalysisDataDoctype = async ({ firstEnedisMonthlyAnalysis[0]?.month === firstMinuteData[0].month && firstEnedisMonthlyAnalysis[0]?.year === firstMinuteData[0].year ) { - logStack('info', 'Every Enedis Anlysis already synchronized') + logStack('info', 'Every Enedis Analysis already synchronized') return } else if (firstEnedisMonthlyAnalysis) { logStack( 'info', - 'Doctype is partially completed, fetiching all available history' + 'Doctype is partially completed, fetching all available history' ) const firstEnedisMonthlyAnalysisDate = DateTime.fromObject({ year: firstEnedisMonthlyAnalysis[0].year,