eva4j 1.0.11 → 1.0.13

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 (73) hide show
  1. package/AGENTS.md +441 -14
  2. package/DOMAIN_YAML_GUIDE.md +425 -21
  3. package/FUTURE_FEATURES.md +315 -115
  4. package/QUICK_REFERENCE.md +101 -153
  5. package/README.md +77 -70
  6. package/bin/eva4j.js +57 -1
  7. package/config/defaults.json +3 -0
  8. package/docs/commands/GENERATE_ENTITIES.md +662 -1968
  9. package/docs/commands/GENERATE_HTTP_EXCHANGE.md +274 -450
  10. package/docs/commands/GENERATE_KAFKA_EVENT.md +219 -498
  11. package/docs/commands/GENERATE_KAFKA_LISTENER.md +18 -18
  12. package/docs/commands/GENERATE_RECORD.md +335 -311
  13. package/docs/commands/GENERATE_TEMPORAL_ACTIVITY.md +174 -0
  14. package/docs/commands/GENERATE_TEMPORAL_FLOW.md +237 -0
  15. package/docs/commands/GENERATE_USECASE.md +216 -282
  16. package/docs/commands/INDEX.md +36 -7
  17. package/examples/doctor-evaluation.yaml +3 -3
  18. package/examples/domain-audit-complete.yaml +2 -2
  19. package/examples/domain-collections.yaml +2 -2
  20. package/examples/domain-ecommerce.yaml +2 -2
  21. package/examples/domain-events.yaml +201 -0
  22. package/examples/domain-field-visibility.yaml +11 -5
  23. package/examples/domain-multi-aggregate.yaml +12 -6
  24. package/examples/domain-one-to-many.yaml +1 -1
  25. package/examples/domain-one-to-one.yaml +1 -1
  26. package/examples/domain-secondary-onetomany.yaml +1 -1
  27. package/examples/domain-secondary-onetoone.yaml +1 -1
  28. package/examples/domain-simple.yaml +1 -1
  29. package/examples/domain-soft-delete.yaml +3 -3
  30. package/examples/domain-transitions.yaml +1 -1
  31. package/examples/domain-value-objects.yaml +1 -1
  32. package/package.json +2 -2
  33. package/src/commands/add-kafka-client.js +3 -1
  34. package/src/commands/add-temporal-client.js +286 -0
  35. package/src/commands/generate-entities.js +75 -4
  36. package/src/commands/generate-kafka-event.js +273 -89
  37. package/src/commands/generate-temporal-activity.js +228 -0
  38. package/src/commands/generate-temporal-flow.js +216 -0
  39. package/src/generators/module-generator.js +1 -0
  40. package/src/generators/shared-generator.js +26 -0
  41. package/src/utils/yaml-to-entity.js +93 -4
  42. package/templates/aggregate/AggregateRepository.java.ejs +3 -2
  43. package/templates/aggregate/AggregateRepositoryImpl.java.ejs +15 -7
  44. package/templates/aggregate/AggregateRoot.java.ejs +38 -2
  45. package/templates/aggregate/DomainEntity.java.ejs +6 -2
  46. package/templates/aggregate/DomainEventHandler.java.ejs +62 -0
  47. package/templates/aggregate/DomainEventRecord.java.ejs +50 -0
  48. package/templates/aggregate/JpaAggregateRoot.java.ejs +3 -1
  49. package/templates/aggregate/JpaEntity.java.ejs +3 -1
  50. package/templates/base/docker/kafka-services.yaml.ejs +2 -2
  51. package/templates/base/docker/temporal-services.yaml.ejs +29 -0
  52. package/templates/base/resources/parameters/develop/temporal.yaml.ejs +9 -0
  53. package/templates/base/resources/parameters/local/temporal.yaml.ejs +9 -0
  54. package/templates/base/resources/parameters/production/temporal.yaml.ejs +9 -0
  55. package/templates/base/resources/parameters/test/temporal.yaml.ejs +9 -0
  56. package/templates/base/root/AGENTS.md.ejs +916 -51
  57. package/templates/crud/Controller.java.ejs +36 -6
  58. package/templates/crud/ListQuery.java.ejs +6 -2
  59. package/templates/crud/ListQueryHandler.java.ejs +24 -10
  60. package/templates/crud/UpdateCommand.java.ejs +52 -0
  61. package/templates/crud/UpdateCommandHandler.java.ejs +105 -0
  62. package/templates/kafka-event/DomainEventHandlerMethod.ejs +1 -0
  63. package/templates/kafka-event/Event.java.ejs +23 -0
  64. package/templates/shared/application/dtos/PagedResponse.java.ejs +30 -0
  65. package/templates/shared/configurations/temporalConfig/TemporalConfig.java.ejs +104 -0
  66. package/templates/shared/domain/DomainEvent.java.ejs +40 -0
  67. package/templates/shared/interfaces/HeavyActivity.java.ejs +4 -0
  68. package/templates/shared/interfaces/LightActivity.java.ejs +4 -0
  69. package/templates/temporal-activity/ActivityImpl.java.ejs +14 -0
  70. package/templates/temporal-activity/ActivityInterface.java.ejs +11 -0
  71. package/templates/temporal-flow/WorkFlowImpl.java.ejs +64 -0
  72. package/templates/temporal-flow/WorkFlowInterface.java.ejs +19 -0
  73. package/templates/temporal-flow/WorkFlowService.java.ejs +49 -0
@@ -1,282 +1,216 @@
1
- # Command `generate usecase` (alias: `g usecase`)
2
-
3
- ## 📋 Description
4
-
5
- Generates CQRS use cases (Commands or Queries) with their respective handlers, following the Command Query Responsibility Segregation pattern.
6
-
7
- ## 🎯 Purpose
8
-
9
- Create individual use cases for specific business operations, maintaining clear separation between write operations (Commands) and read operations (Queries).
10
-
11
- ## 📝 Syntax
12
-
13
- ```bash
14
- eva4j generate usecase <UseCaseName> --type <command|query>
15
- eva4j g usecase <UseCaseName> --type <command|query> # Short alias
16
- ```
17
-
18
- ### Parameters
19
-
20
- | Parameter | Required | Description |
21
- |-----------|----------|-------------|
22
- | `UseCaseName` | Yes | Name of the use case (PascalCase, e.g., UpdateCustomer, GetOrderById) |
23
- | `--type` | Yes | Type of use case: `command` (write) or `query` (read) |
24
-
25
- ## 💡 Examples
26
-
27
- ### Example 1: Update Command
28
-
29
- ```bash
30
- eva4j g usecase UpdateCustomer --type command
31
- ```
32
-
33
- **Generates:**
34
- - `application/commands/UpdateCustomerCommand.java` - Command with request data
35
- - `application/commands/UpdateCustomerCommandHandler.java` - Handler with business logic
36
-
37
- ### Example 2: Delete Command
38
-
39
- ```bash
40
- eva4j g usecase DeleteOrder --type command
41
- ```
42
-
43
- **Generates:**
44
- - `application/commands/DeleteOrderCommand.java`
45
- - `application/commands/DeleteOrderCommandHandler.java`
46
-
47
- ### Example 3: Custom Query
48
-
49
- ```bash
50
- eva4j g usecase GetCustomerByEmail --type query
51
- ```
52
-
53
- **Generates:**
54
- - `application/queries/GetCustomerByEmailQuery.java`
55
- - `application/queries/GetCustomerByEmailQueryHandler.java`
56
-
57
- ### Example 4: Search Query
58
-
59
- ```bash
60
- eva4j g usecase SearchProducts --type query
61
- ```
62
-
63
- **Generates:**
64
- - `application/queries/SearchProductsQuery.java`
65
- - `application/queries/SearchProductsQueryHandler.java`
66
-
67
- ## 📦 Generated Code Structure
68
-
69
- ### Command Example
70
-
71
- **UpdateCustomerCommand.java:**
72
- ```java
73
- package com.example.project.customer.application.commands;
74
-
75
- import lombok.AllArgsConstructor;
76
- import lombok.Data;
77
- import lombok.NoArgsConstructor;
78
-
79
- @Data
80
- @NoArgsConstructor
81
- @AllArgsConstructor
82
- public class UpdateCustomerCommand {
83
- private Long id;
84
- // Add your fields here
85
- }
86
- ```
87
-
88
- **UpdateCustomerCommandHandler.java:**
89
- ```java
90
- package com.example.project.customer.application.commands;
91
-
92
- import com.example.project.customer.domain.models.Customer;
93
- import com.example.project.customer.domain.repositories.CustomerRepository;
94
- import lombok.RequiredArgsConstructor;
95
- import org.springframework.stereotype.Service;
96
- import org.springframework.transaction.annotation.Transactional;
97
-
98
- @Service
99
- @RequiredArgsConstructor
100
- public class UpdateCustomerCommandHandler {
101
-
102
- private final CustomerRepository repository;
103
-
104
- @Transactional
105
- public void handle(UpdateCustomerCommand command) {
106
- // TODO: Implement update logic
107
- Customer customer = repository.findById(command.getId())
108
- .orElseThrow(() -> new RuntimeException("Customer not found"));
109
-
110
- // Update customer fields
111
-
112
- repository.save(customer);
113
- }
114
- }
115
- ```
116
-
117
- ### Query Example
118
-
119
- **GetCustomerByEmailQuery.java:**
120
- ```java
121
- package com.example.project.customer.application.queries;
122
-
123
- import lombok.AllArgsConstructor;
124
- import lombok.Data;
125
- import lombok.NoArgsConstructor;
126
-
127
- @Data
128
- @NoArgsConstructor
129
- @AllArgsConstructor
130
- public class GetCustomerByEmailQuery {
131
- private String email;
132
- }
133
- ```
134
-
135
- **GetCustomerByEmailQueryHandler.java:**
136
- ```java
137
- package com.example.project.customer.application.queries;
138
-
139
- import com.example.project.customer.domain.models.Customer;
140
- import com.example.project.customer.domain.repositories.CustomerRepository;
141
- import lombok.RequiredArgsConstructor;
142
- import org.springframework.stereotype.Service;
143
- import org.springframework.transaction.annotation.Transactional;
144
-
145
- @Service
146
- @RequiredArgsConstructor
147
- public class GetCustomerByEmailQueryHandler {
148
-
149
- private final CustomerRepository repository;
150
-
151
- @Transactional(readOnly = true)
152
- public Customer handle(GetCustomerByEmailQuery query) {
153
- // TODO: Implement query logic
154
- return repository.findByEmail(query.getEmail())
155
- .orElseThrow(() -> new RuntimeException("Customer not found"));
156
- }
157
- }
158
- ```
159
-
160
- ## ✨ Features
161
-
162
- ### Commands (Write Operations)
163
- - **@Transactional** - Ensures data consistency
164
- - **Repository injection** - Domain repository ready
165
- - **TODO comments** - Guides implementation
166
- - **Lombok annotations** - Reduces boilerplate
167
-
168
- ### Queries (Read Operations)
169
- - ✅ **@Transactional(readOnly = true)** - Optimized for reads
170
- - **Repository injection** - Domain repository ready
171
- - ✅ **Return type flexibility** - Can return entities or DTOs
172
- - **Clean structure** - Follows CQRS pattern
173
-
174
- ## 🎯 Common Use Cases
175
-
176
- ### Customer Module
177
- ```bash
178
- eva4j g usecase UpdateCustomer --type command
179
- eva4j g usecase DeactivateCustomer --type command
180
- eva4j g usecase GetCustomerByEmail --type query
181
- eva4j g usecase SearchCustomers --type query
182
- eva4j g usecase CountActiveCustomers --type query
183
- ```
184
-
185
- ### Order Module
186
- ```bash
187
- eva4j g usecase UpdateOrderStatus --type command
188
- eva4j g usecase CancelOrder --type command
189
- eva4j g usecase AddOrderItem --type command
190
- eva4j g usecase GetOrdersByCustomer --type query
191
- eva4j g usecase GetOrdersByDateRange --type query
192
- ```
193
-
194
- ### Product Module
195
- ```bash
196
- eva4j g usecase UpdateProductPrice --type command
197
- eva4j g usecase UpdateStock --type command
198
- eva4j g usecase DeactivateProduct --type command
199
- eva4j g usecase SearchProductsByCategory --type query
200
- eva4j g usecase GetLowStockProducts --type query
201
- ```
202
-
203
- ## 🔄 CQRS Pattern Guidelines
204
-
205
- ### Commands (Writes)
206
- - **Purpose:** Change system state
207
- - **Transaction:** Required (`@Transactional`)
208
- - **Return:** Usually `void` or entity ID
209
- - **Examples:** Create, Update, Delete, Activate, Deactivate
210
-
211
- ### Queries (Reads)
212
- - **Purpose:** Retrieve data without side effects
213
- - **Transaction:** Read-only (`@Transactional(readOnly = true)`)
214
- - **Return:** Entity, DTO, or List
215
- - **Examples:** Get, List, Search, Count, Find
216
-
217
- ## 🚀 Next Steps
218
-
219
- After generating a use case:
220
-
221
- 1. **Implement the logic:**
222
- - Edit the handler class
223
- - Add business validations
224
- - Implement the actual operation
225
-
226
- 2. **Add to controller (if needed):**
227
- ```java
228
- @PostMapping("/update")
229
- public ResponseEntity<Void> update(@RequestBody UpdateCustomerCommand command) {
230
- handler.handle(command);
231
- return ResponseEntity.ok().build();
232
- }
233
- ```
234
-
235
- 3. **Add validations to command:**
236
- ```java
237
- @NotNull
238
- private Long id;
239
-
240
- @NotBlank
241
- @Size(max = 100)
242
- private String name;
243
- ```
244
-
245
- 4. **Create DTOs if needed:**
246
- - Create response DTOs for queries
247
- - Create mappers between entities and DTOs
248
-
249
- ## ⚠️ Prerequisites
250
-
251
- - Be in a project created with `eva4j create`
252
- - Module must exist (created with `eva4j add module`)
253
- - Working directory should be the project root
254
-
255
- ## 🔍 Validations
256
-
257
- The command validates:
258
- - ✅ Valid eva4j project
259
- - ✅ Use case name is in PascalCase
260
- - ✅ Type is either `command` or `query`
261
- - ✅ Module exists in the project
262
-
263
- ## 📚 See Also
264
-
265
- - [generate-entities](./GENERATE_ENTITIES.md) - Generate complete CRUD
266
- - [generate-resource](./GENERATE_RESOURCE.md) - Generate REST controller
267
- - [add-module](./ADD_MODULE.md) - Create modules
268
-
269
- ## 🐛 Troubleshooting
270
-
271
- **Error: "Invalid use case name"**
272
- - Solution: Use PascalCase naming (e.g., `UpdateCustomer`, not `updateCustomer` or `update-customer`)
273
-
274
- **Error: "Type must be command or query"**
275
- - Solution: Always specify `--type command` or `--type query`
276
-
277
- **Files not created in correct location**
278
- - Solution: Run command from project root directory
279
- - Check that you're in a valid eva4j project
280
-
281
- **Repository not found after generation**
282
- - Solution: Generate entities first with `eva4j g entities`, or create repository interface manually
1
+ # Command `generate usecase` (alias: `g usecase`)
2
+
3
+ ## Description
4
+
5
+ Generates CQRS use cases (Commands or Queries) with their handlers, following the Command Query Responsibility Segregation pattern.
6
+
7
+ ## Purpose
8
+
9
+ Create individual use cases for specific business operations, maintaining clear separation between write operations (Commands) and read operations (Queries).
10
+
11
+ ## Syntax
12
+
13
+ ```bash
14
+ eva generate usecase <module> [name]
15
+ eva g usecase <module> [name] # Short alias
16
+ ```
17
+
18
+ ### Parameters
19
+
20
+ | Parameter | Required | Description |
21
+ |-----------|----------|-------------|
22
+ | `module` | Yes | Module where the use case will be created (e.g., `user`, `order`) |
23
+ | `name` | No | Use case name in kebab-case or PascalCase prompted if omitted |
24
+
25
+ > **Interactive prompts:**
26
+ > 1. **Use case name** — if not provided as argument (e.g., `create-user`, `find-user-by-id`)
27
+ > 2. **Type** `Command` (write) or `Query` (read)
28
+
29
+ ## Examples
30
+
31
+ ### Example 1: Create command
32
+
33
+ ```bash
34
+ eva g usecase user create-user
35
+ # Prompted for type Command
36
+ ```
37
+
38
+ Generates:
39
+ - `application/commands/CreateUserCommand.java`
40
+ - `application/usecases/CreateUserCommandHandler.java`
41
+
42
+ ### Example 2: Find query
43
+
44
+ ```bash
45
+ eva g usecase user find-user-by-id
46
+ # Prompted for type → Query
47
+ ```
48
+
49
+ Generates:
50
+ - `application/queries/FindUserByIdQuery.java`
51
+ - `application/usecases/FindUserByIdQueryHandler.java`
52
+ - `application/dtos/FindUserByIdResponseDto.java`
53
+
54
+ ### Example 3: Module-specific commands
55
+
56
+ ```bash
57
+ eva g usecase order cancel-order # Command
58
+ eva g usecase product update-stock # Command
59
+ eva g usecase order find-orders-by-customer # Query
60
+ ```
61
+
62
+ ## Generated Code Structure
63
+
64
+ ### Command
65
+
66
+ **CreateUserCommand.java** (`application/commands/`):
67
+ ```java
68
+ package com.example.project.user.application.commands;
69
+
70
+ public record CreateUserCommand(
71
+ // TODO: add command fields
72
+ ) {
73
+ }
74
+ ```
75
+
76
+ **CreateUserCommandHandler.java** (`application/usecases/`):
77
+ ```java
78
+ package com.example.project.user.application.usecases;
79
+
80
+ import com.example.project.user.application.commands.CreateUserCommand;
81
+ import com.example.project.shared.domain.annotations.ApplicationComponent;
82
+
83
+ @ApplicationComponent
84
+ public class CreateUserCommandHandler {
85
+
86
+ public CreateUserCommandHandler() {
87
+ }
88
+
89
+ public void handle(CreateUserCommand command) {
90
+ //todo: implement use case
91
+ }
92
+ }
93
+ ```
94
+
95
+ ### Query
96
+
97
+ **FindUserByIdQuery.java** (`application/queries/`):
98
+ ```java
99
+ package com.example.project.user.application.queries;
100
+
101
+ public record FindUserByIdQuery(
102
+ // TODO: add query fields
103
+ ) {
104
+ }
105
+ ```
106
+
107
+ **FindUserByIdQueryHandler.java** (`application/usecases/`):
108
+ ```java
109
+ package com.example.project.user.application.usecases;
110
+
111
+ import com.example.project.user.application.queries.FindUserByIdQuery;
112
+ import com.example.project.user.application.dtos.FindUserByIdResponseDto;
113
+ import com.example.project.shared.domain.annotations.ApplicationComponent;
114
+
115
+ @ApplicationComponent
116
+ public class FindUserByIdQueryHandler {
117
+
118
+ public FindUserByIdQueryHandler() {
119
+ }
120
+
121
+ public FindUserByIdResponseDto handle(FindUserByIdQuery query) {
122
+ //todo: implement use case
123
+ return null;
124
+ }
125
+ }
126
+ ```
127
+
128
+ **FindUserByIdResponseDto.java** (`application/dtos/`):
129
+ ```java
130
+ package com.example.project.user.application.dtos;
131
+
132
+ public record FindUserByIdResponseDto(
133
+ // TODO: add response fields
134
+ ) {
135
+ }
136
+ ```
137
+
138
+ ## Key Design Decisions
139
+
140
+ - **Pure Java records** — Commands and Queries are immutable records (no Lombok)
141
+ - **`@ApplicationComponent`** — Custom annotation from `shared` that marks handlers for Spring DI; not `@Service`
142
+ - **Handlers in `application/usecases/`** — All handlers live here regardless of type (Command or Query)
143
+ - **Commands in `application/commands/`** — Command record classes
144
+ - **Queries in `application/queries/`** — Query record classes
145
+ - **DTOs in `application/dtos/`** — Response DTOs (queries only)
146
+
147
+ ## CQRS Pattern Guidelines
148
+
149
+ ### Commands (Writes)
150
+ - **Purpose:** Change system state
151
+ - **Return:** `void` or minimal confirmation
152
+ - **Examples:** Create, Update, Delete, Activate, Deactivate
153
+
154
+ ### Queries (Reads)
155
+ - **Purpose:** Retrieve data without side effects
156
+ - **Return:** ResponseDto or `List<ResponseDto>`
157
+ - **Examples:** FindById, FindAll, Search
158
+
159
+ ## Common Use Cases
160
+
161
+ ### User Module
162
+ ```bash
163
+ eva g usecase user create-user # Command
164
+ eva g usecase user update-user # Command
165
+ eva g usecase user deactivate-user # Command
166
+ eva g usecase user find-user-by-id # Query
167
+ eva g usecase user find-user-by-email # Query
168
+ ```
169
+
170
+ ### Order Module
171
+ ```bash
172
+ eva g usecase order place-order # Command
173
+ eva g usecase order cancel-order # Command
174
+ eva g usecase order find-order-by-id # Query
175
+ eva g usecase order find-orders-by-customer # Query
176
+ ```
177
+
178
+ ### Product Module
179
+ ```bash
180
+ eva g usecase product update-price # Command
181
+ eva g usecase product update-stock # Command
182
+ eva g usecase product find-by-category # Query
183
+ eva g usecase product get-low-stock # Query
184
+ ```
185
+
186
+ ## Next Steps After Generation
187
+
188
+ 1. **Add fields to the record:**
189
+ ```java
190
+ public record CreateUserCommand(
191
+ String name,
192
+ String email
193
+ ) { }
194
+ ```
195
+
196
+ 2. **Implement the handler:**
197
+ ```java
198
+ public void handle(CreateUserCommand command) {
199
+ User user = new User(command.name(), command.email());
200
+ userRepository.save(user);
201
+ }
202
+ ```
203
+
204
+ 3. **Wire into a Controller or another Handler** — inject the handler via constructor and call `handler.handle(command)`.
205
+
206
+ ## Prerequisites
207
+
208
+ - Be in a project created with `eva create`
209
+ - Module must exist (`eva add module <module>`)
210
+ - Run the command from the project root
211
+
212
+ ## See Also
213
+
214
+ - [generate-entities](./GENERATE_ENTITIES.md) Generate complete domain model from YAML
215
+ - [generate-resource](./GENERATE_RESOURCE.md) REST controller with 5 CRUD endpoints
216
+ - [add-module](./ADD_MODULE.md) — Create a new module
@@ -79,6 +79,28 @@ Commands for integrating with external services and messaging systems.
79
79
  - Kafka dependencies installation
80
80
  - Base configuration
81
81
 
82
+ ### ⏳ Temporal / Workflow Commands
83
+
84
+ Commands for integrating with [Temporal](https://temporal.io/) for durable workflow orchestration.
85
+
86
+ - **add temporal-client** - Add Temporal SDK and worker infrastructure
87
+ - *Documentation coming soon*
88
+ - Temporal SDK dependency
89
+ - Worker configuration (FLOW_QUEUE, LIGHT_TASK_QUEUE, HEAVY_TASK_QUEUE)
90
+ - Docker Compose service for local development
91
+
92
+ - **[generate temporal-flow](./GENERATE_TEMPORAL_FLOW.md)** (`g temporal-flow`) - Create a Temporal workflow
93
+ - `@WorkflowInterface` with signal and query methods
94
+ - Saga implementation with compensation
95
+ - Spring service facade (async & sync)
96
+ - Auto-registers in `TemporalConfig.java`
97
+
98
+ - **[generate temporal-activity](./GENERATE_TEMPORAL_ACTIVITY.md)** (`g temporal-activity`) - Create a Temporal activity
99
+ - `@ActivityInterface` with unique `@ActivityMethod` name
100
+ - `LightActivity` or `HeavyActivity` marker for queue routing
101
+ - Auto-registered via Spring DI (no manual config patching)
102
+ - Registers stub in the chosen `WorkFlowImpl`
103
+
82
104
  ### 🚀 Deployment & Scaling Commands
83
105
 
84
106
  Commands for transitioning from monolith to microservices.
@@ -117,6 +139,11 @@ Commands for transitioning from monolith to microservices.
117
139
  2. [generate kafka-event](./GENERATE_KAFKA_EVENT.md) - Event publishing
118
140
  3. [generate kafka-listener](./GENERATE_KAFKA_LISTENER.md) - Event consumption
119
141
 
142
+ ### Orchestrating Workflows
143
+ 1. [add temporal-client](./INDEX.md) - Install Temporal infrastructure
144
+ 2. [generate temporal-flow](./GENERATE_TEMPORAL_FLOW.md) - Define workflow
145
+ 3. [generate temporal-activity](./GENERATE_TEMPORAL_ACTIVITY.md) - Implement activities
146
+
120
147
  ### Scaling to Microservices
121
148
  1. [detach](./DETACH.md) - Extract module
122
149
  2. [generate http-exchange](./GENERATE_HTTP_EXCHANGE.md) - Service communication
@@ -191,13 +218,15 @@ Commands for transitioning from monolith to microservices.
191
218
  All generate commands support short aliases for faster development:
192
219
 
193
220
  ```bash
194
- eva4j g entities <name> # generate entities
195
- eva4j g usecase <name> # generate usecase
196
- eva4j g resource <name> # generate resource
197
- eva4j g record <name> # generate record
198
- eva4j g http <name> # generate http-exchange
199
- eva4j g kafka-event <name> # generate kafka-event
200
- eva4j g kafka-listener <name> # generate kafka-listener
221
+ eva g entities <name> # generate entities
222
+ eva g usecase <name> # generate usecase
223
+ eva g resource <name> # generate resource
224
+ eva g record <name> # generate record
225
+ eva g http <name> # generate http-exchange
226
+ eva g kafka-event <name> # generate kafka-event
227
+ eva g kafka-listener <name> # generate kafka-listener
228
+ eva g temporal-flow <module> # generate temporal-flow
229
+ eva g temporal-activity <module># generate temporal-activity
201
230
  ```
202
231
 
203
232
  ---
@@ -5,7 +5,7 @@
5
5
  aggregates:
6
6
  - name: Evaluation
7
7
  entities:
8
- - name: evaluation
8
+ - name: Evaluation
9
9
  isRoot: true
10
10
  tableName: evaluations
11
11
  auditable: true
@@ -28,7 +28,7 @@ aggregates:
28
28
  cascade: [ PERSIST, MERGE, REMOVE ]
29
29
  fetch: LAZY
30
30
 
31
- - name: evaluationDoctor
31
+ - name: EvaluationDoctor
32
32
  auditable: true
33
33
  tableName: evaluation_doctors
34
34
  fields:
@@ -50,7 +50,7 @@ aggregates:
50
50
  type: List<Degrees>
51
51
 
52
52
 
53
- - name: evaluationBranch
53
+ - name: EvaluationBranch
54
54
  tableName: evaluation_branchs
55
55
  auditable: true
56
56
  fields:
@@ -5,7 +5,7 @@
5
5
  aggregates:
6
6
  - name: Order
7
7
  entities:
8
- - name: order
8
+ - name: Order
9
9
  isRoot: true
10
10
  tableName: orders
11
11
  audit:
@@ -67,7 +67,7 @@ aggregates:
67
67
 
68
68
  - name: Customer
69
69
  entities:
70
- - name: customer
70
+ - name: Customer
71
71
  isRoot: true
72
72
  tableName: customers
73
73
  audit:
@@ -5,7 +5,7 @@
5
5
  aggregates:
6
6
  - name: BlogPost
7
7
  entities:
8
- - name: blogPost
8
+ - name: BlogPost
9
9
  isRoot: true
10
10
  tableName: blog_posts
11
11
  auditable: true
@@ -41,7 +41,7 @@ aggregates:
41
41
  cascade: [PERSIST, MERGE, REMOVE]
42
42
  fetch: LAZY
43
43
 
44
- - name: comment
44
+ - name: Comment
45
45
  tableName: comments
46
46
  auditable: true
47
47
  fields:
@@ -5,7 +5,7 @@
5
5
  aggregates:
6
6
  - name: ShoppingCart
7
7
  entities:
8
- - name: shoppingCart
8
+ - name: ShoppingCart
9
9
  isRoot: true
10
10
  tableName: shopping_carts
11
11
  auditable: true
@@ -39,7 +39,7 @@ aggregates:
39
39
  cascade: [PERSIST, MERGE, REMOVE]
40
40
  fetch: LAZY
41
41
 
42
- - name: cartItem
42
+ - name: CartItem
43
43
  tableName: cart_items
44
44
  auditable: true
45
45
  fields: