From ab665e51b51bf763dbe919a995ec3d681fdd6adf Mon Sep 17 00:00:00 2001 From: enlineawork Date: Mon, 7 Sep 2026 20:44:42 -0300 Subject: [PATCH] feat(f4): add superadmin SMTP settings entity --- .../entities/system-smtp-settings.entity.ts | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 api-v3/src/database/entities/system-smtp-settings.entity.ts diff --git a/api-v3/src/database/entities/system-smtp-settings.entity.ts b/api-v3/src/database/entities/system-smtp-settings.entity.ts new file mode 100644 index 0000000..06ae268 --- /dev/null +++ b/api-v3/src/database/entities/system-smtp-settings.entity.ts @@ -0,0 +1,44 @@ +import { Column, Entity, PrimaryGeneratedColumn } from 'typeorm'; +import { TimestampedEntity } from './timestamped.entity'; + +export enum SmtpSecurityMode { + NONE = 'NONE', + STARTTLS = 'STARTTLS', + TLS = 'TLS', +} + +@Entity({ name: 'system_smtp_settings' }) +export class SystemSmtpSettings extends TimestampedEntity { + @PrimaryGeneratedColumn('uuid') + id!: string; + + @Column({ type: 'varchar', length: 255 }) + host!: string; + + @Column({ type: 'integer' }) + port!: number; + + @Column({ name: 'security_mode', type: 'varchar', length: 24, default: SmtpSecurityMode.STARTTLS }) + securityMode!: SmtpSecurityMode; + + @Column({ type: 'varchar', length: 255, nullable: true }) + username!: string | null; + + @Column({ name: 'password_enc', type: 'text', nullable: true }) + passwordEnc!: string | null; + + @Column({ name: 'from_name', type: 'varchar', length: 200 }) + fromName!: string; + + @Column({ name: 'from_email', type: 'varchar', length: 320 }) + fromEmail!: string; + + @Column({ name: 'reply_to', type: 'varchar', length: 320, nullable: true }) + replyTo!: string | null; + + @Column({ type: 'boolean', default: true }) + enabled!: boolean; + + @Column({ name: 'updated_by', type: 'uuid', nullable: true }) + updatedBy!: string | null; +}