-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathcomplex.json
More file actions
344 lines (344 loc) · 15.3 KB
/
Copy pathcomplex.json
File metadata and controls
344 lines (344 loc) · 15.3 KB
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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
{
"0": {
"schema": {
"type": "record",
"name": "AccountMigrationEvent",
"namespace": "uk.co.boostpower.support.kafka.messages",
"doc": "Account migration related events. It describes several flows: 1. Happy path: AccountMigrationScheduledEvent -> BalanceRetrievedMigrationEvent -> AccountMigrationValidatedEvent -> AccountMigrationCompletedEvent 2. Cancel where the migration is about the be restarted: AccountMigrationScheduledEvent -> BalanceRetrievedMigrationEvent -> AccountMigrationCancelledEvent -> Start from the beginning, AccountMigrationScheduledEvent -> AccountMigrationCancelledEvent -> Start from the beginning 3. Rollback: AccountMigrationScheduledEvent -> BalanceRetrievedMigrationEvent -> AccountMigrationValidatedEvent -> AccountMigrationCompletedEvent -> AccountMigrationRollBackInitiatedEvent -> AccountMigrationRolledBackEvent -> Start from the beginning AccountMigrationScheduledEvent generates a flow id which is used in every subsequent migration message to be grouped together",
"fields": [
{
"name": "event",
"type": [
{
"type": "record",
"name": "AccountMigrationCancelledEvent",
"doc": "Triggered by Migration Service. Before T2 signals that a siemens account migration has been cancelled. Migration is about to be restarted for the same account that means a new AccountMigrationScheduledEvent with a new flow id will be sent.Consumers should not react on this in normal case.",
"fields": [
{
"name": "metadata",
"type": {
"type": "record",
"name": "EventMetadata",
"namespace": "com.ovoenergy.kafka.common.event",
"doc": "Metadata, to be used in each event class",
"fields": [
{
"name": "eventId",
"type": "string",
"doc": "A globally unique ID for this Kafka message"
},
{
"name": "traceToken",
"type": "string",
"doc": "An ID that can be used to link all the requests and Kafka messages in a given transaction. If you already have a trace token from a previous event/request, you should copy it here. If this is the very start of a transaction, you should generate a fresh trace token and put it here. A UUID is suitable"
},
{
"name": "createdAt",
"type": {
"type": "long",
"logicalType": "timestamp-millis"
},
"doc": "A timestamp for when the event was created (in epoch millis)"
}
]
}
},
{
"name": "enrollmentId",
"type": "string",
"doc": "Globally unique identifier for the enrollment"
},
{
"name": "accountId",
"type": "string",
"doc": "Unique identifier for the customer. GentrackId/SiemensId. Usually 7 digits."
},
{
"name": "mpan",
"type": "string",
"doc": "The unique national reference for Meter Point Administration Number"
},
{
"name": "effectiveEnrollmentDate",
"type": {
"type": "int",
"logicalType": "date"
},
"doc": "The date when the account is going to be enrolled for the new balance platform (in epoch days)"
},
{
"name": "cancelledAt",
"type": {
"type": "long",
"logicalType": "timestamp-millis"
},
"doc": "The time when the migration was cancelled (in epoch millis)"
}
]
},
{
"type": "record",
"name": "AccountMigrationCompletedEvent",
"doc": "Triggered by SMILE. After SMILE processed the AccountMigrationValidatedEvent and switched over to Billy from Siemens they trigger this event to inform consumers like BIT CSA portal and Salesforce to do the necessary steps for the switchover",
"fields": [
{
"name": "metadata",
"type": "com.ovoenergy.kafka.common.event.EventMetadata"
},
{
"name": "enrollmentId",
"type": "string",
"doc": "Globally unique identifier for the enrollment"
},
{
"name": "accountId",
"type": "string",
"doc": "Unique identifier for the customer. GentrackId/SiemensId. Usually 7 digits."
},
{
"name": "effectiveEnrollmentDate",
"type": {
"type": "int",
"logicalType": "date"
},
"doc": "The date when the account is going to be enrolled for the new balance platform (in epoch days)"
},
{
"name": "completedAt",
"type": {
"type": "long",
"logicalType": "timestamp-millis"
},
"doc": "The time when the migration was completed (in epoch millis)"
}
]
},
{
"type": "record",
"name": "AccountMigrationRollBackInitiatedEvent",
"doc": "Triggered by Migration Service. After T2 it signals that a siemens account migration roll back was initiated. SMILE should change the data master system for the account from Billy to Siemens and inform other system about the result.",
"fields": [
{
"name": "metadata",
"type": "com.ovoenergy.kafka.common.event.EventMetadata"
},
{
"name": "enrollmentId",
"type": "string",
"doc": "Globally unique identifier for the enrollment"
},
{
"name": "accountId",
"type": "string",
"doc": "Unique identifier for the customer. GentrackId/SiemensId. Usually 7 digits."
},
{
"name": "effectiveEnrollmentDate",
"type": {
"type": "int",
"logicalType": "date"
},
"doc": "The date when the account is going to be enrolled for the new balance platform (in epoch days)"
},
{
"name": "rollBackInitiatedAt",
"type": {
"type": "long",
"logicalType": "timestamp-millis"
},
"doc": "The time when the migration rollback was initiated (in epoch millis)"
}
]
},
{
"type": "record",
"name": "AccountMigrationRolledBackEvent",
"doc": "Triggered by SMILE. As the response to the AccountMigrationRollBackInitiatedEvent, SMILE indicates that mastering system for account data has been restored to be Siemens.As an action to this Billy, BIT CSA portal and Salesforce can do the necessary steps to clean up internal data and switch over to use Siemens data.",
"fields": [
{
"name": "metadata",
"type": "com.ovoenergy.kafka.common.event.EventMetadata"
},
{
"name": "enrollmentId",
"type": "string",
"doc": "Globally unique identifier for the enrollment"
},
{
"name": "accountId",
"type": "string",
"doc": "Unique identifier for the customer. GentrackId/SiemensId. Usually 7 digits."
},
{
"name": "effectiveEnrollmentDate",
"type": {
"type": "int",
"logicalType": "date"
},
"doc": "The date when the account is going to be enrolled for the new balance platform (in epoch days)"
},
{
"name": "rolledBackAt",
"type": {
"type": "long",
"logicalType": "timestamp-millis"
},
"doc": "The time when the migration was rolled back (in epoch millis)"
}
]
},
{
"type": "record",
"name": "AccountMigrationScheduledEvent",
"doc": "Triggered by Migration Service. At T-2 it signals that a siemens account migration has been scheduled for T0 (effectiveEnrollmentDate).Consumers should do the necessary steps like removing primary card functionality in PAYG account service. If consumers see a new AccountMigrationScheduledEvent with a new flow id then they have to update their internal state with the new flow id since every subsequent message in the migration flow will use the same id",
"fields": [
{
"name": "metadata",
"type": "com.ovoenergy.kafka.common.event.EventMetadata"
},
{
"name": "enrollmentId",
"type": "string",
"doc": "Globally unique identifier for the enrollment"
},
{
"name": "accountId",
"type": "string",
"doc": "Unique identifier for the customer. GentrackId/SiemensId. Usually 7 digits."
},
{
"name": "mpan",
"type": "string",
"doc": "The unique national reference for Meter Point Administration Number"
},
{
"name": "supplyStartDate",
"type": {
"type": "int",
"logicalType": "date"
},
"doc": "The date when the customer came on supply with Boost (in epoch days)"
},
{
"name": "effectiveEnrollmentDate",
"type": {
"type": "int",
"logicalType": "date"
},
"doc": "The date when the account is going to be enrolled for the new balance platform (in epoch days)"
},
{
"name": "scheduledAt",
"type": {
"type": "long",
"logicalType": "timestamp-millis"
},
"doc": "The time when the migration was scheduled (in epoch millis)"
}
]
},
{
"type": "record",
"name": "AccountMigrationValidatedEvent",
"doc": "Triggered by Balance Service. At T2 it signals that a siemens balance and transaction history was migrated to the new balance platform and the validation was successful. Billy is ready to be the source for balance and transaction history data. SMILE should change the data master system for the account from Siemens to Billy and inform other system about the result",
"fields": [
{
"name": "metadata",
"type": "com.ovoenergy.kafka.common.event.EventMetadata"
},
{
"name": "enrollmentId",
"type": "string",
"doc": "Globally unique identifier for the enrollment"
},
{
"name": "accountId",
"type": "string",
"doc": "Unique identifier for the customer. GentrackId/SiemensId. Usually 7 digits."
},
{
"name": "effectiveEnrollmentDate",
"type": {
"type": "int",
"logicalType": "date"
},
"doc": "The date when the account is going to be enrolled for the new balance platform (in epoch days)"
},
{
"name": "validatedAt",
"type": {
"type": "long",
"logicalType": "timestamp-millis"
},
"doc": "The time when the migrated balance and transactions were validated (in epoch millis)"
}
]
},
{
"type": "record",
"name": "BalanceRetrievedMigrationEvent",
"doc": "Triggered by Migration Service. At T1 signals that a siemens balance and transaction history is available for Billy. Contains details.",
"fields": [
{
"name": "metadata",
"type": "com.ovoenergy.kafka.common.event.EventMetadata"
},
{
"name": "enrollmentId",
"type": "string",
"doc": "Globally unique identifier for the enrollment"
},
{
"name": "accountId",
"type": "string",
"doc": "Unique identifier for the customer. GentrackId/SiemensId. Usually 7 digits."
},
{
"name": "mpan",
"type": "string",
"doc": "The unique national reference for Meter Point Administration Number"
},
{
"name": "effectiveEnrollmentDate",
"type": {
"type": "int",
"logicalType": "date"
},
"doc": "The date when the account is going to be enrolled for the new balance platform (in epoch days)"
},
{
"name": "retrievedAt",
"type": {
"type": "long",
"logicalType": "timestamp-millis"
},
"doc": "The time when the balance and transaction history was fetched (in epoch millis)"
}
]
}
]
}
]
},
"partition": 0,
"key": null,
"topic": "migration-all-1",
"messages": [
{
"event": {
"uk.co.boostpower.support.kafka.messages.AccountMigrationCompletedEvent": {
"metadata": {
"eventId": "14f49508-1328-4083-8613-queued",
"traceToken": "8115ef8a-71c8-4814-aea4-0b7984eae263",
"createdAt": 1525478400000
},
"accountId": "2222222",
"enrollmentId": "123",
"effectiveEnrollmentDate": 123123123,
"completedAt": 1525478400000
}
}
}
]
}
}