+
    Jh                        R t R tR tR t]R8X  Ed^   ^ RIt^ RIt ]! RRRR	7      ;_uu_ 4       t]P                  ! ]4      t
RRR4       ]! R]! ]
4       R24       ]! R!4       ]! ]
4      t]! R4       ^ t] F  tR]9   g   K  ]! R]R,           24       ]! R]P%                  R^ 4      R 24       ]! R]P%                  R^ 4       R]P%                  R^ 4       R]P%                  R^ 4       R24       ]R,           F  t]! R] 24       K  	  ]^,          t]^8  g   K   M	  ]^ 8X  d	   ]! R4       ]! RRRR	7      ;_uu_ 4       t]P(                  ! ]]R^R7       RRR4       ]! R 4       R# R#   + '       g   i     EL9; i  ] d    ]! R
4       ]P                  ! ^4        EL`i ; i  + '       g   i     LX; i)"z
KPI Validation Layer
Overrides GPT scores when KPIs prove them impossible
Prevents glaring mistakes like scoring 5/5 for Guest when there's no building
c                &   V P                  4       pVP                  R4      pVP                  R4      pVP                  R4      pVP                  R4      p. pVe   V^ 8X  d   Ve   V^ 8X  d   VP                  R^ 4      ^8  d*   VP                  RVP                  R4       R24       ^VR&   VP                  R^ 4      ^8  d*   VP                  R	VP                  R4       R24       ^VR&   VP                  R
^ 4      ^8  d*   VP                  RVP                  R
4       R24       ^VR
&   MUVeR   V^ 8  dK   V^8  dD   VP                  R
^ 4      ^8  d-   VP                  RVP                  R
4       RV R24       ^VR
&   Ve   V^ 8X  d   VP                  R^ 4      ^8  d*   VP                  RVP                  R4       R24       ^VR&   VP                  R^ 4      ^8  d*   VP                  R	VP                  R4       R24       ^VR&   MVe   V^8X  d   VP                  R^ 4      ^8  d*   VP                  RVP                  R4       R24       ^VR&   VP                  R^ 4      ^8  d*   VP                  R	VP                  R4       R24       ^VR&   MKVeH   V^8X  dA   VP                  R^ 4      ^8  d*   VP                  R	VP                  R4       R24       ^VR&   VeR   V^ 8  dK   VR8  dD   VP                  R^ 4      ^8  d-   VP                  RVP                  R4       RV R24       ^VR&   VeR   V^ 8  dK   VR8  dD   VP                  R^ 4      ^8  d-   VP                  RVP                  R4       RV R24       ^VR&   W'3# )a,  
Validate and override GPT scores based on hard KPI facts

Args:
    criteria_scores: dict with keys like 'market_garden', 'guest_accommodation', etc.
    kpis: dict with 'land_size_m2', 'building_size_m2', 'bedrooms', 'bathrooms'

Returns:
    dict: validated criteria scores with overrides applied
land_size_m2building_size_m2bedrooms	bathroomsguest_accommodationzGuest u   →1 (confirmed no building)rental_unitszRental workshopz	Workshop u   →2 (building too small: u   m²)u   →1 (confirmed no bedrooms)u   →2 (only 1 bedroom)u4   →1 (only 1 bedroom, not enough for multiple units)u   →2 (only 2 bedrooms)i  market_gardenzMarket Garden u   →2 (land too small: i  u   →1 (land too small: )copygetappend)criteria_scoreskpis	validated	land_sizebuilding_sizer   r   	overridess   &&      X/Users/jonathan/SynologyDrive/Since Today/PROJECTEN/farmmatch/scraper/validate_scores.pyvalidate_criteria_scoresr      s     $$&I (IHH/0Mxx
#H%I I  ]a%7H<PU]abUb==.2Q6vimm4I&J%KKghi/0I+,==+a/wy}}^'D&EEabc()In%==Q'!+yz)B(CC_`a$%Ij! 
	"}q'8]R=O==Q'!+yz)B(CC]^k]llpqr$%Ij! A==.2Q6vimm4I&J%KKghi/0I+,==+a/wy}}^'D&EEabc()In% 
	(a-==.2Q6vimm4I&J%KK`ab/0I+,==+a/wy}}^'D&EEyz{()In% 
	(a-==+a/wy}}^'D&EE[\]()In% Q9t3C==!,q0~immO.L-MMcdmcnnrst)*Io& Q9s?==!,q0~immO.L-MMcdmcnnrst)*Io&
     c           
         RV P                  R4      RV P                  R4      RV P                  R4      RV P                  R4      /pV P                  R/ 4      p\        W!4      w  r4W0R&   V'       d   W@R&   V # )z
Validate all scores for a single property

Args:
    property_data: dict with 'criteria', 'land_size_m2', 'building_size_m2', 'bedrooms', 'bathrooms'

Returns:
    dict: property_data with validated criteria scores
r   r   r   r   criteriavalidation_overrides)r   r   )property_datar   original_criteriavalidated_criteriar   s   &    r   validate_property_scoresr   `   s     	)).9M--.@AM%%j1]&&{3	D &))*b9$<=N$U! !3* 09,-r   c                   ^ pV  FP  pVP                  R/ 4      P                  4       p\        V4      pRV9   g   K7  V\        VR,          4      ,          pKR  	  \	        R\        V 4       R24       \	        RV R24       V # )z
Validate scores for all properties in enriched_data.json

Args:
    enriched_data: list of property dicts

Returns:
    list: validated properties with overrides applied
r   r   u   ✅ Validated z propertiesu   🔧 Applied z score overrides based on KPIs)r   r   r   lenprint)enriched_datatotal_overridespropr   validated_props   &    r   validate_all_propertiesr%   ~   s     O HHZ499;1$7!^3s>2H#IJJO  
N3}-.k
:;	M/**H
IJr   __main__Nzenriched_data.jsonrzutf-8)encodingu    ❌ enriched_data.json not foundu   📊 Validating z properties...u   
📋 Example overrides:r   
urlu     Price: €pricez,.0fz  KPIs: r   z bed, r   u    m² building, r   u	    m² landu
     ⚠️  z5  (No overrides needed - all scores align with KPIs!)wF)ensure_asciiindentu5   
✅ Validation complete - enriched_data.json updatedz<============================================================)__doc__r   r   r%   __name__jsonsysopenfloaddataFileNotFoundErrorr    exitr   validated_dataoverride_countr#   r   overridedump r   r   <module>r>      s  U p<2 z&g>>!99Q<D ? 
SYK~
67	(O -T2N 

%&N!T)BtE{m$%L'1!5d ;<=HTXXj!45VDHHEWYZ<[;\\klpltlt  vD  FG  mH  lI  IR  S  T !788
8*-. 9aN"  EF 
"C'	:	:a		.!%B 
; 

BCO  ?>> 018 
;	:s:   F E3F F/3F	>F F !F,+F,/F?	