forked from AlexBHdez/cofluencer-server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinfluencer.js
70 lines (67 loc) · 1.55 KB
/
influencer.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
const mongoose = require('mongoose');
/* eslint-disable */
const Schema = mongoose.Schema;
/* eslint-enable */
const IgMedia = require('./ig-media');
const Msg = require('./msg');
const influencerSchema = new Schema({
username: String,
role: { type: String, default: 'influencer' },
name: { type: String, default: 'New Cofluencer' },
lastname: String,
email: String,
facebookID: String,
password: String,
phone: Number,
address: {
street: String,
city: String,
state: String,
zip: Number,
},
bio: String,
influenceArea: String,
profileImage: String,
coverImage: String,
socialLinks: {
facebook: String,
instagram: String,
twitter: { type: String, default: null },
youtube: { type: String, default: null },
},
tags: [],
no_read: { type: Number, default: 0 },
messages: [Msg.schema],
send: [Msg.schema],
campaignsFavs: [Schema.Types.ObjectId],
companiesFavs: [Schema.Types.ObjectId],
followers: [Schema.Types.ObjectId],
instagram: {
username: String,
biography: String,
website: String,
followers_count: Number,
media_count: Number,
media: {
data: [IgMedia.schema],
paging: {
cursors: {
before: String,
after: String,
},
next: String,
},
},
id: String,
},
stats: {
instagram: {
avgLikePhoto: Number,
},
},
id: String,
}, {
timestamps: { createdAt: 'created_at', updatedAt: 'updated_at' },
});
const Influencer = mongoose.model('Influencer', influencerSchema);
module.exports = Influencer;