/* eslint-disable */
import { ref } from "vue";
import { defineStore } from "pinia";
import { SchedulePresetsService } from "src/modules/profile/services/schedule-presets-service";
import type { SchedulePreset } from "src/modules/profile/models/schedule-presets.models";


export const useSchedulePresetsStore = defineStore('schedule_presets_store', () => {
    const schedule_presets = ref<SchedulePreset>();

    const createSchedulePreset = async (): Promise<boolean> => {
        try {
            // const new_preset: SchedulePreset = ??
            // await SchedulePresetsService.createSchedulePresets(new_preset);
            return true;
        } catch (error) {
            console.error('DEV ERROR || error while creating schedule preset: ', error);
            return false;
        }
    }

    const updateSchedulePreset = async (): Promise<boolean> => {
        try {
            return true;
        } catch (error) {
            console.error('DEV ERROR || error while updating schedule preset: ', error);
            return false;
        }

    }

    const deleteSchedulePreset = async (preset_id: number): Promise<boolean> => {
        try {
            await SchedulePresetsService.deleteSchedulePresets(preset_id);
            return true;
        } catch (error) {
            console.error('DEV ERROR || error while deleting schedule preset: ', error);
            return false
        }
    }

    const findSchedulePresetList = async (): Promise<boolean> => {
        try {
            return true;
        } catch (error) {
            console.error('DEV ERROR || error while searching for schedule presets: ', error);
            return false
        }
    }

    const applySchedulePreset = async (): Promise<boolean> => {
        try {
            return true;
        } catch (error) {
            console.error('DEV ERROR || error while building schedule: ', error);
            return false
        }
    }

    return {
        schedule_presets,
        createSchedulePreset,
        updateSchedulePreset,
        deleteSchedulePreset,
        findSchedulePresetList,
        applySchedulePreset,
    }
})