{% extends 'layouts/base.html' %}

{% block content %}

<!-- Services Start -->
<div class="container-fluid pt-5 pb-3">
    <div class="container">
        <br />
        <br />
        <br />
        <h4>Recovered missing data using the following parameters:</h4><br />
        Start Date: <b>{{ session['startdate'] }}</b><br />
        End Date: <b>{{ session['enddate'] }}</b> <br />
        From Schema: <b>{{ session['source'] }}</b><br />
        To Schema: <b>{{ session['target'] }}</b><br /><br />
        Received {{ session['from_rows'] }} from SOURCE<br/>
        Received {{ session['to_rows'] }} from TARGET<br/>
        <b>Table(s) successfully processed:</b><br />
        <ul>
            {% for minuscount in minuscountlist %}
            <li>{{ minuscount['actualtable'] }}: <b> {{ minuscount['rowcount'] }} Rows added to target schema</b></li>
            {% endfor %}
        </ul>
        {% if failed_tables|length > 1 %}
        <b>Unable to process data from the following table(s). Manual review of CSV files needed to resolve the
            issue:</b><br />
        <ul>
            {% for tablename in failed_tables %}
            <li>{{ tablename }}</li>
            {% endfor %}
            <li></li>
        </ul>
        {% endif %}
        {% if mismatchlist|length >= 1 %}
        <b>Warning:</b><br />
        <ul>
            {% for mismatch in mismatchlist %}
            <li>Detected count discrepancy for {{ mismatch['actualtable'] }} while processing data:<br />
                <b>(Sending Table) </b>{{ mismatch['from'] }}: <b>{{ mismatch['fromcount'] }} Rows</b><br />
                <b>(Receiving Table) </b>{{ mismatch['to'] }}: <b>{{ mismatch['tocount'] }} Rows</b><br/>
                <b>Further investigation may be required as we expected the source table to have more rows than the target</b><br/>
            </li>
            {% endfor %}
        </ul>
        {% endif %}
    </div>
</div>
<!-- Services End -->

{% endblock %}