Social - Chat (Logic)
DomainsDOL AcademyUX279 words1 min read
Purpose
Phần tiêu đề “Purpose”- Nhắn tin 1-1 và nhóm với giao diện in‑app quen thuộc; hậu trường tích hợp bên thứ 3 (ví dụ: Telegram) để giảm effort triển khai, vẫn bảo toàn quyền riêng tư.
Scope
Phần tiêu đề “Scope”- In‑app UI: DM và Group chat (text; emoji; file nhỏ nếu cần). Trải nghiệm liền mạch trong nền tảng.
- Tích hợp bên thứ 3 (Telegram): adapter trung gian đồng bộ gửi/nhận; lưu mapping và metadata tối thiểu.
- Moderation: report, block, mute; rate limit.
Entities
Phần tiêu đề “Entities”- ChatThread: { id, type: dm|group, externalRef?, createdAt }.
- Message: { id, threadId, authorId, body, createdAt, editedAt?, deletedAt? }.
- Membership: { threadId, userId, role: owner|member, joinedAt }.
- Integration: { provider: telegram|…, externalId, metadata }.
- ChatAdapter: { provider, capabilities: send|receive|files?, retryPolicy }.
Logic
Phần tiêu đề “Logic”- Create group: owner tạo → mời bằng link/invite; nếu tích hợp Telegram, tạo/mapping
Integration.externalIdqua bot. - In‑app UX: gửi/nhận trong UI nền tảng; ChatAdapter chuyển tiếp tới nhà cung cấp; lỗi adapter → fallback mở deep link ngoài.
- Privacy: group private theo mặc định.
- Data: khi tích hợp Telegram, chỉ lưu mapping/metadata (không nhân bản lịch sử) để giảm rủi ro PII.
Flows
Phần tiêu đề “Flows”- DM: open/create thread → send/receive.
- Group: create → invite → chat; owner quản lý members.
- Report/Block: ẩn nội dung từ user bị block; gửi report tới moderation.
Edge cases
Phần tiêu đề “Edge cases”- Sync lỗi với bên thứ 3: fallback hiển thị link mở app ngoài.
- Người dùng rời nhóm: giữ lịch sử theo policy; revoke invite.
Technical Notes
Phần tiêu đề “Technical Notes”- Webhook/bot cho Telegram (nếu dùng); chịu giới hạn ToS.
- PII: tối thiểu; tuân thủ privacy mặc định của Account.