Spaces:
Sleeping
Sleeping
| import { | |
| Entity, | |
| PrimaryGeneratedColumn, | |
| Column, | |
| CreateDateColumn, | |
| UpdateDateColumn, | |
| ManyToOne, | |
| JoinColumn, | |
| } from 'typeorm'; | |
| import { User } from '../../auth/entities/user.entity'; | |
| export enum IntegrationType { | |
| LMS = 'lms', | |
| SSO = 'sso', | |
| PAYMENT = 'payment', | |
| EMAIL = 'email', | |
| SMS = 'sms', | |
| AI = 'ai', | |
| STORAGE = 'storage', | |
| OTHER = 'other', | |
| } | |
| export enum HealthStatus { | |
| HEALTHY = 'healthy', | |
| DEGRADED = 'degraded', | |
| DOWN = 'down', | |
| } | |
| ('api_integrations') | |
| export class ApiIntegration { | |
| ({ name: 'integration_id', type: 'bigint', unsigned: true }) | |
| integrationId: number; | |
| ({ name: 'campus_id', type: 'bigint', unsigned: true }) | |
| campusId: number; | |
| ({ name: 'integration_name', type: 'varchar', length: 100 }) | |
| integrationName: string; | |
| ({ | |
| name: 'integration_type', | |
| type: 'enum', | |
| enum: IntegrationType, | |
| }) | |
| integrationType: IntegrationType; | |
| ({ name: 'api_endpoint', type: 'varchar', length: 500, nullable: true }) | |
| apiEndpoint: string; | |
| ({ name: 'api_key_encrypted', type: 'varchar', length: 500, nullable: true }) | |
| apiKeyEncrypted: string; | |
| ({ name: 'api_secret_encrypted', type: 'varchar', length: 500, nullable: true }) | |
| apiSecretEncrypted: string; | |
| ({ name: 'configuration', type: 'longtext', nullable: true }) | |
| configuration: string; | |
| ({ name: 'is_active', type: 'tinyint', default: 1 }) | |
| isActive: boolean; | |
| ({ | |
| name: 'health_status', | |
| type: 'enum', | |
| enum: HealthStatus, | |
| default: HealthStatus.HEALTHY, | |
| }) | |
| healthStatus: HealthStatus; | |
| ({ name: 'last_sync_at', type: 'timestamp', nullable: true }) | |
| lastSyncAt: Date; | |
| ({ name: 'created_by', type: 'bigint', unsigned: true, nullable: true }) | |
| createdBy: number; | |
| ({ name: 'updated_by', type: 'bigint', unsigned: true, nullable: true }) | |
| updatedBy: number; | |
| ({ name: 'created_at' }) | |
| createdAt: Date; | |
| ({ name: 'updated_at' }) | |
| updatedAt: Date; | |
| (() => User) | |
| ({ name: 'created_by' }) | |
| createdByUser: User; | |
| (() => User) | |
| ({ name: 'updated_by' }) | |
| updatedByUser: User; | |
| } | |