- Added EmailBlacklist service and controller for managing blacklisted emails. - Created EmailBlacklistDto for data transfer and EmailBlacklistFormViewModel for form handling. - Implemented views for listing and adding emails to the blacklist. - Updated database schema with new EmailBlacklist entity and related migrations. - Enhanced OAuthClientFormViewModel to include ClientId and ClientSecret properties. - Added EmailBlacklistService to handle email blacklisting logic. - Integrated email blacklist service into the application with necessary dependencies.
59 lines
2.5 KiB
Markdown
59 lines
2.5 KiB
Markdown
# Flows
|
||
|
||
流程以「API 自建 UI」與「會員中心統一 UI」兩種模式描述。
|
||
|
||
## F-01 註冊會員
|
||
- [API] 站點送出 `POST /auth/register`(待補 API)
|
||
- [API] 會員中心建立 user、寄送驗證信
|
||
- [UI] 導向會員中心註冊頁完成註冊
|
||
- [UI] 會員中心寄送驗證信
|
||
|
||
## F-02 登入(OAuth2 + OIDC)
|
||
- [API] 站點送出 `POST /auth/login` 取得 access_token + id_token
|
||
- [API] 站點建立自身 session
|
||
- [UI] 導向 `/oauth/authorize` 完成授權碼流程
|
||
- [UI] 站點用 code 換 token + id_token
|
||
|
||
## F-03 忘記密碼 / 重設密碼
|
||
- [API] 站點送出 `POST /auth/password/forgot`
|
||
- [UI] 會員中心頁提交 email 並發送重設信
|
||
- [API/UI] 使用 token 進入重設密碼頁
|
||
|
||
## F-04 訂閱電子報(未登入)
|
||
- [API] 站點送出 `POST /newsletter/subscribe`
|
||
- [API] 會員中心建立 pending 訂閱並發送驗證信
|
||
- [UI] 使用者點擊驗證信連結 `/newsletter/confirm?token=...`
|
||
- [UI] 訂閱改為 active,發出 event `subscription.activated`
|
||
|
||
## F-05 取消訂閱(單一清單)
|
||
- [API] 站點以 `list_id + email` 呼叫 `POST /newsletter/unsubscribe-token` 取得 token
|
||
- [UI] 使用者點擊退訂連結 `/newsletter/unsubscribe?token=...`
|
||
- [UI] 訂閱狀態改為 unsubscribed
|
||
- [API] 發出 event `subscription.unsubscribed`
|
||
|
||
## F-06 訂閱偏好管理(登入後)
|
||
- [API] 站點以 `list_id + email` 讀取 `/newsletter/preferences`
|
||
- [API] 站點以 `list_id + email` 更新 `/newsletter/preferences`
|
||
- [UI] 會員中心提供偏好頁(可選)
|
||
|
||
## F-10 Send Engine 事件同步(Member Center → Send Engine)
|
||
- [API] Member Center 以 webhook 推送 `subscription.activated/unsubscribed/preferences.updated`(scope: `newsletter:events.write`)
|
||
- [API] Send Engine 驗證 tenant scope + 簽章/重放防護
|
||
- [API] Send Engine 更新名單快照
|
||
|
||
## F-11 黑名單回寫(Send Engine → Member Center)
|
||
- [API] Send Engine 判定黑名單(例如 hard bounce / complaint)
|
||
- [API] 呼叫 `POST /api/subscriptions/disable`(scope: `newsletter:events.write`)
|
||
- [API] Member Center 將 email 寫入 `email_blacklist`,停用寄送並停止事件推送
|
||
|
||
## F-07 會員資料查看
|
||
- [API] 站點讀取 `/user/profile`
|
||
- [UI] 會員中心提供個人資料頁
|
||
|
||
## F-08 管理者管理租戶/清單/Client
|
||
- [UI] 會員中心管理後台進行 CRUD
|
||
|
||
## F-09 訂閱與會員綁定
|
||
- [API] 使用者完成註冊後,會員中心將訂閱資料與 user_id 綁定
|
||
- [API] 發送事件 `subscription.linked_to_user`
|