From e44ecfeb5f47b13f21ae572f055d812fed316fb1 Mon Sep 17 00:00:00 2001 From: KenTandrian Date: Tue, 14 Jul 2026 22:57:58 +0700 Subject: [PATCH] feat(api): create interface for BetterStack update SLA response --- .../queues/statistics-gathering/interfaces/interfaces.ts | 7 +++++++ .../statistics-gathering/statistics-gathering.processor.ts | 4 +++- 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 apps/api/src/services/queues/statistics-gathering/interfaces/interfaces.ts diff --git a/apps/api/src/services/queues/statistics-gathering/interfaces/interfaces.ts b/apps/api/src/services/queues/statistics-gathering/interfaces/interfaces.ts new file mode 100644 index 000000000..3c316720f --- /dev/null +++ b/apps/api/src/services/queues/statistics-gathering/interfaces/interfaces.ts @@ -0,0 +1,7 @@ +export interface BetterStackUptimeSlaResponse { + data: { + attributes: { + availability: number; + }; + }; +} diff --git a/apps/api/src/services/queues/statistics-gathering/statistics-gathering.processor.ts b/apps/api/src/services/queues/statistics-gathering/statistics-gathering.processor.ts index 82f362d25..b64efaad8 100644 --- a/apps/api/src/services/queues/statistics-gathering/statistics-gathering.processor.ts +++ b/apps/api/src/services/queues/statistics-gathering/statistics-gathering.processor.ts @@ -25,6 +25,8 @@ import { Injectable, Logger } from '@nestjs/common'; import * as cheerio from 'cheerio'; import { format, subDays } from 'date-fns'; +import { BetterStackUptimeSlaResponse } from './interfaces/interfaces'; + @Injectable() @Processor(STATISTICS_GATHERING_QUEUE) export class StatisticsGatheringProcessor { @@ -225,7 +227,7 @@ export class StatisticsGatheringProcessor { ) } ) - .then((res) => res.json()); + .then((res) => res.json()); return data.attributes.availability / 100; } catch (error) {