This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun sumOf( | |
first: CustomerAllocatedCapacity, | |
second: CustomerAllocatedCapacity | |
): List<CustomerAllocatedCapacity> { | |
... | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface CustomerAllocatedCapacity { | |
val id: CustomerAllocatedCapacityId | |
val allocationStartInstant: Instant | |
val allocationEndInstant: Instant | |
val quantity: EnergyQuantity | |
fun add(other: CustomerAllocatedCapacity): CustomerAllocatedCapacity | |
fun subtract(other: CustomerAllocatedCapacity): CustomerAllocatedCapacity |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun sum(values: List<QuantityOverDateRange>): List<QuantityOverDateRange> { | |
// ... | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CustomerAllocatedCapacity( | |
val id: CustomerAllocatedCapacityId, | |
val allocationStartInstant: Instant, | |
val allocationEndInstant: Instant, | |
val quantity: EnergyQuantity | |
) { | |
val allocationPeriod | |
get () = DateRange(allocationStartInstant, allocationEndInstant) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(id , contrat , parent) | |
[-----------100------------] (ca1 , cédant , ) | |
[-------100---------] (ca2 , cédant , ) | |
[-------200---------] (cos1, cédant , ) | |
[-100-] (cos2, cédant , ) | |
[--------200--------] (cc , customer1 => customer2, ) | |
[--------100--------] ( , cessionnaire , ca1 ) | |
[--------100--------] ( , cessionnaire , ca2 ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface QuantityOverDateRange { | |
val dateRange: DateRange | |
val quantity: Quantity | |
val groupId: String? | |
fun startBefore(period: DateRange): Boolean | |
fun endAfter(period: DateRange): Boolean | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data class SubtractionResult( | |
val remainingRanges: List<QuantityOverDateRange>, | |
val changes: List<Change>, | |
) {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface QuantityOverDateRange { | |
val dateRange: DateRange | |
val quantity: Quantity | |
val groupId: String? | |
fun subtract(subtrahend: QuantityOverDateRange): SubtractionResult | |
fun add(value: QuantityOverDateRange): List<QuantityOverDateRange> | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface QuantityOverDateRange { | |
val dateRange: DateRange | |
val quantity: Quantity | |
val groupId: String? | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Value | |
@Builder | |
public class Person { | |
String firstName; | |
String lastName; | |
Integer age; | |
} |
NewerOlder