base-domain
Version:
simple module to help build Domain-Driven Design
90 lines (67 loc) • 1.81 kB
text/coffeescript
'use strict'
###*
interface of client accessing to resource.
Used in BaseRepository
LoopBackClient in loopback-promised package implements this interface.
see https://github.com/CureApp/loopback-promised
###
class ResourceClientInterface
# this file is just a concept and no implementation here.
###*
Create new instance of Model class, saved in database
###
###*
Update or insert a model instance
The update will override any specified attributes in the request data object. It won’t remove existing ones unless the value is set to null.
###
###*
Find object by ID.
###
###*
Find all model instances that match filter specification.
###
###*
Find one model instance that matches filter specification. Same as find, but limited to one result
###
###*
Destroy model instance
###
###*
Destroy model instance with the specified ID.
###
###*
Update set of attributes.
###
module.exports = ResourceClientInterface