-
Notifications
You must be signed in to change notification settings - Fork 6
Feat/messaging/role based email messages #374
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 25 commits
ff274f0
7ea3749
72ae8f0
338561f
31e54fe
01a5072
cd0bb8d
a5b8632
669105b
a1951fe
c5295ac
997de75
ba287b0
b2db8cb
723bb08
150bdad
0d85571
06dcf93
0c4dad4
13a5704
7e5ea0e
adda470
0c76fae
1aa01ee
fb73ecd
eef3ab1
3e16062
8864ea4
14d1934
ad8af25
225440e
816c2fc
bd4499f
3d9dc36
5b75664
e98a477
2ab30af
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -48,6 +48,7 @@ | |||||
| "allNations": "All Nations", | ||||||
| "allPiecesCollected": "All puzzle pieces have been collected!", | ||||||
| "allRightsReservedby": "All rights reserved by", | ||||||
| "allowDelegationMailer": "Allow delegation emails", | ||||||
| "alpha3Code": "ISO Alpha 3 Code", | ||||||
| "alphabetical": "alphabetical", | ||||||
| "alreadRegistered": "Already registered", | ||||||
|
|
@@ -228,6 +229,8 @@ | |||||
| "committeesAndAgendaItems": "Committees and Agenda Items", | ||||||
| "committeesSucessfullyAssigned": "Committees successfully assigned", | ||||||
| "communication": "Communication", | ||||||
| "communicationPreferences": "Communication preferences", | ||||||
| "communicationPreferencesDescription": "Choose which updates you want to receive about your delegation.", | ||||||
| "compareVersion": "Compare with another version", | ||||||
| "compareVersions": "Compare Versions", | ||||||
| "complete": "complete", | ||||||
|
|
@@ -556,6 +559,60 @@ | |||||
| "mediaConsentStatus": "Media Status", | ||||||
| "members": "Members", | ||||||
| "membersPerDelegation": "Seats per Delegation", | ||||||
| "messageCancelButton": "Cancel", | ||||||
| "messageCompose": "Compose", | ||||||
| "messageComposeAnnouncement": "Compose announcement", | ||||||
| "messageComposeMessage": "Compose Message", | ||||||
| "messageDraft": "Draft", | ||||||
| "messageDraftAMessage": "Draft a new message", | ||||||
| "messageHistory": "History", | ||||||
| "messageMessageBody": "Message", | ||||||
| "messageMessagePlaceholder": "Share key details, action items, and deadlines here...\n\nKeep it clear and concise. You can include links for additional information.", | ||||||
| "messageNoMessagesSent": "No messages sent yet. Send your first update from the compose page.", | ||||||
| "messageRecipient": "Recipient", | ||||||
| "messageRecipientNotEnabled": "Recipient has not enabled messaging.", | ||||||
| "messageReviewDeliveryStatus": "Review delivery status and message activity for this conference.", | ||||||
| "messageReviewSent": "Review sent", | ||||||
| "messageSendButton": "Send Message", | ||||||
| "messageSendToParticipants": "Send a message to conference participants", | ||||||
| "messageSent": "Message sent.", | ||||||
| "messageSentLog": "Sent log", | ||||||
| "messageStatusDelivered": "Delivered", | ||||||
| "messageSubject": "Subject", | ||||||
| "messageSubjectPlaceholder": "e.g., Committee agenda lock - 18:00 CET", | ||||||
| "messagingCenter": "Messaging Center", | ||||||
| "messagingCheckDeliveryStatus": "Check delivery status", | ||||||
| "messagingClearActionDeadlines": "Include deadlines when applicable", | ||||||
| "messagingConferenceMessaging": "Conference Messaging", | ||||||
| "messagingDeliveryLog": "Delivery log", | ||||||
| "messagingDescription": "Reach delegations and participants quickly. Compose announcements, track delivery, and keep the conference aligned.", | ||||||
| "messagingDisabledForAccount": "Messaging is disabled for your account.", | ||||||
| "messagingEnableInSettings": "Enable it in settings", | ||||||
| "messagingGuidelineDeadlines": "Use clear actions and deadlines to reduce back-and-forth.", | ||||||
| "messagingGuidelineOptIn": "Send only to opt-in recipients and avoid duplicates.", | ||||||
| "messagingGuidelineShort": "Keep subject lines short and specific to improve visibility.", | ||||||
| "messagingGuidelines": "Guidelines", | ||||||
| "messagingKeepConcise": "Keep it concise and actionable", | ||||||
| "messagingLogsStored": "Messaging logs are stored for auditing and compliance.", | ||||||
| "messagingMessageDetails": "Message Details", | ||||||
| "messagingMessaging": "Messaging", | ||||||
| "messagingNewMessage": "New message", | ||||||
| "messagingNoEligibleRecipients": "No eligible recipients found", | ||||||
| "messagingNoReplyWarning": "You cannot receive replies.", | ||||||
| "messagingOnlyEnabledUsers": "Only users who have enabled messaging will appear in this list", | ||||||
| "messagingOverview": "Overview", | ||||||
| "messagingQuickActions": "Quick actions", | ||||||
| "messagingRecipientLabel": "Recipient", | ||||||
| "messagingRecipientRequired": "Select a recipient...", | ||||||
| "messagingSavedInHistory": "This message will be saved in delivery history", | ||||||
| "messagingSelectRecipient": "Select a recipient...", | ||||||
| "messagingSent": "Sent", | ||||||
| "messagingSentHistory": "Sent history", | ||||||
| "messagingStartTargetedMessage": "Start a targeted message to delegations, committees, or individual participants.", | ||||||
| "messagingStatus": "Status", | ||||||
| "messagingTipSubjectLine": "Tip: Use clear subject lines like \"Committee agenda lock - 18:00\" to improve response rates", | ||||||
| "messagingUnableToLoadRecipients": "Unable to load recipient", | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Singular/plural mismatch in The key name ends in 📝 Proposed fix- "messagingUnableToLoadRecipients": "Unable to load recipient",
+ "messagingUnableToLoadRecipients": "Unable to load recipients",📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||
| "messagingVerifyRecipient": "Verify recipient and conference", | ||||||
| "missingInformation": "Missing information", | ||||||
| "motivation": "Motivation", | ||||||
| "myAccount": "My Account", | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| -- CreateEnum | ||
| CREATE TYPE "MessageStatus" AS ENUM ('SENT', 'FAILED', 'BLOCKED'); | ||
|
|
||
| -- AlterTable | ||
| ALTER TABLE "User" ADD COLUMN "canReceiveDelegationMail" BOOLEAN NOT NULL DEFAULT false; | ||
|
|
||
| -- CreateTable | ||
| CREATE TABLE "MessageAudit" ( | ||
| "id" TEXT NOT NULL, | ||
| "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
| "updatedAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
| "subject" TEXT NOT NULL, | ||
| "body" TEXT NOT NULL, | ||
| "senderUserId" TEXT NOT NULL, | ||
| "recipientUserId" TEXT NOT NULL, | ||
| "conferenceId" TEXT NOT NULL, | ||
| "messageId" TEXT, | ||
| "status" "MessageStatus" NOT NULL DEFAULT 'SENT', | ||
|
|
||
| CONSTRAINT "MessageAudit_pkey" PRIMARY KEY ("id") | ||
| ); | ||
|
|
||
| -- AddForeignKey | ||
| ALTER TABLE "MessageAudit" ADD CONSTRAINT "MessageAudit_senderUserId_fkey" FOREIGN KEY ("senderUserId") REFERENCES "User"("id") ON DELETE CASCADE ON UPDATE CASCADE; | ||
|
|
||
| -- AddForeignKey | ||
| ALTER TABLE "MessageAudit" ADD CONSTRAINT "MessageAudit_recipientUserId_fkey" FOREIGN KEY ("recipientUserId") REFERENCES "User"("id") ON DELETE CASCADE ON UPDATE CASCADE; | ||
|
|
||
| -- AddForeignKey | ||
| ALTER TABLE "MessageAudit" ADD CONSTRAINT "MessageAudit_conferenceId_fkey" FOREIGN KEY ("conferenceId") REFERENCES "Conference"("id") ON DELETE CASCADE ON UPDATE CASCADE; |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -86,8 +86,9 @@ model Conference { | |||||||||||||||||||||
| WaitingListEntry WaitingListEntry[] | ||||||||||||||||||||||
| papers Paper[] | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| createdAt DateTime @default(now()) | ||||||||||||||||||||||
| updatedAt DateTime @default(now()) @updatedAt | ||||||||||||||||||||||
| createdAt DateTime @default(now()) | ||||||||||||||||||||||
| updatedAt DateTime @default(now()) @updatedAt | ||||||||||||||||||||||
| messageAudits MessageAudit[] | ||||||||||||||||||||||
| } | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| /// A committee in a conference. E.g. the human rights council | ||||||||||||||||||||||
|
|
@@ -188,6 +189,9 @@ model User { | |||||||||||||||||||||
| papers Paper[] | ||||||||||||||||||||||
| paperReviews PaperReview[] | ||||||||||||||||||||||
| reviewerSnippets ReviewerSnippet[] | ||||||||||||||||||||||
| canReceiveDelegationMail Boolean @default(false) | ||||||||||||||||||||||
| sentDelegationMessages MessageAudit[] @relation("SentMessages") | ||||||||||||||||||||||
| receivedDelegationMessages MessageAudit[] @relation("ReceivedMessages") | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| createdAt DateTime @default(now()) | ||||||||||||||||||||||
| updatedAt DateTime @default(now()) @updatedAt | ||||||||||||||||||||||
|
|
@@ -624,3 +628,34 @@ model TeamMember { | |||||||||||||||||||||
|
|
||||||||||||||||||||||
| @@unique([conferenceId, userId]) | ||||||||||||||||||||||
| } | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| model MessageAudit { | ||||||||||||||||||||||
| id String @id @default(nanoid()) | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| createdAt DateTime @default(now()) | ||||||||||||||||||||||
| updatedAt DateTime @default(now()) @updatedAt | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| subject String | ||||||||||||||||||||||
| body String | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| //tracibility | ||||||||||||||||||||||
|
ahsanfarooq210 marked this conversation as resolved.
|
||||||||||||||||||||||
| senderUserId String | ||||||||||||||||||||||
| senderUser User @relation("SentMessages", fields: [senderUserId], references: [id], onDelete: Cascade) | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| recipientUserId String | ||||||||||||||||||||||
| recipientUser User @relation("ReceivedMessages", fields: [recipientUserId], references: [id], onDelete: Cascade) | ||||||||||||||||||||||
|
Comment on lines
+675
to
+679
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Both relations cascade, meaning deletion of either party removes the For audit-preserving GDPR compliance, consider making the user IDs nullable with 🛡️ Proposed approach (nullable + SetNull)- senderUserId String
- senderUser User `@relation`("SentMessages", fields: [senderUserId], references: [id], onDelete: Cascade)
+ senderUserId String?
+ senderUser User? `@relation`("SentMessages", fields: [senderUserId], references: [id], onDelete: SetNull)
- recipientUserId String
- recipientUser User `@relation`("ReceivedMessages", fields: [recipientUserId], references: [id], onDelete: Cascade)
+ recipientUserId String?
+ recipientUser User? `@relation`("ReceivedMessages", fields: [recipientUserId], references: [id], onDelete: SetNull)If Cascade is intentional (e.g., policy to delete all data on user erasure), document the tradeoff explicitly, and update the 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||
|
|
||||||||||||||||||||||
| conferenceId String | ||||||||||||||||||||||
| conference Conference @relation(fields: [conferenceId], references: [id], onDelete: Cascade) | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| // Technical meta-data | ||||||||||||||||||||||
| messageId String? // The ID from the email provider | ||||||||||||||||||||||
| status MessageStatus @default(SENT) | ||||||||||||||||||||||
| } | ||||||||||||||||||||||
|
Comment on lines
+665
to
+692
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add The CASL ability conditions and messaging queries filter on ⚡ Proposed indexes replies MessageAudit[] `@relation`("MessageThread")
+
+ @@index([senderUserId])
+ @@index([recipientUserId])
+ @@index([conferenceId])
+ @@index([replyToMessageId])
}🤖 Prompt for AI Agents |
||||||||||||||||||||||
|
|
||||||||||||||||||||||
| /// Status for message audit entries | ||||||||||||||||||||||
| enum MessageStatus { | ||||||||||||||||||||||
| SENT | ||||||||||||||||||||||
| FAILED | ||||||||||||||||||||||
| BLOCKED | ||||||||||||||||||||||
| } | ||||||||||||||||||||||
Uh oh!
There was an error while loading. Please reload this page.