context-mapper-mcp 1.0.0 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/README.md +13 -14
  2. package/dist/generators/builtin/plantuml-adapter.d.ts +60 -0
  3. package/dist/generators/builtin/plantuml-adapter.d.ts.map +1 -0
  4. package/dist/generators/builtin/plantuml-adapter.js +119 -0
  5. package/dist/generators/builtin/plantuml-adapter.js.map +1 -0
  6. package/dist/generators/cli/config.d.ts +105 -0
  7. package/dist/generators/cli/config.d.ts.map +1 -0
  8. package/dist/generators/cli/config.js +168 -0
  9. package/dist/generators/cli/config.js.map +1 -0
  10. package/dist/generators/cli/context-map.d.ts +26 -0
  11. package/dist/generators/cli/context-map.d.ts.map +1 -0
  12. package/dist/generators/cli/context-map.js +124 -0
  13. package/dist/generators/cli/context-map.js.map +1 -0
  14. package/dist/generators/cli/executor.d.ts +95 -0
  15. package/dist/generators/cli/executor.d.ts.map +1 -0
  16. package/dist/generators/cli/executor.js +277 -0
  17. package/dist/generators/cli/executor.js.map +1 -0
  18. package/dist/generators/cli/generic.d.ts +54 -0
  19. package/dist/generators/cli/generic.d.ts.map +1 -0
  20. package/dist/generators/cli/generic.js +224 -0
  21. package/dist/generators/cli/generic.js.map +1 -0
  22. package/dist/generators/cli/manager.d.ts +83 -0
  23. package/dist/generators/cli/manager.d.ts.map +1 -0
  24. package/dist/generators/cli/manager.js +281 -0
  25. package/dist/generators/cli/manager.js.map +1 -0
  26. package/dist/generators/cli/mdsl.d.ts +26 -0
  27. package/dist/generators/cli/mdsl.d.ts.map +1 -0
  28. package/dist/generators/cli/mdsl.js +118 -0
  29. package/dist/generators/cli/mdsl.js.map +1 -0
  30. package/dist/generators/interfaces.d.ts +144 -0
  31. package/dist/generators/interfaces.d.ts.map +1 -0
  32. package/dist/generators/interfaces.js +59 -0
  33. package/dist/generators/interfaces.js.map +1 -0
  34. package/dist/generators/registry.d.ts +100 -0
  35. package/dist/generators/registry.d.ts.map +1 -0
  36. package/dist/generators/registry.js +169 -0
  37. package/dist/generators/registry.js.map +1 -0
  38. package/dist/index.js +180 -3
  39. package/dist/index.js.map +1 -1
  40. package/dist/tools/cli-tools.d.ts +103 -0
  41. package/dist/tools/cli-tools.d.ts.map +1 -0
  42. package/dist/tools/cli-tools.js +220 -0
  43. package/dist/tools/cli-tools.js.map +1 -0
  44. package/dist/tools/generation-tools.d.ts +73 -1
  45. package/dist/tools/generation-tools.d.ts.map +1 -1
  46. package/dist/tools/generation-tools.js +160 -1
  47. package/dist/tools/generation-tools.js.map +1 -1
  48. package/dist/utils/temp-files.d.ts +77 -0
  49. package/dist/utils/temp-files.d.ts.map +1 -0
  50. package/dist/utils/temp-files.js +164 -0
  51. package/dist/utils/temp-files.js.map +1 -0
  52. package/package.json +4 -1
  53. package/src/templates/FullReportTemplate.md.ftl +297 -0
  54. package/src/templates/GlossaryTemplate.md.ftl +132 -0
  55. package/src/templates/JHipster-Microservices.jdl.ftl +139 -0
  56. package/src/templates/JHipster-Monolith.jdl.ftl +159 -0
@@ -0,0 +1,297 @@
1
+ <#--
2
+ Full Domain Report Template
3
+ Generates comprehensive documentation for the domain model
4
+
5
+ Includes:
6
+ - Executive summary
7
+ - Context map visualization description
8
+ - Detailed bounded context documentation
9
+ - Relationship analysis
10
+ - Technical recommendations
11
+ -->
12
+ # Domain Model Report
13
+
14
+ <#if model.name??>
15
+ ## ${model.name}
16
+ </#if>
17
+
18
+ <#if contextMap?? && contextMap.state??>
19
+ **State:** ${contextMap.state}
20
+ </#if>
21
+
22
+ **Generated:** ${.now?string("yyyy-MM-dd HH:mm:ss")}
23
+
24
+ ---
25
+
26
+ ## Executive Summary
27
+
28
+ <#assign totalContexts = boundedContexts?size>
29
+ <#assign totalAggregates = 0>
30
+ <#assign totalEntities = 0>
31
+ <#assign totalValueObjects = 0>
32
+ <#assign totalEvents = 0>
33
+ <#assign totalCommands = 0>
34
+ <#list boundedContexts as bc>
35
+ <#assign totalAggregates = totalAggregates + bc.aggregates?size>
36
+ <#list bc.aggregates as agg>
37
+ <#assign totalEntities = totalEntities + agg.entities?size>
38
+ <#assign totalValueObjects = totalValueObjects + agg.valueObjects?size>
39
+ <#assign totalEvents = totalEvents + agg.domainEvents?size>
40
+ <#assign totalCommands = totalCommands + agg.commands?size>
41
+ </#list>
42
+ </#list>
43
+
44
+ This domain model consists of:
45
+
46
+ | Metric | Count |
47
+ |--------|-------|
48
+ | Bounded Contexts | ${totalContexts} |
49
+ | Aggregates | ${totalAggregates} |
50
+ | Entities | ${totalEntities} |
51
+ | Value Objects | ${totalValueObjects} |
52
+ | Domain Events | ${totalEvents} |
53
+ | Commands | ${totalCommands} |
54
+
55
+ <#if contextMap?? && contextMap.relationships?size gt 0>
56
+ | Relationships | ${contextMap.relationships?size} |
57
+ </#if>
58
+
59
+ ---
60
+
61
+ ## Context Map Overview
62
+
63
+ <#if contextMap??>
64
+ <#if contextMap.relationships?size gt 0>
65
+ The domain is organized into ${totalContexts} bounded contexts with ${contextMap.relationships?size} relationships between them.
66
+
67
+ ### Relationship Summary
68
+
69
+ <#assign partnerships = 0>
70
+ <#assign sharedKernels = 0>
71
+ <#assign upstreamDownstream = 0>
72
+ <#list contextMap.relationships as rel>
73
+ <#if rel.type == "Partnership">
74
+ <#assign partnerships = partnerships + 1>
75
+ <#elseif rel.type == "SharedKernel">
76
+ <#assign sharedKernels = sharedKernels + 1>
77
+ <#elseif rel.type == "UpstreamDownstream">
78
+ <#assign upstreamDownstream = upstreamDownstream + 1>
79
+ </#if>
80
+ </#list>
81
+
82
+ | Relationship Type | Count | Description |
83
+ |-------------------|-------|-------------|
84
+ | Partnership | ${partnerships} | Collaborative relationships between teams |
85
+ | Shared Kernel | ${sharedKernels} | Shared domain model portions |
86
+ | Upstream/Downstream | ${upstreamDownstream} | Producer/Consumer relationships |
87
+
88
+ ### Relationship Details
89
+
90
+ <#list contextMap.relationships as rel>
91
+ <#if rel.type == "Partnership">
92
+ **Partnership:** ${rel.participant1} <-> ${rel.participant2}
93
+ - Both contexts collaborate as partners with shared goals
94
+ - Changes require coordination between teams
95
+
96
+ <#elseif rel.type == "SharedKernel">
97
+ **Shared Kernel:** ${rel.participant1} <-> ${rel.participant2}
98
+ - Both contexts share a portion of the domain model
99
+ - Changes to shared model require agreement from both teams
100
+
101
+ <#elseif rel.type == "UpstreamDownstream">
102
+ **Upstream/Downstream:** ${rel.upstream} -> ${rel.downstream}
103
+ <#if rel.upstreamPatterns?? && rel.upstreamPatterns?size gt 0>
104
+ - Upstream patterns: <#list rel.upstreamPatterns as p>${p}<#if p?has_next>, </#if></#list>
105
+ <#if rel.upstreamPatterns?seq_contains("OHS")>
106
+ - *Open Host Service*: Upstream provides a well-defined API
107
+ </#if>
108
+ <#if rel.upstreamPatterns?seq_contains("PL")>
109
+ - *Published Language*: Uses a shared documented language
110
+ </#if>
111
+ </#if>
112
+ <#if rel.downstreamPatterns?? && rel.downstreamPatterns?size gt 0>
113
+ - Downstream patterns: <#list rel.downstreamPatterns as p>${p}<#if p?has_next>, </#if></#list>
114
+ <#if rel.downstreamPatterns?seq_contains("ACL")>
115
+ - *Anti-Corruption Layer*: Downstream protects its model from upstream changes
116
+ </#if>
117
+ <#if rel.downstreamPatterns?seq_contains("CF")>
118
+ - *Conformist*: Downstream conforms to upstream's model
119
+ </#if>
120
+ </#if>
121
+ <#if rel.exposedAggregates?? && rel.exposedAggregates?size gt 0>
122
+ - Exposed aggregates: <#list rel.exposedAggregates as ea>${ea}<#if ea?has_next>, </#if></#list>
123
+ </#if>
124
+
125
+ </#if>
126
+ </#list>
127
+ <#else>
128
+ *No relationships defined between bounded contexts.*
129
+ </#if>
130
+ <#else>
131
+ *No context map defined.*
132
+ </#if>
133
+
134
+ ---
135
+
136
+ ## Bounded Contexts
137
+
138
+ <#list boundedContexts as bc>
139
+ ### ${bc.name}
140
+
141
+ <#if bc.domainVisionStatement??>
142
+ > ${bc.domainVisionStatement}
143
+
144
+ </#if>
145
+ <#if bc.implementationTechnology??>
146
+ **Implementation Technology:** ${bc.implementationTechnology}
147
+
148
+ </#if>
149
+ <#if bc.responsibilities?? && bc.responsibilities?size gt 0>
150
+ **Responsibilities:**
151
+ <#list bc.responsibilities as resp>
152
+ - ${resp}
153
+ </#list>
154
+
155
+ </#if>
156
+ <#if bc.knowledgeLevel??>
157
+ **Knowledge Level:** ${bc.knowledgeLevel}
158
+
159
+ </#if>
160
+
161
+ #### Statistics
162
+
163
+ | Element Type | Count |
164
+ |--------------|-------|
165
+ | Aggregates | ${bc.aggregates?size} |
166
+ <#assign bcEntities = 0>
167
+ <#assign bcVOs = 0>
168
+ <#assign bcEvents = 0>
169
+ <#assign bcCommands = 0>
170
+ <#assign bcServices = 0>
171
+ <#list bc.aggregates as agg>
172
+ <#assign bcEntities = bcEntities + agg.entities?size>
173
+ <#assign bcVOs = bcVOs + agg.valueObjects?size>
174
+ <#assign bcEvents = bcEvents + agg.domainEvents?size>
175
+ <#assign bcCommands = bcCommands + agg.commands?size>
176
+ <#assign bcServices = bcServices + agg.services?size>
177
+ </#list>
178
+ | Entities | ${bcEntities} |
179
+ | Value Objects | ${bcVOs} |
180
+ | Domain Events | ${bcEvents} |
181
+ | Commands | ${bcCommands} |
182
+ | Services | ${bcServices} |
183
+
184
+ <#if bc.aggregates?size gt 0>
185
+ #### Aggregates
186
+
187
+ <#list bc.aggregates as agg>
188
+ ##### ${agg.name}
189
+
190
+ <#if agg.responsibilities?? && agg.responsibilities?size gt 0>
191
+ **Responsibilities:**
192
+ <#list agg.responsibilities as resp>
193
+ - ${resp}
194
+ </#list>
195
+
196
+ </#if>
197
+ <#if agg.aggregateRoot??>
198
+ **Aggregate Root:** ${agg.aggregateRoot.name}
199
+
200
+ | Attribute | Type | Key | Nullable |
201
+ |-----------|------|-----|----------|
202
+ <#list agg.aggregateRoot.attributes as attr>
203
+ | ${attr.name} | ${attr.type} | <#if attr.key?? && attr.key>Yes<#else>No</#if> | <#if attr.nullable?? && attr.nullable>Yes<#else>No</#if> |
204
+ </#list>
205
+
206
+ <#if agg.aggregateRoot.operations?? && agg.aggregateRoot.operations?size gt 0>
207
+ **Operations:**
208
+ <#list agg.aggregateRoot.operations as op>
209
+ - `${op.name}(<#list op.parameters as p>${p.type} ${p.name}<#if p?has_next>, </#if></#list>): ${op.returnType!"void"}`
210
+ </#list>
211
+
212
+ </#if>
213
+ </#if>
214
+ <#if agg.entities?size gt 1 || (agg.entities?size == 1 && !agg.aggregateRoot??)>
215
+ **Other Entities:**
216
+
217
+ <#list agg.entities as entity>
218
+ <#if !entity.aggregateRoot?? || !entity.aggregateRoot>
219
+ - **${entity.name}**
220
+ <#list entity.attributes as attr>
221
+ - ${attr.name}: ${attr.type}
222
+ </#list>
223
+ </#if>
224
+ </#list>
225
+
226
+ </#if>
227
+ <#if agg.valueObjects?size gt 0>
228
+ **Value Objects:**
229
+
230
+ <#list agg.valueObjects as vo>
231
+ - **${vo.name}**: <#list vo.attributes as attr>${attr.name}<#if attr?has_next>, </#if></#list>
232
+ </#list>
233
+
234
+ </#if>
235
+ <#if agg.domainEvents?size gt 0>
236
+ **Domain Events:**
237
+
238
+ | Event | Attributes |
239
+ |-------|------------|
240
+ <#list agg.domainEvents as event>
241
+ | ${event.name} | <#list event.attributes as attr>${attr.name}: ${attr.type}<#if attr?has_next>, </#if></#list> |
242
+ </#list>
243
+
244
+ </#if>
245
+ <#if agg.commands?size gt 0>
246
+ **Commands:**
247
+
248
+ | Command | Attributes |
249
+ |---------|------------|
250
+ <#list agg.commands as cmd>
251
+ | ${cmd.name} | <#list cmd.attributes as attr>${attr.name}: ${attr.type}<#if attr?has_next>, </#if></#list> |
252
+ </#list>
253
+
254
+ </#if>
255
+ <#if agg.services?size gt 0>
256
+ **Services:**
257
+
258
+ <#list agg.services as svc>
259
+ - **${svc.name}**
260
+ <#list svc.operations as op>
261
+ - `${op.name}(<#list op.parameters as p>${p.type} ${p.name}<#if p?has_next>, </#if></#list>): ${op.returnType!"void"}`
262
+ </#list>
263
+ </#list>
264
+
265
+ </#if>
266
+ ---
267
+
268
+ </#list>
269
+ </#if>
270
+ </#list>
271
+
272
+ ## Recommendations
273
+
274
+ ### Architecture Patterns
275
+
276
+ Based on the context map analysis:
277
+
278
+ <#if contextMap?? && upstreamDownstream?? && upstreamDownstream gt 0>
279
+ 1. **API Gateway**: Consider implementing an API gateway to manage cross-context communication
280
+ 2. **Event-Driven Architecture**: The ${totalEvents} domain events suggest opportunities for asynchronous communication
281
+ 3. **CQRS**: The separation of commands (${totalCommands}) and domain events supports CQRS implementation
282
+ <#else>
283
+ 1. **Define Relationships**: Consider defining explicit relationships between bounded contexts
284
+ 2. **Event Storming**: Conduct event storming sessions to identify domain events and commands
285
+ </#if>
286
+
287
+ ### Implementation Considerations
288
+
289
+ <#list boundedContexts as bc>
290
+ <#if bc.implementationTechnology??>
291
+ - **${bc.name}**: ${bc.implementationTechnology}
292
+ </#if>
293
+ </#list>
294
+
295
+ ---
296
+
297
+ *Generated by Context Mapper MCP Server*
@@ -0,0 +1,132 @@
1
+ <#--
2
+ Ubiquitous Language Glossary Template
3
+ Generates a Markdown glossary from the domain model
4
+
5
+ Available variables:
6
+ - contextMap: The context map (if present)
7
+ - boundedContexts: List of all bounded contexts
8
+ - model: The full CML model
9
+ -->
10
+ # Ubiquitous Language Glossary
11
+
12
+ <#if model.name??>
13
+ **Model:** ${model.name}
14
+ </#if>
15
+
16
+ <#if contextMap?? && contextMap.state??>
17
+ **State:** ${contextMap.state}
18
+ </#if>
19
+
20
+ ---
21
+
22
+ <#list boundedContexts as bc>
23
+ ## ${bc.name}
24
+
25
+ <#if bc.domainVisionStatement??>
26
+ *${bc.domainVisionStatement}*
27
+
28
+ </#if>
29
+ <#if bc.responsibilities?? && bc.responsibilities?size gt 0>
30
+ **Responsibilities:**
31
+ <#list bc.responsibilities as resp>
32
+ - ${resp}
33
+ </#list>
34
+
35
+ </#if>
36
+ <#if bc.implementationTechnology??>
37
+ **Technology:** ${bc.implementationTechnology}
38
+
39
+ </#if>
40
+ <#if bc.aggregates?size gt 0>
41
+ ### Aggregates
42
+
43
+ <#list bc.aggregates as agg>
44
+ #### ${agg.name}
45
+
46
+ <#if agg.aggregateRoot??>
47
+ | Term | Type | Description |
48
+ |------|------|-------------|
49
+ | **${agg.aggregateRoot.name}** | Aggregate Root | <#if agg.aggregateRoot.documentation??>${agg.aggregateRoot.documentation}<#else>Root entity of the ${agg.name} aggregate</#if> |
50
+ <#list agg.aggregateRoot.attributes as attr>
51
+ | ${attr.name} | ${attr.type} | <#if attr.key?? && attr.key>Key attribute<#else>-</#if> |
52
+ </#list>
53
+ </#if>
54
+
55
+ <#if agg.entities?size gt 0>
56
+ **Entities:**
57
+
58
+ | Term | Description |
59
+ |------|-------------|
60
+ <#list agg.entities as entity>
61
+ <#if !entity.aggregateRoot?? || !entity.aggregateRoot>
62
+ | **${entity.name}** | <#if entity.documentation??>${entity.documentation}<#else>Entity in ${agg.name}</#if> |
63
+ </#if>
64
+ </#list>
65
+ </#if>
66
+
67
+ <#if agg.valueObjects?size gt 0>
68
+ **Value Objects:**
69
+
70
+ | Term | Attributes | Description |
71
+ |------|------------|-------------|
72
+ <#list agg.valueObjects as vo>
73
+ | **${vo.name}** | <#list vo.attributes as attr>${attr.name}<#if attr?has_next>, </#if></#list> | <#if vo.documentation??>${vo.documentation}<#else>Value object in ${agg.name}</#if> |
74
+ </#list>
75
+ </#if>
76
+
77
+ <#if agg.domainEvents?size gt 0>
78
+ **Domain Events:**
79
+
80
+ | Event | Attributes | Description |
81
+ |-------|------------|-------------|
82
+ <#list agg.domainEvents as event>
83
+ | **${event.name}** | <#list event.attributes as attr>${attr.name}<#if attr?has_next>, </#if></#list> | <#if event.documentation??>${event.documentation}<#else>Domain event from ${agg.name}</#if> |
84
+ </#list>
85
+ </#if>
86
+
87
+ <#if agg.commands?size gt 0>
88
+ **Commands:**
89
+
90
+ | Command | Attributes | Description |
91
+ |---------|------------|-------------|
92
+ <#list agg.commands as cmd>
93
+ | **${cmd.name}** | <#list cmd.attributes as attr>${attr.name}<#if attr?has_next>, </#if></#list> | <#if cmd.documentation??>${cmd.documentation}<#else>Command for ${agg.name}</#if> |
94
+ </#list>
95
+ </#if>
96
+
97
+ <#if agg.services?size gt 0>
98
+ **Services:**
99
+
100
+ | Service | Operations |
101
+ |---------|------------|
102
+ <#list agg.services as svc>
103
+ | **${svc.name}** | <#list svc.operations as op>${op.name}()<#if op?has_next>, </#if></#list> |
104
+ </#list>
105
+ </#if>
106
+
107
+ </#list>
108
+ </#if>
109
+
110
+ ---
111
+
112
+ </#list>
113
+
114
+ <#if contextMap?? && contextMap.relationships?size gt 0>
115
+ ## Context Relationships
116
+
117
+ | Relationship | Type | Details |
118
+ |--------------|------|---------|
119
+ <#list contextMap.relationships as rel>
120
+ <#if rel.type == "Partnership">
121
+ | ${rel.participant1} <-> ${rel.participant2} | Partnership | Collaborative relationship |
122
+ <#elseif rel.type == "SharedKernel">
123
+ | ${rel.participant1} <-> ${rel.participant2} | Shared Kernel | Shared domain model |
124
+ <#elseif rel.type == "UpstreamDownstream">
125
+ | ${rel.upstream} -> ${rel.downstream} | Upstream/Downstream | <#if rel.upstreamPatterns?? && rel.upstreamPatterns?size gt 0>U: [<#list rel.upstreamPatterns as p>${p}<#if p?has_next>, </#if></#list>]</#if> <#if rel.downstreamPatterns?? && rel.downstreamPatterns?size gt 0>D: [<#list rel.downstreamPatterns as p>${p}<#if p?has_next>, </#if></#list>]</#if> |
126
+ </#if>
127
+ </#list>
128
+ </#if>
129
+
130
+ ---
131
+
132
+ *Generated by Context Mapper MCP Server*
@@ -0,0 +1,139 @@
1
+ <#--
2
+ JHipster Microservices JDL Template
3
+ Generates JHipster JDL for microservices architecture
4
+
5
+ Each bounded context becomes a microservice application.
6
+ Aggregates become entities with relationships.
7
+ -->
8
+ <#-- Generate application definitions -->
9
+ <#list boundedContexts as bc>
10
+ application {
11
+ config {
12
+ baseName ${bc.name?replace(" ", "")?uncap_first}
13
+ applicationType microservice
14
+ packageName com.example.${bc.name?replace(" ", "")?lower_case}
15
+ authenticationType jwt
16
+ prodDatabaseType postgresql
17
+ buildTool gradle
18
+ serverPort ${8080 + bc?index}
19
+ }
20
+ entities <#list bc.aggregates as agg><#list agg.entities as entity>${entity.name}<#if entity?has_next || agg?has_next>, </#if></#list></#list>
21
+ }
22
+
23
+ </#list>
24
+ <#-- Generate gateway application -->
25
+ application {
26
+ config {
27
+ baseName gateway
28
+ applicationType gateway
29
+ packageName com.example.gateway
30
+ authenticationType jwt
31
+ prodDatabaseType postgresql
32
+ buildTool gradle
33
+ serverPort 8080
34
+ }
35
+ }
36
+
37
+ <#-- Generate entities -->
38
+ <#list boundedContexts as bc>
39
+ // Entities for ${bc.name}
40
+ <#list bc.aggregates as agg>
41
+ <#list agg.entities as entity>
42
+ /**
43
+ * ${entity.name} entity
44
+ <#if entity.documentation??> * ${entity.documentation}</#if>
45
+ * Part of ${agg.name} aggregate in ${bc.name}
46
+ */
47
+ @microservice(${bc.name?replace(" ", "")?uncap_first})
48
+ entity ${entity.name} {
49
+ <#list entity.attributes as attr>
50
+ <#if attr.name != "id" && !attr.name?ends_with("Id")>
51
+ ${attr.name} ${mapJHipsterType(attr.type)}<#if attr.nullable?? && !attr.nullable> required</#if>
52
+ </#if>
53
+ </#list>
54
+ }
55
+
56
+ </#list>
57
+ <#-- Generate value objects as embedded or entities -->
58
+ <#list agg.valueObjects as vo>
59
+ <#if vo.attributes?size gt 2>
60
+ /**
61
+ * ${vo.name} value object
62
+ <#if vo.documentation??> * ${vo.documentation}</#if>
63
+ */
64
+ @microservice(${bc.name?replace(" ", "")?uncap_first})
65
+ @readOnly
66
+ entity ${vo.name} {
67
+ <#list vo.attributes as attr>
68
+ ${attr.name} ${mapJHipsterType(attr.type)}
69
+ </#list>
70
+ }
71
+
72
+ </#if>
73
+ </#list>
74
+ </#list>
75
+ </#list>
76
+
77
+ <#-- Generate relationships -->
78
+ <#list boundedContexts as bc>
79
+ <#list bc.aggregates as agg>
80
+ <#if agg.aggregateRoot?? && agg.entities?size gt 1>
81
+ // Relationships in ${agg.name}
82
+ relationship OneToMany {
83
+ <#list agg.entities as entity>
84
+ <#if !entity.aggregateRoot?? || !entity.aggregateRoot>
85
+ ${agg.aggregateRoot.name} to ${entity.name}
86
+ </#if>
87
+ </#list>
88
+ }
89
+
90
+ </#if>
91
+ </#list>
92
+ </#list>
93
+
94
+ <#-- Generate enums from domain events/commands (simplified) -->
95
+ <#list boundedContexts as bc>
96
+ <#list bc.aggregates as agg>
97
+ <#if agg.domainEvents?size gt 0>
98
+ // Events in ${agg.name} (for reference)
99
+ // <#list agg.domainEvents as event>${event.name}<#if event?has_next>, </#if></#list>
100
+ </#if>
101
+ <#if agg.commands?size gt 0>
102
+ // Commands in ${agg.name} (for reference)
103
+ // <#list agg.commands as cmd>${cmd.name}<#if cmd?has_next>, </#if></#list>
104
+ </#if>
105
+ </#list>
106
+ </#list>
107
+
108
+ <#-- Pagination and service configuration -->
109
+ paginate * with pagination
110
+ service * with serviceClass
111
+
112
+ <#-- Helper function to map CML types to JHipster types -->
113
+ <#function mapJHipsterType cmlType>
114
+ <#if cmlType?starts_with("-")>
115
+ <#return "String">
116
+ <#elseif cmlType == "String">
117
+ <#return "String">
118
+ <#elseif cmlType == "int" || cmlType == "Integer">
119
+ <#return "Integer">
120
+ <#elseif cmlType == "long" || cmlType == "Long">
121
+ <#return "Long">
122
+ <#elseif cmlType == "float" || cmlType == "Float">
123
+ <#return "Float">
124
+ <#elseif cmlType == "double" || cmlType == "Double">
125
+ <#return "Double">
126
+ <#elseif cmlType == "boolean" || cmlType == "Boolean">
127
+ <#return "Boolean">
128
+ <#elseif cmlType == "DateTime" || cmlType == "Date">
129
+ <#return "Instant">
130
+ <#elseif cmlType == "BigDecimal">
131
+ <#return "BigDecimal">
132
+ <#elseif cmlType == "UUID">
133
+ <#return "UUID">
134
+ <#elseif cmlType?starts_with("List<") || cmlType?starts_with("Set<")>
135
+ <#return "String">
136
+ <#else>
137
+ <#return "String">
138
+ </#if>
139
+ </#function>