iqpass-label-composer-service v0.0.1
Label Composer Service
Description
This service manages the label compositions in a MySQL database with CRUD. The service can be used through a seneca communication.
http://37.97.191.51:10135/act
Config
The config.json file is located in the lib folder.
Use this file to configure all the credentials and database layout. Also set the seneca host and port the service should be run on.
Create a new composition
Pattern
role:labelComposer
action:createArguments
All of these arguments are required.
The combination must be unique in order for it to be inserted into the database.
composition: {
rubric: <number>
role: <number>
rubric: <number>
}Callback
Expected { success: true, result: { id:<number> } }
Failed: Database write failed { success: false, error:ACTION_FAILED' }
Failed: No rows affected { success: false, error:NO_DATA_WRITTEN' }
Get all compositions
Pattern
role:labelComposer
action:getAllArguments
None
Callback
Expected { success: true, result: <Array> }
result: [
{ rubric: <number>, role: <number>, worktype: <number> },
...
]Failed: Database read failed { success: false, error:ACTION_FAILED' }
Update
Pattern
role:labelComposer
action:updateArguments
All of these arguments are required.
composition Used as a indentifier.
newComposition The combination must be unique in order for it to be inserted into the database.
composition: {
rubric: <number>
role: <number>
worktype: <number>
},
newComposition: {
rubric: <number>
role: <number>
worktype: <number>
}Callback
Expected { success: true, result: { rubric:<number>, role:<number>, worktype:<number> } }
The result hold the composition that was used as a identifier
Failed: Database write failed { success: false, error:ACTION_FAILED' }
Failed: No rows affected { success: false, error:NO_DATA_WRITTEN' }
Delete
Pattern
role:labelComposer
action:deleteArguments
All of these arguments are required.
composition Used as a indentifier.
composition: {
rubric: <number>
role: <number>
worktype: <number>
}Callback
Expected { success: true, result: { rubric:<number>, role:<number>, worktype:<number> } }
The result hold the composition that was used as a identifier
Failed: Database write failed { success: false, error:ACTION_FAILED' }
Failed: No rows affected { success: false, error:NO_DATA_WRITTEN' }
9 years ago