feat(telegram): integrate Telegram bot for notifications and add related models

This commit is contained in:
Jose Selesan
2026-06-17 08:42:13 -03:00
parent c0c8bf0945
commit b8d8f16f4e
14 changed files with 493 additions and 3 deletions

View File

@@ -319,3 +319,23 @@ export function importPeriodicExpenses(file: File): Promise<ImportResult> {
return r.json();
});
}
// Telegram
export type TelegramStatus = {
botUsername: string | null;
connected: boolean;
};
export type TelegramCode = {
code: string;
botUsername: string | null;
};
export function getTelegramStatus(): Promise<TelegramStatus> {
return fetcher<TelegramStatus>("/api/telegram/status");
}
export function generateTelegramCode(): Promise<TelegramCode> {
return mutator<TelegramCode>("/api/telegram/code", "POST");
}