fix symbols in transacion name

This commit is contained in:
2025-11-09 13:02:04 -03:00
parent b305173b9d
commit 5474644580
4 changed files with 11 additions and 2 deletions

View File

@@ -8,6 +8,7 @@ import datetime
from correpy.domain.enums import TransactionType
from correpy.parsers.brokerage_notes.parser_factory import ParserFactory
from fastapi import UploadFile
import re
account_id = '1590f1bb-b3ee-4dc8-ac46-bd1f15a83e87'
@@ -51,11 +52,13 @@ def convert_to_ghostfolio(brokerage_list: list, filename: str):
transaction_type = 'BUY'
elif transaction.transaction_type == TransactionType.SELL:
transaction_type = 'SELL'
name = re.sub(r'@|#' , '', transaction.security.name.strip())
activity = {'accountId': account_id, 'comment': filename, 'date': reference_date,
'type': transaction_type,
'fee': fees, 'unitPrice': transaction.unit_price, 'quantity': transaction.amount,
'symbol': mappings.name_to_tickers[transaction.security.name.strip()].strip(),
'symbol': mappings.name_to_tickers[name.strip()].strip(),
'currency': 'BRL',
'dataSource': 'YAHOO'}
activities['activities'].append(activity)