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.
- package/AGENTS.md +441 -14
- package/DOMAIN_YAML_GUIDE.md +425 -21
- package/FUTURE_FEATURES.md +315 -115
- package/QUICK_REFERENCE.md +101 -153
- package/README.md +77 -70
- package/bin/eva4j.js +57 -1
- package/config/defaults.json +3 -0
- package/docs/commands/GENERATE_ENTITIES.md +662 -1968
- package/docs/commands/GENERATE_HTTP_EXCHANGE.md +274 -450
- package/docs/commands/GENERATE_KAFKA_EVENT.md +219 -498
- package/docs/commands/GENERATE_KAFKA_LISTENER.md +18 -18
- package/docs/commands/GENERATE_RECORD.md +335 -311
- package/docs/commands/GENERATE_TEMPORAL_ACTIVITY.md +174 -0
- package/docs/commands/GENERATE_TEMPORAL_FLOW.md +237 -0
- package/docs/commands/GENERATE_USECASE.md +216 -282
- package/docs/commands/INDEX.md +36 -7
- package/examples/doctor-evaluation.yaml +3 -3
- package/examples/domain-audit-complete.yaml +2 -2
- package/examples/domain-collections.yaml +2 -2
- package/examples/domain-ecommerce.yaml +2 -2
- package/examples/domain-events.yaml +201 -0
- package/examples/domain-field-visibility.yaml +11 -5
- package/examples/domain-multi-aggregate.yaml +12 -6
- package/examples/domain-one-to-many.yaml +1 -1
- package/examples/domain-one-to-one.yaml +1 -1
- package/examples/domain-secondary-onetomany.yaml +1 -1
- package/examples/domain-secondary-onetoone.yaml +1 -1
- package/examples/domain-simple.yaml +1 -1
- package/examples/domain-soft-delete.yaml +3 -3
- package/examples/domain-transitions.yaml +1 -1
- package/examples/domain-value-objects.yaml +1 -1
- package/package.json +2 -2
- package/src/commands/add-kafka-client.js +3 -1
- package/src/commands/add-temporal-client.js +286 -0
- package/src/commands/generate-entities.js +75 -4
- package/src/commands/generate-kafka-event.js +273 -89
- package/src/commands/generate-temporal-activity.js +228 -0
- package/src/commands/generate-temporal-flow.js +216 -0
- package/src/generators/module-generator.js +1 -0
- package/src/generators/shared-generator.js +26 -0
- package/src/utils/yaml-to-entity.js +93 -4
- package/templates/aggregate/AggregateRepository.java.ejs +3 -2
- package/templates/aggregate/AggregateRepositoryImpl.java.ejs +15 -7
- package/templates/aggregate/AggregateRoot.java.ejs +38 -2
- package/templates/aggregate/DomainEntity.java.ejs +6 -2
- package/templates/aggregate/DomainEventHandler.java.ejs +62 -0
- package/templates/aggregate/DomainEventRecord.java.ejs +50 -0
- package/templates/aggregate/JpaAggregateRoot.java.ejs +3 -1
- package/templates/aggregate/JpaEntity.java.ejs +3 -1
- package/templates/base/docker/kafka-services.yaml.ejs +2 -2
- package/templates/base/docker/temporal-services.yaml.ejs +29 -0
- package/templates/base/resources/parameters/develop/temporal.yaml.ejs +9 -0
- package/templates/base/resources/parameters/local/temporal.yaml.ejs +9 -0
- package/templates/base/resources/parameters/production/temporal.yaml.ejs +9 -0
- package/templates/base/resources/parameters/test/temporal.yaml.ejs +9 -0
- package/templates/base/root/AGENTS.md.ejs +916 -51
- package/templates/crud/Controller.java.ejs +36 -6
- package/templates/crud/ListQuery.java.ejs +6 -2
- package/templates/crud/ListQueryHandler.java.ejs +24 -10
- package/templates/crud/UpdateCommand.java.ejs +52 -0
- package/templates/crud/UpdateCommandHandler.java.ejs +105 -0
- package/templates/kafka-event/DomainEventHandlerMethod.ejs +1 -0
- package/templates/kafka-event/Event.java.ejs +23 -0
- package/templates/shared/application/dtos/PagedResponse.java.ejs +30 -0
- package/templates/shared/configurations/temporalConfig/TemporalConfig.java.ejs +104 -0
- package/templates/shared/domain/DomainEvent.java.ejs +40 -0
- package/templates/shared/interfaces/HeavyActivity.java.ejs +4 -0
- package/templates/shared/interfaces/LightActivity.java.ejs +4 -0
- package/templates/temporal-activity/ActivityImpl.java.ejs +14 -0
- package/templates/temporal-activity/ActivityInterface.java.ejs +11 -0
- package/templates/temporal-flow/WorkFlowImpl.java.ejs +64 -0
- package/templates/temporal-flow/WorkFlowInterface.java.ejs +19 -0
- package/templates/temporal-flow/WorkFlowService.java.ejs +49 -0
|
@@ -1,282 +1,216 @@
|
|
|
1
|
-
# Command `generate usecase` (alias: `g usecase`)
|
|
2
|
-
|
|
3
|
-
##
|
|
4
|
-
|
|
5
|
-
Generates CQRS use cases (Commands or Queries) with their
|
|
6
|
-
|
|
7
|
-
##
|
|
8
|
-
|
|
9
|
-
Create individual use cases for specific business operations, maintaining clear separation between write operations (Commands) and read operations (Queries).
|
|
10
|
-
|
|
11
|
-
##
|
|
12
|
-
|
|
13
|
-
```bash
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
### Parameters
|
|
19
|
-
|
|
20
|
-
| Parameter | Required | Description |
|
|
21
|
-
|-----------|----------|-------------|
|
|
22
|
-
| `
|
|
23
|
-
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
```
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
-
|
|
209
|
-
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
-
|
|
215
|
-
-
|
|
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
|
package/docs/commands/INDEX.md
CHANGED
|
@@ -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
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
42
|
+
- name: CartItem
|
|
43
43
|
tableName: cart_items
|
|
44
44
|
auditable: true
|
|
45
45
|
fields:
|