dev.atedeg.mdm.restocking

Type members

Classlikes

The events handled by this bounded context.

The events handled by this bounded context.

object Main extends IOApp
final case class QuintalsOfIngredient(quintals: WeightInQuintals, ingredient: Ingredient)

An ingredient and a weight in quintals.

An ingredient and a weight in quintals.

final case class QuintalsOfMilk(quintals: PositiveNumber)

A quantity of milk expressed in quintals.

A quantity of milk expressed in quintals.

final case class StockedMilk(quintals: NonNegativeDecimal)

Quintals of stocked milk.

Quintals of stocked milk.

final case class StockedQuantity(quintals: NonNegativeDecimal)

A quantity of a stocked product.

A quantity of a stocked product.

final case class WeightInQuintals(n: PositiveDecimal)

A weight expressed in quintals.

A weight expressed in quintals.

Types

Defines for each ingredient the quantity in stock.

Defines for each ingredient the quantity in stock.

Value members

Concrete methods

def consumeIngredients(stock: Stock)(ingredients: NonEmptyList[QuintalsOfIngredient]): Stock

Given a list of ingredients needed to start a production, it removes that quantity from the stock.

Given a list of ingredients needed to start a production, it removes that quantity from the stock.