Vlad Chikalkin c22357b71e
feat: integrate Telegraf for Telegram notifications in order lifecycle (#4)
- Added Telegraf dependency to handle Telegram bot interactions.
- Updated order lifecycle methods to send notifications upon order creation and updates.
- Refactored datetime handling to use a consistent timezone.
- Removed unused utility functions to streamline codebase.
2025-07-23 13:14:02 +03:00

14 lines
382 B
TypeScript

// Универсальная функция для извлечения id из разных форматов входных данных
export function extractId(input) {
if (typeof input === 'number' || typeof input === 'string') {
return input;
}
if (input?.id) {
return input.id;
}
if (input?.set?.[0]?.id) {
return input.set[0].id;
}
return null;
}