// ── Asset Types ───────────────────────────────────────────────────────────────
export const AssetType = {
  OFFICE: 'OFFICE',
  RETAIL: 'RETAIL',
  GASTRO: 'GASTRO',              // legacy – kept for mock-data compatibility
  LIGHT_INDUSTRIAL: 'LIGHT_INDUSTRIAL',
  LOGISTICS: 'LOGISTICS',
  PRODUCTION: 'PRODUCTION',
  MIXED: 'MIXED',
  UNKNOWN: 'UNKNOWN',
} as const
export type AssetType = typeof AssetType[keyof typeof AssetType]

// ── Result Types ──────────────────────────────────────────────────────────────
export const ResultType = {
  VERIFIED_PORTFOLIO: 'VERIFIED_PORTFOLIO',
  MAISON_WORK: 'MAISON_WORK',
  FUTURE_AVAILABILITY: 'FUTURE_AVAILABILITY',
} as const
export type ResultType = typeof ResultType[keyof typeof ResultType]

// ── Match Strength ─────────────────────────────────────────────────────────────
export const MatchStrength = {
  STRONG: 'STRONG',
  MODERATE: 'MODERATE',
  WEAK: 'WEAK',
} as const
export type MatchStrength = typeof MatchStrength[keyof typeof MatchStrength]

// ── Match Status ──────────────────────────────────────────────────────────────
export const MatchStatus = {
  PENDING_REVIEW: 'PENDING_REVIEW',
  APPROVED: 'APPROVED',
  REJECTED: 'REJECTED',
  SHORTLISTED: 'SHORTLISTED',
  ARCHIVED: 'ARCHIVED',
} as const
export type MatchStatus = typeof MatchStatus[keyof typeof MatchStatus]

// ── Risk Level ────────────────────────────────────────────────────────────────
export const RiskLevel = {
  LOW: 'LOW',
  MEDIUM: 'MEDIUM',
  HIGH: 'HIGH',
  CRITICAL: 'CRITICAL',
} as const
export type RiskLevel = typeof RiskLevel[keyof typeof RiskLevel]

// ── Confidence Level (qualitative) ───────────────────────────────────────────
export const ConfidenceLevel = {
  VERY_HIGH: 'VERY_HIGH',   // >= 0.90
  HIGH: 'HIGH',             // >= 0.75
  MEDIUM: 'MEDIUM',         // >= 0.55
  LOW: 'LOW',               // >= 0.35
  VERY_LOW: 'VERY_LOW',     // < 0.35
} as const
export type ConfidenceLevel = typeof ConfidenceLevel[keyof typeof ConfidenceLevel]

// ── Data Quality Level (qualitative) ─────────────────────────────────────────
export const DataQualityLevel = {
  HIGH: 'HIGH',             // >= 0.80
  MEDIUM: 'MEDIUM',         // >= 0.60
  LOW: 'LOW',               // < 0.60
  INCOMPLETE: 'INCOMPLETE', // missing critical fields
} as const
export type DataQualityLevel = typeof DataQualityLevel[keyof typeof DataQualityLevel]

// ── Availability Status ───────────────────────────────────────────────────────
export const AvailabilityStatus = {
  AVAILABLE_NOW: 'AVAILABLE_NOW',
  AVAILABLE_SOON: 'AVAILABLE_SOON',
  FUTURE_SIGNAL: 'FUTURE_SIGNAL',
  OCCUPIED: 'OCCUPIED',
  UNKNOWN: 'UNKNOWN',
} as const
export type AvailabilityStatus = typeof AvailabilityStatus[keyof typeof AvailabilityStatus]

// ── Availability Type (structural distinction) ────────────────────────────────
export const AvailabilityType = {
  CONFIRMED: 'CONFIRMED',        // verified, date known
  INDICATIVE: 'INDICATIVE',      // external listing, unconfirmed
  PROBABILISTIC: 'PROBABILISTIC', // AI signal, no confirmed date
} as const
export type AvailabilityType = typeof AvailabilityType[keyof typeof AvailabilityType]

// ── Source Type ───────────────────────────────────────────────────────────────
export const SourceType = {
  ERP_IMPORT: 'ERP_IMPORT',
  MANUAL_ENTRY: 'MANUAL_ENTRY',
  IMMOSCOUT_SCRAPE: 'IMMOSCOUT_SCRAPE',
  HOMEGATE_SCRAPE: 'HOMEGATE_SCRAPE',
  NEWHOME_SCRAPE: 'NEWHOME_SCRAPE',
  MATCHOFFICE_SCRAPE: 'MATCHOFFICE_SCRAPE',
  MAISON_WORK_SCRAPE: 'MAISON_WORK_SCRAPE',
  AI_SIGNAL: 'AI_SIGNAL',
  PARTNER_FEED: 'PARTNER_FEED',
  UNKNOWN: 'UNKNOWN',
} as const
export type SourceType = typeof SourceType[keyof typeof SourceType]

// ── Freshness Status ──────────────────────────────────────────────────────────
export const FreshnessStatus = {
  FRESH: 'FRESH',       // updated within 48h
  STALE: 'STALE',       // 2–14 days old
  OUTDATED: 'OUTDATED', // > 14 days old
} as const
export type FreshnessStatus = typeof FreshnessStatus[keyof typeof FreshnessStatus]

/** @deprecated Use FreshnessStatus — kept for mock-data backward compatibility */
export const DataFreshness = FreshnessStatus
export type DataFreshness = FreshnessStatus

// ── Review Status ─────────────────────────────────────────────────────────────
export const ReviewStatus = {
  UNREVIEWED: 'UNREVIEWED',
  IN_REVIEW: 'IN_REVIEW',
  APPROVED: 'APPROVED',
  REJECTED: 'REJECTED',
  FLAGGED: 'FLAGGED',
} as const
export type ReviewStatus = typeof ReviewStatus[keyof typeof ReviewStatus]

// ── Sensitivity Level ─────────────────────────────────────────────────────────
export const SensitivityLevel = {
  PUBLIC: 'PUBLIC',
  INTERNAL: 'INTERNAL',
  CONFIDENTIAL: 'CONFIDENTIAL',
  RESTRICTED: 'RESTRICTED',
} as const
export type SensitivityLevel = typeof SensitivityLevel[keyof typeof SensitivityLevel]

// ── Shortlist Status ──────────────────────────────────────────────────────────
export const ShortlistStatus = {
  DRAFT: 'DRAFT',
  REVIEW_READY: 'REVIEW_READY',
  FINALIZED: 'FINALIZED',
  ACTIVE: 'ACTIVE',
  SHARED: 'SHARED',
  ARCHIVED: 'ARCHIVED',
  CONVERTED: 'CONVERTED',
} as const
export type ShortlistStatus = typeof ShortlistStatus[keyof typeof ShortlistStatus]

// ── User Role ─────────────────────────────────────────────────────────────────
export const UserRole = {
  SUPER_ADMIN: 'SUPER_ADMIN',
  ORGANIZATION_ADMIN: 'ORGANIZATION_ADMIN',
  PROPERTY_MANAGER: 'PROPERTY_MANAGER',
  REVIEWER: 'REVIEWER',
  OWNER_VIEWER: 'OWNER_VIEWER',
  DEMAND_USER: 'DEMAND_USER',
} as const
export type UserRole = typeof UserRole[keyof typeof UserRole]

// ── Signal Type ───────────────────────────────────────────────────────────────
export const SignalType = {
  EXPANSION: 'EXPANSION',
  POSSIBLE_MOVE_OUT: 'POSSIBLE_MOVE_OUT',
  CONSTRUCTION_PROJECT: 'CONSTRUCTION_PROJECT',
  RESTRUCTURING: 'RESTRUCTURING',
  PROJECT_DEVELOPMENT: 'PROJECT_DEVELOPMENT',
  SPACE_CONSOLIDATION: 'SPACE_CONSOLIDATION',
  LEASE_EXPIRY: 'LEASE_EXPIRY',
} as const
export type SignalType = typeof SignalType[keyof typeof SignalType]

// ── Workspace ─────────────────────────────────────────────────────────────────
export const WorkspaceType = {
  SUPPLY: 'SUPPLY',
  DEMAND: 'DEMAND',
  OPERATIONS: 'OPERATIONS',
} as const
export type WorkspaceType = typeof WorkspaceType[keyof typeof WorkspaceType]
