Skip to content
nattapon.r edited this page May 16, 2017 · 18 revisions

v1

/**
 * Copyright 2016-2017 Ahoo Studio.co.th.
 *
 * Author @ nattapon.r@live.com
 */
export default class UserModel {
    _id: string;
    email: string;
    password: string;
    gender: string;
    first_name: string;
    last_name: string;
    mobile: string;
    country_code: string;
    avatar: string;
    birthday: Date;
    highest_education: string;
    institute: string;
    major: string;
    occupation: string;
    facebookId: string;
    deviceTokens: string[];
    follower: string[];
    sharedBy: string[];
    defaultCardId: string;
    linkeds: string[];
    link_requests: string[];
    trash_link_requests: string[];
    waiting_requests: string[];
    status: UserStatus;    // [activated, pending, deactivate]
    online_status: boolean;
    lastModified: Date;
    lastLogedin: Date;
    registerDate: Date;
    activatedDate: Date;
    location: NearByCard;
    source: string;
};

/**
 * UserStatus
 */
export enum UserStatus {
    deactivate = 0, activated = 1, pending = 2,
}

v1.2

export default class UserModel {
    _id: string;
    email: string;
    password: string;
    gender: string;
    first_name: string;
    last_name: string;
    mobile: string;
    country_code: string;
    avatar: string;
    birthday: Date;
    highest_education: string;
    institute: string;
    major: string;
    occupation: string;
    facebookId: string;
    deviceTokens: string[];
    follower: string[];
    sharedBy: string[];
    defaultCardId: string;
    linkeds: string[];
    link_requests: string[];
    trash_link_requests: string[];
    waiting_requests: string[];
    status: UserStatus;    // [activated, pending, deactivate]
    online_status: boolean;
    lastModified: Date;
    lastLogedin: Date;
    registerDate: Date;
    activatedDate: Date;
    location: NearByCard;
    source: string;
    /** v2 user model. */
    username: string;
    data_asof: Date;
    user_type: string;
    migrated_date: Date;
};

###Sample

{
    "_id" : ObjectId("585bd0f47f438233120bcda6"),
    "email" : "rattajak.n@gmail.com",
    "password" : "xxx",
    "status" : 1,
    "lastModified" : ISODate("2017-01-20T06:30:17.905Z"),
    "first_name" : "Nattapon",
    "last_name" : "Rattajak",
    "facebookId" : "",
    "avatar" : "http://203.148.250.152:3002/uploads/images/25a470e0-cccb-11e6-b8bc-27ae7896183a.jpg",
    "mobile" : "xxx",
    "country_code" : "66",
    "birthday" : "22/12/2532",
    "occupation" : "Employee",
    "gender" : "Male",
    "highest_education" : "Bachelor Degree",
    "institute" : null,
    "major" : null,
    "defaultCardId" : ObjectId("585bd1027f438233120bcda8"),
    "online_status" : true,
    "deviceTokens" : [ 
        "af88c3104376f581f75592956b79da360debd7a64699b3c2066d9c75aec09e74"
    ],
    "link_requests" : [],
    "linkeds" : [ 
        "585bd15a7f438233120bcdac", 
        "585bd15a7f438233120bcdab"
    ],
    "location" : {}
}
Clone this wiki locally