adding in proper creation of user

This commit is contained in:
talksik
2022-03-18 17:34:51 -04:00
parent 0a126900b9
commit b9d38a6484
9 changed files with 113 additions and 52 deletions
@@ -0,0 +1,21 @@
import { ObjectId } from "mongodb";
// some sort of contact or friend model
export default class Relationship {
constructor(
public senderUserId: string,
public receiverUserId: string,
public state: RelationshipState,
public createdDate: Date = new Date(),
public lastUpdatedDate: Date = new Date(),
public _id: ObjectId = new ObjectId()
) {}
}
export enum RelationshipState {
PENDING = "PENDING",
ACTIVE = "ACTIVE",
BLOCKED = "BLOCKED",
}
+14 -1
View File
@@ -2,6 +2,7 @@ import { ObjectId } from "mongodb";
export class User {
constructor(
public googleId: string, // our Google id that every google user has unique that we are going to use for now
public email: string,
public verifiedEmail: boolean,
public name: string,
@@ -9,6 +10,18 @@ export class User {
public family_name: string,
public picture: string,
public locale: string,
public _id?: ObjectId // additional properties specific to our users collection
// additional properties specific to our users collection
public createdDate: Date,
public status: UserStatus,
public lastUpdatedDate?: Date,
public _id?: ObjectId
) {}
}
export enum UserStatus {
ONLINE = "ONLINE",
OFFLINE = "OFFLINE",
FLOW_STATE = "FLOW_STATE",
}