45 lines
1.2 KiB
TypeScript
45 lines
1.2 KiB
TypeScript
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;
|
|
}
|