56 lines
2.6 KiB
TypeScript
Executable File
56 lines
2.6 KiB
TypeScript
Executable File
// Заглушки для функций AI (Gemini отключен)
|
|
import { Building, ResidentFeedback, AIAnalysisResult, AnalyzedFeedback } from "../types";
|
|
|
|
export const generateBuildingAudit = async (building: Building): Promise<string> => {
|
|
// Заглушка - функция AI отключена
|
|
return `# Анализ дома ${building.passport.address}
|
|
|
|
## Общее состояние
|
|
Дом в эксплуатации. Требуется ручной анализ данных.
|
|
|
|
## Финансовое состояние
|
|
- Баланс: ${building.financials.balance.toLocaleString('ru-RU')} ₽
|
|
- Собираемость: ${building.financials.collectionRate}%
|
|
- Задолженность: ${building.financials.debt.toLocaleString('ru-RU')} ₽
|
|
|
|
*Примечание: Функция AI анализа отключена.*
|
|
`;
|
|
};
|
|
|
|
export const generateResidentFinancialSummary = async (building: Building): Promise<string> => {
|
|
// Заглушка - функция AI отключена
|
|
const balance = building.financials.balance;
|
|
const collectionRate = building.financials.collectionRate;
|
|
|
|
return `Уважаемые жители дома ${building.passport.address}!
|
|
|
|
💰 Баланс дома: ${balance.toLocaleString('ru-RU')} ₽
|
|
📊 Собираемость платежей: ${collectionRate}%
|
|
|
|
${collectionRate > 90 ? '✅ Благодарим за своевременную оплату!' : '⚠️ Просим своевременно оплачивать коммунальные услуги.'}
|
|
|
|
*Примечание: Функция AI генерации отключена. Текст сформирован автоматически.*
|
|
`;
|
|
};
|
|
|
|
export const analyzeResidentFeedback = async (feedback: ResidentFeedback[]): Promise<AIAnalysisResult | null> => {
|
|
// Заглушка - функция AI отключена
|
|
// Возвращаем базовый анализ без AI
|
|
const analyzedFeedback: AnalyzedFeedback[] = feedback.map(f => ({
|
|
...f,
|
|
category: 'Другое',
|
|
sentiment: f.rating >= 7 ? 'Positive' : f.rating <= 3 ? 'Negative' : 'Neutral'
|
|
}));
|
|
|
|
const positiveCount = analyzedFeedback.filter(f => f.sentiment === 'Positive').length;
|
|
const negativeCount = analyzedFeedback.filter(f => f.sentiment === 'Negative').length;
|
|
|
|
return {
|
|
analyzedFeedback,
|
|
summary: {
|
|
positive: positiveCount > 0 ? [`Получено ${positiveCount} положительных отзывов`] : [],
|
|
negative: negativeCount > 0 ? [`Получено ${negativeCount} отрицательных отзывов`] : []
|
|
}
|
|
};
|
|
};
|