fix: Align NestJS entity columns with service expectations
Resolved 12 TypeScript compilation errors caused by mismatched column names between TypeORM entities and service layer. Entity changes: - NotificationsConfig: Renamed email_alerts_enabled → email_enabled, added email_address, standardized notification event column names (notify_on_start, notify_on_stop, notify_on_crash, etc.) - ScheduledTask: Renamed is_active → is_enabled, added last_run timestamp - TeamMember: Renamed accepted_at → joined_at to match service expectations - Role: Added description column for custom role metadata Service changes: - JwtStrategy: Updated to reference joined_at instead of accepted_at All services now compile cleanly against updated entity schemas. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
37
backend-nest/src/entities/role.entity.ts
Normal file
37
backend-nest/src/entities/role.entity.ts
Normal file
@@ -0,0 +1,37 @@
|
||||
import { Entity, PrimaryGeneratedColumn, Column, ManyToOne, JoinColumn } from 'typeorm';
|
||||
import { License } from './license.entity';
|
||||
|
||||
@Entity('roles')
|
||||
export class Role {
|
||||
@PrimaryGeneratedColumn('uuid')
|
||||
id: string;
|
||||
|
||||
@Column({ type: 'uuid', nullable: true })
|
||||
license_id: string | null;
|
||||
|
||||
@Column({ type: 'varchar', length: 50 })
|
||||
role_name: string;
|
||||
|
||||
@Column({ type: 'text', nullable: true })
|
||||
description: string | null;
|
||||
|
||||
@Column({ type: 'boolean', default: false })
|
||||
is_system_default: boolean;
|
||||
|
||||
@Column({ type: 'uuid', nullable: true })
|
||||
is_cloned_from: string | null;
|
||||
|
||||
@Column({ type: 'jsonb', default: {} })
|
||||
permissions: Record<string, any>;
|
||||
|
||||
@Column({ type: 'timestamptz', default: () => 'NOW()' })
|
||||
created_at: Date;
|
||||
|
||||
@ManyToOne(() => License, { onDelete: 'CASCADE', nullable: true })
|
||||
@JoinColumn({ name: 'license_id' })
|
||||
license: License | null;
|
||||
|
||||
@ManyToOne(() => Role, { onDelete: 'SET NULL', nullable: true })
|
||||
@JoinColumn({ name: 'is_cloned_from' })
|
||||
cloned_from: Role | null;
|
||||
}
|
||||
Reference in New Issue
Block a user