import CONSTANTS from "../config/constants";
import clientConfigDB from "../models/clientConfig.model";

// const getRentReciptPoints = (clientId: number) => {
//   if (Number(clientId) === 421)
// 	  return `<ul>
//           <li>
//             A one-month prior notice is mandatory before vacating the PG.
//           </li>
//           <li>
//             Rent must be paid on or before the 5th of every month.
//           </li>
//         </ul>`;
//   else 
// 	  return `<ul>
//           <li>
//             This is an acknowledgment receipt of the payment made by the tenant
//             through whatsoever mode of payment for the corresponding services.
//           </li>
//           <li>
//             If an online payment fails for any reason, this receipt will be considered null and void.
//           </li>
//           <li>
//             Refunds will not be provided under any circumstances for this receipt.
//           </li>
//         </ul>`;
// };

const getRentReciptPoints = async (clientId: number) => {
  const receiptTerms = await clientConfigDB.getClientConfig({
      clientId,
      provider: CONSTANTS.CLIENT_CONFIG_PROVIDER.INTERNAL,
      type: CONSTANTS.CLIENT_CONFIG_TYPE.INTERNAL.RECEIPT_TERMS,
    });
  if (receiptTerms)
	  return receiptTerms.value;
  else 
	  return `<ul>
          <li>
            This is an acknowledgment receipt of the payment made by the tenant
            through whatsoever mode of payment for the corresponding services.
          </li>
          <li>
            If an online payment fails for any reason, this receipt will be considered null and void.
          </li>
          <li>
            Refunds will not be provided under any circumstances for this receipt.
          </li>
        </ul>`;
};

export default getRentReciptPoints;
