Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down