update naming of classes and tests

This commit is contained in:
2025-03-24 09:20:10 -07:00
parent 135a294e5d
commit 619ef9a27f
8 changed files with 26 additions and 26 deletions

View File

@@ -1,7 +1,7 @@
import { NotificationService } from "./services/NotificationService";
import { ETANotificationScheduler } from "./notifications/schedulers/ETANotificationScheduler";
import { GetterSetterRepository } from "./repositories/GetterSetterRepository";
export interface ServerContext {
repository: GetterSetterRepository;
notificationService: NotificationService;
notificationService: ETANotificationScheduler;
}

View File

@@ -5,7 +5,7 @@ import { MergedResolvers } from "./MergedResolvers";
import { ServerContext } from "./ServerContext";
import { UnoptimizedInMemoryRepository } from "./repositories/UnoptimizedInMemoryRepository";
import { TimedApiBasedRepositoryLoader } from "./loaders/TimedApiBasedRepositoryLoader";
import { NotificationService } from "./services/NotificationService";
import { ETANotificationScheduler } from "./notifications/schedulers/ETANotificationScheduler";
import { configDotenv } from "dotenv";
import { loadTestData } from "./loaders/loadTestData";
@@ -21,16 +21,16 @@ async function main() {
});
const repository = new UnoptimizedInMemoryRepository();
let notificationService: NotificationService;
let notificationService: ETANotificationScheduler;
if (process.argv.length > 2 && process.argv[2] == "integration-testing") {
await loadTestData(repository);
notificationService = new NotificationService(repository, false);
notificationService = new ETANotificationScheduler(repository, false);
} else {
const repositoryDataUpdater = new TimedApiBasedRepositoryLoader(
repository
);
await repositoryDataUpdater.start();
notificationService = new NotificationService(repository);
notificationService = new ETANotificationScheduler(repository);
}
notificationService.reloadAPNsTokenIfTimePassed();

View File

@@ -1,8 +1,8 @@
import { GetterRepository } from "../repositories/GetterRepository";
import { GetterRepository } from "../../repositories/GetterRepository";
import jwt from "jsonwebtoken";
import fs from "fs";
import { TupleKey } from "../types/TupleKey";
import { IEta } from "../entities/entities";
import { TupleKey } from "../../types/TupleKey";
import { IEta } from "../../entities/entities";
import http2 from "http2";
export interface ScheduledNotificationData {
@@ -17,7 +17,7 @@ interface APNsUrl {
host: string;
}
export class NotificationService {
export class ETANotificationScheduler {
public readonly secondsThresholdForNotificationToFire = 180;
private apnsToken: string | undefined = undefined;
@@ -113,7 +113,7 @@ export class NotificationService {
throw new Error("APNS_BUNDLE_ID environment variable is not set correctly");
}
const { path, host } = NotificationService.getAPNsFullUrlToUse(deviceId);
const { path, host } = ETANotificationScheduler.getAPNsFullUrlToUse(deviceId);
const headers = {
':method': 'POST',