o
    g                     @   s*   d dl m Z  d dlmZ G dd dZdS )    )datetime)FinancialInformationTablec                   @   s$   e Zd Zedd Zedd ZdS ) FinancialInformationTableServicec           
         s   | d}|rC| jttj|kgddI dH }|rC|d  }i ||}tdi |}||j | jttj|kg|dI dH  |S tdi |t	 |jd}||j | 
|I dH }	|	S )	zL
        Save a record into the financial_information_tables table.
        page_id   )filterslimitNr   )r   values)
created_at
created_by )getexecute_queryr   r   to_dictupdate_modifyuser_idupdate_recordr   nowexecute_insert)
dbcurrent_userkwargsr   existing_recordexisting_dataupdated_dataupdated_record
new_recordrecordr   r   A/var/www/html/XCapMarket/services/financial_info/table_service.pysave_record   s6   




z,FinancialInformationTableService.save_recordc                    s*   | j ttj|ktj|kgdddI dH S )z:
        Get a financial information table by id.
        r   T)r   r   firstN)r   r   r   
project_id)r   r   r!   r   r   r   get_record_by_id(   s   z1FinancialInformationTableService.get_record_by_idN)__name__
__module____qualname__staticmethodr   r"   r   r   r   r   r      s
    
!r   N)r   models.financial_informationr   r   r   r   r   r   <module>   s    