-
Notifications
You must be signed in to change notification settings - Fork 8
/
interfaces.ts
41 lines (35 loc) · 967 Bytes
/
interfaces.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import { BigNumber } from '@ethersproject/bignumber';
export interface IConsumerPriority {
consumerId: string;
generatorPriority: IGeneratorPreference[][];
}
export interface IGeneratorPreference {
generatorId: string;
}
export interface IConsumption {
id: string;
volume: BigNumber;
}
export interface IGeneration {
id: string;
volume: BigNumber;
certificateId: number;
}
export interface IMatchingInput<T extends IConsumption, U extends IGeneration> {
consumptions: T[];
generations: U[];
}
export interface IMatchingOutput<T extends IConsumption, U extends IGeneration> {
matches: IMatch<T, U>[];
leftoverConsumptions: T[];
excessGenerations: U[];
}
export interface IMatch<IConsumptionEntity, IGenerationEntity> {
volume: BigNumber;
consumption: Omit<IConsumptionEntity, 'volume'>;
generation: Omit<IGenerationEntity, 'volume'>;
}
export interface ITimeFrame {
from: Date;
to: Date;
}