dev.atedeg.mdm.productionplanning

Type members

Classlikes

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

Defines how many days of ripening are needed for a given type of cheese.

Defines how many days of ripening are needed for a given type of cheese.

The events that have to be handled by the bounded context.

The events that have to be handled by the bounded context.

final case class MissingProducts(missingProducts: Map[Product, MissingQuantity])

The products missing from the stock in a given quantity.

The products missing from the stock in a given quantity.

final case class MissingQuantity(n: NonNegativeNumber)

A quantity of a missing product.

A quantity of a missing product.

final case class Order(orderdID: OrderID, requiredBy: LocalDate, orderedProducts: NonEmptyList[OrderedProduct])

A set of requested products with the quantities that have to be produced by the given date.

A set of requested products with the quantities that have to be produced by the given date.

final case class OrderID(id: UUID)

An ID used to uniquely identify an order.

An ID used to uniquely identify an order.

final case class OrderedProduct(product: Product, quantity: Quantity)

A product requested in a given quantity.

A product requested in a given quantity.

The events that may be produced by the bounded context.

The events that may be produced by the bounded context.

final case class ProductToProduce(product: Product, quantity: Quantity)

The quantity of each product to be produced.

The quantity of each product to be produced.

final case class ProductionPlan(productsToProduce: NonEmptyList[ProductToProduce])

All the products to be produced in a day.

All the products to be produced in a day.

final case class Quantity(n: PositiveNumber)

A quantity of something.

A quantity of something.

final case class RipeningDays(days: NonNegativeNumber)

The number of days needed for the ripening process to be done.

The number of days needed for the ripening process to be done.

Value members

Concrete methods

def createProductionPlan[M[_] : CanEmit[OrderDelayed]](missingProducts: MissingProducts, cheeseTypeRipeningDays: CheeseTypeRipeningDays)(previousProductionPlan: Option[ProductionPlan], orders: List[Order]): M[ProductionPlan]

Estimate how many products to produce that day. To do so, takes into account the production plan for the same day of the previous year, the new orders considering the ripening days of each cheese type and the products needed to replenish the stock. If an order cannot be fulfilled since it contains products whose ripening days make it impossible to satisfy the order by the required date, it emits an order delayed event.

Estimate how many products to produce that day. To do so, takes into account the production plan for the same day of the previous year, the new orders considering the ripening days of each cheese type and the products needed to replenish the stock. If an order cannot be fulfilled since it contains products whose ripening days make it impossible to satisfy the order by the required date, it emits an order delayed event.