Skip to content

Commit

Permalink
Merge pull request #166 from CheckMateSG/develop
Browse files Browse the repository at this point in the history
2.7.1
  • Loading branch information
sarge1989 authored Sep 28, 2023
2 parents 9643dbd + cb57e67 commit 59087a1
Show file tree
Hide file tree
Showing 23 changed files with 13,874 additions and 11,260 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
```
8 changes: 6 additions & 2 deletions documentation/dataSchema.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
```mermaid
erDiagram
message {
string id PK "Assigned by Firestore"
string machineCategory
boolean isMachineCategorised
string text "Text. For text, shows the latest iteration"
string originalText "text as sent by user"
string text "pii-stripped text. For text, shows the latest iteration"
string caption "Latest caption for image, if applicable"
timestamp firstTimestamp "Timestamp of first instance"
timestamp lastTimestamp "Timestamp of latest instance"
timestamp lastRefreshedTimestamp "Timestamp where details were last updated"
boolean isPollStarted
boolean isAssessed "Should message be considered assessed and ready for reply"
timestamp assessedTimestamp
Expand All @@ -21,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 @@ -115,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
```
2 changes: 1 addition & 1 deletion functions/.env.local.test
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ NUM_SHARDS_INSTANCE_COUNT=5
NUM_SHARDS_VOTE_COUNT=5
GRAPH_API_VERSION=v15.0
TEST_SERVER_URL=http://resultserver:12345
ENVIRONMENT=DEV
ENVIRONMENT=SIT
SPREADSHEET_ID=SPREADSHEET_ID
WHATSAPP_TEST_USER_BOT_PHONE_NUMBER_ID=WHATSAPP_TEST_USER_BOT_PHONE_NUMBER_ID
WHATSAPP_TEST_CHECKER_BOT_PHONE_NUMBER_ID=WHATSAPP_TEST_CHECKER_BOT_PHONE_NUMBER_ID
Expand Down
Loading

0 comments on commit 59087a1

Please sign in to comment.