guibranco / BancosBrasileiros-MergeTool

🇧🇷 🏦 📋 Brazilian banks: MergeTool - The C# .NET tool used to merge and keep data from the Bancos Brasileiros repository updated
https://guibranco.github.io/BancosBrasileiros-MergeTool/
MIT License
5 stars 0 forks source link

GitAuto: [FEATURE] Grab IF.data #166

Open gitauto-ai[bot] opened 2 weeks ago

gitauto-ai[bot] commented 2 weeks ago

Resolves #142

What is the feature

This feature enables the tool to grab information such as TCB, SR, TC, City, State, Agencies, and Service Stations from IF.Data and SFA - Open Finance sources, and integrate this data into the merge tool.

Why we need the feature

Integrating data from IF.Data and SFA - Open Finance enriches our dataset with comprehensive and up-to-date information about financial institutions. This enhances the accuracy and usefulness of the merged data, providing users with more detailed insights into banking entities across different regions.

How to implement and why

  1. Add Required URLs to Constants.cs:

    • Add the API endpoints for IF.Data and SFA - Open Finance to the Constants.cs file for easy access throughout the application.
  2. Update Source.cs Enum:

    • Add new enum items IFDATA and SFA to represent the new data sources, using their acronyms for consistency.
  3. Implement Data Loaders in Reader.cs:

    • Create methods LoadIFDATA() and LoadSFA() in Reader.cs to handle data retrieval from the respective APIs.
    • Use the provided Swagger documentation and API references to properly fetch and parse the data.
    • If the data is not in PDF format, implement custom parsing logic suitable for JSON or XML as needed.
  4. Add New Fields to Bank.cs:

    • Introduce new properties in the Bank class to store the additional fields: TCB, SR, TC, City, State, Agencies, and Service Stations.
    • This allows the new data to be seamlessly integrated into existing data structures.
  5. Update Regular Expressions in Patterns.cs (If Necessary):

    • If specific patterns are required to extract data from text fields, add appropriate regular expressions to Patterns.cs.
  6. Implement Merging Logic in Seeder.cs:

    • Add methods MergeIFDATA() and MergeSFA() to merge the new data with existing entries.
    • Use ISPB and Document numbers to match and update existing records.
    • Adhere to the guideline of not adding new banks unless they have all the mandatory fields (COMPE, ISPB, Document, Name).
  7. Modify AcquireData Method in Program.cs:

    • Call the new Load and Merge methods within the AcquireData method to ensure the new data sources are included in the data acquisition process.
  8. Update Output Methods in Writer.cs:

    • Edit SaveCsv(), SaveMarkdown(), and SaveSql() methods to map and include the new fields in the output files.
    • Ensure that the new data is correctly formatted and exported.
  9. Testing:

    • Run the application locally to test the integration of the new data sources.
    • Verify that the data from IF.Data and SFA - Open Finance is correctly fetched, parsed, merged, and exported.
    • Ensure that existing functionality remains unaffected.

About backward compatibility

The integration of new data fields and sources maintains backward compatibility. Existing data structures are extended but not modified in a way that would disrupt current users. Any systems consuming the data can continue to function without changes, as the original fields remain intact. The additional fields provide extra information without affecting the existing schema, ensuring seamless integration for all users.

Test these changes locally

git checkout -b gitauto/issue-#142-7a1ad03c-dc70-4b27-99fe-190c4a52ab27
git pull origin gitauto/issue-#142-7a1ad03c-dc70-4b27-99fe-190c4a52ab27
sonarcloud[bot] commented 2 weeks ago

Quality Gate Failed Quality Gate failed

Failed conditions
B Maintainability Rating on New Code (required ≥ A)

See analysis details on SonarCloud

Catch issues before they fail your Quality Gate with our IDE extension SonarLint