adding models and stale state for convos

This commit is contained in:
talksik
2022-04-03 06:53:13 -04:00
parent 362a6db698
commit 327299d8d7
5 changed files with 140 additions and 9 deletions
@@ -0,0 +1,30 @@
import { ObjectId } from "mongodb";
export class Conversation {
_id: ObjectId;
name?: string;
createdDate: Date;
lastUpdatedDate: Date;
constructor() {}
}
export class ConversationMember {
_id: ObjectId;
// unique constraint
conversationId: ObjectId;
userId: ObjectId;
state: ConversationMemberState;
createdDate: Date;
}
export enum ConversationMemberState {
INVITED = "INVITED", // user gets this in their request inbox
INBOX = "INBOX", // user decided to join this conversation after being invited
TUNED = "TUNED", // user upgraded priority of this and now is tuned in live to convo
ARCHIVED = "ARCHIVED", // user no longer wants anything to do with convo
}