Comparing version
module.exports = require('./lib'); |
@@ -0,1 +1,3 @@ | ||
var uuid = require('node-uuid').v4; | ||
var DefaultEventHandler = require('./default_event_handler'); | ||
@@ -22,2 +24,5 @@ var DefaultCommandHandler = require('./default_command_handler'); | ||
Aggregate.prototype._apply = function(event, isNew) { | ||
if(!event.id) { | ||
event.id = uuid(); | ||
} | ||
if(!event.type || !event.aggregateId || event.aggregateId != this.id) { | ||
@@ -49,2 +54,5 @@ console.log(this); | ||
Aggregate.prototype._sink = function(command) { | ||
if(!command.id) { | ||
command.id = uuid(); | ||
} | ||
//console.log(command.aggregateId + " || " + this.id + " || " + this._state.id); | ||
@@ -51,0 +59,0 @@ if(!command.type || !command.aggregateId || command.aggregateId != this.id) { |
@@ -0,0 +0,0 @@ var _ = require('lodash'); |
@@ -0,0 +0,0 @@ var _ = require('lodash'); |
@@ -0,0 +0,0 @@ var Aggregate = require('./aggregate'); |
module.exports.Repository = require('./repository'); | ||
module.exports.Aggregate = require('./aggregate'); |
@@ -0,0 +0,0 @@ var uuid = require('node-uuid').v4; |
{ | ||
"name": "demeine", | ||
"version": "0.0.2", | ||
"version": "0.1.0", | ||
"description": "DDDD - Distributed Domain Driven Design", | ||
@@ -36,6 +36,4 @@ "main": "index.js", | ||
"dependencies": { | ||
"bluebird": "^2.9.12", | ||
"lodash": "^3.9.3", | ||
"node-uuid": "^1.4.3" | ||
"bluebird": "^2.9.12" | ||
} | ||
} |
# demeine | ||
DDDD - Distributed Domain Drive Design |
@@ -0,0 +0,0 @@ var Location = require('./aggregates/location'); |
@@ -0,0 +0,0 @@ var util=require('util'); |
@@ -0,0 +0,0 @@ var should = require('should'); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
1
-66.67%234
3.08%10597
-1.6%- Removed
- Removed
- Removed
- Removed