-
Notifications
You must be signed in to change notification settings - Fork 4
/
mockData.js
135 lines (128 loc) · 2.38 KB
/
mockData.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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
var USER = require('./utils/db.js').User;
var PAKT = require('./utils/db.js').Pakt;
var PICTURE = require('./utils/db.js').Picture;
var PAKT_USER = require('./utils/db.js').Pakt_User;
var USER_USER = require('./utils/db.js').User_User;
var user = [
{ id: 1, // automatically created by sequelize;
fbId: 10,
name: 'Diamond',
email: 'DW@DW.com',
picture: '/fb/samplePath1/' },
{ id: 2,
fbId: 5,
name: 'Alex',
email: 'AS@AS.com',
picture: '/fb/samplePath2/' },
{ id: 3,
fbId: 11,
name: 'Deniz',
email: 'deniz@AS.com',
picture: '/fb/samplePath3/' }
];
var pakt = [
{
name: 'first pakt',
description: 'gym 3 times a week',
isMonetary: false,
consequenceText: 'buy me lunch',
consequenceValue: null,
repeating: true,
frequency: 3,
timeFrame: 8,
startDate: '2016-03-14 14:00:00',
endDate: '2016-05-14 14:00:00',
settled: false,
open: true
},
{
name: 'second pakt',
description: '4 times a week',
isMonetary: true,
consequenceText: null,
consequenceValue: 10,
repeating: true,
frequency: 4,
timeFrame: 8,
startDate: '2016-03-18 14:00:00',
endDate: '2016-05-18 14:00:00',
settled: false,
open: true
},
{
name: 'third pakt',
description: 'wed game',
isMonetary: false,
consequenceText: 'buy me dinner',
consequenceValue: null,
repeating: false,
frequency: null,
timeFrame: null,
startDate: null,
endDate: '2016-05-14 14:00:00',
settled: false,
open: true
}
];
var picture = [
{
path: '/samplePath90/',
PaktId: 2,
UserId: 1
},
{
path: '/samplePath6/',
PaktId: 2,
UserId: 2
},
{
path: '/samplePath5/',
PaktId: 3,
UserId: 3
},
{
path: '/samplePath3/',
PaktId: 3,
UserId: 1
}
];
var userPakt = [
{
PaktId: 1,
UserId: 1
},
{
PaktId: 1,
UserId: 2
},
{
PaktId: 2,
UserId: 1
}
];
var userUser = [
{
UserId: 1,
friendId: 2
},
{
UserId: 1,
friendId: 3
}
];
// for loading mock data from spec/test
module.exports.insertTestData = function () {
USER.bulkCreate(user)
.then(function () {
PAKT.bulkCreate(pakt);
})
.then(function () {
PICTURE.bulkCreate(picture);
})
.then(function () {
PAKT_USER.bulkCreate(userPakt);
})
.then(function () {
USER_USER.bulkCreate(userUser);
});
};