diff --git a/tutorial/step_2_business_language/src/Morphir/Example/App/App.elm b/tutorial/step_2_business_language/src/Morphir/Example/App/App.elm index 700049c..2f954a0 100644 --- a/tutorial/step_2_business_language/src/Morphir/Example/App/App.elm +++ b/tutorial/step_2_business_language/src/Morphir/Example/App/App.elm @@ -1,24 +1,24 @@ module Morphir.Example.App.App exposing (..) -import Morphir.Example.App.Analytics as Analytics +import Morphir.Example.App.Analytics exposing (..) import Morphir.Example.App.BusinessTerms exposing (..) import Morphir.Example.App.Forecast exposing (..) import Morphir.Example.App.Rentals exposing (..) import Morphir.Example.App.Winds exposing (..) -processRequest : Forecast -> CurrentInventory -> ExistingReservations -> ReservationQuantity -> CanceledQuantity -> PendingReturns -> RequestedQuantity -> AllowPartials -> Result Reason ReservationQuantity -processRequest forecast inventory reservations reservationQuantity canceledQuantity returns requestedQuantity allowPartials = +main : Forecast -> CurrentInventory -> ExistingReservations -> ReservationQuantity -> CanceledQuantity -> PendingReturns -> RequestedQuantity -> AllowPartials -> Result Reason ReservationQuantity +main forecast inventory reservations reservationQuantity canceledQuantity returns requestedQuantity allowPartials = let windCategory : WindCategory windCategory = categorizeWindForForecast forecast - probableReservations : ReservationQuantity -> ProbableReservations - probableReservations = - Analytics.probableReservations reservationQuantity canceledQuantity + estimatedReservations : ProbableReservations + estimatedReservations = + probableReservations reservationQuantity canceledQuantity reservations in - decide windCategory forecast.shortForcast inventory (probableReservations reservations) returns requestedQuantity allowPartials + decide windCategory forecast.shortForcast inventory estimatedReservations returns requestedQuantity allowPartials categorizeWindForForecast : Forecast -> WindCategory diff --git a/tutorial/step_2_business_language/src/Morphir/Example/App/Rentals.elm b/tutorial/step_2_business_language/src/Morphir/Example/App/Rentals.elm index 737e84d..5f1b100 100644 --- a/tutorial/step_2_business_language/src/Morphir/Example/App/Rentals.elm +++ b/tutorial/step_2_business_language/src/Morphir/Example/App/Rentals.elm @@ -9,16 +9,7 @@ decide : WindCategory -> ForecastDetail -> CurrentInventory -> ProbableReservati decide windCategory forecastDetail inventory probableReservations returns requestedQuantity allowPartials = let isClosed : Bool - isClosed = - case ( windCategory, forecastDetail ) of - ( DangerousWinds, _ ) -> - True - - ( _, Thunderstorms ) -> - True - - _ -> - False + isClosed = (windCategory == DangerousWinds) || (forecastDetail == Thunderstorms) availability : Availability availability =