set up orders model and relationships
This commit is contained in:
41
common/models/order-products.json
Normal file
41
common/models/order-products.json
Normal file
@@ -0,0 +1,41 @@
|
||||
{
|
||||
"name": "orderProducts",
|
||||
"base": "PersistedModel",
|
||||
"idInjection": true,
|
||||
"options": {
|
||||
"validateUpsert": true
|
||||
},
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string",
|
||||
"required": true
|
||||
},
|
||||
"quantity": {
|
||||
"type": "number",
|
||||
"required": true
|
||||
},
|
||||
"price": {
|
||||
"type": "number",
|
||||
"required": true
|
||||
},
|
||||
"totalPrice": {
|
||||
"type": "number",
|
||||
"required": true
|
||||
}
|
||||
},
|
||||
"validations": [],
|
||||
"relations": {
|
||||
"order": {
|
||||
"type": "belongsTo",
|
||||
"model": "order",
|
||||
"foreignKey": ""
|
||||
},
|
||||
"product": {
|
||||
"type": "belongsTo",
|
||||
"model": "product",
|
||||
"foreignKey": ""
|
||||
}
|
||||
},
|
||||
"acls": [],
|
||||
"methods": {}
|
||||
}
|
||||
Reference in New Issue
Block a user