54 lines
1.1 KiB
TypeScript
54 lines
1.1 KiB
TypeScript
import { Entity, Column, Index } from 'typeorm';
|
|
import { BasePlace } from './base-place.entity';
|
|
|
|
export enum CandidateStatus {
|
|
PENDING = 'PENDING',
|
|
APPROVED = 'APPROVED',
|
|
REJECTED = 'REJECTED'
|
|
}
|
|
|
|
export enum CountryCode {
|
|
JORDAN = 'JORDAN',
|
|
SYRIA = 'SYRIA',
|
|
EGYPT = 'EGYPT',
|
|
IRAQ = 'IRAQ'
|
|
}
|
|
|
|
@Entity('map_candidates')
|
|
export class MapCandidate extends BasePlace {
|
|
@Column({
|
|
type: 'enum',
|
|
enum: CandidateStatus,
|
|
default: CandidateStatus.PENDING
|
|
})
|
|
@Index()
|
|
status: CandidateStatus;
|
|
|
|
@Column({ nullable: true })
|
|
@Index()
|
|
submittedBy: string; // Email or User UID
|
|
|
|
@Column({ type: 'text', nullable: true })
|
|
rejectionReason: string;
|
|
|
|
@Column({
|
|
type: 'enum',
|
|
enum: CountryCode,
|
|
default: CountryCode.JORDAN
|
|
})
|
|
@Index()
|
|
country: CountryCode;
|
|
|
|
@Column({ type: 'jsonb', nullable: true })
|
|
metadata: any; // For photos, extra contact info, etc.
|
|
|
|
@Column({ nullable: true })
|
|
verified_name: string;
|
|
|
|
@Column({ type: 'int', default: 0 })
|
|
confidence_score: number;
|
|
|
|
@Column({ type: 'jsonb', nullable: true })
|
|
verification_metadata: any;
|
|
}
|