import { customClient } from "../services/http.service";

export interface UserSettingsModel {
	id: string;
	userId: string;
	positioningStrategy: string;
	manualLatitude?: number;
	manualLongitude?: number;
	assetGroupId?: string;
	createdAt: string;
	updatedAt: string;
}

export interface UpdateUserSettingsRequest {
	positioningStrategy: string;
	manualLatitude?: number;
	manualLongitude?: number;
	assetGroupId?: string;
}

export const getUserSettings = () => {
	return customClient<UserSettingsModel>({
		url: "/api/user-settings",
		method: "GET",
	});
};

export const updateUserSettings = (request: UpdateUserSettingsRequest) => {
	return customClient<UserSettingsModel>({
		url: "/api/user-settings",
		method: "PUT",
		headers: { "Content-Type": "application/json" },
		data: request,
	});
}; 