itemLog for item history refactor

This commit is contained in:
Carlos Jimenez 2018-02-08 11:40:06 +01:00
parent 378c04b123
commit 76f808e7f6
2 changed files with 32 additions and 32 deletions

View File

@ -4,12 +4,12 @@ module.exports = Self => {
function filterParams(params) {
return {
where: {
itemFk: params.itemFk
originFk: params.itemFk
},
skip: (params.page - 1) * params.size,
limit: params.size,
include: [{
relation: "origin"
relation: "item"
},
{
relation: "user"

View File

@ -1,35 +1,35 @@
{
"name": "ItemLog",
"base": "VnModel",
"options": {
"mysql": {
"table": "itemLog",
"database": "vn"
}
},
"properties": {
"id": {
"type": "Number",
"id": true,
"description": "Identifier"
},
"creationDate": {
"type": "Date"
},
"description": {
"type": "String"
"name": "ItemLog",
"base": "VnModel",
"options": {
"mysql": {
"table": "itemLog",
"database": "vn"
}
},
"properties": {
"id": {
"type": "Number",
"id": true,
"description": "Identifier"
},
"relations": {
"origin": {
"type": "belongsTo",
"model": "Origin",
"foreignKey": "originFk"
},
"user": {
"type": "belongsTo",
"model": "User",
"foreignKey": "userFk"
}
"creationDate": {
"type": "Date"
},
"description": {
"type": "String"
}
},
"relations": {
"item": {
"type": "belongsTo",
"model": "Item",
"foreignKey": "originFk"
},
"user": {
"type": "belongsTo",
"model": "User",
"foreignKey": "userFk"
}
}
}