import CONSTANTS from "../config/constants";

const getLeadStatusDescription = (status: number) => {
  let statusDescription = "New";

  switch (Number(status)) {
    case CONSTANTS.LEAD_STATUS.FOLLOW_UP:
      statusDescription = "Follow Up";
      break;
    case CONSTANTS.LEAD_STATUS.VISIT_SCHEDULED:
      statusDescription = "Visit Scheduled";
      break;
    case CONSTANTS.LEAD_STATUS.CONVERTED:
      statusDescription = "Converted";
      break;
    case CONSTANTS.LEAD_STATUS.CONTACTED:
      statusDescription = "Contacted";
      break;
    case CONSTANTS.LEAD_STATUS.VISIT_SCHEDULED:
      statusDescription = "Visit Scheduled";
      break;
    case CONSTANTS.LEAD_STATUS.VISIT_DONE:
      statusDescription = "Visit Done";
      break;
    case CONSTANTS.LEAD_STATUS.LOST:
      statusDescription = "Lost";
      break;
    case CONSTANTS.LEAD_STATUS.INTERESTED:
      statusDescription = "Interested";
      break;
    case CONSTANTS.LEAD_STATUS.INVALID:
      statusDescription = "Invalid";
      break;
    case CONSTANTS.LEAD_STATUS.NOT_ANSWERED:
      statusDescription = "Not Answered";
      break;
    case CONSTANTS.LEAD_STATUS.NOT_INTERESTED:
      statusDescription = "Not Interested";
      break;
    case CONSTANTS.LEAD_STATUS.ONHOLD:
      statusDescription = "On Hold";
      break;
    default:
      statusDescription = "Pending";
  }
  
  return statusDescription;
};

export const getSourceName = (source: number) => {
  let sourceName = "Not Specified";

  switch (Number(source)) {
    case CONSTANTS.LEAD_SOURCE.FACEBOOK:
      sourceName = "Facebook";
      break;
    case CONSTANTS.LEAD_SOURCE.GOOGLE:
      sourceName = "Google";
      break;
    case CONSTANTS.LEAD_SOURCE.INSTAGRAM:
      sourceName = "Instagram";
      break;
    case CONSTANTS.LEAD_SOURCE.FLATMATE:
      sourceName = "Flatmate";
      break;
    case CONSTANTS.LEAD_SOURCE.MAGICBRICKS:
      sourceName = "Magicbricks";
      break;
    case CONSTANTS.LEAD_SOURCE.ACRES:
      sourceName = "99acres";
      break;
    case CONSTANTS.LEAD_SOURCE.HOUSING:
      sourceName = "Housing.com";
      break;
    case CONSTANTS.LEAD_SOURCE.WEBSITE:
      sourceName = "Website";
      break;
    case CONSTANTS.LEAD_SOURCE.EQARO:
      sourceName = "Eqaro";
      break;
    case CONSTANTS.LEAD_SOURCE.NOBROKER:
      sourceName = "NoBroker";
      break;
    case CONSTANTS.LEAD_SOURCE.OLX:
      sourceName = "OLX";
      break;
    case CONSTANTS.LEAD_SOURCE.QUIKR:
      sourceName = "Quikr";
      break;
    case CONSTANTS.LEAD_SOURCE.OTHERS:
      sourceName = "Others";
      break;
    default:
      sourceName = "Not Specified";
  }
  return sourceName;
};

export const rentRangeNames = (rentRange: number) => {
  let rentRangeName = "Not Specified";

  switch (Number(rentRange)) {
    case CONSTANTS.RENT_RANGE.ZERO_TO_FIVE_K:
      rentRangeName = "0 - 5K";
      break;
    case CONSTANTS.RENT_RANGE.FIVE_TO_TEN_K:
      rentRangeName = "5K - 10K";
      break;
    case CONSTANTS.RENT_RANGE.TEN_TO_FIFTEEN_K:
      rentRangeName = "10K - 15K";
      break;
    case CONSTANTS.RENT_RANGE.FIFTEEN_TO_TWENTY_K:
      rentRangeName = "15K - 20K";
      break;
    case CONSTANTS.RENT_RANGE.TWENTY_TO_TWENTY_FIVE_K:
      rentRangeName = "20K - 25K";
      break;
    case CONSTANTS.RENT_RANGE.TWENTY_FIVE_TO_THIRTY_K:
      rentRangeName = "25K - 30K";
      break;
    case CONSTANTS.RENT_RANGE.THIRTY_TO_THIRTY_FIVE_K:
      rentRangeName = "30K - 35K";
      break;
    case CONSTANTS.RENT_RANGE.THIRTY_FIVE_TO_FORTY_K:
      rentRangeName = "35K - 40K";
      break;
    case CONSTANTS.RENT_RANGE.FORTY_TO_FORTY_FIVE_K:
      rentRangeName = "40K - 45K";
      break;
    case CONSTANTS.RENT_RANGE.FORTY_FIVE_TO_FIFTY_K:
      rentRangeName = "45K - 50K";
      break;
    case CONSTANTS.RENT_RANGE.FIFTY_PLUS:
      rentRangeName = "50K+";
      break;
    default:
      rentRangeName = "Not Specified";  
  }
  return rentRangeName;
};

export default getLeadStatusDescription;
