package com.utopiaindustries.dao.ctp;

import com.utopiaindustries.model.ctp.SummaryInventoryReport;
import org.springframework.jdbc.core.RowMapper;

import java.sql.ResultSet;
import java.sql.SQLException;

public class SummaryInventoryReportRowMapper implements RowMapper<SummaryInventoryReport> {
    public SummaryInventoryReport mapRow(ResultSet rs, int rowNum) throws SQLException {
        SummaryInventoryReport summaryInventoryReport = new SummaryInventoryReport();
        summaryInventoryReport.setItemId(rs.getInt("item_id"));
        summaryInventoryReport.setSku(rs.getString("sku"));
        summaryInventoryReport.setParentDocumentId(rs.getString("parent_document_id"));
        summaryInventoryReport.setAccountId(rs.getString("account_id"));
        summaryInventoryReport.setDate(rs.getString("transaction_date"));
        summaryInventoryReport.setTotalIn(rs.getLong("total_in"));
        summaryInventoryReport.setJobCardID(rs.getLong("job_card_id"));
        summaryInventoryReport.setTotalOut(rs.getLong("total_out"));
        summaryInventoryReport.setParentDocumentType(rs.getString("parent_document_type"));
        summaryInventoryReport.setParentDocumentPieceType(rs.getString("parent_document_piece_type"));
        return summaryInventoryReport;
    }
}
