2019-06-13 11:08:11 +00:00
|
|
|
{
|
|
|
|
"name": "Town",
|
|
|
|
"base": "VnModel",
|
|
|
|
"options": {
|
|
|
|
"mysql": {
|
|
|
|
"table": "town"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"properties": {
|
|
|
|
"id": {
|
|
|
|
"id": true,
|
2022-05-12 07:47:47 +00:00
|
|
|
"type": "number"
|
2019-06-13 11:08:11 +00:00
|
|
|
},
|
|
|
|
"name": {
|
2024-07-29 08:35:01 +00:00
|
|
|
"type": "string",
|
|
|
|
"required": true
|
2019-06-13 11:08:11 +00:00
|
|
|
}
|
|
|
|
},
|
|
|
|
"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"
|
|
|
|
},
|
|
|
|
{
|
2019-06-13 11:08:11 +00:00
|
|
|
"relation": "province",
|
|
|
|
"scope": {
|
|
|
|
"include": {
|
|
|
|
"relation": "country"
|
|
|
|
}
|
|
|
|
}
|
2019-07-08 12:07:09 +00:00
|
|
|
}],
|
|
|
|
"fields": ["id", "name", "provinceFk"]
|
2019-06-13 11:08:11 +00:00
|
|
|
}
|
|
|
|
}
|
2024-07-29 08:35:01 +00:00
|
|
|
}
|