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

@Entity('email_templates')
export class EmailTemplate {
  @PrimaryGeneratedColumn('uuid')
  id: string;

  @Column({ unique: true })
  template_name: string;

  @Column()
  subject: string;

  @Column({ type: 'text' })
  body_html: string;

  @Column({ type: 'json', nullable: true })
  variables: string[];

  @Column({ nullable: true })
  description: string;

  @Column({ default: 'en', length: 10 })
  language_code: string;

  @Column({ type: 'enum', enum: ['transactional', 'marketing', 'system'], default: 'transactional' })
  category: string;

  @Column({ type: 'enum', enum: ['candidate', 'employer', 'admin', 'internal'], nullable: true })
  recipient: string;

  @Column({ default: true })
  is_active: boolean;

  @CreateDateColumn()
  created_at: Date;

  @UpdateDateColumn()
  updated_at: Date;
}