Skip to content

Commit

Permalink
Merge pull request #165 from CheckMateSG/documentation/fix-and-enhance
Browse files Browse the repository at this point in the history
docs: fix and enhance mermaid diagrams
  • Loading branch information
sarge1989 authored Sep 28, 2023
2 parents 2bb5696 + 838108d commit cb57e67
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 7 deletions.
4 changes: 3 additions & 1 deletion documentation/businessFlow.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
```mermaid
sequenceDiagram
autonumber
participant Outside Chat
Expand Down Expand Up @@ -33,4 +34,5 @@ sequenceDiagram
System->> User Bot: Trigger reply with corresponding response
User Bot->> Citizen: "The message has been assessed to be..."
end
end
end
```
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
```mermaid
sequenceDiagram
actor citizen
Expand All @@ -8,7 +9,7 @@ actor checker
citizen ->> user bot: {fake news}
alt there is a match
alt vote not completed
user bot ->> citizen: Hello! 👋 Thank you for sending this in! Our *CheckMates🕵🏻 will be reviewing this message* and *providing you with the results soon*.
user bot ->> citizen: Hello! 👋 Thank you for sending this in! Our *CheckMates🕵🏻 will be reviewing this message* and *providing you with the results soon*.
else is a scam
user bot ->> citizen: ⛔⛔ Thank you for waiting! Our CheckMates have reviewed the message and think this is likely to be a *scam*!🚫\n\nWe recommend you do not engage further⛔️\n\nThank you for keeping Singapore safe!
else is suspicious
Expand Down Expand Up @@ -44,4 +45,5 @@ else no match
checker bot ->> checker: No problem! If you wish to come back and assess the message, you may do so by clicking the "yes" button. See you soon!😊
end
end
end
```
4 changes: 3 additions & 1 deletion documentation/dataSchema.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
```mermaid
erDiagram
message {
Expand All @@ -23,7 +24,7 @@ erDiagram
boolean isInfo
boolean isIrrelevant "Should message be considered assessed and ready for reply"
number truthScore
string primaryCategory either "scam", "illicit", "irrelevant", "spam", "legitimate", "misleading", "untrue", "accurate", "unsure", or "error"
string primaryCategory "either scam, illicit, irrelevant, spam, legitimate, misleading, untrue, accurate, unsure, or error"
string customReply "Not used for now"
number instanceCount
collection instances
Expand Down Expand Up @@ -117,3 +118,4 @@ erDiagram
user ||--|{ instance: sends
message ||--o{ voteRequest: triggers
factChecker ||--o{ voteRequest: responds_to
```
8 changes: 5 additions & 3 deletions documentation/detailedFlow.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
```mermaid
sequenceDiagram
actor Citizen
participant User Bot
Expand Down Expand Up @@ -59,10 +60,10 @@ sequenceDiagram
webhookHandler->>Firestore: Update vote request
Firestore->> onVoteRequestUpdate: Trigger
onVoteRequestUpdate->> Checker Bot: call API with interactive poll
Checker Bot->>Checker: "On a scale of 0-5, how true...?"
Checker Bot->>Checker: "On a scale of 0-5, how true...?"
Checker->>Checker Bot: "<Vote>"
Checker Bot->>webhookHandler: Trigger
webhookHandler->>Firestore: Update vote request
webhookHandler->>Firestore: Update vote request
end
Firestore->> onVoteRequestUpdate: Trigger
onVoteRequestUpdate->>onVoteRequestUpdate: Determine isScam, isIrrelevant, isAssessed
Expand All @@ -79,4 +80,5 @@ sequenceDiagram
end
end
end
end
end
```

0 comments on commit cb57e67

Please sign in to comment.