eva4j 1.0.8 → 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.
@@ -35,6 +35,9 @@ aggregates:
35
35
 
36
36
  - name: OrderItem
37
37
  tableName: order_items
38
+ audit:
39
+ enabled: true # Agrega createdAt, updatedAt
40
+ trackUser: true # Agrega createdBy, updatedBy
38
41
  fields:
39
42
  - name: id
40
43
  type: Long
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eva4j",
3
- "version": "1.0.8",
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, createdAt, updatedAt)
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++; %><% }); %>) {