import express from 'express';
import controller from '../../controllers/admin/leads';

const router = express.Router();

// #region /api/admin/leads/getLeads apidoc
/**
 * @api {post} /api/admin/leads/getLeads Get Leads
 * @apiVersion 1.0.0
 * @apiName Get Leads
 * @apiDescription Get Leads
 * @apiGroup Leads - Admin
 * @apiSuccess (200) {JSON} Result status, message, recordList, totalRecords.
 * @apiSuccessExample {json} Success-200-Response:
 *     HTTP/1.1 200 OK
 *     {
 *          status: 200,
 *          isDisplayMessage: <true/false>, // if the value is true then display message on screen
 *          message: 'Get Leads',
 *          recordList: Leads,
 *          totalRecords: TotalRecords
 *     }
 * @apiError (500) {JSON} Result message, apiName, apiType, fileName, functionName, lineNumber, typeName, stack.
 * @apiErrorExample {json} Error-500-Response:
 *     HTTP/1.1 500 ERROR
 *     {
 *          status: <error status code>,
 *          isDisplayMessage: <true/false>, // if the value is true then display message on screen
 *          message: <error message>,
 *          error: {
 *              apiName: <api name>,
 *              apiType: <api type>,
 *              fileName: <file name>,
 *              functionName: <function name>,
 *              lineNumber: <line number>,
 *              typeName: <type name>,
 *              stack: <stack>
 *          },
 *          value: <value if any>
 *     }
 */
// #endregion

router.post('/getLeads', controller.getLeads);

// #region /api/admin/leads/getPartnerForAssignLead apidoc
/**
 * @api {post} /api/admin/leads/getPartnerForAssignLead Get Parnter
 * @apiVersion 1.0.0
 * @apiName Get Leads
 * @apiDescription Get Leads
 * @apiGroup Leads - Admin
 * @apiSuccess (200) {JSON} Result status, message, recordList, totalRecords.
 * @apiSuccessExample {json} Success-200-Response:
 *     HTTP/1.1 200 OK
 *     {
 *          status: 200,
 *          isDisplayMessage: <true/false>, // if the value is true then display message on screen
 *          message: 'Get Leads',
 *          recordList: Leads,
 *          totalRecords: TotalRecords
 *     }
 * @apiError (500) {JSON} Result message, apiName, apiType, fileName, functionName, lineNumber, typeName, stack.
 * @apiErrorExample {json} Error-500-Response:
 *     HTTP/1.1 500 ERROR
 *     {
 *          status: <error status code>,
 *          isDisplayMessage: <true/false>, // if the value is true then display message on screen
 *          message: <error message>,
 *          error: {
 *              apiName: <api name>,
 *              apiType: <api type>,
 *              fileName: <file name>,
 *              functionName: <function name>,
 *              lineNumber: <line number>,
 *              typeName: <type name>,
 *              stack: <stack>
 *          },
 *          value: <value if any>
 *     }
 */
// #endregion


router.post('/getPartnerForLeads', controller.getPartnerForLeads);

// #region /api/admin/leads/assignToPartner apidoc
/**
 * @api {post} /api/admin/leads/assignToPartner Assign To Partner
 * @apiVersion 1.0.0
 * @apiName Assign To Partner Leads
 * @apiDescription Assign To Partner Leads
 * @apiGroup Leads - Admin
 * @apiSuccess (200) {JSON} Result status, message, recordList, totalRecords.
 * @apiSuccessExample {json} Success-200-Response:
 *     HTTP/1.1 200 OK
 *     {
 *          status: 200,
 *          isDisplayMessage: <true/false>, // if the value is true then display message on screen
 *          message: 'Assign To Partner Leads',
 *          recordList: Leads,
 *          totalRecords: TotalRecords
 *     }
 * @apiError (500) {JSON} Result message, apiName, apiType, fileName, functionName, lineNumber, typeName, stack.
 * @apiErrorExample {json} Error-500-Response:
 *     HTTP/1.1 500 ERROR
 *     {
 *          status: <error status code>,
 *          isDisplayMessage: <true/false>, // if the value is true then display message on screen
 *          message: <error message>,
 *          error: {
 *              apiName: <api name>,
 *              apiType: <api type>,
 *              fileName: <file name>,
 *              functionName: <function name>,
 *              lineNumber: <line number>,
 *              typeName: <type name>,
 *              stack: <stack>
 *          },
 *          value: <value if any>
 *     }
 */
// #endregion


router.post('/assignToPartner', controller.assignToPartner);


// #region /api/admin/leads/getLeadstatuses apidoc
/**
 * @api {post} /api/admin/leads/getLeadstatuses Get Lead Statuses
 * @apiVersion 1.0.0
 * @apiName Get Lead Statuses
 * @apiDescription Get Leads Statuses
 * @apiGroup Leads - Admin
 * @apiSuccess (200) {JSON} Result status, message, recordList, totalRecords.
 * @apiSuccessExample {json} Success-200-Response:
 *     HTTP/1.1 200 OK
 *     {
 *          status: 200,
 *          isDisplayMessage: <true/false>, // if the value is true then display message on screen
 *          message: 'Get Leads Statuses',
 *          recordList: Leads Statuses,
 *          totalRecords: TotalRecords
 *     }
 * @apiError (500) {JSON} Result message, apiName, apiType, fileName, functionName, lineNumber, typeName, stack.
 * @apiErrorExample {json} Error-500-Response:
 *     HTTP/1.1 500 ERROR
 *     {
 *          status: <error status code>,
 *          isDisplayMessage: <true/false>, // if the value is true then display message on screen
 *          message: <error message>,
 *          error: {
 *              apiName: <api name>,
 *              apiType: <api type>,
 *              fileName: <file name>,
 *              functionName: <function name>,
 *              lineNumber: <line number>,
 *              typeName: <type name>,
 *              stack: <stack>
 *          },
 *          value: <value if any>
 *     }
 */
// #endregion

router.post('/getLeadstatuses', controller.getLeadStatuses);

// #region /api/admin/leads/convertLeadIntoLoan apidoc
/**
 * @api {post} /api/admin/leads/convertLeadIntoLoan Lead Convert Into Loan
 * @apiVersion 1.0.0
 * @apiName Lead Convert Into Loan
 * @apiDescription Lead Convert Into Loan
 * @apiGroup Leads - Admin
 * @apiParam  {Integer}          LeadId                Required id of Lead
 * @apiParam  {Integer}          CustomerId                Required id of customer
 * @apiParam  {Integer}          employmentTypeId                Required id of EmploymentType
 * @apiParam  {Integer}          serviceId                Required id of Services
 * @apiParam  {Integer}          assignPartnerId                Required id of partner
 * @apiSuccess (200) {JSON} Result status, message, recordList, totalRecords.
 * @apiSuccessExample {json} Success-200-Response:
 *     HTTP/1.1 200 OK
 *     {
 *          status: 200,
 *          isDisplayMessage: <true/false>, // if the value is true then display message on screen
 *          message: 'Convert Leads Into Loans',
 *          recordList: Leads,
 *          totalRecords: TotalRecords
 *     }
 * @apiError (500) {JSON} Result message, apiName, apiType, fileName, functionName, lineNumber, typeName, stack.
 * @apiErrorExample {json} Error-500-Response:
 *     HTTP/1.1 500 ERROR
 *     {
 *          status: <error status code>,
 *          isDisplayMessage: <true/false>, // if the value is true then display message on screen
 *          message: <error message>,
 *          error: {
 *              apiName: <api name>,
 *              apiType: <api type>,
 *              fileName: <file name>,
 *              functionName: <function name>,
 *              lineNumber: <line number>,
 *              typeName: <type name>,
 *              stack: <stack>
 *          },
 *          value: <value if any>
 *     }
 */
// #endregion

router.post('/convertLeadIntoLoan', controller.convertLeadIntoLoan);

// #region /api/admin/leads/changeLeadStatus apidoc
/**
 * @api {post} /api/admin/leads/changeLeadStatus Change Lead Statuses
 * @apiVersion 1.0.0
 * @apiName Change Lead Statuses
 * @apiDescription Change Leads Statuses
 * @apiGroup Leads - Admin
 * @apiSuccess (200) {JSON} Result status, message, recordList, totalRecords.
 * @apiSuccessExample {json} Success-200-Response:
 *     HTTP/1.1 200 OK
 *     {
 *          status: 200,
 *          isDisplayMessage: <true/false>, // if the value is true then display message on screen
 *          message: 'Change Leads Statuses',
 *          recordList: Leads Statuses,
 *          totalRecords: TotalRecords
 *     }
 * @apiError (500) {JSON} Result message, apiName, apiType, fileName, functionName, lineNumber, typeName, stack.
 * @apiErrorExample {json} Error-500-Response:
 *     HTTP/1.1 500 ERROR
 *     {
 *          status: <error status code>,
 *          isDisplayMessage: <true/false>, // if the value is true then display message on screen
 *          message: <error message>,
 *          error: {
 *              apiName: <api name>,
 *              apiType: <api type>,
 *              fileName: <file name>,
 *              functionName: <function name>,
 *              lineNumber: <line number>,
 *              typeName: <type name>,
 *              stack: <stack>
 *          },
 *          value: <value if any>
 *     }
 */
// #endregion

router.post('/changeLeadStatus', controller.changeLeadStatus);

// #region /api/admin/leads/convertLeadIntoCreditCard apidoc
/**
 * @api {post} /api/admin/leads/convertLeadIntoCreditCard Lead Convert Into Credit Card Request
 * @apiVersion 1.0.0
 * @apiName Lead Convert Into Credit Card Request
 * @apiDescription Lead Convert Into Credit Card Request
 * @apiGroup Leads - Admin
 * @apiParam  {Integer}          id                         Required id of Lead
 * @apiParam  {Integer}          serviceId                  Required id of Services
 * @apiSuccess (200) {JSON} Result status, message, recordList, totalRecords.
 * @apiSuccessExample {json} Success-200-Response:
 *     HTTP/1.1 200 OK
 *     {
 *          status: 200,
 *          isDisplayMessage: <true/false>, // if the value is true then display message on screen
 *          message: 'Convert Leads Into Loans',
 *          recordList: Leads,
 *          totalRecords: TotalRecords
 *     }
 * @apiError (500) {JSON} Result message, apiName, apiType, fileName, functionName, lineNumber, typeName, stack.
 * @apiErrorExample {json} Error-500-Response:
 *     HTTP/1.1 500 ERROR
 *     {
 *          status: <error status code>,
 *          isDisplayMessage: <true/false>, // if the value is true then display message on screen
 *          message: <error message>,
 *          error: {
 *              apiName: <api name>,
 *              apiType: <api type>,
 *              fileName: <file name>,
 *              functionName: <function name>,
 *              lineNumber: <line number>,
 *              typeName: <type name>,
 *              stack: <stack>
 *          },
 *          value: <value if any>
 *     }
 */
// #endregion
router.post('/convertLeadIntoCreditCard', controller.convertLeadIntoCreditCard);

export = router;