import { request } from '@/api';

/**
 * @description: 获取品种枚举列表
 */
export async function getVarietyEnumsListApi(): Promise<any> {
    return request.get<any>('/contractVariety/getVarietyEnumsList')
}

/**
 * @description: 新增品种枚举
 * @param params - { code: 编码, name: 名称, status: 状态(1启用/2禁用) }
 */
export async function addVarietyEnumsApi(params: { code: string; name: string; status: number }): Promise<any> {
    return request.post<any>('/contractVariety/addVarietyEnums', params)
}

/**
 * @description: 编辑品种枚举
 * @param params - { id, code: 编码, name: 名称, status: 状态(1启用/2禁用) }
 */
export async function editVarietyEnumsApi(params: { id: number; code: string; name: string; status: number }): Promise<any> {
    return request.post<any>('/contractVariety/editVarietyEnums', params)
}

/**
 * @description: 删除品种枚举
 * @param params - { id }
 */
export async function delVarietyEnumsApi(params: { id: number }): Promise<any> {
    return request.post<any>('/contractVariety/delVarietyEnums', params)
}
