57 lines
953 B
JSON
57 lines
953 B
JSON
{
|
|
"name": "Town",
|
|
"base": "VnModel",
|
|
"options": {
|
|
"mysql": {
|
|
"table": "town"
|
|
}
|
|
},
|
|
"properties": {
|
|
"id": {
|
|
"id": true,
|
|
"type": "number"
|
|
},
|
|
"name": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"relations": {
|
|
"province": {
|
|
"type": "belongsTo",
|
|
"model": "Province",
|
|
"foreignKey": "provinceFk"
|
|
},
|
|
"postcodes": {
|
|
"type": "hasMany",
|
|
"model": "Postcode",
|
|
"foreignKey": "townFk"
|
|
},
|
|
"geo": {
|
|
"type": "belongsTo",
|
|
"model": "ZoneGeo",
|
|
"foreignKey": "geoFk"
|
|
}
|
|
},
|
|
"acls": [{
|
|
"accessType": "READ",
|
|
"principalType": "ROLE",
|
|
"principalId": "$everyone",
|
|
"permission": "ALLOW"
|
|
}],
|
|
"scopes": {
|
|
"location": {
|
|
"include": [{
|
|
"relation": "postcodes"
|
|
},
|
|
{
|
|
"relation": "province",
|
|
"scope": {
|
|
"include": {
|
|
"relation": "country"
|
|
}
|
|
}
|
|
}],
|
|
"fields": ["id", "name", "provinceFk"]
|
|
}
|
|
}
|
|
} |