import { Entity, Column, PrimaryGeneratedColumn, CreateDateColumn, UpdateDateColumn } from 'typeorm';

@Entity('email_settings')
export class EmailSettings {
    @PrimaryGeneratedColumn('uuid')
    id: string;

    @Column({ default: 'smtp' })
    provider: string;

    @Column({ name: 'smtp_host', nullable: true })
    smtpHost: string;

    @Column({ name: 'smtp_port', nullable: true })
    smtpPort: number;

    @Column({ name: 'smtp_user', nullable: true })
    smtpUser: string;

    @Column({ name: 'smtp_pass', nullable: true })
    smtpPass: string; // Stored as is for now

    @Column({ name: 'smtp_secure', default: true })
    smtpSecure: boolean;

    @Column({ name: 'sender_name', default: 'GoHorse Jobs' })
    senderName: string;

    @Column({ name: 'sender_email', default: 'no-reply@gohorsejobs.com' })
    senderEmail: string;

    @Column({ name: 'amqp_url', nullable: true })
    amqpUrl: string;

    @Column({ name: 'is_active', default: true })
    isActive: boolean;

    @CreateDateColumn({ name: 'updated_at' })
    updatedAt: Date;
}
