
    ii8!                     D   d dl m Z  d dlmZmZmZ d dlmZ d dlmZ d dl	m
Z
 d dlmZ d dlmZ d dlmZ d d	lmZ d d
lmZ d dlmZmZmZmZ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$ d dl%m&Z&  G d de"      Z' G d de"      Z( G d de"      Z) G d de)      Z*y)    )datetime)DictListOptional)SplitPaymentRequestSchema)RecurringPaymentRequestSchema)PaymentRequestProductSchema)AddressSchema)CustomerSchema)FileResponseSchema)MerchantSchema)PaymentMethodSchema)PaymentCurrenciesPaymentMethodTypesTransactionCategoriesTransactionStatusTypesTransactionSourceTypesPaymentTypes)PaymentAuthorizationTypesr   PaymentFrequenciesPaymentRequestStatusTypes)Field)
BaseSchema)InvoiceSchema)PaymentRequestCustomersSchemac                      e Zd ZU  ed      Zee   ed<    ed      Zee   ed<    ed      Z	e
ed<    ed      Zeed	<    ed
      Zee
   ed<    ed      Zee
   ed<    ed      Zee   ed<    ed      Zee   ed<   y)TransactionLineItemsSchemazName or title of line itemdescriptiontitlezDescription of line itemr   zPrice of line item
unit_pricezQuantity of line itemquantityzTax amount of the producttaxzDiscount detailsdiscountzDiscount Typediscount_typezDisplay order of this line itemdisplay_orderN)__name__
__module____qualname__r   r    r   str__annotations__r   r!   floatr"   intr#   r$   r%   r&        n/var/www/html/hwPaymentPortal-be-dev/hw-payment-portal-api/src/apps/transactions/schemas/transaction_common.pyr   r   %   s     -IJE8C=J!&3M!NK#N*>?J?&=>Hc> -HIC%I %2D EHhuoE#(_#EM8C=E#(5V#WM8C=Wr/   r   c                      e Zd ZU  ed      Zeed<    ed      Zee	   ed<    ed      Z
ee   ed<    ed      Zee   ed	<    ed
      Zee   ed<    ed      Zee   ed<    ed      Zee   ed<    ed      Zee   ed<    ed      Zee   ed<    ed      Zee   ed<    ed      Zee   ed<    ed      Zeee      ed<    ed      Zeee      ed<    ed      Zee   ed<    ed      Z eee!      ed<    ed      Zeee      ed<    ed       Z"ee#   ed!<    ed"      Z$ee   ed#<    ed$      Z%eee&      ed%<    ed$      Z'eee(      ed&<    ed'      Z)ee   ed(<    ed)      Z*ee   ed*<    ed+      Z+ee   ed,<    ed-      Z,eee-      ed.<    ed/      Z.ee/   ed0<   y1)2TransactionPaymentRequestSchemazId of PaymentRequest resourcer   idz/Amount of PaymentRequest, accepts decimal inputamountz4Frequency of payment, (Split / Recurring / One-time)payment_frequencyzKPaymentRequest authorisation type, (Pre-Authorized / Request-Authorization)authorization_typez)Preferred payment method, (Cards/ACH/etc)payment_methodz0Status of payment request, (Pending/Cleared/etc)statusz8Indicates if the chosen payment method needs to be savedsave_payment_methodzEnables tipping	allow_tipz7Denotes if the payment request can be configured or notconfigure_adjustmentzTax Type detailstax_typezAdditional message or commentsmessagez+Attachments included in the payment requestattachmentsz'Configuration for split payment requestsplit_configz+Configuration for recurring payment requestrecurring_configz4List of payment methods used in this payment requestpayment_methodsz Merchant of this Payment RequestmerchantThird party reference idreference_idz7Any transactional items included in the payment request
line_itemsproductsz0Is this payment request editable by the merchantcan_editzkPayment Request Literal, just a simple 9 digit code to identify the payment request in a human readable waypayment_request_literalz>Unique id of payment request, typically has the form 'pr_xxx' payment_request_idz)Customers included in the payment requestpayment_request_customersTransaction typepayment_typeN)0r'   r(   r)   r   r3   r-   r+   r4   r   r,   r5   r   r6   r   r7   r   r8   r   r9   boolr:   r;   r<   r*   r=   r>   r   r   r?   r   r@   r   rA   r   rB   r   rD   rE   r   rF   r	   rG   rH   rI   rJ   r   rL   r   r.   r/   r0   r2   r2   0   s    ?@B@#EFHUO  7<J7x 23  ?Da?!:;  49?4NH/0  38F3FH./  +0N+$  !&2C DIx~D+0M,(4.  $0BCHhsmC"/OPGXc]P6;A7K$123  ?D=?L(4 9:;  AFAAh<=  <AJ<OXd#678  7<A7K$123  */6*Hh~&  #(4N"OL(3-O=BM>J89:  =BM=Hht789   %F Hhtn  .3 B.Xc]  ).T)  PU?Px-J(KL  ,1=O+PL(<(Pr/   r2   c                      e Zd ZU  ed      Zeed<    ed      Zee	   ed<    ed      Z
ee   ed<    ed      Zee   ed	<    ed
      Zee   ed<    ed      Zee   ed<    ed      Zee   ed<    ed      Zee   ed<    eej(                  d      Zee   ed<    edd      Zee   ed<    ed      Zee   ed<    ed      Zee   ed<    ed      Zee   ed<    ed      Zee   ed<    ed       Zee    ed!<   y")#TransactionBasezTransaction amount valuer   
txn_amountrK   txn_typezTransaction status
txn_statusz+Transaction date and time as unix timestamp
ocurred_atzOTransaction ID. Do not use this for create or update. This an autgenrated fieldtxn_idzcTransaction Literal, just a simple 9 digit code to identify the transaction in a human readable waytxn_literalrC   rD   z$Brief description of the transactionr   zPayment currency to be useddefaultr   currencyg        zThird party gas feesplatform_fee_amountz&Optional name used for billing purposebilling_namez$Merchant of this Transaction accountrB   z$Customer of this Transaction accountcustomerz+Payment Request of this Transaction accountpayment_requestz*Payment Method of this Transaction accountr7   N)!r'   r(   r)   r   rP   r,   r+   rQ   r   r   rR   r   rS   r   rT   r*   rU   rD   r   r   USDrX   rY   r-   rZ   rB   r   r[   r   r\   r2   r7   r   r.   r/   r0   rO   rO   s   s   *DEJE-2?Q-RHh)*R38(4J/0  &+A&J"  "eFHSM  "'y"K#  #(4N"OL(3-O!&:"K#  -2!%%3P-Hh()  */!7*#  #(<#L(3-  */:*Hh~&  */:*Hh~&  BGABOX=>  5:@5NH01 r/   rO   c                      e Zd ZU  ed      Zeed<    eej                  d      Z	e
e   ed<    ed      Ze
e   ed<    ed	      Ze
e   ed
<    ed      Ze
e   ed<    ed      Ze
e   ed<    ed      Ze
e   ed<    ed      Ze
ee      ed<    ed      Ze
e   ed<    ed      Ze
e   ed<    ed      Ze
e   ed<   y)TransactionSchemazId of Transaction resourcer   r3   zTransaction categoryrV   categoryz+Type of charge being done. Credit or Debit?charge_typezyOptional key value pair for storing extra data in transaction. The same will be returned in invoices of this transaction.additional_infoz2Human readable text for the invoice status integerstatus_textz4Available refund balance amount for this transactionrefundable_balancez Address used for billing purposebilling_addressz"Invoice details of the transactioninvoicesz*Payment Request details of the transactionr\   z'Authorization amount of the transactionauth_amountrK   
txn_sourceN)r'   r(   r)   r   r3   r-   r+   r   CHARGEr`   r   ra   r*   rb   r   rc   rd   r,   re   r
   rf   r   r   r\   r2   rg   rh   r   r.   r/   r0   r_   r_      s-    <=B=05%,,:P1Hh,-  "'A"K#  ', P'OXd^  "'H"K#  +0J+  0560OXm,  /48/HhtM*+  BG@BOX=>  $)=$K%  49EW3XJ/0Xr/   r_   N)+r   typingr   r   r   7src.apps.payment_requests.schemas.split_payment_requestr   ;src.apps.payment_requests.schemas.recurring_payment_requestr   9src.apps.payment_requests.schemas.payment_request_productr	   src.apps.base.schemas.commonr
   *src.apps.customers.schemas.customer_commonr   "src.apps.files.schemas.file_commonr   *src.apps.merchants.schemas.merchant_commonr   0src.apps.payment_requests.schemas.payment_methodr   src.core.utils.enumsr   r   r   r   r   r   src.apps.payment_requests.enumsr   r   r   pydanticr   r   (src.apps.invoices.schemas.invoice_commonr   :src.apps.payment_requests.schemas.payment_request_customerr   r   r2   rO   r_   r.   r/   r0   <module>rx      s     ' ' ] 7 E A E P    3 B
X X?Qj ?QF'j 'T!Y !Yr/   