it's just a mess

This commit is contained in:
talksik
2022-05-29 07:54:08 -05:00
parent f704676f62
commit 8391c94976
3 changed files with 159 additions and 41 deletions
+25 -12
View File
@@ -5,23 +5,36 @@ export default class Conversation {
constructor(
public createdByUserId: string,
public membersList: string[],
public name: string | null = null,
public lastUpdatedDate = Timestamp.now(),
public createdDate = Timestamp.now(),
public membersInRoom: string[] = [],
public lastActivityDate: Timestamp = Timestamp.now(),
) {}
}
// export class Member {
// constructor(
// public id: string,
// public userId: string,
// public role: 'admin' | 'regular',
// public joinedDate = Timestamp.now(),
// ) {}
// }
export class ConversationMember {
constructor(
public id: string, // NOTE: serves as the user ID
public conversationId: string,
public role: MemberRole,
public memberState: MemberState,
public lastActiveDate: Timestamp | null = null,
public joinedDate = Timestamp.now(),
) {}
}
export enum MemberRole {
admin = 'admin',
regular = 'regular',
}
export enum MemberState {
priority = 'priority',
inbox = 'inbox',
// deleted = "deleted"
}