@model economy.Models.View<economy.Models.Interest.Request, economy.Models.Interest.Response>

@{
    ViewData["Title"] = "대출 금리";
}

<div class="container">
    <h3>대출 금리</h3>

    @await Html.PartialAsync("NavTab")

    <div class="row mt-3 mb-3">
        <div class="col-auto">
            <input type="date" name="date" id="date" class="form-control" value="@Model.Request.DateFormatted" form="fSearch" />
        </div>
    </div>

    <p>
        한국수출입은행이 제공하는 대출 금리 정보입니다.
        각 대출기간에 대한 고정기준금리를 일 기준으로 제공합니다.
    </p>

    <div class="table-responsive">
        <table id="financialInterest" class="table table-bordered table-hover w-auto">
            <thead>
                <tr>
                    <th>대출 기간</th>
                    <th>고정기준 금리</th>
                </tr>
            </thead>
            <tbody>
                @if (Model.Response?.Items != null && Model.Response?.Items.Count() > 0)
                {
                    @foreach (var row in Model.Response.Items)
                    {
                        <tr>
                            <td>@row.InterestName</td>
                            <td>@row.InterestRate</td>
                        </tr>
                    }
                }
                else
                {
                    <tr>
                        <td colspan="2">
                            No data.
                        </td>
                    </tr>
                }
            </tbody>
        </table>
    </div>

    <form id="fSearch" method="get" accept-charset="UTF-8" rel="search" autocomplete="off" asp-controller="Financial" asp-action="Interest"></form>
</div>

@section Scripts {
    <script src="~/js/financial.js" asp-append-version="true"></script>
}
@section Styles {
    <link href="~/css/style.css" rel="stylesheet" asp-append-version="true" />
}