import { post } from '@/utils/request.js'

/**
 * 临时工首次登记
 * @param {{
 *   realName: string,
 *   idCardNo: string,
 *   bankAccount: string,
 *   bankName: string,
 *   bankBranch?: string,
 *   agreedLaborContract: boolean,
 *   agreedPrivacyPolicy: boolean
 * }} data
 */
export function registerWorker(data) {
	return post('/worker/register', data)
}

/**
 * 查询第三方可用临时工（按工种分组）
 * POST /api/v1/mp/worker/third-party/available
 * Body: [{ jobType, workLocation? }, ...]
 * @param {Array<{ jobType: string, workLocation?: string }>} queries
 */
export function listThirdPartyAvailableWorkers(queries = [], options = {}) {
	return post('/worker/third-party/available', Array.isArray(queries) ? queries : [], options)
}
