auth api tested

This commit is contained in:
2025-03-25 19:01:46 +03:00
parent db2cde2f5d
commit 637edfadd4
65 changed files with 774 additions and 673 deletions

View File

@@ -41,24 +41,26 @@ def parse_excel_file(excel_frame: DataFrame) -> list[dict]:
iban = str(row[5]).replace(" ", "")
if not str(row[1]) == "nan" and not str(row[2]) == "nan":
if len(str(row[1]).split("/")) > 2:
data_list.append(dict(
iban=str(iban),
bank_date=arrow.get(
datetime.datetime.strptime(str(row[1]), "%d/%m/%Y-%H:%M:%S")
).__str__(),
channel_branch=unidecode(str(row[3])),
currency_value=(
float(str(row[4]).replace(",", "")) if row[4] else 0
),
balance=float(str(row[5]).replace(",", "")) if row[5] else 0,
additional_balance=(
float(str(row[6]).replace(",", "")) if row[6] else 0
),
process_name=str(row[7]),
process_type=unidecode(str(row[8])),
process_comment=unidecode(str(row[9])),
bank_reference_code=str(row[15]),
))
data_list.append(
dict(
iban=str(iban),
bank_date=arrow.get(
datetime.datetime.strptime(str(row[1]), "%d/%m/%Y-%H:%M:%S")
).__str__(),
channel_branch=unidecode(str(row[3])),
currency_value=(
float(str(row[4]).replace(",", "")) if row[4] else 0
),
balance=float(str(row[5]).replace(",", "")) if row[5] else 0,
additional_balance=(
float(str(row[6]).replace(",", "")) if row[6] else 0
),
process_name=str(row[7]),
process_type=unidecode(str(row[8])),
process_comment=unidecode(str(row[9])),
bank_reference_code=str(row[15]),
)
)
return data_list

View File

@@ -48,11 +48,15 @@ def set_account_records_to_send_email():
account_records = (
account_records.order_by(
AccountRecords.bank_date.desc(), AccountRecords.bank_reference_code.desc()
).limit(3).all()
)
.limit(3)
.all()
)
first_record, second_record, balance_error = (
account_records[0], account_records[1], False
account_records[0],
account_records[1],
False,
)
second_balance = first_record.bank_balance - first_record.currency_value
if second_balance != second_record.bank_balance:

View File

@@ -86,6 +86,7 @@ if __name__ == "__main__":
results = check_any_written_stage_in_mongo_database(mongo_provider=provider)
for result in results:
send_email_and_update_mongo_database(
mongo_provider=provider, email_data=result,
mongo_provider=provider,
email_data=result,
)
time.sleep(60)

View File

@@ -1,5 +1,3 @@
def main():
print("Hello from seperatorservice!")

View File

@@ -46,7 +46,9 @@ def write_parsed_data_to_account_records(
).data:
print("already @database record", found_record.id)
else:
new_account_record = AccountRecords.find_or_create(db=db_session, **data_dict)
new_account_record = AccountRecords.find_or_create(
db=db_session, **data_dict
)
new_account_record.is_confirmed = True
new_account_record.save(db=db_session)
mongo_provider.update_one(