Skip to content

Commit

Permalink
[Penify]: Documentation for commit - 3d3bf32
Browse files Browse the repository at this point in the history
  • Loading branch information
penify-dev[bot] authored Sep 13, 2024
1 parent c5b9b30 commit dd702cb
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions examples/dotnet/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,50 @@ class Program
fileContent
);

/// <summary>
/// The entry point of the application that initializes the program execution.
/// </summary>
/// <remarks>
/// This method serves as the main entry point for the application. It first calls the
/// <see cref="ShowBanks"/> method to display a list of available banks to the user.
/// After that, it prompts the user to input their preferred bank comparison criteria
/// by calling the <see cref="GetCompeFromUser"/> method. Finally, it filters the list
/// of banks based on the user's input by invoking the <see cref="FilterBanks"/> method.
/// This method orchestrates the flow of the application and ensures that the user
/// can interact with the bank data effectively.
/// </remarks>
static void Main()
{
ShowBanks();
var compe = GetCompeFromUser();
FilterBanks(compe);
}
/// <summary>
/// Prompts the user to input a 3-digit COMPE code and returns the entered value.
/// </summary>
/// <returns>A string representing the COMPE code entered by the user.</returns>
/// <remarks>
/// This method displays a message asking the user to enter a 3-digit COMPE code.
/// It reads the input from the console and returns it as a string.
/// The method does not perform any validation on the input, so it is the caller's responsibility
/// to ensure that the input meets the expected format of a 3-digit code.
/// </remarks>
private static string GetCompeFromUser(){
Console.Write("Buscar COMPE (3 dígitos): ");
return Console.ReadLine();
}
/// <summary>
/// Displays information about the banks in the collection.
/// </summary>
/// <remarks>
/// This method iterates through a collection of bank objects and prints their details to the console.
/// For each bank, it displays the bank's name, CNPJ (a unique identifier for Brazilian companies),
/// and additional attributes such as type, charge options, credit document availability,
/// PIX type, salary portability, and the last updated date.
/// The output is formatted with color coding for better visibility, using magenta for bank names
/// and white for other details. This method does not return any value and is intended for
/// console output only.
/// </remarks>
private static void ShowBanks(){
Console.WriteLine($"Banks: {banks.Count}");
foreach (var bank in banks)
Expand All @@ -38,6 +72,18 @@ private static void ShowBanks(){
Console.WriteLine($"\tAtualizado em: {bank.DateUpdated}\n");
}
}
/// <summary>
/// Filters and displays banks based on the provided COMPE code.
/// </summary>
/// <param name="compe">The COMPE code used to filter the banks.</param>
/// <remarks>
/// This method clears the console and retrieves a list of banks that match the specified COMPE code.
/// If matching banks are found, it displays their details including CNPJ, long name, type, charge options,
/// credit document options, PIX type, salary portability status, and the last updated date.
/// If no banks are found, it prompts the user with options to either list all banks or search for another COMPE code.
/// The user can input their choice, and the method will either call the main listing function or recursively call itself
/// to filter banks again based on a new COMPE code input by the user.
/// </remarks>
private static void FilterBanks(string compe)
{
Console.Clear();
Expand Down

0 comments on commit dd702cb

Please sign in to comment.