-
Notifications
You must be signed in to change notification settings - Fork 0
/
us2.feature
142 lines (139 loc) · 3.54 KB
/
us2.feature
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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
Feature: User Story 2
As a buyer:
- I want to review the product emissions which I am buying.
- I want to trace all of the upstream emissions of an asset.
- I want to filter emissions based on date and emission category
Scenario: Buyer reviews and follows the chain of emissions for an asset
Given A "Seller" creates an asset that is split into child assets where the assets are defined as:
"""
[
{
"metadata": {
"weight": 100
},
"emissions": [
{
"emission_category": "Upstream",
"dataSource": "Some Algorithm",
"value": 15,
"date": 1682632800
}
]
},
{
"metadata": {
"weight": 50
},
"emissions": [
{
"emission_category": "Upstream",
"dataSource": "Some Algorithm",
"value": 10,
"date": 1705040054
}
]
},
{
"metadata": {
"weight": 25
},
"emissions": [
{
"emission_category": "Upstream",
"dataSource": "Some Algorithm",
"value": 5,
"date": 1755040054
},
{
"category": "Process",
"dataSource": "Some Algorithm",
"balanced": true,
"value": 5,
"date": 1755040054
}
]
},
{
"metadata": {
"weight": 15
},
"emissions": [
{
"emission_category": "Process",
"dataSource": "Some Algorithm",
"value": 5,
"date": 1765040054
}
]
}
]
"""
When "Buyer" performs a query on the asset with ID 4
Then The emissions can be calculated offchain for "Upstream" emissions between the dates 1700000000 and 1900000000 and weight 100 with the total equal to 1500 based on the following:
"""
[
{
"assetId": 4,
"metadata": "0x7b22776569676874223a31357d",
"emissions": [
{
"category": "Process",
"dataSource": "0x536f6d6520416c676f726974686d",
"balanced": true,
"value": 5,
"date": 1765040054
}
],
"parent": 3
},
{
"assetId": 3,
"metadata": "0x7b22776569676874223a32357d",
"emissions": [
{
"category": "Upstream",
"dataSource": "0x536f6d6520416c676f726974686d",
"balanced": true,
"value": 5,
"date": 1755040054
},
{
"category": "Process",
"dataSource": "0x536f6d6520416c676f726974686d",
"balanced": true,
"value": 5,
"date": 1755040054
}
],
"parent": 2
},
{
"assetId": 2,
"metadata": "0x7b22776569676874223a35307d",
"emissions": [
{
"category": "Upstream",
"dataSource": "0x536f6d6520416c676f726974686d",
"balanced": true,
"value": 10,
"date": 1705040054
}
],
"parent": 1
},
{
"assetId": 1,
"metadata": "0x7b22776569676874223a3130307d",
"emissions": [
{
"category": "Upstream",
"dataSource": "0x536f6d6520416c676f726974686d",
"balanced": true,
"value": 15,
"date": 1682632800
}
],
"parent": null
}
]
"""