Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
26 additions
and
0 deletions.
There are no files selected for viewing
14 changes: 14 additions & 0 deletions
14
test/integration/fixture/set1/personDetail/viewBuilders/blockedEmail.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// if exports is an array, it will be the same like loading multiple files... | ||
module.exports = require('../../../../../../index').defineViewBuilder({ | ||
//module.exports = require('cqrs-eventdenormalizer').defineViewBuilder({ | ||
name: 'blockedEmail', // optional, default is file name without extension, if name is '' it will handle all events that matches | ||
aggregate: 'person', // optional | ||
context: 'hr', // optional | ||
version: 0, // optional, default is 0 | ||
payload: 'payload' // optional, if not defined it will pass the whole event... | ||
}, function (data, vm) { | ||
vm.set('blocked', true); | ||
}).useAsQuery(function (evt) { | ||
return { email: evt.payload.email }; | ||
}); | ||
|
12 changes: 12 additions & 0 deletions
12
test/integration/fixture/set1/personDetail/viewBuilders/exitedPerson.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// if exports is an array, it will be the same like loading multiple files... | ||
module.exports = require('../../../../../../index').defineViewBuilder({ | ||
//module.exports = require('cqrs-eventdenormalizer').defineViewBuilder({ | ||
name: 'exitedPerson', // optional, default is file name without extension, if name is '' it will handle all events that matches | ||
aggregate: 'person', // optional | ||
context: 'hr', // optional | ||
version: 0, // optional, default is 0 | ||
id: 'aggregate.id', // if not defined or not found it will generate a new viewmodel with new id | ||
payload: 'payload', // optional, if not defined it will pass the whole event... | ||
priority: 20 // optional, default Infinity | ||
}, 'delete'); | ||
|