import type { InferResponseType, InferRequestType } from 'hono/client';
import { salaryClient } from './salaryClient';

// 薪资搜索参数类型
export type SalarySearchParams = {
  provinceId?: number;
  cityId?: number;
  districtId?: number;
  page: number;
  limit: number;
};

// 分页响应类型
export type PaginatedResponse<T> = {
  data: T[];
  total: number;
};

// 使用Hono类型推导 - 请求类型
export type CreateSalaryRequest = InferRequestType<typeof salaryClient.create.$post>['json'];
export type UpdateSalaryRequest = InferRequestType<typeof salaryClient.update[':id']['$put']>['json'];
export type DeleteSalaryRequest = InferRequestType<typeof salaryClient.delete[':id']['$delete']>['param'];

// 使用Hono类型推导 - 响应类型
export type SalaryResponse = InferResponseType<typeof salaryClient.list.$get, 200>['data'][0];
export type SalaryListResponse = InferResponseType<typeof salaryClient.list.$get, 200>;
export type SalaryDetailResponse = InferResponseType<typeof salaryClient.detail[':id']['$get'], 200>;
export type SalaryByProvinceCityResponse = InferResponseType<typeof salaryClient.byProvinceCity.$get, 200>;

// 查询参数类型
export type QuerySalaryParams = InferRequestType<typeof salaryClient.list.$get>['query'];