From 5a5e58ff785695f6f03c9d24d49605c98803df18 Mon Sep 17 00:00:00 2001 From: berkay Date: Tue, 26 Nov 2024 11:18:34 +0300 Subject: [PATCH] bank service update [config] --- service_account_records/app_accounts.py | 16 ++++++++-------- service_account_records/configs.py | 6 ++++++ service_account_records/regex_func.py | 11 +++-------- service_app_banks/isbank/config_isbank.py | 13 ++++++++----- service_app_banks/isbank/unread/unread.txt | 0 5 files changed, 25 insertions(+), 21 deletions(-) create mode 100644 service_app_banks/isbank/unread/unread.txt diff --git a/service_account_records/app_accounts.py b/service_account_records/app_accounts.py index 4b7f3f6..9c67604 100644 --- a/service_account_records/app_accounts.py +++ b/service_account_records/app_accounts.py @@ -173,9 +173,9 @@ def account_records_search(): fs, ac = similarity_result.get("similarity"), account_record.similarity or 0 if float(fs) >= 0.8 and float(fs) > float(ac): found_list.append(similarity_result) - # account_save_search_result( - # account_record=account_record, similarity_result=similarity_result - # ) + account_save_search_result( + account_record=account_record, similarity_result=similarity_result + ) else: similarity_result = parse_comment_with_name_iban_description( account_record=account_record @@ -183,9 +183,9 @@ def account_records_search(): fs, ac = similarity_result.get("similarity"), account_record.similarity or 0 if float(fs) >= 0.8 and float(fs) > float(ac): found_list.append(similarity_result) - # account_save_search_result( - # account_record=account_record, similarity_result=similarity_result - # ) + account_save_search_result( + account_record=account_record, similarity_result=similarity_result + ) print("Account Records Search : ", len(found_list), "/", len(account_records_list)) return @@ -323,9 +323,9 @@ def send_accounts_to_decision_payment(): def account_records_service() -> None: - # account_records_find_decision_book() + account_records_find_decision_book() account_records_search() - # send_accounts_to_decision_payment() + send_accounts_to_decision_payment() return diff --git a/service_account_records/configs.py b/service_account_records/configs.py index 2888d1c..6cc6b82 100644 --- a/service_account_records/configs.py +++ b/service_account_records/configs.py @@ -1,2 +1,8 @@ class AccountConfig: BEFORE_DAY = 30 + CATEGORIES = { + "DAIRE": ["daire", "dagire", "daare", "nolu daire", "no", "nolu dairenin"], + "APARTMAN": ["apartman", "aparman", "aprmn"], + "VILLA": ["villa", "vlla"], + "BINA": ["bina", "binna"] + } diff --git a/service_account_records/regex_func.py b/service_account_records/regex_func.py index 7989304..6679817 100644 --- a/service_account_records/regex_func.py +++ b/service_account_records/regex_func.py @@ -1,13 +1,7 @@ import re + from difflib import get_close_matches - - -categories = { - "DAIRE": ["daire", "dagire", "daare", "nolu daire", "no", "nolu dairenin"], - "APARTMAN": ["apartman", "aparman", "aprmn"], - "VILLA": ["villa", "vlla"], - "BINA": ["bina", "binna"] -} +from service_account_records.configs import AccountConfig def word_straighten(word, ref_list, threshold=0.8): @@ -16,6 +10,7 @@ def word_straighten(word, ref_list, threshold=0.8): def category_finder(text, output_template="{kategori} {numara}"): + categories = AccountConfig.CATEGORIES result = {category: [] for category in categories} # Sonuçları depolamak için bir sözlük for category, patterns in categories.items(): words = re.split(r'\W+', text) diff --git a/service_app_banks/isbank/config_isbank.py b/service_app_banks/isbank/config_isbank.py index 8732b76..9314a24 100644 --- a/service_app_banks/isbank/config_isbank.py +++ b/service_app_banks/isbank/config_isbank.py @@ -1,12 +1,15 @@ + + class Config: # IP_ADDRESS: str = "http://10.10.2.46:41575/internal/isbank/retreive" SERVICE_TIMING: int = 900 # 15 min - UNREAD_PATH: str = "/home/bank/isbank/unread/" - PARSED_PATH: str = "/home/bank/isbank/parsed/parsed_data.json" - ARCHIVE_PATH: str = "/home/bank/isbank/archive/" - INCOMING_PATH: str = "/home/bank/isbank/unread" - COMPLETED_PATH: str = "/home/bank/isbank/completed" + CONTAINERS_PATH: str = "/service_app_banks" + UNREAD_PATH: str = f"{CONTAINERS_PATH}/isbank/unread/" + PARSED_PATH: str = f"{CONTAINERS_PATH}/isbank/parsed/parsed_data.json" + ARCHIVE_PATH: str = f"{CONTAINERS_PATH}/isbank/archive/" + INCOMING_PATH: str = f"{CONTAINERS_PATH}/isbank/unread" + COMPLETED_PATH: str = f"{CONTAINERS_PATH}/isbank/completed" MAILBOX: str = "bilgilendirme@ileti.isbank.com.tr" KARATAY: str = "karatay.berkay@gmail.com" diff --git a/service_app_banks/isbank/unread/unread.txt b/service_app_banks/isbank/unread/unread.txt new file mode 100644 index 0000000..e69de29