import { Column, Entity, PrimaryGeneratedColumn, CreateDateColumn, UpdateDateColumn, } from 'typeorm'; @Entity({ name: 'frm_integration_config' }) export class IntegrationConfig { @PrimaryGeneratedColumn({ name: 'id', type: 'int' }) id: number; @Column({ name: 'app_code', type: 'varchar', length: 100 }) app_code: string; @Column({ name: 'integration_type', type: 'varchar', length: 20 }) integration_type: string; @Column({ name: 'integration_provider', type: 'varchar', length: 100 }) integration_provider: string; @Column({ name: 'integration_source_id', type: 'int', nullable: true }) integration_source_id: number; @Column({ name: 'level_id', type: 'int' }) level_id: number; @Column({ name: 'level_type', type: 'varchar', length: 100 }) level_type: string; @Column({ name: 'status', type: 'int', default: 1 }) status: number; @Column({ name: 'priority', type: 'int', default: 1 }) priority: number; @Column({ name: 'is_default', type: 'boolean', default: false, nullable: true }) is_default: boolean; @Column({ name: 'config_json', type: 'json', nullable: true }) config_json: { // Gmail Config clientId?: string; clientSecret?: string; refreshToken?: string; accessToken?: string; email?: string; // Outlook Config tenantId?: string; // WhatsApp Config phoneNumberId?: string; apiVersion?: string; // Twilio Config accountSid?: string; authToken?: string; fromNumber?: string; // AWS SES Config accessKeyId?: string; secretAccessKey?: string; region?: string; fromEmail?: string; // SMTP Config (Gmail, Outlook, Generic) password?: string; host?: string; port?: number; secure?: boolean; user?: string; from?: string; tls?: any; // SendGrid SMTP Config apiKey?: string; templateId?: string; dynamicTemplateData?: any; // Knowlarity Config callerNumber?: string; apiSecret?: string; baseUrl?: string; callType?: 'voice' | 'sms'; voiceMessage?: string; language?: string; // User Integration external_user_id?: string; // Common fields subject?: string; html?: string; attachments?: any[]; cc?: string | string[]; bcc?: string | string[]; [key: string]: any; }; @CreateDateColumn({ name: 'created_at', type: 'timestamp', }) created_at: Date; @UpdateDateColumn({ name: 'updated_at', type: 'timestamp', }) updated_at: Date; }