Relaciones arregladas

This commit is contained in:
Juan Ferrer Toribio 2017-05-12 11:14:55 +02:00
parent 8ce3325f06
commit b7fb0bca98
8 changed files with 88 additions and 86 deletions

View File

@ -8,9 +8,6 @@
"id": true, "id": true,
"description": "Identifier" "description": "Identifier"
}, },
"clientFk": {
"type": "Number"
},
"consignee": { "consignee": {
"type": "string", "type": "string",
"required": true "required": true
@ -26,9 +23,6 @@
"postcode": { "postcode": {
"type": "string" "type": "string"
}, },
"provinceFk": {
"type": "Number"
},
"phone": { "phone": {
"type": "string" "type": "string"
}, },
@ -41,9 +35,6 @@
"default": { "default": {
"type": "boolean" "type": "boolean"
}, },
"defaultAgencyFk": {
"type": "Number"
},
"longitude": { "longitude": {
"type": "Number" "type": "Number"
}, },
@ -53,20 +44,20 @@
}, },
"validations": [], "validations": [],
"relations": { "relations": {
"countryFk": { "provinceFk": {
"type": "hasOne", "type": "belongsTo",
"model": "Country", "model": "Province",
"foreignKey": "id" "foreignKey": "provinceFk"
}, },
"clientFk": { "clientFk": {
"type": "hasOne", "type": "belongsTo",
"model": "Client", "model": "Client",
"foreignKey": "id" "foreignKey": "clientFk"
}, },
"defaultAgencyFk": { "defaultAgencyFk": {
"type": "hasOne", "type": "belongsTo",
"model": "Agency", "model": "Agency",
"foreignKey": "id" "foreignKey": "defaultAgencyFk"
} }
}, },
"acls": [ "acls": [

View File

@ -15,15 +15,9 @@
"description": { "description": {
"type": "string" "type": "string"
}, },
"agencyTypeFk": {
"type": "Number"
},
"m3": { "m3": {
"type": "Number" "type": "Number"
}, },
"agencyFk": {
"type": "Number"
},
"inflation": { "inflation": {
"type": "Number" "type": "Number"
}, },
@ -31,6 +25,18 @@
"type": "string" "type": "string"
} }
}, },
"relations": {
"agencyFk": {
"type": "belongsTo",
"model": "Agency",
"foreignKey": "agencyFk"
},
"agencyTypeFk": {
"type": "belongsTo",
"model": "AgencyType",
"foreignKey": "agencyTypeFk"
}
},
"acls": [ "acls": [
{ {
"accessType": "*", "accessType": "*",

View File

@ -1,13 +1,6 @@
{ {
"name": "Client", "name": "Client",
"base": "MyModel", "base": "MyModel",
"scopes": {
"test": {
"where": {
"name": "Verdnatura"
}
}
},
"validateUpsert": true, "validateUpsert": true,
"properties": { "properties": {
"id": { "id": {
@ -41,12 +34,6 @@
"postcode": { "postcode": {
"type": "string" "type": "string"
}, },
"provinceFk": {
"type": "Number"
},
"countryFk": {
"type": "Number"
},
"email": { "email": {
"type": "string" "type": "string"
}, },
@ -86,15 +73,6 @@
"type": "boolean", "type": "boolean",
"description": "Send invoices by email" "description": "Send invoices by email"
}, },
"payMethodFk": {
"type": "Number"
},
"salesPersonFk": {
"type": "Number"
},
"contactChannelFk": {
"type": "Number"
},
"sepaVnl": { "sepaVnl": {
"type": "boolean" "type": "boolean"
}, },
@ -126,29 +104,39 @@
"validations": [], "validations": [],
"relations": { "relations": {
"accountFk": { "accountFk": {
"type": "hasOne", "type": "belongsTo",
"model": "Account", "model": "Account",
"foreignKey": "id" "foreignKey": "id"
}, },
"payMethodFk": { "payMethodFk": {
"type": "hasOne", "type": "belongsTo",
"model": "PayMethod", "model": "PayMethod",
"foreignKey": "id" "foreignKey": "payMethodFk"
}, },
"salesPersonFk": { "salesPersonFk": {
"type": "hasOne", "type": "belongsTo",
"model": "Employee", "model": "Employee",
"foreignKey": "id" "foreignKey": "salesPersonFk"
},
"provinceFk":{
"type": "belongsTo",
"model": "Province",
"foreignKey": "provinceFk"
},
"countryFk":{
"type": "belongsTo",
"model": "Country",
"foreignKey": "countryFk"
},
"contactChannelFk":{
"type": "belongsTo",
"model": "ContactChannel",
"foreignKey": "contactChannelFk"
}, },
"addressesFk": { "addressesFk": {
"type": "hasMany", "type": "hasMany",
"model": "Address", "model": "Address",
"foreignKey": "clientFk" "foreignKey": "clientFk"
},
"chanelFK":{
"type": "hasOne",
"model": "ContactChannel",
"foreignKey": "contactChannelFk"
} }
}, },
"acls": [ "acls": [
@ -159,5 +147,12 @@
"permission": "ALLOW" "permission": "ALLOW"
} }
], ],
"methods": {} "methods": {},
"scopes": {
"test": {
"where": {
"name": "Verdnatura"
}
}
}
} }

View File

@ -12,28 +12,28 @@
"clientFk": { "clientFk": {
"type": "Number" "type": "Number"
}, },
"employeeFk": {
"type": "Number"
},
"text": { "text": {
"type": "string", "type": "string",
"description": "Text" "description": "Text"
}, },
"employeeFk": {
"type": "Number"
},
"creationTime": { "creationTime": {
"type": "date", "type": "date",
"description": "Creation date and time" "description": "Creation date and time"
} }
}, },
"relations": { "relations": {
"employeeFk": {
"type": "hasOne",
"model": "Employee",
"foreignKey": "id"
},
"clientFk": { "clientFk": {
"type": "hasOne", "type": "hasOne",
"model": "Client", "model": "Client",
"foreignKey": "id" "foreignKey": "id"
},
"employeeFk": {
"type": "hasOne",
"model": "Employee",
"foreignKey": "id"
} }
}, },
"acls": [ "acls": [

View File

@ -17,12 +17,18 @@
}, },
"code": { "code": {
"type": "string" "type": "string"
}, }
},
"relations": {
"currencyFk": { "currencyFk": {
"type": "Number" "type": "belongsTo",
"model": "Currency",
"foreignKey": "currencyFk"
}, },
"realCountryFk": { "realCountryFk": {
"type": "Number" "type": "belongsTo",
"model": "Country",
"foreignKey": "realCountryFk"
} }
}, },
"acls": [ "acls": [

View File

@ -11,10 +11,13 @@
"name": { "name": {
"type": "string", "type": "string",
"required": true "required": true
}, }
},
"relations": {
"userFk": { "userFk": {
"type": "Number", "type": "belongsTo",
"required": true "model": "Account",
"foreignKey": "userFk"
} }
}, },
"acls": [ "acls": [

View File

@ -11,22 +11,23 @@
"name": { "name": {
"type": "string", "type": "string",
"required": true "required": true
},
"countryFk": {
"type": "Number"
},
"warehouseFk": {
"type": "Number"
},
"zoneFk": {
"type": "Number"
} }
}, },
"relations": { "relations": {
"countryFk": { "countryFk": {
"type": "hasOne", "type": "belongsTo",
"model": "Country", "model": "Country",
"foreignKey": "id" "foreignKey": "countryFk"
},
"warehouseFk": {
"type": "belongsTo",
"model": "Warehouse",
"foreignKey": "warehouseFk"
},
"zoneFk": {
"type": "belongsTo",
"model": "Zone",
"foreignKey": "zoneFk"
} }
}, },
"acls": [ "acls": [

View File

@ -42,7 +42,7 @@
"dataSource": "vn", "dataSource": "vn",
"public": true "public": true
}, },
"Employee": { "ClientObservation": {
"dataSource": "vn", "dataSource": "vn",
"public": true "public": true
}, },
@ -62,10 +62,6 @@
"dataSource": "vn", "dataSource": "vn",
"public": true "public": true
}, },
"ClientObservation": {
"dataSource": "vn",
"public": true
},
"Account": { "Account": {
"dataSource": "vn", "dataSource": "vn",
"public": true "public": true
@ -73,5 +69,9 @@
"ContactChannel": { "ContactChannel": {
"dataSource": "vn", "dataSource": "vn",
"public": true "public": true
},
"Employee": {
"dataSource": "vn",
"public": true
} }
} }