cleaning bunch of models, services, and routes for new line stuff
This commit is contained in:
@@ -1,31 +0,0 @@
|
||||
import { ObjectId } from "mongodb";
|
||||
|
||||
export class Conversation {
|
||||
name?: string;
|
||||
|
||||
constructor(
|
||||
public _id?: ObjectId,
|
||||
public createdDate: Date = new Date(),
|
||||
public lastUpdatedDate: Date = new Date()
|
||||
) {}
|
||||
}
|
||||
|
||||
export class ConversationMember {
|
||||
constructor(
|
||||
// unique constraint
|
||||
public conversationId: ObjectId,
|
||||
public userId: ObjectId,
|
||||
|
||||
public state: ConversationMemberState = ConversationMemberState.INVITED,
|
||||
|
||||
public createdDate: Date = new Date(),
|
||||
public _id?: ObjectId
|
||||
) {}
|
||||
}
|
||||
|
||||
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
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
import { ObjectId } from "mongodb";
|
||||
|
||||
export class Line {
|
||||
constructor(
|
||||
public _id?: ObjectId,
|
||||
public createdDate: Date = new Date(),
|
||||
public lastUpdatedDate: Date = new Date(),
|
||||
public name?: string
|
||||
) {}
|
||||
}
|
||||
|
||||
export class LineMember {
|
||||
// the last time that the user visited the line
|
||||
// for new activity monitoring
|
||||
lastVisitDate?: Date;
|
||||
|
||||
constructor(
|
||||
// unique constraint
|
||||
public lineId: ObjectId,
|
||||
public userId: ObjectId,
|
||||
|
||||
public state: LineMemberState = LineMemberState.INBOX,
|
||||
|
||||
public createdDate: Date = new Date(),
|
||||
public _id?: ObjectId
|
||||
) {}
|
||||
}
|
||||
|
||||
export enum LineMemberState {
|
||||
// these states will be for later when we want an inbox and such
|
||||
// INVITED = "INVITED", // user gets this in their request inbox
|
||||
|
||||
// ARCHIVED = "ARCHIVED", // user no longer wants anything to do with convo
|
||||
|
||||
INBOX = "INBOX", // user decided to join this conversation after being invited...for now things just land in inbox anyway
|
||||
TUNED = "TUNED", // user upgraded priority of this and now is toggle tuned in live to convo
|
||||
}
|
||||
+4
-4
@@ -1,8 +1,8 @@
|
||||
import AudioClip from "./audioClip.model";
|
||||
import { ConversationMember } from "./conversation.model";
|
||||
import { LineMember } from "./line.model";
|
||||
import { ObjectId } from "mongodb";
|
||||
|
||||
export default class MasterConversation {
|
||||
export default class MasterLineData {
|
||||
constructor(
|
||||
// attributes of conversation
|
||||
public id: ObjectId, // id of the conversation
|
||||
@@ -11,9 +11,9 @@ export default class MasterConversation {
|
||||
public lastUpdatedDate: Date,
|
||||
|
||||
// compiled data for easy client read
|
||||
public currentUserMember?: ConversationMember,
|
||||
public currentUserMember?: LineMember,
|
||||
|
||||
public otherMembers?: ConversationMember[],
|
||||
public otherMembers?: LineMember[],
|
||||
|
||||
public audioClips: AudioClip[] = [],
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
"main": "index.js",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"mongodb": "^4.4.1"
|
||||
"mongodb": "^4.4.1",
|
||||
"@nirvana/core": "*"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Conversation } from "../models/conversation.model";
|
||||
import { Line } from "../models/line.model";
|
||||
|
||||
export default class GetDmConversationByOtherUserIdResponse {
|
||||
constructor(public conversation: Conversation) {}
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
import { Conversation } from "../models/conversation.model";
|
||||
|
||||
export default class GetUserConversationsResponse {
|
||||
constructor(public convos: Conversation[]) {}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
import { Line } from "../models/line.model";
|
||||
|
||||
export default class GetUserLinesResponse {
|
||||
constructor(public lines: Line[]) {}
|
||||
}
|
||||
Reference in New Issue
Block a user