@@ -0,0 +1,52 @@ | |||||
{ | |||||
"routes": [ | |||||
{ | |||||
"method": "GET", | |||||
"path": "/couriers", | |||||
"handler": "courier.find", | |||||
"config": { | |||||
"policies": [] | |||||
} | |||||
}, | |||||
{ | |||||
"method": "GET", | |||||
"path": "/couriers/count", | |||||
"handler": "courier.count", | |||||
"config": { | |||||
"policies": [] | |||||
} | |||||
}, | |||||
{ | |||||
"method": "GET", | |||||
"path": "/couriers/:id", | |||||
"handler": "courier.findOne", | |||||
"config": { | |||||
"policies": [] | |||||
} | |||||
}, | |||||
{ | |||||
"method": "POST", | |||||
"path": "/couriers", | |||||
"handler": "courier.create", | |||||
"config": { | |||||
"policies": [] | |||||
} | |||||
}, | |||||
{ | |||||
"method": "PUT", | |||||
"path": "/couriers/:id", | |||||
"handler": "courier.update", | |||||
"config": { | |||||
"policies": [] | |||||
} | |||||
}, | |||||
{ | |||||
"method": "DELETE", | |||||
"path": "/couriers/:id", | |||||
"handler": "courier.delete", | |||||
"config": { | |||||
"policies": [] | |||||
} | |||||
} | |||||
] | |||||
} |
@@ -0,0 +1,8 @@ | |||||
'use strict'; | |||||
/** | |||||
* Read the documentation (https://strapi.io/documentation/developer-docs/latest/concepts/controllers.html#core-controllers) | |||||
* to customize this controller | |||||
*/ | |||||
module.exports = {}; |
@@ -0,0 +1,8 @@ | |||||
'use strict'; | |||||
/** | |||||
* Read the documentation (https://strapi.io/documentation/developer-docs/latest/concepts/models.html#lifecycle-hooks) | |||||
* to customize this model | |||||
*/ | |||||
module.exports = {}; |
@@ -0,0 +1,30 @@ | |||||
{ | |||||
"kind": "collectionType", | |||||
"collectionName": "couriers", | |||||
"info": { | |||||
"name": "Courier" | |||||
}, | |||||
"options": { | |||||
"increments": true, | |||||
"timestamps": true, | |||||
"draftAndPublish": true | |||||
}, | |||||
"attributes": { | |||||
"name": { | |||||
"type": "string" | |||||
}, | |||||
"duration": { | |||||
"type": "string" | |||||
}, | |||||
"price": { | |||||
"type": "biginteger" | |||||
}, | |||||
"description": { | |||||
"type": "richtext" | |||||
}, | |||||
"products": { | |||||
"via": "couriers", | |||||
"collection": "product" | |||||
} | |||||
} | |||||
} |
@@ -0,0 +1,8 @@ | |||||
'use strict'; | |||||
/** | |||||
* Read the documentation (https://strapi.io/documentation/developer-docs/latest/concepts/services.html#core-services) | |||||
* to customize this service | |||||
*/ | |||||
module.exports = {}; |
@@ -11,9 +11,9 @@ | |||||
}, | }, | ||||
"attributes": { | "attributes": { | ||||
"user": { | "user": { | ||||
"via": "partners_login_states", | |||||
"plugin": "users-permissions", | "plugin": "users-permissions", | ||||
"model": "user", | |||||
"via": "partners_login_states" | |||||
"model": "user" | |||||
}, | }, | ||||
"business_partner": { | "business_partner": { | ||||
"model": "business-partner" | "model": "business-partner" | ||||
@@ -66,6 +66,11 @@ | |||||
"business_partner": { | "business_partner": { | ||||
"model": "business-partner", | "model": "business-partner", | ||||
"via": "products" | "via": "products" | ||||
}, | |||||
"couriers": { | |||||
"collection": "courier", | |||||
"via": "products", | |||||
"dominant": true | |||||
} | } | ||||
} | } | ||||
} | } |
@@ -60,8 +60,20 @@ | |||||
"configurable": false | "configurable": false | ||||
}, | }, | ||||
"partners_login_states": { | "partners_login_states": { | ||||
"via": "user", | |||||
"collection": "partners-login-state" | |||||
"collection": "partners-login-state", | |||||
"via": "user" | |||||
}, | |||||
"first_name": { | |||||
"type": "string" | |||||
}, | |||||
"last_name": { | |||||
"type": "string" | |||||
}, | |||||
"nohp": { | |||||
"type": "biginteger" | |||||
}, | |||||
"address": { | |||||
"type": "text" | |||||
} | } | ||||
} | } | ||||
} | } |