Skip to content

Instantly share code, notes, and snippets.

@mohamed-gara
Created February 26, 2022 21:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mohamed-gara/7b917de09b9d7e11d7614d2c569830b7 to your computer and use it in GitHub Desktop.
Save mohamed-gara/7b917de09b9d7e11d7614d2c569830b7 to your computer and use it in GitHub Desktop.
class CustomerAllocatedCapacity(
val id: CustomerAllocatedCapacityId,
val allocationStartInstant: Instant,
val allocationEndInstant: Instant,
val quantity: EnergyQuantity
) {
val allocationPeriod
get () = DateRange(allocationStartInstant, allocationEndInstant)
fun asQuantityOverDateRange() = QuantityOverDateRange(allocationPeriod, quantity.inKwhj25(), id)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment