Skip to content

Commit

Permalink
main bug
Browse files Browse the repository at this point in the history
  • Loading branch information
dlojudice-vortx committed Sep 9, 2019
1 parent bcbc5e8 commit 9a09a17
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 12 deletions.
12 changes: 12 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,18 @@
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Main.js Launch",
"program": "${workspaceFolder}/examples/todoapp/main.js",
"skipFiles": [
"${workspaceFolder}/node_modules/**/*.js",
"<node_internals>/**/*.js"
]
},


{
"type": "node",
"request": "launch",
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ References:
- [X] Steps - Enable multiple steps for a use case
- [X] Nested Steps - Enable multiple steps for a parent step
- [ ] Nested Steps - multiple files - Enable multiple steps in diferent files for a parent step
- [ ] Use usecase as a step
- [X] Doc Step - Get description and structure from use case and its steps
- [X] Request - Be able to describe and validate the use case request object
- [ ] Response - Be able to describe and validate the use case response object
Expand All @@ -207,7 +208,6 @@ References:
- [X] Use case examples
- [ ] Doc - Documentation and samples for each feature


### Contribute
Come with us to make an awesome *Grounds*.

Expand Down
23 changes: 12 additions & 11 deletions examples/todoapp/main.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
const { addOrUpdateItem } = require('./usecases/addOrUpdateItem')

function addOrUpdateItemUC() {
void async function main() {
const user = { user: "John", id: '923b8b9a', isAdmin: true }

const req = {
listId: 1,
item: { id: 10, name: "Do not forget this", position: 9 }
}

const uc = addOrUpdateItem()
console.log("------ doc: ------\n", uc.doc())

uc.authorize(user)
return uc
}
const req = {
listId: 1,
item: { id: 10, name: "Do not forget this", position: 9 }
}
const uc = addOrUpdateItemUC()
console.log(JSON.stringify(uc.doc()))
uc.run(req)
console.log(uc.auditTrail)
await uc.run(req)
console.log("------ audit: ------\n", uc.auditTrail)
}()

0 comments on commit 9a09a17

Please sign in to comment.