dev.atedeg.mdm.production

Type members

Classlikes

final case class BatchID(ID: UUID)

An ID used to uniquely identify a batch of cheese.

An ID used to uniquely identify a batch of cheese.

final case class CheeseTypeRipeningDays(value: Map[CheeseType, RipeningDays])

For each cheese type, associates its ripening days.

For each cheese type, associates its ripening days.

final case class MissingRecipe(forType: CheeseType)

Error raised in case there is no recipe for a given cheese type.

Error raised in case there is no recipe for a given cheese type.

final case class NumberOfUnits(n: PositiveNumber)

Counts the number of units of something.

Counts the number of units of something.

The events that may be produced by the bounded context.

The events that may be produced by the bounded context.

final case class ProductionID(ID: UUID)

An ID used to uniquely identify a production.

An ID used to uniquely identify a production.

final case class ProductionPlan(plan: NonEmptyList[ProductionPlanItem])

A production plan that specifies how many units of products need to be produced.

A production plan that specifies how many units of products need to be produced.

final case class ProductionPlanItem(productToProduce: Product, units: NumberOfUnits)

A single line of a production plan that specifies a product and how many units of it to produce.

A single line of a production plan that specifies a product and how many units of it to produce.

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 Recipe(lines: NonEmptyList[QuintalsOfIngredient])

A list of ingredients and the respective quintals needed to produce a quintal of a product.

A list of ingredients and the respective quintals needed to produce a quintal of a product.

final case class RecipeBook(recipeBook: Map[CheeseType, Recipe])

Associates to each cheese type the recipe to produce a quintal of it.

Associates to each cheese type the recipe to produce a quintal of it.

final case class RipeningDays(days: NonNegativeNumber)

The number of days a cheese type has to ripen before being ready.

The number of days a cheese type has to ripen before being ready.

final case class WeightInQuintals(n: PositiveDecimal)

A weight expressed in quintals.

A weight expressed in quintals.

Value members

Concrete methods

def endProduction[M[_] : Emits[NewBatch]](ripeningDays: CheeseTypeRipeningDays)(production: InProgress): M[Ended]

Ends a production by assigning it a batch ID.

Ends a production by assigning it a batch ID.

def setupProductions(productionPlan: ProductionPlan): NonEmptyList[ToStart]

Prepares the new productions to start from a given production plan.

Prepares the new productions to start from a given production plan.

def startProduction[M[_] : Emits[StartProduction]](recipeBook: RecipeBook)(production: ToStart): M[InProgress]

Starts a production by calculating the quintals of ingredients needed to produce the specified product; the ingredients needed are specified by the recipe read from a recipe book.

Starts a production by calculating the quintals of ingredients needed to produce the specified product; the ingredients needed are specified by the recipe read from a recipe book.