added aggregateid attribute

This commit is contained in:
Niclas Thobaben 2021-07-18 14:35:22 +02:00
parent 729602ee15
commit 3c77a0a06d

View file

@ -9,7 +9,7 @@ const templateModel = fs.readFileSync(path.resolve(path.join('templates', 'axon-
module.exports = (service) => {
let models = service.models.map(model => {
let aggregateAttribute = model.attributes.find(attr => attr.name === 'aggregateId') || {}
let aggregateAttribute = (model.attributes.find(attr => attr.name === 'aggregateId') || { value: {} }).value
let aggregateId = {}
aggregateId.name = aggregateAttribute.name || 'aggregateId'
aggregateId.type = aggregateAttribute.type ? javaType.mapJavaType(aggregateAttribute.type) : javaType.mapJavaType('string')