mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-26 18:42:49 +00:00
46 lines
1.4 KiB
TypeScript
46 lines
1.4 KiB
TypeScript
import { BaseEntity } from '@edr/api-common';
|
|
import { Column, Entity, Index, ManyToOne, JoinColumn } from 'typeorm';
|
|
import { Company } from './company.entity';
|
|
|
|
@Entity({ schema: 'freight', name: 'external_profiles' })
|
|
@Index(['userId'])
|
|
@Index(['companyId'])
|
|
export class ExternalProfile extends BaseEntity {
|
|
@Column({ name: 'user_id', type: 'uuid' })
|
|
userId!: string;
|
|
|
|
@Column({ name: 'company_id', type: 'uuid' })
|
|
companyId!: string;
|
|
|
|
@ManyToOne(() => Company, (company) => company.profiles)
|
|
@JoinColumn({ name: 'company_id' })
|
|
company!: Company;
|
|
|
|
@Column({ name: 'first_name', type: 'varchar', length: 100 })
|
|
firstName!: string;
|
|
|
|
@Column({ name: 'last_name', type: 'varchar', length: 100 })
|
|
lastName!: string;
|
|
|
|
@Column({ name: 'national_id', type: 'varchar', length: 50, nullable: true })
|
|
nationalId?: string | null;
|
|
|
|
@Column({ name: 'job_title', type: 'varchar', length: 100, nullable: true })
|
|
jobTitle?: string | null;
|
|
|
|
@Column({ name: 'is_primary_contact', type: 'boolean', default: false })
|
|
isPrimaryContact!: boolean;
|
|
|
|
/** Coarse resume point for the onboarding wizard (e.g. 'role', 'company', 'documents', 'done'). */
|
|
@Column({
|
|
name: 'onboarding_step',
|
|
type: 'varchar',
|
|
length: 40,
|
|
nullable: true,
|
|
})
|
|
onboardingStep?: string | null;
|
|
|
|
@Column({ name: 'onboarding_completed', type: 'boolean', default: false })
|
|
onboardingCompleted!: boolean;
|
|
}
|