set up orders model and relationships
This commit is contained in:
38
common/models/order.json
Normal file
38
common/models/order.json
Normal 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": {}
|
||||
}
|
||||
Reference in New Issue
Block a user