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; +}