
    i+j                        d dl mZmZ d dlmZmZmZmZ d dlmZ d dl	m
Z
 d dlmZ  G d dee      Z G d d	ee      Z G d
 dee      Z G d de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 G d dee      Z G d dee      Z G d  d!e      Z G d" d#e      Zy$)%    )	BaseModelField)ListOptionalDictAny)datetime)Decimal)Enumc                        e Zd ZdZdZdZdZdZy)NfeStatusEnumimportedpending_linklinkedconflictignoredN)__name__
__module____qualname__r   r   r   r   r        =/var/www/hypershopcomercio.com.br/hyper-ai/app/schemas/nfe.pyr   r      s    H!LFHGr   r   c                       e Zd ZdZdZdZy)LinkStatusEnumpending	suggested	confirmedN)r   r   r   r   r   r   r   r   r   r   r      s    GIIr   r   c                       e Zd ZdZdZdZy)LinkConfidenceEnumhighmediumlowN)r   r   r   r    r!   r"   r   r   r   r   r      s    DF
Cr   r   c                       e Zd ZdZdZy)ParseStatusEnumsuccesserrorN)r   r   r   r%   r&   r   r   r   r$   r$      s    GEr   r$   c                   b    e Zd ZU  ed      Zeed<    ed      Zeed<    ed      Zee   ed<   y)	TaxDetail0.0valueratebaseN)	r   r   r   r
   r*   __annotations__r+   r,   r   r   r   r   r(   r(      s1    U^E7#END'"%enD(7
,r   r(   c                       e Zd ZU  ed      Zeed<    ed      Zeed<    ed      Zeed<    ed      Zeed<   dZ	e
e   ed<   y)AllocationDetailr)   freight	insurancediscountotherNformula)r   r   r   r
   r0   r-   r1   r2   r3   r4   r   strr   r   r   r/   r/   !   sH    u~GW% Iw'Hg&U^E7#!GXc]!r   r/   c                   
   e Zd ZU dZee   ed<   eed<   dZee   ed<   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<   eed<   eed<   eed<   dZee   ed<   dZee   ed<   dZee   ed<    ee      Zeed<    ee      Zeeef   ed<    ee      Zeeef   ed<   dZee   ed<   dZee   ed<   ej<                  Zeed<   dZ ee!   ed<   dZ"ee   ed<    G d d      Z#y)NfeItemSchemaNidn_itemsku_supplierdescriptioneanncmcestcfop	cst_csosnunitquantity
unit_valueproduct_value	unit_tribquantity_tribunit_value_tribdefault_factoryallocationstaxescalculated_costs
linked_skulinked_mlb_idlink_statuslink_confidencelink_methodc                       e Zd ZdZy)NfeItemSchema.ConfigTNr   r   r   from_attributesr   r   r   ConfigrS   I       r   rV   )$r   r   r   r8   r   intr-   r:   r5   r<   r=   r>   r?   r@   rA   r
   rE   rF   rG   r   r/   rJ   dictrK   r   r(   rL   rM   rN   r   r   rO   rP   r   rQ   rV   r   r   r   r7   r7   (   sS   BK"&L(3-&C#C#D(3-D(3-#Ix}#D(3-#Ix}#'+M8G$+)-OXg&-$):J$KK!K"'"=E4Y=+0+Fd3<(F !%J$#'M8C='"0"8"8K848OX018!%K#% r   r7   c                   "    e Zd ZU eed<   eed<   y)	NfeIssuercnpjnameN)r   r   r   r5   r-   r   r   r   r[   r[   L   s    
I
Ir   r[   c                       e Zd ZU  ed      Zeed<    ed      Zeed<    ed      Zeed<    ed      Zeed<    ed      Z	eed<    ed      Z
eed<   y)		NfeTotalsr)   products_valueinvoice_valuer0   r1   r2   r3   N)r   r   r   r
   r`   r-   ra   r0   r1   r2   r3   r   r   r   r_   r_   P   sV    %enNG,$U^M7+u~GW% Iw'Hg&U^E7#r   r_   c                       e Zd ZU 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d<   y)	NfeMetadataN
nfe_numberseriesmodeloperation_natureenvironmentprotocol_number
xml_sha256)r   r   r   rd   r   r5   r-   re   rf   rg   rh   ri   rj   r   r   r   rc   rc   X   se     $J$ FHSM E8C=&*hsm*!%K#%%)OXc]) $J$r   rc   c                       e Zd ZU dZee   ed<   eed<   ej                  Z
eed<   eed<   eed<   eed<    ee      Zeed	<   ej$                  Zeed
<   dZee   ed<   g Zee   ed<    G d d      Zy)NfeImportSchemaNr8   
access_keystatus
issue_dateissuertotalsrH   metadataparse_statusparse_erroritemsc                       e Zd ZdZy)NfeImportSchema.ConfigTNrT   r   r   r   rV   rw   p   rW   r   rV   )r   r   r   r8   r   rX   r-   r5   r   r   rn   r	   r[   r_   r   rc   rr   r$   r%   rs   rt   ru   r   r7   rV   r   r   r   rl   rl   a   s}    BO)22FM2!+>Hk>$3$;$;L/;!%K#%!#E4# r   rl   c                       e Zd ZdZdZdZdZy)ReconciliationStatusEnumr   r   r   r   N)r   r   r   r   r   r   r   r   r   r   ry   ry   s   s    IIHGr   ry   c                       e Zd ZdZdZdZdZy)ReconciliationSourceEnum
user_inputimported_erp
bank_matchsupplier_agreementN)r   r   r   r|   r}   r~   r   r   r   r   r{   r{   y   s    J!LJ-r   r{   c                       e Zd ZU eed<   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<   y)	NfeReconciliationCreatefinancial_value_realsource_typeNevidence_referencenotespayment_datedue_datefinancial_document_id)r   r   r   r
   r-   r{   r   r   r5   r   r   r   r   r   r   r   r   r      sV    !!))(,,E8C="&L(3-&"Hhsm"+/8C=/r   r   c                   b   e Zd ZU eed<   eed<   eed<   eed<   eed<   eed<   eed<   eed<   eed	<   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d<   dZee   ed<   dZee   ed<   dZee   ed<   eed<   eed<    G d d      Zy)NfeReconciliationSchemar8   nfe_idsupplier_cnpj	is_activefiscal_value_xmlr   coverage_percentfinancial_multiplierreconciliation_statusr   Nr   r   confirmed_byconfirmed_atr   r   r   bank_transaction_idaccounts_payable_id
confidence
created_at
updated_atc                       e Zd ZdZy)NfeReconciliationSchema.ConfigTNrT   r   r   r   rV   r      rW   r   rV   )r   r   r   rX   r-   r5   boolr
   ry   r{   r   r   r   r   r   r	   r   r   r   r   r   r   rV   r   r   r   r   r      s    GKO!!!!33))(,,E8C="&L(3-&'+L(8$+'+L(8$+#'Hhx '+/8C=/)-#-)-#- $J$ r   r   N)pydanticr   r   typingr   r   r   r   r	   decimalr
   enumr   r5   r   r   r   r$   r(   r/   r7   r[   r_   rc   rl   ry   r{   r   r   r   r   r   <module>r      s    % , ,   C S$ 
d 
c4 -	 -
"y ""I "H	 $	 $%) %i $sD .sD .0i 0i r   