eva4j 1.0.7 → 1.0.9
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.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eva4j",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.9",
|
|
4
4
|
"description": "A powerful Node.js CLI for generating Spring Boot projects with modular architecture that enables efficient monolith-first development with seamless transition to microservices",
|
|
5
5
|
"main": "bin/eva4j.js",
|
|
6
6
|
"bin": {
|
|
@@ -78,7 +78,7 @@ function enrichRelationshipsRecursively(entity, secondaryEntities, depth = 0, vi
|
|
|
78
78
|
}
|
|
79
79
|
|
|
80
80
|
const targetFields = targetEntity.fields.filter(f =>
|
|
81
|
-
f.name !== 'id' && f.name !== 'createdAt' && f.name !== 'updatedAt'
|
|
81
|
+
f.name !== 'id' && f.name !== 'createdAt' && f.name !== 'updatedAt' && f.name !== 'createdBy' && f.name !== 'updatedBy'
|
|
82
82
|
);
|
|
83
83
|
|
|
84
84
|
// Recursively enrich nested relationships
|
|
@@ -542,9 +542,9 @@ async function generateCrudResources(aggregate, moduleName, moduleBasePath, pack
|
|
|
542
542
|
const idField = rootEntity.fields[0];
|
|
543
543
|
const idType = idField.javaType;
|
|
544
544
|
|
|
545
|
-
// Filter command fields (exclude id
|
|
545
|
+
// Filter command fields (exclude id and audit fields)
|
|
546
546
|
const commandFields = rootEntity.fields.filter(f =>
|
|
547
|
-
f.name !== 'id' && f.name !== 'createdAt' && f.name !== 'updatedAt'
|
|
547
|
+
f.name !== 'id' && f.name !== 'createdAt' && f.name !== 'updatedAt' && f.name !== 'createdBy' && f.name !== 'updatedBy'
|
|
548
548
|
);
|
|
549
549
|
|
|
550
550
|
// Build enriched OneToMany relationships with recursive nested data
|
|
@@ -578,7 +578,7 @@ async function generateCrudResources(aggregate, moduleName, moduleBasePath, pack
|
|
|
578
578
|
}
|
|
579
579
|
|
|
580
580
|
const targetFields = targetEntity.fields.filter(f =>
|
|
581
|
-
f.name !== 'id' && f.name !== 'createdAt' && f.name !== 'updatedAt'
|
|
581
|
+
f.name !== 'id' && f.name !== 'createdAt' && f.name !== 'updatedAt' && f.name !== 'createdBy' && f.name !== 'updatedBy'
|
|
582
582
|
);
|
|
583
583
|
|
|
584
584
|
return {
|
|
@@ -811,7 +811,7 @@ async function generatePostmanCollection(
|
|
|
811
811
|
const idType = idField.javaType;
|
|
812
812
|
|
|
813
813
|
const commandFields = rootEntity.fields.filter(f =>
|
|
814
|
-
f.name !== 'id' && f.name !== 'createdAt' && f.name !== 'updatedAt'
|
|
814
|
+
f.name !== 'id' && f.name !== 'createdAt' && f.name !== 'updatedAt' && f.name !== 'createdBy' && f.name !== 'updatedBy'
|
|
815
815
|
);
|
|
816
816
|
|
|
817
817
|
const oneToManyRelationships = enrichRelationshipsRecursively(
|
|
@@ -44,7 +44,7 @@ public class <%= name %> {
|
|
|
44
44
|
<% }); %>
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
-
<% const creationFields = fields.filter(f => f.name !== 'id' && f.name !== 'createdAt' && f.name !== 'updatedAt'); %>
|
|
47
|
+
<% const creationFields = fields.filter(f => f.name !== 'id' && f.name !== 'createdAt' && f.name !== 'updatedAt' && f.name !== 'createdBy' && f.name !== 'updatedBy'); %>
|
|
48
48
|
<% if (creationFields.length > 0) { %>
|
|
49
49
|
// Constructor for new entity creation (without id and audit fields)
|
|
50
50
|
public <%= name %>(<% let paramIdx = 0; %><% creationFields.forEach((field, idx) => { %><% if (paramIdx > 0) { %>, <% } %><%- field.javaType %> <%= field.name %><% paramIdx++; %><% }); %>) {
|
|
@@ -35,7 +35,7 @@ public class <%= name %> {
|
|
|
35
35
|
<% }); %>
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
<% const creationFields = fields.filter(f => f.name !== 'id' && f.name !== 'createdAt' && f.name !== 'updatedAt'); %>
|
|
38
|
+
<% const creationFields = fields.filter(f => f.name !== 'id' && f.name !== 'createdAt' && f.name !== 'updatedAt' && f.name !== 'createdBy' && f.name !== 'updatedBy'); %>
|
|
39
39
|
<% if (creationFields.length > 0) { %>
|
|
40
40
|
// Constructor for new entity creation (without id and audit fields)
|
|
41
41
|
public <%= name %>(<% let paramIdx = 0; %><% creationFields.forEach((field, idx) => { %><% if (paramIdx > 0) { %>, <% } %><%- field.javaType %> <%= field.name %><% paramIdx++; %><% }); %>) {
|
|
@@ -515,7 +515,7 @@ public class AuditorAwareImpl implements AuditorAware<String> {
|
|
|
515
515
|
**4. Configuración en Application.java**:
|
|
516
516
|
```java
|
|
517
517
|
@EnableJpaAuditing(auditorAwareRef = "auditorProvider")
|
|
518
|
-
public class <%=
|
|
518
|
+
public class <%= applicationClassName %> {
|
|
519
519
|
// ...
|
|
520
520
|
}
|
|
521
521
|
```
|
|
@@ -868,16 +868,18 @@ const mappableFields = entity.fields.filter(f =>
|
|
|
868
868
|
);
|
|
869
869
|
```
|
|
870
870
|
|
|
871
|
+
En los templates EJS, los campos se filtran así:
|
|
872
|
+
|
|
871
873
|
```ejs
|
|
872
|
-
|
|
873
|
-
|
|
874
|
+
<%%# En AggregateMapper.java.ejs %%>
|
|
875
|
+
<%% rootEntity.fields.filter(f =>
|
|
874
876
|
!(f.name === 'createdAt' ||
|
|
875
877
|
f.name === 'updatedAt' ||
|
|
876
878
|
f.name === 'createdBy' ||
|
|
877
879
|
f.name === 'updatedBy')
|
|
878
|
-
).forEach(field => {
|
|
879
|
-
|
|
880
|
-
|
|
880
|
+
).forEach(field => { %%>
|
|
881
|
+
.<%%= field.name %%>(domain.get<%%= field.name.charAt(0).toUpperCase() + field.name.slice(1) %%>())
|
|
882
|
+
<%% }); %%>
|
|
881
883
|
```
|
|
882
884
|
|
|
883
885
|
### Relaciones Bidireccionales
|