import { ScheduleType } from '../../../../AdaptableState/Common/Enums';
import StringExtensions from '../../../../Utilities/Extensions/StringExtensions';
export const isSettingsValid = (schedule) => {
    if (schedule.ScheduleType === ScheduleType.Reminder) {
        const reminder = schedule;
        if (!reminder.MessageType) {
            return 'Message type not selected';
        }
        if (StringExtensions.IsNullOrEmpty(reminder?.Header)) {
            return 'Reminder header not specified';
        }
        if (StringExtensions.IsNullOrEmpty(reminder?.Message)) {
            return 'Reminder message not specified';
        }
    }
    if (schedule.ScheduleType === ScheduleType.Report) {
        const report = schedule;
        if (StringExtensions.IsNullOrEmpty(report?.ReportName)) {
            return 'Report source not specified';
        }
        if (StringExtensions.IsNullOrEmpty(report?.ReportFormat)) {
            return 'Report format not selected';
        }
    }
    if (schedule.ScheduleType === ScheduleType.ipushpull) {
        const ipushpull = schedule;
        if (StringExtensions.IsNullOrEmpty(ipushpull?.IPushPullReport?.ReportName)) {
            return 'Report not selected';
        }
        if (StringExtensions.IsNullOrEmpty(ipushpull?.IPushPullReport?.Folder)) {
            return 'Report folder not selected';
        }
        if (StringExtensions.IsNullOrEmpty(ipushpull?.IPushPullReport?.Page)) {
            return 'Report page not selected';
        }
    }
    if (schedule.ScheduleType === ScheduleType.OpenFin) {
        const openfin = schedule;
        if (StringExtensions.IsNullOrEmpty(openfin?.OpenFinReport?.ReportName)) {
            return 'Report not selected';
        }
    }
    return true;
};
