import api from './api';

export type RoomType = 'VEG' | 'FLOWER' | 'DRY' | 'CURE' | 'MOTHER' | 'CLONE' | 'FACILITY';
export type RoomStatus = 'ACTIVE' | 'CLEANING' | 'MAINTENANCE';

export interface Room {
    id: string;
    name: string;
    type: RoomType;
    status: RoomStatus;
    sqft?: number;
    capacity?: number;
    targetTemp?: number;
    targetHumidity?: number;
    targetVPD?: number;
    batches?: { id: string; name: string; status: string }[];
}

export const roomsApi = {
    getAll: async () => {
        const response = await api.get<Room[]>('/rooms');
        return response.data;
    },

    create: async (data: any) => {
        const response = await api.post<Room>('/rooms', data);
        return response.data;
    }
};
