import { request } from './request';
import { apiClient } from './axiosClient';

const END_POINT = '/api/lucky-wheel';

// Get wheel config
export const getWheelConfig = async () => {
    const response = await apiClient.get(`${END_POINT}/config`);
    return response.data;
};

// Update wheel config (admin)
export const updateWheelConfig = async (data) => {
    const response = await apiClient.put(`${END_POINT}/config`, data);
    return response.data;
};

// Spin the wheel
export const spinWheel = async () => {
    const response = await apiClient.post(`${END_POINT}/spin`);
    return response.data;
};

// Get personal history
export const getSpinHistory = async () => {
    const response = await apiClient.get(`${END_POINT}/history`);
    return response.data;
};

// Get all history (admin)
export const getAllSpinHistory = async () => {
    const response = await apiClient.get(`${END_POINT}/history/all`);
    return response.data;
};
