agencies
This commit is contained in:
parent
df320908ae
commit
a4d9c3008a
|
@ -0,0 +1,7 @@
|
|||
module.exports = function(Agency) {
|
||||
|
||||
var serverFilter = {"where": {"tpv": {"neq": 0}}};
|
||||
|
||||
Agency.defineScope(serverFilter);
|
||||
|
||||
}
|
|
@ -1,22 +0,0 @@
|
|||
module.exports = function(State) {
|
||||
State.list = function(filter, cb) {
|
||||
|
||||
};
|
||||
|
||||
function where(filter) {
|
||||
|
||||
if(!filter)
|
||||
return {
|
||||
where: {
|
||||
"order": {gt: 0 }
|
||||
},
|
||||
order: "order, name"
|
||||
}
|
||||
else{
|
||||
filter.where.order = {gt: 0 };
|
||||
filter.order = "order, name";
|
||||
return filter;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
module.exports = function(State) {
|
||||
|
||||
var serverFilter = {where: { "order": {gt: 0 }}, order: "order, name"};
|
||||
|
||||
State.defineScope(serverFilter);
|
||||
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
var app = require('../../server/server');
|
||||
|
||||
module.exports = function(Agency) {
|
||||
var models = app.models;
|
||||
|
||||
// Methods
|
||||
|
||||
require('../methods/agency/list.js')(Agency);
|
||||
};
|
|
@ -0,0 +1,34 @@
|
|||
{
|
||||
"name": "Agency",
|
||||
"base": "MyModel",
|
||||
"validateUpsert": true,
|
||||
"properties": {
|
||||
"id": {
|
||||
"id": true,
|
||||
"type": "Number",
|
||||
"forceId": false
|
||||
},
|
||||
"name": {
|
||||
"type": "String",
|
||||
"required": false
|
||||
},
|
||||
"tpv":{
|
||||
"type": "Number",
|
||||
"required": false
|
||||
}
|
||||
},
|
||||
"acls": [
|
||||
{
|
||||
"accessType": "*",
|
||||
"principalType": "ROLE",
|
||||
"principalId": "$everyone",
|
||||
"permission": "DENY"
|
||||
},
|
||||
{
|
||||
"accessType": "*",
|
||||
"principalType": "ROLE",
|
||||
"principalId": "root",
|
||||
"permission": "ALLOW"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -5,5 +5,5 @@ module.exports = function(State) {
|
|||
|
||||
// Methods
|
||||
|
||||
require('../methods/state/find.js')(State);
|
||||
require('../methods/state/list.js')(State);
|
||||
};
|
|
@ -5,5 +5,5 @@ module.exports = function(Warehouse) {
|
|||
|
||||
// Methods
|
||||
|
||||
require('../methods/warehouse/list-warehouses.js')(Warehouse);
|
||||
require('../methods/warehouse/list.js')(Warehouse);
|
||||
};
|
|
@ -60,5 +60,9 @@
|
|||
"Employee":{
|
||||
"dataSource": "client",
|
||||
"public": true
|
||||
},
|
||||
"Agency": {
|
||||
"dataSource": "vn",
|
||||
"public": true
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue