email refactor

This commit is contained in:
jackiettran
2025-11-14 17:36:35 -05:00
parent 629f0055a1
commit 3a6da3d47d
25 changed files with 3176 additions and 2219 deletions

View File

@@ -0,0 +1,58 @@
const AuthEmailService = require("./domain/AuthEmailService");
const FeedbackEmailService = require("./domain/FeedbackEmailService");
const ForumEmailService = require("./domain/ForumEmailService");
const MessagingEmailService = require("./domain/MessagingEmailService");
const CustomerServiceEmailService = require("./domain/CustomerServiceEmailService");
const RentalFlowEmailService = require("./domain/RentalFlowEmailService");
const RentalReminderEmailService = require("./domain/RentalReminderEmailService");
const UserEngagementEmailService = require("./domain/UserEngagementEmailService");
const AlphaInvitationEmailService = require("./domain/AlphaInvitationEmailService");
/**
* EmailServices aggregates all domain-specific email services
* This class provides a unified interface to access all email functionality
*/
class EmailServices {
constructor() {
// Initialize all domain services
this.auth = new AuthEmailService();
this.feedback = new FeedbackEmailService();
this.forum = new ForumEmailService();
this.messaging = new MessagingEmailService();
this.customerService = new CustomerServiceEmailService();
this.rentalFlow = new RentalFlowEmailService();
this.rentalReminder = new RentalReminderEmailService();
this.userEngagement = new UserEngagementEmailService();
this.alphaInvitation = new AlphaInvitationEmailService();
this.initialized = false;
}
/**
* Initialize all email services
* @returns {Promise<void>}
*/
async initialize() {
if (this.initialized) return;
await Promise.all([
this.auth.initialize(),
this.feedback.initialize(),
this.forum.initialize(),
this.messaging.initialize(),
this.customerService.initialize(),
this.rentalFlow.initialize(),
this.rentalReminder.initialize(),
this.userEngagement.initialize(),
this.alphaInvitation.initialize(),
]);
this.initialized = true;
console.log("All Email Services initialized successfully");
}
}
// Create and export singleton instance
const emailServices = new EmailServices();
module.exports = emailServices;