|
|
@@ -100,7 +100,9 @@ companies(id, name, slug, status, fcm_shared, telegram_bot_token_enc,
|
|
|
|
|
|
-- People & devices
|
|
|
individuals(id, company_id, full_name, email, phone_e164, locale, tz,
|
|
|
- telegram_chat_id, telegram_user_id, status, created_at)
|
|
|
+ telegram_chat_id, telegram_user_id,
|
|
|
+ telegram_invite_code, telegram_invite_expires_at,
|
|
|
+ status, created_at)
|
|
|
fcm_tokens(id, individual_id, token, device_id, platform, locale,
|
|
|
app_version, last_seen, status, created_at)
|
|
|
groups(id, company_id, name, description, fcm_topic, telegram_chat_id,
|
|
|
@@ -210,7 +212,10 @@ A single FCM project can hold this. Storage is on our side (the
|
|
|
- For group alerts we use the bot in a company group chat
|
|
|
(`telegram_chat_id` on the `groups` table).
|
|
|
- **Bot commands** (Telegram = management UI):
|
|
|
- - `/start` — link telegram account to `individuals.id`
|
|
|
+ - `/start <invite_code>` — link telegram account to the
|
|
|
+ pre-existing `individuals.id` (admin must create the
|
|
|
+ individual and issue the code first; unknown users are
|
|
|
+ rejected)
|
|
|
- `/mute <duration>` — e.g. `/mute 2h`, `/mute until 18:00`
|
|
|
- `/unmute`
|
|
|
- `/subscribe <source> <min_severity>`
|