Skip to content

Commit a2e0174

Browse files
committed
feat: define incoming and outgoing events
1 parent ebc1f8d commit a2e0174

File tree

1 file changed

+16
-3
lines changed
  • milk-planning/src/main/scala/dev/atedeg/mdm/milkplanning/types

1 file changed

+16
-3
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,24 @@
11
package dev.atedeg.mdm.milkplanning.types
22

3+
import cats.data.NonEmptyList
4+
35
import dev.atedeg.mdm.products.Product
46

7+
/**
8+
* Events managed by the bounded context.
9+
*/
510
enum IncomingEvent:
6-
case ProductRemovedFromStock(product: Product)
7-
case ProductAddedToStock(product: Product)
8-
case RestockedMilk(quintalsOfMilk: QuintalsOfMilk)
11+
/**
12+
* Event representing an order placed used to estimate the [[QuintalsOfMilk quintals of milk]] to be ordered.
13+
*/
14+
case ReceivedOrder(products: NonEmptyList[RequestedProduct])
915

16+
/**
17+
* Events sent by the bounded context.
18+
*/
1019
enum OutgoingEvent:
20+
/**
21+
* Event to order the [[QuintalsOfMilk quintals of milk]] needed for the next week.
22+
* This event is emitted every week on saturday.
23+
*/
1124
case OrderMilk(n: QuintalsOfMilk)

0 commit comments

Comments
 (0)