- Add audit controller, routes, middleware and services - Add MFA controller, routes and services - Add feature flags module with controllers, DTOs, middleware and services - Update auth, financial, inventory entities - Update package.json dependencies Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
37 lines
930 B
TypeScript
37 lines
930 B
TypeScript
import {
|
|
Entity,
|
|
PrimaryGeneratedColumn,
|
|
Column,
|
|
ManyToOne,
|
|
JoinColumn,
|
|
CreateDateColumn,
|
|
} from 'typeorm';
|
|
import { User } from './user.entity.js';
|
|
import { UserProfile } from './user-profile.entity.js';
|
|
|
|
@Entity({ schema: 'auth', name: 'user_profile_assignments' })
|
|
export class UserProfileAssignment {
|
|
@PrimaryGeneratedColumn('uuid')
|
|
id: string;
|
|
|
|
@Column({ type: 'uuid', nullable: false, name: 'user_id' })
|
|
userId: string;
|
|
|
|
@Column({ type: 'uuid', nullable: false, name: 'profile_id' })
|
|
profileId: string;
|
|
|
|
@Column({ type: 'boolean', name: 'is_default', default: false })
|
|
isDefault: boolean;
|
|
|
|
@CreateDateColumn({ name: 'assigned_at', type: 'timestamp' })
|
|
assignedAt: Date;
|
|
|
|
@ManyToOne(() => User, { onDelete: 'CASCADE' })
|
|
@JoinColumn({ name: 'user_id' })
|
|
user: User;
|
|
|
|
@ManyToOne(() => UserProfile, { onDelete: 'CASCADE' })
|
|
@JoinColumn({ name: 'profile_id' })
|
|
profile: UserProfile;
|
|
}
|