
    5i                        d Z ddlmZmZ ddlmZ ddlmZmZmZm	Z	 ddl
mZmZmZmZmZ e G d d             Ze G d	 d
             Ze G d d             Ze G d d             Ze G d d             Ze G d d             Ze G d d             Ze G d d             Ze G d d             Ze G d d             Ze G d d             Ze G d d             Zy) z.Data models for Publishing Integrity entities.    )	dataclassfield)datetime)OptionalDictAnyList   )ValidationStateAvailabilityStatusLineupStatusAuditAction
SourceTierc                       e Zd ZU dZee   ed<   dZeed<   dZeed<   dZ	eed<   dZ
ee   ed<   dZeed<   dZee   ed	<   dZee   ed
<   dZee   ed<   dZee   ed<   y)PlayerNid canonical_player_iddisplay_namenormalized_nameofficial_player_idleaguecurrent_team_idprevious_team_id
created_at
updated_at)__name__
__module____qualname__r   r   str__annotations__r   r   r   r   r   r   r   r   r   r        g/var/www/html/rainmaker/backend/tests/publishing_integrity/../../scripts/publishing_integrity/models.pyr   r   	   s    B!!L#OS(,,FC%)OXc])&*hsm*%)J")%)J")r#   r   c                       e Zd ZU dZee   ed<   dZeed<   dZeed<   dZ	eed<   dZ
eed<   dZeed<   dZee   ed	<   dZee   ed
<   dZee   ed<   y)TeamNr   r   canonical_team_idr   r   r   abbreviationofficial_team_idr   r   )r   r   r   r   r   r    r!   r'   r   r   r   r(   r)   r   r   r   r"   r#   r$   r&   r&      sp    BsFCL#OSL#&*hsm*%)J")%)J")r#   r&   c                       e Zd ZU dZee   ed<   dZeed<   dZeed<   dZ	eed<   dZ
eed<   dZee   ed<   d	Zeed
<   dZee   ed<   dZee   ed<   y)GameNr   r   canonical_game_idr   home_team_idaway_team_idscheduled_start_at	scheduledstatusr   r   )r   r   r   r   r   r    r!   r,   r   r-   r.   r/   r   r1   r   r   r"   r#   r$   r+   r+   $   sq    BsFCL#L#-1*1FC%)J")%)J")r#   r+   c                       e Zd ZU dZee   ed<   dZeed<   dZeed<   dZ	eed<   dZ
eed<   dZeed	<   dZeed
<   dZee   ed<   dZee   ed<   y)RosterEntryNr   r   run_idr   team_id	player_idactiveroster_statussourcesource_timestampr   )r   r   r   r   r   r    r!   r4   r   r5   r6   r8   r9   r:   r   r   r"   r#   r$   r3   r3   1   sk    BFCFCGSIs!M3!FC+/hx(/%)J")r#   r3   c                       e Zd ZU dZee   ed<   dZeed<   dZeed<   dZ	eed<   dZ
ee   ed<   dZee   ed<   dZeed	<   dZee   ed
<   dZeed<   dZee   ed<   y)TransactionEntryNr   r   r4   r   r6   old_team_idnew_team_idtransaction_typeeffective_atr9   r   )r   r   r   r   r   r    r!   r4   r   r6   r=   r>   r?   r@   r   r9   r   r"   r#   r$   r<   r<   >   s}    BFCFCIs!%K#%!%K#%c'+L(8$+FC%)J")r#   r<   c                       e Zd ZU dZee   ed<   dZeed<   dZeed<   dZ	eed<   dZ
eed<   ej                  Zeed<   dZeed	<   dZeed
<   dZee   ed<   dZee   ed<   y)AvailabilityReportNr   r   r4   game_idr6   r5   availability_statusdetailed_statusr9   r:   r   )r   r   r   r   r   r    r!   r4   rC   r6   r5   r   UNKNOWNrD   rE   r9   r:   r   r   r"   r#   r$   rB   rB   L   s}    BFCGSIsGS.@.H.H+HOSFC+/hx(/%)J")r#   rB   c                       e Zd ZU dZee   ed<   dZeed<   dZeed<   dZ	eed<   dZ
eed<   ej                  Zeed<   dZeed	<   dZeed
<   dZee   ed<   dZee   ed<   y)LineupConfirmationNr   r   r4   rC   r6   r5   lineup_statuslineup_roler9   r:   r   )r   r   r   r   r   r    r!   r4   rC   r6   r5   r   rF   rI   rJ   r9   r:   r   r   r"   r#   r$   rH   rH   Z   s{    BFCGSIsGS"."6"6M<6KFC+/hx(/%)J")r#   rH   c                       e Zd ZU dZee   ed<   dZeed<   dZeed<   dZ	eed<   dZ
eed<   dZeed<   dZeed	<   d
Zeed<   dZee   ed<   dZee   ed<   y)MarketPlayerPropNr   r   r4   
sportsbookrC   r6   r5   market_typer7   market_statusr:   r   )r   r   r   r   r   r    r!   r4   rM   rC   r6   r5   rN   rO   r:   r   r   r"   r#   r$   rL   rL   h   su    BFCJGSIsGSK!M3!+/hx(/%)J")r#   rL   c                   r   e Zd ZU dZee   ed<   dZeed<   dZeed<   dZ	eed<   dZ
eed<   dZeed<   dZeed	<   ej                  Zeed
<   dZeed<   dZee   ed<   dZee   ed<   dZee   ed<   dZee   ed<   dZee   ed<   dZee   ed<   dZeeeef      ed<   dZeed<   dZee   ed<   dZee   ed<   y)PropEligibilityNr   r   r4   rC   r6   player_namer5   r   validation_stateFmarket_presence_flagroster_verified_atavailability_verified_atlineup_verified_atsuppress_reasonsuppress_reason_humanwinning_sourceconflict_payloadpublish_allowedr   r   )r   r   r   r   r   r    r!   r4   rC   r6   rR   r5   r   r   MANUAL_REVIEW_REQUIREDrS   rT   boolrU   r   rV   rW   rX   rY   rZ   r[   r   r   r\   r   r   r"   r#   r$   rQ   rQ   v   s   BFCGSIsKGSFC(7(N(NoN!&$&-1*137hx07-1*1%)OXc])+/8C=/$(NHSM(15htCH~.5!OT!%)J")%)J")r#   rQ   c                   P   e Zd ZU dZee   ed<   dZeed<   dZeed<   dZ	eed<   dZ
eed<   dZeed<   dZeed	<   ej                  Zeed
<   ej"                  Zeed<   dZee   ed<   dZee   ed<   dZee   ed<   dZeeeef      ed<   dZee   ed<   dZee   ed<   dZee   ed<   y)AuditLogEntryNr   r   r4   rC   r6   rR   r5   r   actionrS   rX   rY   rZ   r[   prior_stateacted_atr   )r   r   r   r   r   r    r!   r4   rC   r6   rR   r5   r   r   
SUPPRESSEDra   r   r]   rS   rX   rY   rZ   r[   r   r   rb   rc   r   r   r"   r#   r$   r`   r`      s    BFCGSIsKGSFC%00FK0(7(N(NoN%)OXc])+/8C=/$(NHSM(15htCH~.5!%K#%#'Hhx '%)J")r#   r`   c                       e Zd ZU dZee   ed<   dZeed<   dZeed<   dZ	eed<   dZ
eed<   dZeed<   d	Zeed
<   dZeed<   dZeeeef      ed<   dZee   ed<   y)RegressionFailureNr   r   r4   	test_namer   entity_type	entity_idhighseverityfailure_reasonfailure_payloadr   )r   r   r   r   r   r    r!   r4   rg   r   rh   ri   rk   rl   rm   r   r   r   r   r"   r#   r$   rf   rf      s|    BFCIsFCKIsHcNC04OXd38n-4%)J")r#   rf   c                       e Zd ZU dZdZeed<   dZeed<   dZeed<   dZ	eed<   dZ
ee   ed<   dZee   ed	<   dZee   ed
<   dZeed<   dZeed<   dZeed<   deeef   fdZy)ConflictDetailz4Structured conflict for debugging and admin display.r   conflict_typerR   r6   r   Nofficial_valueinternal_valuemarket_valuerj   rk   r9   detailreturnc                     | j                   | j                  | j                  | j                  | j                  | j
                  | j                  | j                  | j                  | j                  d
S )N
rp   rR   r6   r   rq   rr   rs   rk   r9   rt   rw   )selfs    r$   to_dictzConflictDetail.to_dict   s\    !//++ZZ"11"11 --kkkk
 	
r#   )r   r   r   __doc__rp   r    r!   rR   r6   r   rq   r   rr   rs   rk   r9   rt   r   r   ry   r"   r#   r$   ro   ro      s    >M3KIsE3O$(NHSM($(NHSM("&L(3-&HcFCFC
c3h 
r#   ro   N)rz   dataclassesr   r   r   typingr   r   r   r	   enumsr   r   r   r   r   r   r&   r+   r3   r<   rB   rH   rL   rQ   r`   rf   ro   r"   r#   r$   <module>r~      sF   4 (  , , ] ] 
* 
* 
* 	* 	* 	* 	* 	* 	* 	* 	* 	* 
* 
* 
* 
* 
* 
* 
* 
* 
* 
* 
* 
* * * *, * * *& 
* 
* 
* 
 
 
r#   