dev.atedeg.mdm.milkplanning

Type members

Classlikes

Events managed by the bounded context.

Events managed by the bounded context.

Events sent by the bounded context.

Events sent by the bounded context.

final case class ProcessedMilk(quantity: QuintalsOfMilk)

The quintals of milk processed in order to produce cheese.

The quintals of milk processed in order to produce cheese.

final case class Quantity(n: PositiveNumber)

A quantity of something.

A quantity of something.

final case class QuintalsOfMilk(quintals: NonNegativeNumber)

A quantity of milk expressed in quintals.

A quantity of milk expressed in quintals.

final case class RequestedProduct(product: Product, quantity: Quantity, requiredBy: LocalDateTime)

A product requested in a given quantity that has to be produced by the given date.

A product requested in a given quantity that has to be produced by the given date.

final case class StockedQuantity(quantity: NonNegativeNumber)

A quantity of a stocked product, it may also be zero.

A quantity of a stocked product, it may also be zero.

final case class Yield(n: PositiveDecimal)

A decimal that represents the yield of milk when producing a given cheese type: i.e. to produce n quintals of a given cheese type, yield of cheese type * n quintals of milk must be used.

A decimal that represents the yield of milk when producing a given cheese type: i.e. to produce n quintals of a given cheese type, yield of cheese type * n quintals of milk must be used.

Types

It defines, for each cheese type, the yield of milk when producing it.

It defines, for each cheese type, the yield of milk when producing it.

It defines, for each product, the quantity available in stock.

It defines, for each product, the quantity available in stock.

Value members

Concrete methods

def estimateQuintalsOfMilk[M[_] : Monad](milkOfPreviousYear: QuintalsOfMilk, requestedProductsForWeek: List[RequestedProduct], currentStock: Stock, recipeBook: RecipeBook, stockedMilk: QuintalsOfMilk): M[QuintalsOfMilk]

Estimate the amount of milk needed for the following week's production. The estimate takes into account the milk processed in the same week last year, the products ordered for the following week, the current stock and the quintals of milk currently in stock and return the quintals of milk needed for the following week.

Estimate the amount of milk needed for the following week's production. The estimate takes into account the milk processed in the same week last year, the products ordered for the following week, the current stock and the quintals of milk currently in stock and return the quintals of milk needed for the following week.