package com.capgemini.reports.r19;

import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;

import com.capgemini.reports.common.AbstractSubmitServlet;
import com.capgemini.reports.definition.r19report.ExecutionR19;

/**
 * This class receives demands to perform a R19 report.<br>
 * It prepares the data and creates the appropriate {@link ExecutionR19} instance that will carry out the job.
 */

@WebServlet("/report_r19/submit")
public class SubmitServletR19 extends AbstractSubmitServlet<ExecutionR19> {

    private static final long serialVersionUID = 9133245294833174909L;

    @Override
    public ExecutionR19 prepareReport(final HttpServletRequest request) {
        String documentId = request.getParameter("num_document");
        String documentRev = request.getParameter("rev_document");
        String documentType = request.getParameter("type_document");
        String documentUID = request.getParameter("uid_document");

        return new ExecutionR19(documentId, documentRev, documentType, documentUID);
    }

}
