set up orders model and relationships

This commit is contained in:
2017-01-26 17:50:56 -07:00
parent a41c7428b9
commit ea5de580a8
8 changed files with 116 additions and 4 deletions

38
common/models/order.json Normal file
View File

@@ -0,0 +1,38 @@
{
"name": "order",
"plural": "orders",
"base": "PersistedModel",
"idInjection": true,
"options": {
"validateUpsert": true
},
"properties": {
"id": {
"type": "string",
"required": true
},
"total": {
"type": "number",
"required": true
},
"datetime": {
"type": "date"
}
},
"validations": [],
"relations": {
"customer": {
"type": "belongsTo",
"model": "customer",
"foreignKey": ""
},
"products": {
"type": "hasMany",
"model": "product",
"foreignKey": "",
"through": "orderProducts"
}
},
"acls": [],
"methods": {}
}