Package-level declarations

Types

Link copied to clipboard
data class AddCartItem(val productId: String, val quantity: Int = 1)

Creates the customer's cart with its first product, as 9.x did, or adds to it.

Link copied to clipboard
data class AddressChanged(val shippingAddress: ShippingAddress)
Link copied to clipboard

The 9.x cart's decisions: a customer's cart, at most MAX_ITEMS products.

Link copied to clipboard
data class CartItem(val productId: String, val quantity: Int)
Link copied to clipboard
data class CartItemAdded(val added: CartItem)
Link copied to clipboard
data class CartItemRemoved(val productIds: Set<String>)
Link copied to clipboard
data class CartQuantityChanged(val changed: CartItem)
Link copied to clipboard

The 9.x CartSaga: an order created from a cart removes its products from the customer's cart (the order's owner). Its subscription, CartSaga.onOrderCreated, is where the 9.x compensation service's unresolved executions of the 9.x CartSaga.onOrderCreated are parked by the import (.4).

Link copied to clipboard
class CartState

The 9.x cart's state; its id is the ref's, the customer's id, in V10.

Link copied to clipboard
data class ChangeAddress(val shippingAddress: ShippingAddress)
Link copied to clipboard
data class ChangeQuantity(val productId: String, val quantity: Int)
Link copied to clipboard
data class CreateOrder(val items: List<CreateOrderItem>, val address: ShippingAddress, val fromCart: Boolean)
Link copied to clipboard
data class CreateOrderItem(val productId: String, val price: BigDecimal, val quantity: Int)
Link copied to clipboard
@BoundedContext(name = "example", description = "The 9.x example's orders and carts, ported for the migration rehearsal")
object ExampleBoundedContext

The 9.x example (example-service, on the v10-9x-baseline branch) ported to V10 for the blue-green rehearsal only: its order and cart, their commands and events by the names migration-map.json gives them.

Link copied to clipboard
@AggregateRoot(retiredEvents = ["OrderPayDuplicated", "OrderOverPaid"])
class Order(state: OrderState)

The 9.x order's decisions. A payment beyond what remains, or of an order no longer created, is rejected, where 9.x recorded OrderOverPaid and OrderPayDuplicated for its payment service to refund: this port retires those two events, so the 9.x history that holds them still loads.

Link copied to clipboard
@Revision(value = 2)
data class OrderCreated(val items: List<OrderItem>, val address: ShippingAddress, val fromCart: Boolean)

Revision 2: the 9.x orderId field is the stream's ref now; upgradeOrderCreatedFrom1 reads the 9.x shape.

Link copied to clipboard
data class OrderItem(val id: String, val productId: String, val price: BigDecimal, val quantity: Int)
Link copied to clipboard
data class OrderPaid(val amount: BigDecimal, val paid: Boolean)
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

The 9.x order's state, field for field; its id is the ref's in V10.

Link copied to clipboard
Link copied to clipboard
data class OrderTagged(val region: String? = null, val teams: Set<String> = emptySet())

The order's region and teams, which the 9.x default_resource_tags_applied set (migration-map.json maps it).

Link copied to clipboard
data class PayOrder(val paymentId: String, val amount: BigDecimal)
Link copied to clipboard
Link copied to clipboard
data class RemoveCartItem(val productIds: Set<String>)
Link copied to clipboard
class ShipOrder
Link copied to clipboard
data class ShippingAddress(val country: String, val province: String, val city: String, val district: String, val detail: String)
Link copied to clipboard
data class TagOrder(val region: String? = null, val teams: Set<String> = emptySet())

Tags the order with a region and teams, as 9.x's ApplyResourceTags did: both together, the region left out for none, as 9.x replaced the whole map.

Functions

Link copied to clipboard
@Upgrade(event = OrderCreated::class, from = 1)
fun upgradeOrderCreatedFrom1(node: ObjectNode): ObjectNode

The 9.x order_created (revision 1 in V10) named the order in orderId, which the ref is now.