Skip to content
Open
Show file tree
Hide file tree
Changes from 25 commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
ff274f0
Refactor conference supervisor seeding to use supervisedDelegationMem…
ahsanfarooq210 Jan 11, 2026
7ea3749
added schema for messages in conference
ahsanfarooq210 Jan 11, 2026
72ae8f0
Add communication preferences and delegation email settings to user a…
ahsanfarooq210 Jan 11, 2026
338561f
Add canReceiveDelegationMail field to user input and update my-accoun…
ahsanfarooq210 Jan 11, 2026
31e54fe
Implement messaging feature with compose and history views, including…
ahsanfarooq210 Jan 13, 2026
01a5072
added basic UI for messaging
ahsanfarooq210 Jan 13, 2026
cd0bb8d
took a pull from main
ahsanfarooq210 Jan 13, 2026
a5b8632
added instruction to run project on windows
ahsanfarooq210 Jan 13, 2026
669105b
feat: complete messaging feature with opt-in and privacy controls
google-labs-jules[bot] Jan 14, 2026
a1951fe
feat: complete messaging feature with opt-in and privacy controls
google-labs-jules[bot] Jan 14, 2026
c5295ac
feat: complete messaging feature with opt-in and privacy controls
google-labs-jules[bot] Jan 15, 2026
997de75
feat: Implement conference delegation messaging with compose UI, emai…
ahsanfarooq210 Jan 16, 2026
ba287b0
feat: Enhance messaging functionality with MessageAudit inputs and up…
ahsanfarooq210 Jan 17, 2026
b2db8cb
feat: Update user retrieval logic in messaging compose handler to use…
ahsanfarooq210 Jan 17, 2026
723bb08
feat: Improve messaging compose functionality with recipient mail val…
ahsanfarooq210 Jan 17, 2026
150bdad
feat: Re-enable recipient mail validation in messaging compose handler
ahsanfarooq210 Jan 17, 2026
0d85571
feat: Enhance messaging compose UI with error handling and improved u…
ahsanfarooq210 Jan 17, 2026
06dcf93
feat: Implement messaging history and compose functionality with erro…
ahsanfarooq210 Jan 17, 2026
0c4dad4
feat: implement messaging reply functionality and composer pattern
google-labs-jules[bot] Jan 18, 2026
13a5704
Merge pull request #2 from ahsanfarooq210/messaging-reply-implementat…
ahsanfarooq210 Jan 23, 2026
7e5ea0e
Merge pull request #1 from ahsanfarooq210/messaging-feature-complete-…
ahsanfarooq210 Jan 23, 2026
adda470
added translations
ahsanfarooq210 Jan 23, 2026
0c76fae
fixed warnings in compose page
ahsanfarooq210 Jan 23, 2026
1aa01ee
added fixes
ahsanfarooq210 Jan 23, 2026
fb73ecd
improved the UI
ahsanfarooq210 Jan 23, 2026
eef3ab1
Merge branch 'main' into feat/messaging/role-based-email-messages
Strehk Jan 24, 2026
3e16062
Small enhancements
Strehk Jan 24, 2026
8864ea4
Merge branch 'main' into feat/messaging/role-based-email-messages
Strehk Feb 5, 2026
14d1934
Merge Main
Strehk Feb 19, 2026
ad8af25
wip
Strehk Feb 19, 2026
225440e
Streamline DaisyUI
Strehk Feb 19, 2026
816c2fc
wip
Strehk Feb 19, 2026
bd4499f
improve email
Strehk Feb 19, 2026
3d9dc36
Add modal preview for archive
Strehk Feb 19, 2026
5b75664
Refactor
Strehk Feb 19, 2026
e98a477
Security fixes
Strehk Feb 19, 2026
2ab30af
Add Inbox
Strehk Feb 20, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,21 @@ bun run dev:server # starts the actual dev server (vite&sveltekit)
bunx lefthook install
```

## Running on Windows

Some `package.json` scripts in this repository assume a Unix-like shell (bash) and may not work out of the box on Windows `cmd.exe` or PowerShell. If you develop on Windows, consider one of the options below:

- **Use WSL or Git Bash:** Install Windows Subsystem for Linux (WSL) or Git for Windows and run the development commands from there. This is the easiest option when scripts use shell operators (like `&&`, `rm`, or `sed`).
- **Modify `package.json` scripts for PowerShell / cmd:** Replace Unix-only commands with cross-platform equivalents or use Node-based packages.

if you are running on windows then change copy the following script tags and replace the cooresponding script tags in package.json

Comment thread
ahsanfarooq210 marked this conversation as resolved.
```bash
"dev": "concurrently \"bun run dev:server\" \"bun run dev:docker\"",
"dev:docker": "docker compose -f ./dev.docker-compose.yml up",
"dev:server": "bunx tsx -e \"const {spawn}=require('child_process'); const sleep=(ms)=>new Promise(r=>setTimeout(r,ms)); const run=(cmd,args)=>new Promise(res=>{const p=spawn(cmd,args,{stdio:'inherit',shell:process.platform==='win32'}); p.on('exit',c=>res(c??0));}); (async()=>{for(;;){let c=await run('bunx',['svelte-kit','sync']); if(c!==0){console.log('🔄 sync failed, retrying...'); await sleep(1000); continue;} c=await run('bunx',['vite']); console.log('🔄 Server exited, restarting...'); await sleep(1000);}})();\"",
```
Comment thread
ahsanfarooq210 marked this conversation as resolved.

## Deployment

The easiest way to deploy delegator on your own hardware is to use our provided [docker images](https://hub.docker.com/r/deutschemodelunitednations/delegator). You can find an example docker compose file in the [example](./example/) directoy. Please note that delegator relies on an [OIDC](https://auth0.com/intro-to-iam/what-is-openid-connect-oidc) issuer to be connected and properly configured. We recommend [ZITADEL](https://zitadel.com/) but any issuer of your choice will work. There are some additional instructions on this topic to be found in the example compose file.
Expand Down
57 changes: 57 additions & 0 deletions messages/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
"allNations": "Alle Nationen",
"allPiecesCollected": "Alle Puzzlestücke wurden gesammelt!",
"allRightsReservedby": "Alle Rechte vorbehalten von",
"allowDelegationMailer": "Delegations-E-Mails erlauben",
"alpha3Code": "ISO Alpha 3 Code",
"alphabetical": "Alphabetisch",
"alreadRegistered": "Bereits angemeldet",
Expand Down Expand Up @@ -228,6 +229,8 @@
"committeesAndAgendaItems": "Gremien und Themen",
"committeesSucessfullyAssigned": "Gremien wurden erfolgreich verteilt.",
"communication": "Kommunikation",
"communicationPreferences": "Kommunikationseinstellungen",
"communicationPreferencesDescription": "Wähle, welche Updates du zu deiner Delegation erhalten möchtest.",
"compareVersion": "Mit einer anderen Version vergleichen",
"compareVersions": "Versionen vergleichen",
"complete": "abgeschlossen",
Expand Down Expand Up @@ -556,6 +559,60 @@
"mediaConsentStatus": "Fotostatus",
"members": "Mitglieder",
"membersPerDelegation": "Plätze pro Delegation",
"messageCancelButton": "Abbrechen",
"messageCompose": "Verfassen",
"messageComposeAnnouncement": "Ankündigung verfassen",
"messageComposeMessage": "Nachricht verfassen",
"messageDraft": "Entwurf",
"messageDraftAMessage": "Eine neue Nachricht entwerfen",
"messageHistory": "Verlauf",
"messageMessageBody": "Nachricht",
"messageMessagePlaceholder": "Teile wichtige Details, Aufgaben und Fristen hier...\n\nHalte es klar und prägnant. Du kannst Links für weitere Informationen hinzufügen.",
"messageNoMessagesSent": "Noch keine Nachrichten versendet. Sende deine erste Nachricht von der Verfassen-Seite.",
"messageRecipient": "Empfänger*in",
"messageRecipientNotEnabled": "Empfänger*in hat Messaging nicht aktiviert.",
"messageReviewDeliveryStatus": "Überprüfe den Zustellungsstatus und die Nachrichtenaktivität für diese Konferenz.",
"messageReviewSent": "Gesendete überprüfen",
"messageSendButton": "Nachricht senden",
"messageSendToParticipants": "Eine Nachricht an Konferenzteilnehmende senden",
"messageSent": "Nachricht gesendet.",
"messageSentLog": "Sendelog",
"messageStatusDelivered": "Zugestellt",
"messageSubject": "Betreff",
"messageSubjectPlaceholder": "z.B. Gremienagenda-Sperrung - 18:00 CET",
"messagingCenter": "Nachrichtenzentrale",
"messagingCheckDeliveryStatus": "Zustellungsstatus prüfen",
"messagingClearActionDeadlines": "Fristen bei Bedarf angeben",
"messagingConferenceMessaging": "Konferenznachrichten",
"messagingDeliveryLog": "Zustellungsprotokoll",
"messagingDescription": "Erreiche Delegationen und Teilnehmende schnell. Verfasse Ankündigungen, verfolge die Zustellung und halte die Konferenz auf dem Laufenden.",
"messagingDisabledForAccount": "Messaging ist für dein Konto deaktiviert.",
"messagingEnableInSettings": "In den Einstellungen aktivieren",
"messagingGuidelineDeadlines": "Verwende klare Handlungsaufforderungen und Fristen, um Hin und Her zu reduzieren.",
"messagingGuidelineOptIn": "Sende nur an Empfänger*innen, die zugestimmt haben, und vermeide Duplikate.",
"messagingGuidelineShort": "Halte Betreffzeilen kurz und spezifisch, um die Sichtbarkeit zu verbessern.",
"messagingGuidelines": "Richtlinien",
"messagingKeepConcise": "Halte es prägnant und handlungsorientiert",
"messagingLogsStored": "Nachrichtenprotokolle werden zur Prüfung und Compliance gespeichert.",
"messagingMessageDetails": "Nachrichtendetails",
"messagingMessaging": "Nachrichten",
"messagingNewMessage": "Neue Nachricht",
"messagingNoEligibleRecipients": "Keine geeigneten Empfänger*innen gefunden",
"messagingNoReplyWarning": "Du kannst keine Antworten erhalten.",
"messagingOnlyEnabledUsers": "Nur Nutzer*innen, die Messaging aktiviert haben, werden in dieser Liste angezeigt",
"messagingOverview": "Übersicht",
"messagingQuickActions": "Schnellaktionen",
"messagingRecipientLabel": "Empfänger*in",
"messagingRecipientRequired": "Empfänger*in auswählen...",
"messagingSavedInHistory": "Diese Nachricht wird im Zustellungsverlauf gespeichert",
"messagingSelectRecipient": "Empfänger*in auswählen...",
"messagingSent": "Gesendet",
"messagingSentHistory": "Sendverlauf",
"messagingStartTargetedMessage": "Starte eine gezielte Nachricht an Delegationen, Gremien oder einzelne Teilnehmende.",
"messagingStatus": "Status",
"messagingTipSubjectLine": "Tipp: Verwende klare Betreffzeilen wie \"Gremienagenda-Sperrung - 18:00\", um die Rücklaufquote zu verbessern",
"messagingUnableToLoadRecipients": "Empfänger*in konnte nicht geladen werden",
"messagingVerifyRecipient": "Empfänger*in und Konferenz überprüfen",
"missingInformation": "Fehlende Informationen",
"motivation": "Motivation",
"myAccount": "Mein Konto",
Expand Down
57 changes: 57 additions & 0 deletions messages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Singular/plural mismatch in messagingUnableToLoadRecipients.

The key name ends in Recipients (plural) but the value reads "Unable to load recipient" (singular). Should be "Unable to load recipients".

📝 Proposed fix
-	"messagingUnableToLoadRecipients": "Unable to load recipient",
+	"messagingUnableToLoadRecipients": "Unable to load recipients",
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"messagingUnableToLoadRecipients": "Unable to load recipient",
"messagingUnableToLoadRecipients": "Unable to load recipients",
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@messages/en.json` at line 865, The message key
messagingUnableToLoadRecipients has a plural name but its value is singular;
update the JSON value for "messagingUnableToLoadRecipients" from "Unable to load
recipient" to "Unable to load recipients" so the key and message agree (ensure
proper JSON quoting/commas remain valid).

"messagingVerifyRecipient": "Verify recipient and conference",
"missingInformation": "Missing information",
"motivation": "Motivation",
"myAccount": "My Account",
Expand Down
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;
39 changes: 37 additions & 2 deletions prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Comment thread
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
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

onDelete: Cascade on recipientUser silently deletes the sender's audit records when the recipient is deleted.

Both relations cascade, meaning deletion of either party removes the MessageAudit row. If a recipient exercises a GDPR deletion request, the sender loses their entire sent-message history — undermining the stated traceability intent of this model.

For audit-preserving GDPR compliance, consider making the user IDs nullable with onDelete: SetNull so the row survives but the PII is cleared:

🛡️ 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 senderUser CASL condition in messageAudit.ts to guard against null IDs.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
senderUserId String
senderUser User @relation("SentMessages", fields: [senderUserId], references: [id], onDelete: Cascade)
recipientUserId String
recipientUser User @relation("ReceivedMessages", fields: [recipientUserId], 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: SetNull)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@prisma/schema.prisma` around lines 675 - 679, The MessageAudit relations
currently use onDelete: Cascade on both senderUser and recipientUser which
causes deletion of one user to remove the entire MessageAudit row; change these
relations so the senderUserId and recipientUserId fields become nullable
(String?), and replace onDelete: Cascade with onDelete: SetNull on the
recipientUser and/or senderUser relation(s) to preserve audit rows while
clearing PII; update the MessageAudit model's fields (senderUserId,
recipientUserId) to be nullable and adjust the relation attributes
(relation("SentMessages") / relation("ReceivedMessages")) accordingly, and then
update the CASL condition logic in messageAudit.ts that references senderUserId
to handle possible null IDs (guard checks or alternate rules).


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
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Add @@index directives — all common query paths hit this table without an index.

The CASL ability conditions and messaging queries filter on senderUserId, recipientUserId, conferenceId, and replyToMessageId. Without indexes, every inbox load and admin audit review becomes a full-table scan. As messages accumulate this will be significant.

⚡ Proposed indexes
   replies          MessageAudit[] `@relation`("MessageThread")
+
+  @@index([senderUserId])
+  @@index([recipientUserId])
+  @@index([conferenceId])
+  @@index([replyToMessageId])
 }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@prisma/schema.prisma` around lines 665 - 692, The MessageAudit model lacks
indexes on frequent filter columns causing full-table scans; add @@index
directives to the MessageAudit model for senderUserId, recipientUserId,
conferenceId, and replyToMessageId (and consider a composite index if you
commonly filter by combinations like conferenceId + recipientUserId) so queries
and CASL ability checks use indexed lookups; update the Prisma model
MessageAudit to include @@index([senderUserId]), @@index([recipientUserId]),
@@index([conferenceId]), and @@index([replyToMessageId]) (and an optional
@@index([conferenceId, recipientUserId]) if relevant).


/// Status for message audit entries
enum MessageStatus {
SENT
FAILED
BLOCKED
}
4 changes: 2 additions & 2 deletions prisma/seed/dev/conferenceSupervisor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ import { faker } from '@faker-js/faker';
export function makeSeedConferenceSupervisor(
options: Pick<ConferenceSupervisor, 'conferenceId' | 'userId'> &
Partial<{
delegations: { connect: { id: string }[] };
postAssignmentDelegeationMembers: { connect: { id: string }[] };
supervisedDelegationMembers: { connect: { id: string }[] };
}>
): ConferenceSupervisor {
return {
...options,
id: faker.database.mongodbObjectId(),
plansOwnAttendenceAtConference: faker.datatype.boolean(),
connectionCode: faker.string.numeric(6),
createdAt: faker.date.past(),
updatedAt: faker.date.past()
};
Expand Down
Loading