import { request } from '/@/utils/service';
import { UserPageQuery, AddReq, DelReq, EditReq, InfoReq } from '@fast-crud/fast-crud';

export const apiPrefix = '/api/system/talent_pool/list';
export function GetList(query: UserPageQuery) {
	return request({
		url: apiPrefix,
		method: 'get',
		params: {...query,tenant_id:1},
	});
}
export function GetObj(id: InfoReq) {
	return request({
		url: apiPrefix + id,
		method: 'get',
	});
}

export function AddObj(obj: AddReq) {
	return request({
		url: apiPrefix,
		method: 'post',
		data: obj,
	});
}

export function UpdateObj(obj: EditReq) {
	return request({
		url: apiPrefix + obj.id + '/',
		method: 'put',
		data: obj,
	});
}

export function DelObj(id: DelReq) {
	return request({
		url:`/api/system/job_applications/${id}/?tenant_id=1`,
		method: 'delete',
		data: { id },
	});
}
export function GetPermission(query: UserPageQuery) {
    return request({
        url: apiPrefix,
        method: 'get',
		params: {...query,tenant_id:1}
    });
}

export function BulkUpdateStatus(data: {
	application_ids: number[];
	new_status: number;
	note?: string;
	tenant_id: string;
}) {
	return request({
		url: '/api/system/job_applications/bulk_update_status/',
		method: 'post',
		data
	});
}

export function updateBatchStatus(data: any) {
	return request({
		url: '/api/system/job_applications/bulk_update_status/',
		method: 'post',
		data
	});
}

/* export function updateBatchTags(data) {
	return request({
		url: '/job-application/batch-update-tags',
		method: 'post',
		data
	});
} */
	export function getApplicationStatusSummary() {
		return request({
			url: '/api/system/job/application_status_summary/?tenant_id=1',
			method: 'get',
		});
	}
	