bank and account service is updated

This commit is contained in:
berkay 2024-12-03 15:31:52 +03:00
parent ac5a71f1a8
commit c2dd464fc6
7 changed files with 27 additions and 8 deletions

View File

@ -37,6 +37,7 @@ class ActionsSchemaFactory:
class MethodToEvent(ABC, ActionsSchemaFactory): class MethodToEvent(ABC, ActionsSchemaFactory):
action_key: str = None
event_type: str = None event_type: str = None
event_description: str = "" event_description: str = ""
event_category: str = "" event_category: str = ""

View File

@ -21,7 +21,6 @@ from api_validations.validations_request import (
) )
from api_validations.core_response import AlchemyJsonResponse from api_validations.core_response import AlchemyJsonResponse
from api_events.events.abstract_class import MethodToEvent, ActionsSchema from api_events.events.abstract_class import MethodToEvent, ActionsSchema
from api_objects.auth.token_objects import EmployeeTokenObject, OccupantTokenObject from api_objects.auth.token_objects import EmployeeTokenObject, OccupantTokenObject
@ -181,6 +180,7 @@ class BuildUpdateEventMethods(MethodToEvent):
event_description = "" event_description = ""
event_category = "" event_category = ""
__class_key__ = ""
__event_keys__ = { __event_keys__ = {
"5ad38a66-1189-451e-babb-77de2d63d757": "build_update", "5ad38a66-1189-451e-babb-77de2d63d757": "build_update",
} }

View File

@ -21,7 +21,7 @@ class Events(CrudCollection):
__tablename__ = "events" __tablename__ = "events"
__exclude__fields__ = [] __exclude__fields__ = []
event_type: Mapped[str] = mapped_column(String, nullable=False, comment="default") event_type: Mapped[str] = mapped_column(String, nullable=False, comment="Event Type")
function_code: Mapped[str] = mapped_column( function_code: Mapped[str] = mapped_column(
String, nullable=False, comment="function code" String, nullable=False, comment="function code"
) )

View File

@ -1,3 +1,8 @@
import sys
if '/service_app_banks' not in list(sys.path):
sys.path.append('/service_account_records')
from decimal import Decimal from decimal import Decimal
from api_services.bank_actions.wag_account_record_parser import ( from api_services.bank_actions.wag_account_record_parser import (

View File

@ -1,3 +1,8 @@
import sys
if '/service_app_banks' not in list(sys.path):
sys.path.append('/service_account_records')
import re import re
from difflib import get_close_matches from difflib import get_close_matches

View File

@ -1,10 +1,14 @@
import sys
if '/service_app_banks' not in list(sys.path):
sys.path.append('/service_app_banks')
from api_services.email.service import send_email from api_services.email.service import send_email
from api_library.date_time_actions.date_functions import client_arrow from api_library.date_time_actions.date_functions import client_arrow
from databases import AccountRecords
def send_mail_to_users_that_have_received_email_from_banks(): def send_mail_to_users_that_have_received_email_from_banks():
from databases import AccountRecords
print("Service is booting up") print("Service is booting up")
print("Sending mail to users that have received email from banks") print("Sending mail to users that have received email from banks")

View File

@ -1,3 +1,8 @@
import sys
if '/service_app_banks' not in list(sys.path):
sys.path.append('/service_app_banks')
import os import os
import json import json
import arrow import arrow
@ -7,6 +12,9 @@ from logging import getLogger, basicConfig, INFO
from config_isbank import Config from config_isbank import Config
from pydantic import BaseModel from pydantic import BaseModel
from databases import AccountRecords
from api_library.date_time_actions.date_functions import system_arrow
logger = getLogger(__name__) logger = getLogger(__name__)
basicConfig(filename=__name__, level=INFO) basicConfig(filename=__name__, level=INFO)
@ -60,11 +68,7 @@ def sender_service():
def is_bank_retrieve_account_records(bank_data): def is_bank_retrieve_account_records(bank_data):
from databases import AccountRecords
from api_library.date_time_actions.date_functions import system_arrow
data_bulk = json.loads(bank_data) data_bulk = json.loads(bank_data)
new_record_list = [] new_record_list = []
for data_keys in data_bulk: # data_bulk is a dict for data_keys in data_bulk: # data_bulk is a dict
for data_dict in data_bulk[data_keys]: # data_bulk[data_keys] is a list for data_dict in data_bulk[data_keys]: # data_bulk[data_keys] is a list