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

export interface TimedDiscountQueryParams { page?: number; pageSize?: number; activityName?: string; status?: number; discountType?: number; }
export interface TimedDiscountListResponse { list: any[]; total: number; pageSize: number; currentPage: number; }

export function getTimedDiscountList(params: TimedDiscountQueryParams): Promise<TimedDiscountListResponse> { return get('/timed-discount/list', params); }
export function getTimedDiscountById(id: number): Promise<any> { return get('/timed-discount/' + id); }
export function createTimedDiscount(data: any): Promise<any> { return post('/timed-discount', data); }
export function updateTimedDiscount(id: number, data: any): Promise<any> { return put('/timed-discount/' + id, data); }
export function updateTimedDiscountStatus(id: number, status: number): Promise<any> { return put('/timed-discount/' + id + '/status', { status }); }
export function deleteTimedDiscount(id: number): Promise<any> { return del('/timed-discount/' + id); }
export function executeTimedDiscount(id: number): Promise<any> { return post('/timed-discount/' + id + '/execute'); }
export function getTimedDiscountRecords(params: any): Promise<TimedDiscountListResponse> { return get('/timed-discount/records', params); }
export function getTimedDiscountStatistics(id: number): Promise<any> { return get('/timed-discount/' + id + '/statistics'); }
