Commit Graph

59 Commits

Author SHA1 Message Date
sampadawagde
cbf982f1b9 JAVA-5223: Fix formatting of POMs 2021-05-06 17:14:43 +05:30
Steven van Beelen
e3a2e8f2f2 Use new Axon BOM
Use the Axon BOM to set the versions for the Axon dependencies

#BAEL-4947
2021-04-30 14:47:24 +02:00
johnA1331
44db1b3e3f Update README.md 2021-04-29 05:26:24 +08:00
Steven van Beelen
a5ad7b16e5 Update previous complete test endpoints
The test endpoints used to create an order, add a product, confirm the
order and ship it are not embracing the asynchronous approach of the
CommandGateway. Make sure that all commands are composed with one
another and return the completable future for Spring to resolve

#BAEL-4767
2021-03-19 11:54:20 +01:00
Steven van Beelen
213f6f0f8b Rename API in line with adjusted approach
Change PlaceOrderCommand/OrderPlacedEvent to
CreateOrderCommand/OrderCreatedEvent. Placed suggests it is already
placed, meaning products cannot be changed. However with the new
OrderLine member and its operations it's no longer correct to state the
order placed upon creation. Furthermore, the OrderedProduct is no longer
 a single product, but contains several. Renaming this to Order is more
 in line with what this query model resembles

#BAEL-4767
2021-03-19 11:35:31 +01:00
Steven van Beelen
449fcf5dbb Update http file for testing
Add additional operations to the order-api.http file to simplify testing

#BAEL-4767
2021-03-19 11:24:08 +01:00
Steven van Beelen
f4c62fe737 Allow all operations on the Controller
Add post mappings to allow single creation of an Order, influencing all
aspects of an Order

#BAEL-4767
2021-03-19 11:23:46 +01:00
Steven van Beelen
5ebb8fdcc9 Add aggregate test cases
Add test cases to reach a 100% coverage of all message handling
functions of the OrderAggregate and OrderLine member. Added, upgrade to
JUnit 5

#BAEL-4767
2021-03-19 11:09:48 +01:00
Steven van Beelen
5635c87d38 Update Projection
Add event handlers to update the products map of the OrderedProduct
model

#BAEL-4767
2021-03-19 11:08:42 +01:00
Steven van Beelen
2fc786b499 Update Command Model
Adjust the OrderAggregate to contain an OrderLine aggregate member. The
OrderLine is added as soon as a Product is added through the
AddProductCommand. The OrderLine member is capable of handling the
increment and decrement product count commands, to increase/decrease the
 number of instances for that OrderLine. Decreasing the count below 1
 will publish the ProductRemovedEvent from within the OrderLine.
 Additional business validation is added to unsure a given Product isn't
  added twice (adding a second should go through increment) and that the
   products aren't adjusted as soon as the product is confirmed.

#BAEL-4767
2021-03-19 11:07:26 +01:00
Steven van Beelen
f8a71eb72b Update Exception API
- Introduce a DuplicateOrderLineException to signal whenever somebody
wants to add the same product twice instead of using the increment
command.
- Introduce OrderAlreadyConfirmedException to signal whenever the order
is confirmed, so that adding products and incrementing/decrementing
their count is not possible once the order has been confirmed

#BAEL-4767
2021-03-19 11:04:12 +01:00
Steven van Beelen
452d36949f Update Query API
Change the OrderedProduct model such that it contains a map of products
having the count as its value, instead of a single product.

#BAEL-4767
2021-03-19 11:01:19 +01:00
Steven van Beelen
37106a346f Update Event API
- Adjust OrderPlacedEvent to only construct the order
- Introduce ProductAddedEvent to be able to add several products
to a order
- Introduce ProductCountIncrementedEvent to increase the number of
product instances for a given Order
- Introduce ProductCountDecrementedEvent to increase the number of
product instances for a given Order
- Introduce ProductRemovedEvent to signal whenever all the product count
 drops below 1

#BAEL-4767
2021-03-19 10:59:26 +01:00
Steven van Beelen
7f879019cf Update Command API
- Adjust PlaceOrderCommand to only construct the order
- Introduce AddProductCommand to be able to add several products to an
order
- Introduce IncrementProductCountCommand to increase the number of
product instances for a given Order
- Introduce DecrementProductCountCommand to increase the number of
product instances for a given Order

#BAEL-4767
2021-03-19 10:57:51 +01:00
Steven van Beelen
a04c2dc0ec Update Axon version
Update Axon version to 4.4.7 (current most recent)

#BAEL-4767
2021-03-19 10:53:34 +01:00
amit.pandey
04c9af4965 pom formatting 2020-03-15 18:22:24 +05:30
catalin-burcea
2f7e94bc92 [BAEL-18783] - Fix formatting of POMs 2019-12-06 11:40:56 +02:00
Dhawal Kapil
2c8354eb51 BAEL-17684 POM Properties Cleanup
-Properties cleanup
2019-10-12 19:24:18 +05:30
Josh Cummings
8435d122dc Merge branch 'master' into readme-26 2019-10-02 22:12:09 -06:00
Josh Cummings
e2f6187f35 Update links to https (#7931)
* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* Update README.md

* https added

* https added

* Update README.md

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added

* https added
2019-10-02 20:30:08 +03:00
Sjmillington
83e27dd408 Add README descriptions 26 2019-09-29 17:47:21 +01:00
Steven van Beelen
ce364f6b2e Adjust expected exception
Adjust expected exception from IllegalArgumentException to
UnconfirmedOrderException

BAEL-3099
2019-07-19 16:05:39 +02:00
Steven van Beelen
62d1391db5 Update Axon version
Update Axon version to 4.1.2

BAEL-3099
2019-07-19 16:05:12 +02:00
Steven van Beelen
496c2b1737 Add ProcessingGroup annotation to OrderedProductsEventHandler
Add the ProcessingGroup annotation to OrderedProductsEventHandler so
 that this event handler is grouped in a nicely named Event Processor.
If the app is started in conjunction with Axon Server, this will make
 the set up more evident from the dashboard

BAEL-2435
2019-07-10 13:37:39 +02:00
Steven van Beelen
97ab713024 Create dedicated UnconfirmedOrderException
Create a dedicated UnconfirmedOrderException and use it from the
 OrderAggregate instead of the IllegalStateException

BAEL-2435
2019-07-10 13:27:50 +02:00
Steven van Beelen
65183f082d Update Axon dependency
Update the Axon Framework version to 4.1.1. Additionally, drop the
 exclusion on axon-server-connector, as the page will be adjusted to
 use Axon Server SE.

BAEL-2345
2019-07-10 13:26:48 +02:00
amit2103
a5b5b0fcba [BAEL-12090] - Extract versions into properties 2019-02-04 00:06:11 +05:30
Steven van Beelen
0cf67f5dbe BAEL-2435 Change dependency
Change the autoconfigure dependency to the starter dependency of Axon
2018-12-31 13:45:58 +01:00
Steven van Beelen
03306112bd BAEL-2435 Minor clean ups
-Add toString() function to messages/query-model
-Fix typo in exception
-Reorder event handlers in OrderedProductsEventHandler
-Replace usage of constants for local fields
-Add missing Aggregate test case
2018-12-28 15:58:41 +01:00
Steven van Beelen
d5ad67a801 BAEL-2435 Add http resource
Add http resource to try out all the end points when running the
application in Intellij
2018-12-27 10:47:22 +01:00
Steven van Beelen
4c7303c293 BAEL-2435 Rename main file
Rename main file from MessagesRunner to OrderApplication
2018-12-27 10:46:45 +01:00
Steven van Beelen
769af6759e BAEL-2435 Introduce Query message logic
Introduce a FindAllOrderedProductsQuery query message, which is
published on the QueryGateway through the OrderRestEndpoint and handled
by the OrderedProductsEventHandler
2018-12-27 10:39:42 +01:00
Steven van Beelen
84b6dc1dbb BAEL-2435 Switch domain around
Change the domain from 'Messages' to 'Order' as that domain is better
suited for an example project like this. The Query Model would be better
 suited to revolve around the OrderedProducts rather than just printing
 out a line of text. To that end, add a OrderedProduct model with the
 OrderStatus, which is updated in the (renamed)
 OrderedProductsEventHandler upon all the events
2018-12-27 10:36:10 +01:00
Steven van Beelen
eab6dfe0dd BAEL-2435 Switch domain around
Change the domain from 'Messages' to 'Order' as that domain is better
suited for an example project like this. Update the endpoint to reflect
the order focus i.o. the message focus. Additionally, add a POST
endpoint which would return an exception due to the state check in the
aggregate
2018-12-27 09:55:49 +01:00
Steven van Beelen
bd0a1efe70 BAEL-2435 Switch domain around
Change the domain from 'Messages' to 'Order' as that domain is better
suited for an example project like this. To that end the
MessagesAggregate should be replaced by an OrderAggregate. Additionally,
 add some decision making logic which denies the shipping of an order if
 it hasn't been confirmed yet. Adjust and update thee unit test
 accordingly
2018-12-27 09:51:08 +01:00
Steven van Beelen
2279246a42 BAEL-2435 Switch domain around
Change the domain from 'Messages' to 'Order' as that domain is better
suited for an example project like this. First, update the commands and
events, adding an extra command/event to flesh out the domain some what
2018-12-27 09:39:40 +01:00
Steven van Beelen
557ce65552 BAEL-2435 Update main application
Update the MessagesRunner to be a spring boot application
2018-12-18 15:17:16 +01:00
Steven van Beelen
d8ef050867 BAEL-2435 Add JPA and H2 dependencies
Add JPA and H2 dependencies to allow event sourcing, as for event
sourcing and EventStore is mandatory, and to make an EventStore a
database needs to be present for Axon's auto-configuration
2018-12-18 15:16:31 +01:00
Steven van Beelen
fe30c44889 BAEL-2435 Add a GUI
-Add spring-boot-starter-web to support rest endpoints
-Add a rest endpoint to spoof some form of UI to publish a message, as
the old main will no longer publish the commands upon start up
2018-12-18 15:15:23 +01:00
Steven van Beelen
e731b95ffb BAEL-2435 Rename unit test class
Rename unit test class to actual contain 'UnitTest' per the defined
standards
2018-12-18 15:01:29 +01:00
Steven van Beelen
2b07c0364d BAEL-2435 Change event message package
Change the package of the event messages to coreapi.events to signal
 that the events are part of the API you'd share with the outside
2018-12-18 14:56:23 +01:00
Steven van Beelen
96945027a1 BAEL-2435 Change command message package
Change the package of the command messages to coreapi.commands to signal
 that the commands are part of the API you'd share with the outside
2018-12-18 14:55:28 +01:00
Steven van Beelen
aaf2ef2227 BAEL-2435 Change eventhandlers package
Change eventhandlers package to querymodel package per best practices
2018-12-18 14:54:07 +01:00
Steven van Beelen
00b297a4d0 BAEL-2435 Rename aggregate test
Rename aggregate test from MessagesAggregateIntegrationTest to
MessagesAggregateTest, as it's not an integration test but a regular
unit test
2018-12-18 14:53:43 +01:00
Steven van Beelen
3e3210a803 BAEL-2435 Change aggregate package
-Change aggregate package to commandmodel package per best practice
-Move the aggregate test to the same package for the test directory
2018-12-18 14:52:54 +01:00
Steven van Beelen
3553fb7506 BAEL-2435 Update commands and events
-Change TargetAggregateIdentifier import statement to the new location
-Add equals/hashcode as best practice for commands and events
-Add description
-Change parent to parent-boot-2 to leverage a spring boot start up
approach
2018-12-18 14:49:30 +01:00
Steven van Beelen
11b1112771 BAEL-2435 Update the event handler
Change the event handler to become a spring service, as this way Axon
will automatically pick it up as an event handling component
2018-12-18 14:48:10 +01:00
Steven van Beelen
bd4881d478 BAEL-2435 Update Aggregate in regards to latest axon version
-Replace old import statements for the new locations
-Mark the aggregate as @Aggregate to make it autowired through the
spring boot starter
-Move all command handlers/decision making functions to the top of the
file
-Rename the command handler to `handle` as a best practice for command
handlers
-Use @EventSourcingHandler i.o. @EventHandler as a best practice for
event handlers in Aggregates, as those only are used to 'source' the
aggregate
-Update test case according to latest standards
2018-12-18 14:47:23 +01:00
Steven van Beelen
cf56b33b9b BAEL-2435 Update pom file
-Add description
-Change parent to parent-boot-2 to leverage a spring boot start up
approach
-Replace core dependency for axon-spring-boot-autoconfigure excluding
axon-server as we cant start that up for this use case
-Add spring-boot-autoconfigure dependency
-Adjust the axon version to 4.0.3
2018-12-18 14:43:32 +01:00
Dhawal Kapil
4058bfc601 BAEL-9567 Align module names, folder names and artifact id
- Added "name" in pom.xml whereever it was missing and aligned the present ones with the artifactid and foldername
2018-11-30 22:16:08 +05:30