Ë
    (´jD  ã                  óä   — d Z ddlmZ ddlmZmZ ddlmZmZ  G d„ de«      Z	 G d„ de«      Z
 G d	„ d
e	«      Z G d„ de«      Z G d„ de«      Z G d„ de«      Z G d„ de«      Z G d„ de«      Zy)u   
models.py
â”€â”€â”€â”€â”€â”€â”€â”€â”€
Pydantic schemas used by the Fraud Report API.

These are intentionally tolerant: real-world fraud_log.json rows
sometimes miss fields (e.g. `access_key` may be absent in the last
DISQUALIFIED event of a session). All optional fields default to None
so the API never throws a 500 on legacy / malformed rows.

When the data source moves to SQL/NoSQL, only `data_source.py`
changes â€” these models stay the same, which keeps the OpenAPI contract
and the JS frontend stable.
é    )Úannotations)ÚAnyÚOptional)Ú	BaseModelÚFieldc                  óº   — e Zd ZU dZdZded<   dZded<   dZded<   dZded	<   d
Z	ded<   dZ
ded<   dZded<   dZded<    ee¬«      Zded<   dZded<   dZded<   y)Ú
FraudEventz)Mirror of a single row in fraud_log.json.NúOptional[str]ÚidÚcandidate_idÚ
access_keyÚUNKNOWNÚstrÚ
event_typeÚ ÚmessageÚ	timestampr   ÚintÚroundÚnoneÚaction)Údefault_factoryzdict[str, Any]ÚmetadataÚ
created_atÚ
updated_at)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   Ú__annotations__r   r   r   r   r   r   r   r   Údictr   r   r   © ó    ún/Users/priyanka/Documents/AI_Agent_Assessment/pepole_hub_candidate/people_hub_candidate/fraud_report/models.pyr	   r	      sx   … Ù3à$(€B�-Ó(Ø$(€L�-Ó(Ø$(€J�-Ó(Ø$-€J�#Ó-Ø$&€G�-Ó&Ø$(€I�-Ó(Ø$%€E�#Ó%Ø$*€F�-Ó*Ù$)¸$Ô$?€H�.Ó?Ø$(€J�-Ó(Ø$(€J�-Ô(r#   r	   c                  óN   — e Zd ZU ded<   ded<   ded<   ded<   ded<   dZd	ed
<   y)Ú	StageInfor   Úround_idr   Úshort_labelÚ	full_nameÚcategoryÚaccentTÚboolÚknownN)r   r   r   r    r-   r"   r#   r$   r&   r&   &   s*   … ØÓØÓØÓØÓØÓØ€E�Ôr#   r&   c                  ó~   — e Zd ZU dZdZded<   ded<   dZded<   d	Zd
ed<   d	Zd
ed<   d	Z	d
ed<   d	Z
d
ed<   d	Zd
ed<   y	)ÚFraudEventOutz;Same row as FraudEvent + derived fields the UI cares about.Úlowr   Úseverityr&   Ústagezclient-monitorÚdetection_sourceNr
   Ú
session_idÚscenario_idÚscreenshot_urlÚpageÚ
user_agent)r   r   r   r   r1   r    r3   r4   r5   r6   r7   r8   r"   r#   r$   r/   r/   0   sR   … ÙEà"'€H�cÓ'ØÓØ"2Ð�cÓ2Ø&*€J�mÓ*Ø&*€K�mÓ*Ø&*€N�mÓ*Ø&*€D�mÓ*Ø&*€J�mÔ*r#   r/   c                  óJ   — e Zd ZU ded<   ded<   ded<   ded<   d	ed
<   d	ed<   y)ÚStageSummaryr&   r2   r   Úevent_countr   Úseverity_maxú	list[str]Úactionsr,   ÚflaggedÚdisqualifiedN©r   r   r   r    r"   r#   r$   r:   r:   >   s&   … ØÓØÓØÓØÓØÓØÔr#   r:   c                  ó�   — e Zd ZU ded<   ded<   ded<   ded<   ded	<   ded
<   ded<   ded<   ded<   ded<   ded<   ded<   ded<   y)ÚReportSummaryr   r   r
   r   r   Útotal_eventszdict[str, int]Úby_event_typeÚby_severityÚby_roundr=   Úsessions_seenÚfirst_event_atÚlast_event_atÚ
risk_scoreÚfraud_statusÚsession_statusr,   Úis_disqualifiedNrA   r"   r#   r$   rC   rC   H   sP   … ØÓØ#Ó#ØÓØ$Ó$Ø$Ó$Ø$Ó$ØÓØ#Ó#Ø#Ó#ØÓØÓØÓØÔr#   rC   c                  ó,   — e Zd ZU ded<   ded<   ded<   y)ÚFraudReportrC   Úsummaryzlist[StageSummary]Ústage_trackzlist[FraudEventOut]ÚeventsNrA   r"   r#   r$   rP   rP   Y   s   … Ø!Ó!Ø&Ó&Ø'Ô'r#   rP   c                  óL   — e Zd ZU ded<   dZded<   ded<   dZded<   d	Zded
<   y)ÚAccessKeyEntryr   r   Nr
   r   r   r;   rJ   ÚCLEANrK   )r   r   r   r    r   rJ   rK   r"   r#   r$   rU   rU   `   s,   … ØÓØ#'€L�=Ó'ØÓØ#'€M�=Ó'Ø#*€J�3Ô*r#   rU   c                  ó"   — e Zd ZU ded<   ded<   y)ÚAccessKeyListr   Úcountzlist[AccessKeyEntry]ÚitemsNrA   r"   r#   r$   rX   rX   h   s   … ØƒJØÔr#   rX   N)r   Ú
__future__r   Útypingr   r   Úpydanticr   r   r	   r&   r/   r:   rC   rP   rU   rX   r"   r#   r$   Ú<module>r^      su   ðñõ #ß  ß %ô)�ô )ô"�	ô ô
+�Jô 
+ô�9ô ô�Iô ô"(�)ô (ô+�Yô +ô �Iõ  r#   