imporve features
This commit is contained in:
@@ -125,6 +125,26 @@ export const RegisterTenantStep: React.FC<RegisterTenantStepProps> = ({
|
||||
false // use_cache = false for initial detection
|
||||
).then((result) => {
|
||||
console.log(`✅ POI detection completed automatically for tenant ${tenant.id}:`, result.summary);
|
||||
|
||||
// Phase 3: Handle calendar suggestion if available
|
||||
if (result.calendar_suggestion) {
|
||||
const suggestion = result.calendar_suggestion;
|
||||
console.log(`📊 Calendar suggestion available:`, {
|
||||
calendar: suggestion.calendar_name,
|
||||
confidence: `${suggestion.confidence_percentage}%`,
|
||||
should_auto_assign: suggestion.should_auto_assign
|
||||
});
|
||||
|
||||
// Store suggestion in wizard context for later use
|
||||
// Frontend can show this in settings or a notification later
|
||||
if (suggestion.confidence_percentage >= 75) {
|
||||
console.log(`✅ High confidence suggestion: ${suggestion.calendar_name} (${suggestion.confidence_percentage}%)`);
|
||||
// TODO: Show notification to admin about high-confidence suggestion
|
||||
} else {
|
||||
console.log(`📋 Lower confidence suggestion: ${suggestion.calendar_name} (${suggestion.confidence_percentage}%)`);
|
||||
// TODO: Store for later review in settings
|
||||
}
|
||||
}
|
||||
}).catch((error) => {
|
||||
console.warn('⚠️ Background POI detection failed (non-blocking):', error);
|
||||
// This is non-critical, so we don't block the user
|
||||
|
||||
@@ -13,7 +13,7 @@ import type {
|
||||
POICacheStats
|
||||
} from '@/types/poi';
|
||||
|
||||
const POI_BASE_URL = '/poi-context';
|
||||
const POI_BASE_URL = '/tenants';
|
||||
|
||||
export const poiContextApi = {
|
||||
/**
|
||||
@@ -26,7 +26,7 @@ export const poiContextApi = {
|
||||
forceRefresh: boolean = false
|
||||
): Promise<POIDetectionResponse> {
|
||||
const response = await apiClient.post<POIDetectionResponse>(
|
||||
`${POI_BASE_URL}/${tenantId}/detect`,
|
||||
`/tenants/${tenantId}/external/poi-context/detect`,
|
||||
null,
|
||||
{
|
||||
params: {
|
||||
@@ -44,7 +44,7 @@ export const poiContextApi = {
|
||||
*/
|
||||
async getPOIContext(tenantId: string): Promise<POIContextResponse> {
|
||||
const response = await apiClient.get<POIContextResponse>(
|
||||
`${POI_BASE_URL}/${tenantId}`
|
||||
`/tenants/${tenantId}/external/poi-context`
|
||||
);
|
||||
return response;
|
||||
},
|
||||
@@ -54,7 +54,7 @@ export const poiContextApi = {
|
||||
*/
|
||||
async refreshPOIContext(tenantId: string): Promise<POIDetectionResponse> {
|
||||
const response = await apiClient.post<POIDetectionResponse>(
|
||||
`${POI_BASE_URL}/${tenantId}/refresh`
|
||||
`/tenants/${tenantId}/external/poi-context/refresh`
|
||||
);
|
||||
return response;
|
||||
},
|
||||
@@ -63,7 +63,7 @@ export const poiContextApi = {
|
||||
* Delete POI context for a tenant
|
||||
*/
|
||||
async deletePOIContext(tenantId: string): Promise<void> {
|
||||
await apiClient.delete(`${POI_BASE_URL}/${tenantId}`);
|
||||
await apiClient.delete(`/tenants/${tenantId}/external/poi-context`);
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -71,7 +71,7 @@ export const poiContextApi = {
|
||||
*/
|
||||
async getFeatureImportance(tenantId: string): Promise<FeatureImportanceResponse> {
|
||||
const response = await apiClient.get<FeatureImportanceResponse>(
|
||||
`${POI_BASE_URL}/${tenantId}/feature-importance`
|
||||
`/tenants/${tenantId}/external/poi-context/feature-importance`
|
||||
);
|
||||
return response;
|
||||
},
|
||||
@@ -86,24 +86,24 @@ export const poiContextApi = {
|
||||
insights: string[];
|
||||
}> {
|
||||
const response = await apiClient.get(
|
||||
`${POI_BASE_URL}/${tenantId}/competitor-analysis`
|
||||
`/tenants/${tenantId}/external/poi-context/competitor-analysis`
|
||||
);
|
||||
return response;
|
||||
},
|
||||
|
||||
/**
|
||||
* Check POI service health
|
||||
* Check POI service health (system level)
|
||||
*/
|
||||
async checkHealth(): Promise<{ status: string; overpass_api: any }> {
|
||||
const response = await apiClient.get(`${POI_BASE_URL}/health`);
|
||||
const response = await apiClient.get(`/health/poi-context`);
|
||||
return response;
|
||||
},
|
||||
|
||||
/**
|
||||
* Get cache statistics
|
||||
* Get cache statistics (system level)
|
||||
*/
|
||||
async getCacheStats(): Promise<{ status: string; cache_stats: POICacheStats }> {
|
||||
const response = await apiClient.get(`${POI_BASE_URL}/cache/stats`);
|
||||
const response = await apiClient.get(`/cache/poi-context/stats`);
|
||||
return response;
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user