package com.ing.baker.tutorials

import com.ing.baker.recipe.javadsl.InteractionDescriptor
import com.ing.baker.recipe.javadsl.Recipe
import com.ing.baker.tutorials.events.SensoryEvents.*
import com.ing.baker.tutorials.events.ShipGoodsEvents
import com.ing.baker.tutorials.interactions.ManufactureGoods
import com.ing.baker.tutorials.interactions.SendInvoice
import com.ing.baker.tutorials.interactions.ShipGoods
import com.ing.baker.tutorials.interactions.ValidateOrder

class WebShopRecipe {
    companion object {
        fun getRecipe(): Recipe {
            return Recipe("Webshop")
                .withSensoryEvents(OrderPlaced::class.java, PaymentMade::class.java, CustomerInfoReceived::class.java)
                .withInteractions(
                    InteractionDescriptor.of(ValidateOrder::class.java),
                    InteractionDescriptor.of(ManufactureGoods::class.java).withRequiredEvent(PaymentMade::class.java),
                    InteractionDescriptor.of(ShipGoods::class.java),
                    InteractionDescriptor.of(SendInvoice::class.java)
                        .withRequiredEvent(ShipGoodsEvents.GoodsShipped::class.java)
                )
        }
    }
}