updated file to generate testcard data.
updated userstest endpoint to return the usercount parameter.
This commit is contained in:
parent
430f91ce18
commit
b7492479c9
@ -1,16 +1,17 @@
|
|||||||
module.exports = function(){
|
module.exports = function(){
|
||||||
var fakeTimeDataCount = 4000, maxUserCount = 120;
|
var fakeTimeDataCount = 4000, maxUserCount = 120, unassignedCardCount = 4;
|
||||||
var faker = require("faker");
|
var faker = require("faker");
|
||||||
var _ = require("lodash");
|
var _ = require("lodash");
|
||||||
var directions = ["in", "out"];
|
var directions = ["in", "out"];
|
||||||
var usersData = _.times(maxUserCount, function (n)
|
var usersData = _.times(maxUserCount, function (n)
|
||||||
{
|
{
|
||||||
return {
|
return {
|
||||||
id: n,
|
id: n, //needed for the /users/id endpoint
|
||||||
//timestamp: faker.date.past(),
|
Id: n,
|
||||||
userId: n,
|
UserId: n,
|
||||||
firstName: faker.name.firstName(),
|
FirstName: faker.name.firstName(),
|
||||||
lastName: faker.name.lastName()
|
LastName: faker.name.lastName(),
|
||||||
|
HoursPerWeek: 37.0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
@ -18,22 +19,38 @@ module.exports = function(){
|
|||||||
{
|
{
|
||||||
return {
|
return {
|
||||||
id: n,
|
id: n,
|
||||||
userId: faker.random.number(maxUserCount),
|
Id: n,
|
||||||
timestamp: faker.date.past(),
|
UserId: faker.random.number(maxUserCount),
|
||||||
direction: directions[faker.random.number(1)]
|
Timestamp: faker.date.past(),
|
||||||
|
Direction: directions[faker.random.number(1)]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
var userDataObject = {users: _.orderBy(usersData, ["lastName", "firstName"],["asc", "asc"])};
|
//var userDataObject = {users: _.orderBy(usersData, ["lastName", "firstName"],["asc", "asc"])};
|
||||||
|
var unassignedTestCards = _.times(unassignedCardCount, function(n)
|
||||||
|
{
|
||||||
return {
|
return {
|
||||||
userSwipeData: _.orderBy(userSwipeDataPoints, ["id"], ["asc"]),
|
id: n,
|
||||||
|
Id: n,
|
||||||
|
UserId: -1,
|
||||||
|
IsSelected: false, //needed for knockout checked binding.
|
||||||
|
CardUId: faker.random.uuid()
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return {
|
||||||
|
timelogs: _.orderBy(userSwipeDataPoints, ["id"], ["asc"]),
|
||||||
//users: _.orderBy(data, ["userId", "asc"]),
|
//users: _.orderBy(data, ["userId", "asc"]),
|
||||||
users: _.orderBy(usersData, ["lastName", "firstName"],["asc", "asc"]),
|
users: _.orderBy(usersData, ["lastName", "firstName"],["asc", "asc"]),
|
||||||
//weather: _.orderBy(data, ["timestamp"],["asc"]),
|
//weather: _.orderBy(data, ["timestamp"],["asc"]),
|
||||||
stats: _.countBy(userSwipeDataPoints, "userId"),
|
stats: _.countBy(userSwipeDataPoints, "userId"),
|
||||||
|
timelogtest: {
|
||||||
|
Logs: _.orderBy(userSwipeDataPoints, "Timestamp", "asc")
|
||||||
|
},
|
||||||
userstest: {
|
userstest: {
|
||||||
users: _.orderBy(usersData, ["lastName", "firstName"],["asc", "asc"])
|
UserCount: maxUserCount,
|
||||||
}
|
Users: _.orderBy(usersData, ["lastName", "firstName"],["asc", "asc"])
|
||||||
|
},
|
||||||
|
unassignedCards: { data: unassignedTestCards}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user