-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
RSWW-56 transport-service: add write part of cqrs
Signed-off-by: Paweł Cichowski <[email protected]>
- Loading branch information
1 parent
a81d662
commit b9c8b91
Showing
7 changed files
with
76 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
...n/java/org/microarchitecturovisco/transport/model/cqrs/aggregates/TransportAggregate.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package org.microarchitecturovisco.transport.model.cqrs.aggregates; | ||
|
||
import lombok.RequiredArgsConstructor; | ||
import org.microarchitecturovisco.transport.model.cqrs.commands.CreateTransportCommand; | ||
import org.microarchitecturovisco.transport.model.cqrs.commands.UpdateTransportCommand; | ||
import org.microarchitecturovisco.transport.model.domain.Transport; | ||
import org.microarchitecturovisco.transport.repositories.TransportRepository; | ||
import org.springframework.stereotype.Component; | ||
|
||
@RequiredArgsConstructor | ||
@Component | ||
public class TransportAggregate { | ||
|
||
private TransportRepository transportRepository; | ||
|
||
public Transport handleCreateTransportCommand(CreateTransportCommand command) { | ||
|
||
// TODO create transport logic | ||
return null; | ||
} | ||
|
||
public Transport handleUpdateTransportCommand(UpdateTransportCommand command) { | ||
// TODO update transport logic | ||
return null; | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
...java/org/microarchitecturovisco/transport/model/cqrs/commands/CreateTransportCommand.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package org.microarchitecturovisco.transport.model.cqrs.commands; | ||
|
||
import org.microarchitecturovisco.transport.model.dto.TransportDto; | ||
|
||
import java.time.LocalDateTime; | ||
|
||
public class CreateTransportCommand { | ||
private String uuid; | ||
private LocalDateTime commandCreatedTime; | ||
|
||
private TransportDto transportDto; | ||
} |
16 changes: 16 additions & 0 deletions
16
...java/org/microarchitecturovisco/transport/model/cqrs/commands/UpdateTransportCommand.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package org.microarchitecturovisco.transport.model.cqrs.commands; | ||
|
||
import lombok.Builder; | ||
import lombok.Data; | ||
import org.microarchitecturovisco.transport.model.dto.TransportDto; | ||
|
||
import java.time.LocalDateTime; | ||
|
||
@Data | ||
@Builder | ||
public class UpdateTransportCommand { | ||
private String uuid; | ||
private LocalDateTime commandCreatedTime; | ||
|
||
private TransportDto transportDto; | ||
} |
11 changes: 11 additions & 0 deletions
11
...java/org/microarchitecturovisco/transport/model/cqrs/projections/TransportProjection.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package org.microarchitecturovisco.transport.model.cqrs.projections; | ||
|
||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.stereotype.Component; | ||
|
||
@RequiredArgsConstructor | ||
@Component | ||
public class TransportProjection { | ||
|
||
|
||
} |
5 changes: 5 additions & 0 deletions
5
...src/main/java/org/microarchitecturovisco/transport/model/cqrs/queries/QueryTransport.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package org.microarchitecturovisco.transport.model.cqrs.queries; | ||
|
||
public class QueryTransport { | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters