package org.example;


public class WritingHelper
{
    String topic;
    String name;
    String location;
    Double amount;

    public WritingHelper(TransactionInfo transactionInfo, String topic)
    {
        this.topic = topic;
        name = transactionInfo.getName();
        location = transactionInfo.getLocation();
        amount = transactionInfo.getAmount();
    }
    @Override
    public String toString()
    {
        String ans = "";
        Double x = amount;
        ans += "Topic: " + topic + " --- Name : " + name + " --- Location of Transaction : " + location
                + " --- amount of transaction : " + x.toString();
        return ans;
    }

    public void writeToLog()
    {
        String ans = toString();
        ReportingKafkaConsumer.log.info(ans);
    }
}
