EPIC-P1-002: Auth entities - Add user-profile.entity.ts - Add profile-tool.entity.ts - Add profile-module.entity.ts - Add user-profile-assignment.entity.ts - Add device.entity.ts - Update auth entities index EPIC-P1-003: DDL-Entity sync - Add isSuperadmin, mfaEnabled, mfaSecretEncrypted fields to User - Add mfaBackupCodes, oauthProvider, oauthProviderId fields to User EPIC-P1-005: Fix test compilation errors - Fix accounts.service.spec.ts - Fix products.service.spec.ts - Fix warehouses.service.spec.ts Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
28 lines
690 B
TypeScript
28 lines
690 B
TypeScript
import {
|
|
Entity,
|
|
PrimaryGeneratedColumn,
|
|
Column,
|
|
ManyToOne,
|
|
JoinColumn,
|
|
} from 'typeorm';
|
|
import { UserProfile } from './user-profile.entity.js';
|
|
|
|
@Entity({ schema: 'auth', name: 'profile_modules' })
|
|
export class ProfileModule {
|
|
@PrimaryGeneratedColumn('uuid')
|
|
id: string;
|
|
|
|
@Column({ type: 'uuid', nullable: false, name: 'profile_id' })
|
|
profileId: string;
|
|
|
|
@Column({ type: 'varchar', length: 50, nullable: false, name: 'module_code' })
|
|
moduleCode: string;
|
|
|
|
@Column({ name: 'is_enabled', default: true })
|
|
isEnabled: boolean;
|
|
|
|
@ManyToOne(() => UserProfile, (p) => p.modules, { onDelete: 'CASCADE' })
|
|
@JoinColumn({ name: 'profile_id' })
|
|
profile: UserProfile;
|
|
}
|