Skip to content

Commit 9d4ddfa

Browse files
refactor(notifications): move providers into dedicated folder
1 parent 437fca2 commit 9d4ddfa

5 files changed

Lines changed: 4 additions & 16 deletions

File tree

src/notifications/index.ts

Lines changed: 0 additions & 4 deletions
This file was deleted.

src/notifications/notifications.module.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { Module, Global } from '@nestjs/common';
22
import { NotificationsService } from './notifications.service';
33
import { NotificationsController } from './notifications.controller';
4-
import { FirebaseProvider } from './firebase.provider';
5-
import { WebPushProvider } from './webpush.provider';
4+
import { FirebaseProvider } from './providers/firebase.provider';
5+
import { WebPushProvider } from './providers/webpush.provider';
66
import { CommonModule } from '../common/common.module';
77

88
@Global()

src/notifications/notifications.service.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import { DatabaseService } from '../common/database/database.service';
33
import { Prisma } from '@prisma/client';
44
import { NotificationPayload } from './interfaces/notification-payload.interface';
55
import { SubscriptionRecord, isWebKeys, isFcmKeys } from './interfaces/subscription-record.interface';
6-
import { WEB_PUSH } from './webpush.provider';
7-
import { FIREBASE_ADMIN } from './firebase.provider';
6+
import { WEB_PUSH } from './providers/webpush.provider';
7+
import { FIREBASE_ADMIN } from './providers/firebase.provider';
88
import { CreateSubscriptionDto } from './dto/create-subscription.dto';
99
import { MassNotificationDto } from './dto/mass-notification.dto';
1010
import webpush, { WebPushError } from 'web-push';

src/notifications/firebase.provider.ts renamed to src/notifications/providers/firebase.provider.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,6 @@ export const FirebaseProvider: Provider = {
1616
useFactory: () => {
1717
// Use process.cwd() and append '/../../google-services.json' to find project root file
1818
const serviceAccountPath = path.resolve(process.cwd(), 'google-services.json');
19-
console.log('[FirebaseProvider] Looking for service account at:', serviceAccountPath);
20-
const parentDir = path.dirname(serviceAccountPath);
21-
try {
22-
const files = fs.readdirSync(parentDir);
23-
console.log(`[FirebaseProvider] Files in ${parentDir}:`, files);
24-
} catch (err) {
25-
console.error(`[FirebaseProvider] Failed to list files in ${parentDir}:`, err);
26-
}
2719
if (!fs.existsSync(serviceAccountPath)) {
2820
console.error('[FirebaseProvider] google-services.json not found in project root.');
2921
throw new Error('google-services.json not found in project root');
File renamed without changes.

0 commit comments

Comments
 (0)