<commit_before>﻿using MicroPos.Core;
using System;
using System.Collections.Generic;
using System.Linq;
using MarkdownLog;
using Ferret.View.KsnStuff;

namespace Ferret.View.Extensions
{
    internal static class AuthorizerExtension
    {
        public static void ShowSummaryOnConsole(this ICollection<ICardPaymentAuthorizer> pinpads)
        {
            Console.WriteLine(
                   pinpads.Select(s => new
                   {
                       PortName = s.PinpadFacade.Communication.PortName,
                       Manufacturer = s.PinpadFacade.Infos.ManufacturerName.Replace(" ", ""),
                       SerialNumber = s.PinpadFacade.Infos.SerialNumber.Replace(" ", "")
                   })
                   .ToMarkdownTable());
        }
        public static void ShowKsns(this ICollection<ICardPaymentAuthorizer> pinpads,
            List<Acquirer> acquirers)
        {
            // TODO: Mostrar dados do KSN.
            Console.WriteLine(
                   pinpads.Select(s => new
                   {
                       PortName = s.PinpadFacade.Communication.PortName,
                       SerialNumber = s.PinpadFacade.Infos.SerialNumber.Replace(" ", "")
                   })
                   .ToMarkdownTable());
        }
    }
}
<commit_msg>:memo: Extension methods documentation.<commit_after>﻿using MicroPos.Core;
using System;
using System.Collections.Generic;
using System.Linq;
using MarkdownLog;
using Ferret.View.KsnStuff;

namespace Ferret.View.Extensions
{
    /// <summary>
    /// Stuff easely do with <see cref="ICardPaymentAuthorizer"/>.
    /// </summary>
    internal static class AuthorizerExtension
    {
        /// <summary>
        /// Show a brief description to each pinpad.
        /// </summary>
        /// <param name="pinpads">Pinpads to log on console.</param>
        public static void ShowSummaryOnConsole(this ICollection<ICardPaymentAuthorizer> pinpads)
        {
            Console.WriteLine(
                   pinpads.Select(s => new
                   {
                       PortName = s.PinpadFacade.Communication.PortName,
                       Manufacturer = s.PinpadFacade.Infos.ManufacturerName.Replace(" ", ""),
                       SerialNumber = s.PinpadFacade.Infos.SerialNumber.Replace(" ", "")
                   })
                .ToMarkdownTable());
        }
        /// <summary>
        /// Log acquirers and KSN information on console.
        /// </summary>
        /// <param name="pinpads">Pinpads to log on console.</param>
        /// <param name="acquirers">KSN information obtained from ABECS GDU command.</param>
        public static void ShowKsns(this ICollection<ICardPaymentAuthorizer> pinpads,
            List<Acquirer> acquirers)
        {
            // TODO: Mostrar dados do KSN.
            Console.WriteLine(
                    pinpads.Select(s => new
                    {
                        PortName = s.PinpadFacade.Communication.PortName,
                        SerialNumber = s.PinpadFacade.Infos.SerialNumber.Replace(" ", "")
                    })
                .ToMarkdownTable());
        }
    }
}

{'fraction_non_alphanumeric': 0.10212496035521726, 'fraction_numerical': 0.0, 'mean_word_length': 1.6751484308736218, 'pattern_counts': {'":': 0, '<': 22, '<?xml version=': 0, '>': 26, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4148143', 'n_tokens_mistral': 847, 'n_tokens_neox': 815, 'n_words': 159}