-
Notifications
You must be signed in to change notification settings - Fork 0
/
schema.cds
107 lines (95 loc) · 2.53 KB
/
schema.cds
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
using { Currency, managed, sap } from '@sap/cds/common';
namespace ghgcds.sample;
entity CarbonEmissions : managed {
key ID : Integer;
ObjectType : String;
ObjectKey : String;
CO2eAmount : Decimal(18, 9);
UnitOfMeasure : String;
EmissionsFrom : DateTime;
EmissionsTo : DateTime;
GHGOrgID : String;
PriorID: String;
}
entity CarbonOffset : managed {
key InternalOffsetID : Integer;
isRetired : Boolean;
isForward : Boolean;
NetworkID : String;
OffsetAmount : Decimal(18, 9);
UnitOfMeasure : String;
TransactionHash : String;
Vintage : Integer;
Region : String;
Methodology : String;
}
type CarbonOffsetType {
InternalOffsetID : Integer;
isRetired : Boolean;
isForward : Boolean;
NetworkID : String;
OffsetAmount : Decimal(18, 9);
UnitOfMeasure : String;
TransactionHash : String;
Vintage : Integer;
Region : String;
Methodology : String;
}
//need to relate retirement to emissions data correctly
entity AtomicCarbonRetirement : managed {
key ACRID : Integer;
NetworkID : String;
OffsetAmount : Decimal(18, 9);
UnitOfMeasure : String;
}
entity GHGOrganization : managed {
key GHGOrganizationID : String;
CompanyCode : String;
Name : String;
Description : String;
emissions : Association to CarbonEmissions on emissions.GHGOrgID = GHGOrganizationID;
}
entity GHGVerifier : managed {
key VerifierID : String;
Description : String;
ContactID : String;
Contact : Association to GHGContact on Contact.ContactID = ContactID;
VerifyingOrgID : String;
VerifyingOrg: Association to GHGOrganization on VerifyingOrg.GHGOrganizationID = VerifyingOrgID;
}
entity GHGContact : managed {
key ContactID : String;
DID : String;
Name : String;
Email : String;
PhoneNumber : String;
}
entity Networks : managed {
key NetworkID : String;
NetworkType: String;
URL : String;
}
type emissionsToken {
TokenID : String;
SmartContractAddress: String;
TransactionHash: String;
NetworkID: String;
}
type scope3Verification {
InternalID : Integer;
ExternalID : Integer;
Scope3TokenID : Integer;
Scope1TokenID : Integer;
Scope3GHGOrgID : String;
Scope1GHGOrgID : String;
Scope3ContractAddress : String;
Scope1ContractAddress : String;
VerificationStatus : Integer;
LastTransactionHash : String;
}
type smartContractUpdate {
TransactionHash : String;
NetworkID: String;
BlockNumber : Integer;
SmartContractAddress : String;
}