fetching convos with current state for user and combining to master convos

This commit is contained in:
talksik
2022-04-03 10:29:52 -04:00
parent d6eadab3c1
commit 87335cbdb6
8 changed files with 154 additions and 15 deletions
@@ -3,15 +3,20 @@ import { ConversationMember } from "./conversation.model";
import { ObjectId } from "mongodb";
export default class MasterConversation {
// attributes of conversation
id: ObjectId; // id of the conversation
name?: string;
createdDate: Date;
lastUpdatedDate: Date;
constructor(
// attributes of conversation
public id: ObjectId, // id of the conversation
// compiled data for easy client read
currentUserMember: ConversationMember;
otherMembers: ConversationMember[];
public createdDate: Date,
public lastUpdatedDate: Date,
audioClips: AudioClip[];
// compiled data for easy client read
public currentUserMember?: ConversationMember,
public otherMembers?: ConversationMember[],
public audioClips: AudioClip[] = [],
public name?: string
) {}
}
@@ -0,0 +1,5 @@
import { Conversation } from "../models/conversation.model";
export default class GetUserConversationsResponse {
constructor(public convos: Conversation[]) {}
}