import request from '@/utils/request';
import type { TenantResponse, TenantRequest, TenantQuery } from './types';

export const getTenants = async (params?: TenantQuery) => {
  return request.get('/api/v1/tenant', {
    params
  });
};

export const createTenant = async (data: TenantRequest) => {
  return request.post('/api/v1/tenant', data);
};

export const updateTenant = async (id: number, data: TenantRequest) => {
  return request.put(`/api/v1/tenant/${id}`, data);
};

export const deleteTenant = async (id: number) => {
  return request.delete(`/api/v1/tenant/${id}`);
};

export const getEnabledTenants = async () => {
  return request.get('/api/v1/tenant/list');
}; 