import { get, post } from '@/utils/request';

export interface RefundQueryParams { page?: number; pageSize?: number; orderNo?: string; status?: number; startDate?: string; endDate?: string; }
export interface RefundListResponse { list: any[]; total: number; pageSize: number; currentPage: number; }

export function getRefundList(params: RefundQueryParams): Promise<RefundListResponse> { return get('/refund/list', params); }
export function getRefundDetail(id: number): Promise<any> { return get('/refund/' + id); }
export function reviewRefund(id: number, data: { approved: boolean; remark?: string }): Promise<any> { return post('/refund/' + id + '/review', data); }
export function refundOrder(orderId: string, reason: string): Promise<void> { return post('/order/' + orderId + '/refund', { reason }); }
