refactor: inventory to nestjs

This commit is contained in:
Ahmed Bouhuolia
2025-01-15 14:14:44 +02:00
parent e7e7a95aa1
commit 936800600b
32 changed files with 455 additions and 227 deletions

View File

@@ -5,29 +5,26 @@ import { MAIL_TRANSPORTER_PROVIDER } from './Mail.constants';
import { MailTransporter } from './MailTransporter.service';
@Module({
imports: [
providers: [
{
module: MailModule,
providers: [
{
provide: MAIL_TRANSPORTER_PROVIDER,
useFactory: (configService: ConfigService) => {
// Create reusable transporter object using the default SMTP transport
const transporter = createTransport({
host: configService.get('mail.host'),
port: configService.get('mail.port'),
secure: configService.get('mail.secure'), // true for 465, false for other ports
auth: {
user: configService.get('mail.username'),
pass: configService.get('mail.password'),
},
});
return transporter;
provide: MAIL_TRANSPORTER_PROVIDER,
inject: [ConfigService],
useFactory: (configService: ConfigService) => {
// Create reusable transporter object using the default SMTP transport
const transporter = createTransport({
host: configService.get('mail.host'),
port: configService.get('mail.port'),
secure: configService.get('mail.secure'), // true for 465, false for other ports
auth: {
user: configService.get('mail.username'),
pass: configService.get('mail.password'),
},
},
],
});
return transporter;
},
},
MailTransporter
MailTransporter,
],
exports: [MAIL_TRANSPORTER_PROVIDER, MailTransporter],
})
export class MailModule {}