S9 — Web Portal — ER Diagram (Target Design)¶
TARGET DESIGN — extension
แสดงเฉพาะ ตารางใหม่/แก้ และความสัมพันธ์ไปยังตาราง reuse (เดิมใน PORTAL) · FK ทุกเส้นตาม schema.sql
· ตาราง reuse ทำเครื่องหมาย (reuse) ในไดอะแกรม
Identity, Membership, SSO, Cards¶
erDiagram
UserProfile ||--o{ UserIdentity : "identities (reuse)"
AuthProvider ||--o{ UserIdentity : "provider"
UserProfile ||--o{ SsoSession : "sessions"
AuthProvider ||--o{ SsoSession : "via"
SsoSession ||--o{ SsoDownstreamGrant : "downstream SSO"
RLPDSystems ||--o{ SsoDownstreamGrant : "to system (reuse)"
UserProfile ||--o{ UserSubsystemMembership : "member of"
RLPDSystems ||--o{ UserSubsystemMembership : "system (reuse)"
RLPDSystems ||--o{ SubsystemCard : "card (reuse)"
UserSubsystemMembership.CitizenId (ThaiD) → ใช้กรอง SubsystemCard ที่ผู้ใช้เห็น (WPT-002 → WPT-003)
Login security¶
erDiagram
UserProfile ||--|| UserSecurityStatus : "security state"
UserProfile ||--o{ PasswordHistory : "old hashes"
UserProfile ||--o{ LoginAttempt : "attempts"
SecurityPolicy {
int MaxFailedAttempts
int LockoutMinutes
int PasswordMaxAgeDays
int InactiveDays
bit BypassPasswordReuse
}
SecurityPolicy เป็น config แถวเดียว (back-office ตั้งค่าได้ — NFR-M06) ที่ logic อ่านไปบังคับ LoginAttempt/UserSecurityStatus/PasswordHistory
Authorization routing (reuse PermissionRequest)¶
erDiagram
PermissionRequest ||--o{ PermissionApproval : "per-system approval (reuse PR)"
RLPDSystems ||--o{ PermissionApproval : "system (reuse)"
UserProfile ||--o{ PermissionApproval : "approver"
RLPDSystems ||--o{ SubsystemOwner : "owned by (reuse)"
UserProfile ||--o{ SubsystemOwner : "owner"
UserProfile ||--o{ Notification : "notified"
PermissionRequest (reuse, + คอลัมน์ใหม่ AdOnlyAccess) → กระจาย PermissionApproval ราย SystemCode → SubsystemOwner รับ Notification
Integration / Service Center / Query Builder¶
erDiagram
RLPDSystems ||--o{ EndpointRegistry : "endpoints (reuse)"
ServiceCenterRequest ||--o{ ServiceCenterRouting : "fan-out"
RLPDSystems ||--o{ ServiceCenterRouting : "target (reuse)"
ApiTokens ||--o{ PublishedQuery : "token (reuse)"
UserProfile ||--o{ PublishedQuery : "owner"
CR-1 (external intake) และ CR-6 (multi-case) ใช้คู่ ServiceCenterRequest/ServiceCenterRouting ร่วมกัน — แยกด้วย Origin
Dashboard & Survey¶
erDiagram
RLPDSystems ||--o{ AuditLog : "audited (reuse)"
RLPDSystems ||--o{ UsageStatDaily : "daily rollup (reuse)"
Survey ||--o{ SurveyQuestion : "questions"
Survey ||--o{ SurveyResponse : "responses"
RLPDSystems ||--o{ SurveyResponse : "evaluated (reuse)"
SurveyResponse ||--o{ SurveyAnswer : "answers"
SurveyQuestion ||--o{ SurveyAnswer : "answered"
SystemAccessLog/AuditLog (raw) → roll-up เป็น UsageStatDaily (กราฟช่วงเวลาเร็วตาม NFR-P02)