Add test data directory, with generate.js data file and users.txt which has some users + id cards in (testing purposes).

This commit is contained in:
Chris.Watts90@outlook.com 2017-01-26 16:53:31 +00:00
parent e5ce621827
commit f625396537
2 changed files with 50 additions and 0 deletions

42
TestData/generate.js Normal file
View File

@ -0,0 +1,42 @@
module.exports = function(){
var fakeTimeDataCount = 4000, maxUserCount = 120;
var faker = require("faker");
var _ = require("lodash");
var directions = ["in", "out"];
var users = _.times(maxUserCount, function (n)
{
return {
id: n,
//timestamp: faker.date.past(),
userId: n,
firstName: faker.name.firstName(),
lastName: faker.name.lastName()
}
}
);
var userSwipeDataPoints = _.times (fakeTimeDataCount, function(n)
{
return {
id: n,
userId: faker.random.number(maxUserCount),
timestamp: faker.date.past(),
direction: directions[faker.random.number(1)]
}
}
);
return {
userSwipeData: _.orderBy(userSwipeDataPoints, ["id"], ["asc"]),
//users: _.orderBy(data, ["userId", "asc"]),
users: _.orderBy(users, ["lastName", "firstName"],["asc", "asc"]),
//weather: _.orderBy(data, ["timestamp"],["asc"]),
stats: _.countBy(userSwipeDataPoints, "userId")
}
}
/*
so to get a list of the available users, call /users
to get specific user info, call /userSwipeData/<userId>
*/

8
TestData/users.txt Normal file
View File

@ -0,0 +1,8 @@
CWATTS - 5B867F01F8FF12E09000
SBANKS - 49808201F8FF12E09000
GNEWTON - E5DADC01F9FF12E09000
SFEKADU - CA837E01F8FF12E09000
RBOWMAN - F2078001F8FF12E09000
AWICKENS - 8C837F01F8FF12E09000
BLawrence - E60C8501F8FF12E09000
Eugene - 5A8C8201F8FF12E09000