import api from './api';

export type PhotoRequirement = 'REQUIRED' | 'OPTIONAL' | 'WEEKLY' | 'ON_DEMAND';

export interface WalkthroughSettings {
    id: string;
    reservoirPhotos: PhotoRequirement;
    irrigationPhotos: PhotoRequirement;
    plantHealthPhotos: PhotoRequirement;
    enableReservoirs: boolean;
    enableIrrigation: boolean;
    enablePlantHealth: boolean;
}

export const settingsApi = {
    getWalkthrough: async () => {
        const response = await api.get<WalkthroughSettings>('/walkthrough-settings');
        return response.data;
    },

    updateWalkthrough: async (data: Partial<WalkthroughSettings>) => {
        const response = await api.patch<WalkthroughSettings>('/walkthrough-settings', data);
        return response.data;
    }
};
