shouldRescheduleBuyAction = async (logger, data) => {
  const {
    symbol,
    symbolConfiguration: {
      buy: {
        athRestriction: { enabled: buyATHRestrictionEnabled }
      },
      botOptions: {
        autoTriggerBuy: {
          conditions: { whenLessThanATHRestriction, afterDisabledPeriod }
        }
      }
    },
    buy: { currentPrice, athRestrictionPrice }
  } = data;

  // If the current price is higher than the restriction price, reschedule it
  if (
    buyATHRestrictionEnabled &&
    whenLessThanATHRestriction &&
    currentPrice > athRestrictionPrice
  ) {
    const rescheduleReason =
      `The auto-trigger buy action needs to be re-scheduled ` +
      `because the current price is higher than ATH restriction price.`;
    logger.info(
      {
        buyATHRestrictionEnabled,
        whenLessThanATHRestriction,
        currentPrice,
        athRestrictionPrice
      },
      rescheduleReason
    );
    return { shouldReschedule: true, rescheduleReason };
  }

  const checkDisable = await isActionDisabled(symbol);

  // If the symbol is disabled for some reason,
  if (afterDisabledPeriod && checkDisable.isDisabled) {
    const rescheduleReason =
      `The auto-trigger buy action needs to be re-scheduled ` +
      `because the action is disabled at the moment.`;
    logger.info(
      {
        afterDisabledPeriod,
        checkDisable
      },
      rescheduleReason
    );

    return { shouldReschedule: true, rescheduleReason };
  }

  return { shouldReschedule: false, rescheduleReason: null };
}
Validate whether the auto trigger buy action needs to be rescheduled.

@param {*} logger
@param {*} data
@returns