salix/back/models/town.json

57 lines
953 B
JSON
Raw Normal View History

{
"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": [{
2019-07-08 12:07:09 +00:00
"relation": "postcodes"
},
{
"relation": "province",
"scope": {
"include": {
"relation": "country"
}
}
2019-07-08 12:07:09 +00:00
}],
"fields": ["id", "name", "provinceFk"]
}
}
}