import { E as EntityType, C as CustomerStatus, L as LocationCompliance, U as UUID, T as Timestamp, P as PaginationParams, a as PaginatedResponse } from './types-B4Ezqo7V.js'; /** * Type definitions for Vesant Risk Profile Service * * These types match the Go structures in: * services/customer-risk-profile-service/internal/domain/customer_profile.go */ interface CustomerProfile { id: UUID; tenant_id: UUID; created_at: Timestamp; updated_at: Timestamp; customer_id: string; account_number?: string; entity_type: EntityType; customer_status: CustomerStatus; customer_tier?: string; date_of_establishment?: Timestamp; last_recorded_activity?: Timestamp; full_name?: string; date_of_birth?: Timestamp; age?: number; gender?: string; business_name?: string; registration_number?: string; country_of_incorporation?: string; date_of_incorporation?: Timestamp; legal_form?: LegalForm; nature_of_business?: string; tax_id?: string; annual_turnover?: number; primary_phone_number?: string; email_address: string; residential_address?: string; country_of_residence?: string; registered_address?: string; operating_address?: string; occupation?: string; employer_name?: string; employment_type?: EmploymentType; business_sector?: string; income_range?: string; source_of_funds?: string; source_of_wealth?: string; total_transactions: number; total_volume: number; flagged_transactions: number; risk_score: number; risk_category: RiskCategory; previous_risk_score?: number; previous_risk_category?: RiskCategory; risk_last_calculated?: Timestamp; watchlist_matches?: string[]; screening_status?: ScreeningStatus; is_pep: boolean; has_adverse_media: boolean; has_sanctions: boolean; requires_edd: boolean; edd_notes?: string; kyc_status?: string; identification_type?: string; identification_number?: string; id_issuing_country?: string; id_issue_date?: Timestamp; id_expiry_date?: Timestamp; location?: string; location_compliance?: LocationCompliance; risk_factors?: RiskFactor[]; risk_history?: RiskHistory[]; } type RiskCategory = 'low' | 'medium' | 'high' | 'critical'; type EmploymentType = 'salaried' | 'self_employed' | 'unemployed'; type LegalForm = 'limited' | 'partnership' | 'ngo' | 'trust' | 'sole_trader'; type ScreeningStatus = 'clear' | 'potential_match' | 'true_positive' | 'false_positive'; interface RiskFactor { id: UUID; tenant_id: UUID; profile_id: UUID; factor_type: RiskFactorType; factor_name: string; score: number; weight: number; weighted_score: number; description?: string; evidence?: Record; source_event?: string; source_service?: string; reference_id?: string; metadata?: Record; is_active: boolean; expires_at?: Timestamp; created_at: Timestamp; updated_at: Timestamp; } type RiskFactorType = 'kyc' | 'aml' | 'fraud' | 'geolocation' | 'transaction' | 'watchlist' | 'pep' | 'sanctions' | 'adverse_media'; interface RiskHistory { id: UUID; tenant_id: UUID; profile_id: UUID; previous_score: number; new_score: number; previous_category: RiskCategory; new_category: RiskCategory; change_reason: string; triggered_by: string; metadata?: Record; created_at: Timestamp; } interface CreateProfileRequest { customer_id: string; entity_type: EntityType; customer_status?: CustomerStatus; account_number?: string; customer_tier?: string; full_name?: string; date_of_birth?: string; gender?: string; business_name?: string; registration_number?: string; country_of_incorporation?: string; legal_form?: LegalForm; nature_of_business?: string; primary_phone_number?: string; email_address: string; residential_address?: string; country_of_residence?: string; registered_address?: string; operating_address?: string; occupation?: string; employment_type?: EmploymentType; income_range?: string; source_of_funds?: string; kyc_status?: string; location?: string; location_compliance?: LocationCompliance; } interface UpdateProfileRequest extends Partial { last_recorded_activity?: Timestamp; } interface ProfileDetailsResponse { profile: CustomerProfile; risk_factors: RiskFactor[]; risk_history: RiskHistory[]; watchlist_alert_count: number; fraud_alert_count: number; geolocation_alert_count: number; kyc_alert_count: number; } interface ProfileFilters extends PaginationParams { risk_category?: RiskCategory[]; min_risk_score?: number; max_risk_score?: number; entity_type?: EntityType[]; status?: CustomerStatus[]; location?: string[]; country_of_residence?: string[]; location_compliance?: LocationCompliance[]; is_pep?: boolean; has_sanctions?: boolean; has_adverse_media?: boolean; requires_edd?: boolean; kyc_status?: string[]; search?: string; sort_by?: 'risk_score' | 'created_at' | 'updated_at' | 'customer_id' | 'full_name'; sort_order?: 'asc' | 'desc'; } type ProfileListResponse = PaginatedResponse; interface RiskDashboardMetrics { total_risky_profiles: number; total_critical_profiles: number; total_high_profiles: number; total_medium_profiles: number; total_low_profiles: number; total_pep_profiles: number; total_sanctioned_profiles: number; total_edd_required: number; average_risk_score: number; risk_distribution: Array<{ category: RiskCategory; count: number; percentage: number; }>; trend_indicators: { critical_trend: 'up' | 'down' | 'stable'; critical_change: number; high_trend: 'up' | 'down' | 'stable'; high_change: number; }; recent_high_risk_profiles?: CustomerProfile[]; } interface RiskConfiguration { id: UUID; tenant_id: UUID; kyc_weight: number; aml_weight: number; fraud_weight: number; geolocation_weight: number; transaction_weight: number; watchlist_weight: number; critical_threshold: number; high_threshold: number; medium_threshold: number; auto_escalate_critical: boolean; create_case_on_critical: boolean; auto_block_sanctioned: boolean; require_review_on_pep: boolean; created_at: Timestamp; updated_at: Timestamp; } export type { CustomerProfile as C, EmploymentType as E, LegalForm as L, ProfileDetailsResponse as P, RiskCategory as R, ScreeningStatus as S, UpdateProfileRequest as U, RiskFactor as a, RiskFactorType as b, RiskHistory as c, CreateProfileRequest as d, ProfileFilters as e, ProfileListResponse as f, RiskDashboardMetrics as g, RiskConfiguration as h };