@zeeshan60/event-processor 1.0.0 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ActivityLogEvents.d.ts +41 -0
- package/dist/ActivityLogEvents.d.ts.map +1 -0
- package/dist/ActivityLogEvents.js +37 -0
- package/dist/FriendEvents.d.ts +122 -0
- package/dist/FriendEvents.d.ts.map +1 -0
- package/dist/FriendEvents.js +213 -0
- package/dist/TransactionEvents.d.ts +148 -16
- package/dist/TransactionEvents.d.ts.map +1 -1
- package/dist/TransactionEvents.js +366 -26
- package/dist/UserEvents.d.ts +196 -0
- package/dist/UserEvents.d.ts.map +1 -0
- package/dist/UserEvents.js +348 -0
- package/dist/common/Event.d.ts +5 -2
- package/dist/common/Event.d.ts.map +1 -1
- package/dist/common/Model.d.ts +0 -1
- package/dist/common/Model.d.ts.map +1 -1
- package/dist/common/index.d.ts +0 -2
- package/dist/common/index.d.ts.map +1 -1
- package/dist/common/index.js +0 -5
- package/dist/index.d.ts +4 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +31 -14
- package/package.json +5 -1
|
@@ -1,13 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TransactionCreated = exports.ChangeHistory = exports.TransactionEventType = exports.SplitType = void 0;
|
|
3
|
+
exports.TransactionDateChanged = exports.CurrencyChanged = exports.SplitTypeChanged = exports.TotalAmountChanged = exports.DescriptionChanged = exports.TransactionDeleted = exports.TransactionCreated = exports.ChangeHistory = exports.TransactionEventType = exports.SplitType = void 0;
|
|
4
|
+
const ActivityLogEvents_1 = require("./ActivityLogEvents");
|
|
5
|
+
const uuid_1 = require("uuid");
|
|
4
6
|
// Enums
|
|
5
7
|
var SplitType;
|
|
6
8
|
(function (SplitType) {
|
|
7
|
-
SplitType["
|
|
8
|
-
SplitType["
|
|
9
|
-
SplitType["
|
|
10
|
-
SplitType["
|
|
9
|
+
SplitType["YouPaidSplitEqually"] = "YouPaidSplitEqually";
|
|
10
|
+
SplitType["TheyPaidSplitEqually"] = "TheyPaidSplitEqually";
|
|
11
|
+
SplitType["TheyOweYouAll"] = "TheyOweYouAll";
|
|
12
|
+
SplitType["YouOweThemAll"] = "YouOweThemAll";
|
|
13
|
+
SplitType["TheyPaidToSettle"] = "TheyPaidToSettle";
|
|
14
|
+
SplitType["YouPaidToSettle"] = "YouPaidToSettle";
|
|
15
|
+
SplitType["SpecificAmounts"] = "SpecificAmounts";
|
|
11
16
|
})(SplitType || (exports.SplitType = SplitType = {}));
|
|
12
17
|
var TransactionEventType;
|
|
13
18
|
(function (TransactionEventType) {
|
|
@@ -24,26 +29,29 @@ var ChangeHistory;
|
|
|
24
29
|
})(ChangeHistory || (exports.ChangeHistory = ChangeHistory = {}));
|
|
25
30
|
// Transaction Created Event
|
|
26
31
|
class TransactionCreated {
|
|
27
|
-
constructor(
|
|
28
|
-
this.userId = userId;
|
|
29
|
-
this.recipientUserId = recipientUserId;
|
|
30
|
-
this.logicalTransactionId = logicalTransactionId;
|
|
31
|
-
this.description = description;
|
|
32
|
-
this.currency = currency;
|
|
33
|
-
this.splitType = splitType;
|
|
34
|
-
this.totalAmount = totalAmount;
|
|
35
|
-
this.amount = amount;
|
|
36
|
-
this.
|
|
37
|
-
this.
|
|
38
|
-
this.
|
|
39
|
-
this.
|
|
40
|
-
this.
|
|
41
|
-
this.
|
|
42
|
-
this.
|
|
32
|
+
constructor(props) {
|
|
33
|
+
this.userId = props.userId;
|
|
34
|
+
this.recipientUserId = props.recipientUserId;
|
|
35
|
+
this.logicalTransactionId = props.logicalTransactionId;
|
|
36
|
+
this.description = props.description;
|
|
37
|
+
this.currency = props.currency;
|
|
38
|
+
this.splitType = props.splitType;
|
|
39
|
+
this.totalAmount = props.totalAmount;
|
|
40
|
+
this.amount = props.amount;
|
|
41
|
+
this.isOwed = props.isOwed;
|
|
42
|
+
this.transactionDate = props.transactionDate;
|
|
43
|
+
this.groupId = props.groupId;
|
|
44
|
+
this.groupTransactionId = props.groupTransactionId;
|
|
45
|
+
this.createdAt = props.createdAt;
|
|
46
|
+
this.createdBy = props.createdBy;
|
|
47
|
+
this.streamId = props.streamId;
|
|
48
|
+
this.version = props.version;
|
|
43
49
|
}
|
|
44
50
|
apply(_existing) {
|
|
51
|
+
if (!this.userId) {
|
|
52
|
+
throw new Error('userId is required for TransactionModel');
|
|
53
|
+
}
|
|
45
54
|
return {
|
|
46
|
-
id: null,
|
|
47
55
|
streamId: this.streamId,
|
|
48
56
|
logicalTransactionId: this.logicalTransactionId,
|
|
49
57
|
userId: this.userId,
|
|
@@ -53,17 +61,349 @@ class TransactionCreated {
|
|
|
53
61
|
splitType: this.splitType,
|
|
54
62
|
totalAmount: this.totalAmount,
|
|
55
63
|
amount: this.amount,
|
|
64
|
+
isOwed: this.isOwed,
|
|
56
65
|
transactionDate: this.transactionDate,
|
|
57
66
|
createdAt: this.createdAt,
|
|
58
|
-
updatedAt:
|
|
67
|
+
updatedAt: this.createdAt,
|
|
59
68
|
createdBy: this.createdBy,
|
|
60
|
-
updatedBy:
|
|
61
|
-
deleted: false,
|
|
62
|
-
version: this.version,
|
|
69
|
+
updatedBy: this.createdBy,
|
|
63
70
|
groupId: this.groupId,
|
|
64
71
|
groupTransactionId: this.groupTransactionId,
|
|
72
|
+
deleted: false,
|
|
73
|
+
version: this.version,
|
|
65
74
|
history: ChangeHistory.empty(),
|
|
66
75
|
};
|
|
67
76
|
}
|
|
77
|
+
activityLog(_existing, actorName) {
|
|
78
|
+
if (!this.userId) {
|
|
79
|
+
return undefined;
|
|
80
|
+
}
|
|
81
|
+
const actor = actorName ?? 'You';
|
|
82
|
+
const logMessage = `${actor} created transaction "${this.description}" for ${this.totalAmount} ${this.currency}`;
|
|
83
|
+
return {
|
|
84
|
+
userId: this.userId,
|
|
85
|
+
activityByUid: this.createdBy,
|
|
86
|
+
sourceStreamId: this.streamId,
|
|
87
|
+
sourceType: ActivityLogEvents_1.SourceType.Transaction,
|
|
88
|
+
logMessage,
|
|
89
|
+
date: this.transactionDate,
|
|
90
|
+
createdAt: this.createdAt,
|
|
91
|
+
createdBy: this.createdBy,
|
|
92
|
+
streamId: (0, uuid_1.v4)(),
|
|
93
|
+
version: 1,
|
|
94
|
+
};
|
|
95
|
+
}
|
|
68
96
|
}
|
|
69
97
|
exports.TransactionCreated = TransactionCreated;
|
|
98
|
+
class TransactionDeleted {
|
|
99
|
+
constructor(props) {
|
|
100
|
+
this.streamId = props.streamId;
|
|
101
|
+
this.version = props.version;
|
|
102
|
+
this.createdAt = props.createdAt;
|
|
103
|
+
this.createdBy = props.createdBy;
|
|
104
|
+
}
|
|
105
|
+
apply(existing) {
|
|
106
|
+
if (!existing) {
|
|
107
|
+
throw new Error('TransactionModel is required for deletion');
|
|
108
|
+
}
|
|
109
|
+
const existingTx = existing;
|
|
110
|
+
return {
|
|
111
|
+
...existingTx,
|
|
112
|
+
version: this.version,
|
|
113
|
+
deleted: true,
|
|
114
|
+
updatedBy: this.createdBy,
|
|
115
|
+
updatedAt: this.createdAt,
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
activityLog(existing, actorName) {
|
|
119
|
+
if (!existing) {
|
|
120
|
+
return undefined;
|
|
121
|
+
}
|
|
122
|
+
const existingTx = existing;
|
|
123
|
+
const actor = actorName ?? 'You';
|
|
124
|
+
const logMessage = `${actor} deleted transaction "${existingTx.description}"`;
|
|
125
|
+
return {
|
|
126
|
+
userId: existingTx.userId,
|
|
127
|
+
activityByUid: this.createdBy,
|
|
128
|
+
sourceStreamId: this.streamId,
|
|
129
|
+
sourceType: ActivityLogEvents_1.SourceType.Transaction,
|
|
130
|
+
logMessage,
|
|
131
|
+
date: this.createdAt,
|
|
132
|
+
createdAt: this.createdAt,
|
|
133
|
+
createdBy: this.createdBy,
|
|
134
|
+
streamId: (0, uuid_1.v4)(),
|
|
135
|
+
version: 1,
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
exports.TransactionDeleted = TransactionDeleted;
|
|
140
|
+
class DescriptionChanged {
|
|
141
|
+
constructor(props) {
|
|
142
|
+
this.description = props.description;
|
|
143
|
+
this.streamId = props.streamId;
|
|
144
|
+
this.version = props.version;
|
|
145
|
+
this.createdAt = props.createdAt;
|
|
146
|
+
this.createdBy = props.createdBy;
|
|
147
|
+
}
|
|
148
|
+
apply(existing) {
|
|
149
|
+
if (!existing) {
|
|
150
|
+
throw new Error('TransactionModel is required');
|
|
151
|
+
}
|
|
152
|
+
const existingTx = existing;
|
|
153
|
+
const descriptionChange = {
|
|
154
|
+
type: 'DESCRIPTION_UPDATED',
|
|
155
|
+
changedAt: this.createdAt,
|
|
156
|
+
changedBy: this.createdBy,
|
|
157
|
+
oldValue: existingTx.description,
|
|
158
|
+
newValue: this.description,
|
|
159
|
+
};
|
|
160
|
+
return {
|
|
161
|
+
...existingTx,
|
|
162
|
+
description: this.description,
|
|
163
|
+
version: this.version,
|
|
164
|
+
updatedBy: this.createdBy,
|
|
165
|
+
updatedAt: this.createdAt,
|
|
166
|
+
history: {
|
|
167
|
+
changes: [descriptionChange, ...existingTx.history.changes],
|
|
168
|
+
},
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
activityLog(existing, actorName) {
|
|
172
|
+
if (!existing) {
|
|
173
|
+
return undefined;
|
|
174
|
+
}
|
|
175
|
+
const existingTx = existing;
|
|
176
|
+
const actor = actorName ?? 'You';
|
|
177
|
+
const logMessage = `${actor} changed description from "${existingTx.description}" to "${this.description}"`;
|
|
178
|
+
return {
|
|
179
|
+
userId: existingTx.userId,
|
|
180
|
+
activityByUid: this.createdBy,
|
|
181
|
+
sourceStreamId: this.streamId,
|
|
182
|
+
sourceType: ActivityLogEvents_1.SourceType.Transaction,
|
|
183
|
+
logMessage,
|
|
184
|
+
date: this.createdAt,
|
|
185
|
+
createdAt: this.createdAt,
|
|
186
|
+
createdBy: this.createdBy,
|
|
187
|
+
streamId: (0, uuid_1.v4)(),
|
|
188
|
+
version: 1,
|
|
189
|
+
};
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
exports.DescriptionChanged = DescriptionChanged;
|
|
193
|
+
class TotalAmountChanged {
|
|
194
|
+
constructor(props) {
|
|
195
|
+
this.totalAmount = props.totalAmount;
|
|
196
|
+
this.streamId = props.streamId;
|
|
197
|
+
this.version = props.version;
|
|
198
|
+
this.createdAt = props.createdAt;
|
|
199
|
+
this.createdBy = props.createdBy;
|
|
200
|
+
}
|
|
201
|
+
apply(existing) {
|
|
202
|
+
if (!existing) {
|
|
203
|
+
throw new Error('TransactionModel is required');
|
|
204
|
+
}
|
|
205
|
+
const existingTx = existing;
|
|
206
|
+
const amountChange = {
|
|
207
|
+
type: 'AMOUNT_UPDATED',
|
|
208
|
+
changedAt: this.createdAt,
|
|
209
|
+
changedBy: this.createdBy,
|
|
210
|
+
oldValue: existingTx.totalAmount,
|
|
211
|
+
newValue: this.totalAmount,
|
|
212
|
+
};
|
|
213
|
+
return {
|
|
214
|
+
...existingTx,
|
|
215
|
+
totalAmount: this.totalAmount,
|
|
216
|
+
version: this.version,
|
|
217
|
+
updatedBy: this.createdBy,
|
|
218
|
+
updatedAt: this.createdAt,
|
|
219
|
+
history: {
|
|
220
|
+
changes: [amountChange, ...existingTx.history.changes],
|
|
221
|
+
},
|
|
222
|
+
};
|
|
223
|
+
}
|
|
224
|
+
activityLog(existing, actorName) {
|
|
225
|
+
if (!existing) {
|
|
226
|
+
return undefined;
|
|
227
|
+
}
|
|
228
|
+
const existingTx = existing;
|
|
229
|
+
const actor = actorName ?? 'You';
|
|
230
|
+
const logMessage = `${actor} changed amount from ${existingTx.totalAmount} ${existingTx.currency} to ${this.totalAmount} ${existingTx.currency}`;
|
|
231
|
+
return {
|
|
232
|
+
userId: existingTx.userId,
|
|
233
|
+
activityByUid: this.createdBy,
|
|
234
|
+
sourceStreamId: this.streamId,
|
|
235
|
+
sourceType: ActivityLogEvents_1.SourceType.Transaction,
|
|
236
|
+
logMessage,
|
|
237
|
+
date: this.createdAt,
|
|
238
|
+
createdAt: this.createdAt,
|
|
239
|
+
createdBy: this.createdBy,
|
|
240
|
+
streamId: (0, uuid_1.v4)(),
|
|
241
|
+
version: 1,
|
|
242
|
+
};
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
exports.TotalAmountChanged = TotalAmountChanged;
|
|
246
|
+
class SplitTypeChanged {
|
|
247
|
+
constructor(props) {
|
|
248
|
+
this.splitType = props.splitType;
|
|
249
|
+
this.totalAmount = props.totalAmount;
|
|
250
|
+
this.amount = props.amount;
|
|
251
|
+
this.isOwed = props.isOwed;
|
|
252
|
+
this.streamId = props.streamId;
|
|
253
|
+
this.version = props.version;
|
|
254
|
+
this.createdAt = props.createdAt;
|
|
255
|
+
this.createdBy = props.createdBy;
|
|
256
|
+
}
|
|
257
|
+
apply(existing) {
|
|
258
|
+
if (!existing) {
|
|
259
|
+
throw new Error('TransactionModel is required');
|
|
260
|
+
}
|
|
261
|
+
const existingTx = existing;
|
|
262
|
+
const splitTypeChange = {
|
|
263
|
+
type: 'SPLIT_TYPE_UPDATED',
|
|
264
|
+
changedAt: this.createdAt,
|
|
265
|
+
changedBy: this.createdBy,
|
|
266
|
+
oldValue: existingTx.splitType,
|
|
267
|
+
newValue: this.splitType,
|
|
268
|
+
};
|
|
269
|
+
return {
|
|
270
|
+
...existingTx,
|
|
271
|
+
splitType: this.splitType,
|
|
272
|
+
amount: this.amount,
|
|
273
|
+
isOwed: this.isOwed,
|
|
274
|
+
version: this.version,
|
|
275
|
+
updatedBy: this.createdBy,
|
|
276
|
+
updatedAt: this.createdAt,
|
|
277
|
+
history: {
|
|
278
|
+
changes: [splitTypeChange, ...existingTx.history.changes],
|
|
279
|
+
},
|
|
280
|
+
};
|
|
281
|
+
}
|
|
282
|
+
activityLog(existing, actorName) {
|
|
283
|
+
if (!existing) {
|
|
284
|
+
return undefined;
|
|
285
|
+
}
|
|
286
|
+
const existingTx = existing;
|
|
287
|
+
const actor = actorName ?? 'You';
|
|
288
|
+
const logMessage = `${actor} changed split type from ${existingTx.splitType} to ${this.splitType}`;
|
|
289
|
+
return {
|
|
290
|
+
userId: existingTx.userId,
|
|
291
|
+
activityByUid: this.createdBy,
|
|
292
|
+
sourceStreamId: this.streamId,
|
|
293
|
+
sourceType: ActivityLogEvents_1.SourceType.Transaction,
|
|
294
|
+
logMessage,
|
|
295
|
+
date: this.createdAt,
|
|
296
|
+
createdAt: this.createdAt,
|
|
297
|
+
createdBy: this.createdBy,
|
|
298
|
+
streamId: (0, uuid_1.v4)(),
|
|
299
|
+
version: 1,
|
|
300
|
+
};
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
exports.SplitTypeChanged = SplitTypeChanged;
|
|
304
|
+
class CurrencyChanged {
|
|
305
|
+
constructor(props) {
|
|
306
|
+
this.currency = props.currency;
|
|
307
|
+
this.streamId = props.streamId;
|
|
308
|
+
this.version = props.version;
|
|
309
|
+
this.createdAt = props.createdAt;
|
|
310
|
+
this.createdBy = props.createdBy;
|
|
311
|
+
}
|
|
312
|
+
apply(existing) {
|
|
313
|
+
if (!existing) {
|
|
314
|
+
throw new Error('TransactionModel is required');
|
|
315
|
+
}
|
|
316
|
+
const existingTx = existing;
|
|
317
|
+
const currencyChange = {
|
|
318
|
+
type: 'CURRENCY_UPDATED',
|
|
319
|
+
changedAt: this.createdAt,
|
|
320
|
+
changedBy: this.createdBy,
|
|
321
|
+
oldValue: existingTx.currency,
|
|
322
|
+
newValue: this.currency,
|
|
323
|
+
};
|
|
324
|
+
return {
|
|
325
|
+
...existingTx,
|
|
326
|
+
currency: this.currency,
|
|
327
|
+
version: this.version,
|
|
328
|
+
updatedBy: this.createdBy,
|
|
329
|
+
updatedAt: this.createdAt,
|
|
330
|
+
history: {
|
|
331
|
+
changes: [currencyChange, ...existingTx.history.changes],
|
|
332
|
+
},
|
|
333
|
+
};
|
|
334
|
+
}
|
|
335
|
+
activityLog(existing, actorName) {
|
|
336
|
+
if (!existing) {
|
|
337
|
+
return undefined;
|
|
338
|
+
}
|
|
339
|
+
const existingTx = existing;
|
|
340
|
+
const actor = actorName ?? 'You';
|
|
341
|
+
const logMessage = `${actor} changed currency from ${existingTx.currency} to ${this.currency}`;
|
|
342
|
+
return {
|
|
343
|
+
userId: existingTx.userId,
|
|
344
|
+
activityByUid: this.createdBy,
|
|
345
|
+
sourceStreamId: this.streamId,
|
|
346
|
+
sourceType: ActivityLogEvents_1.SourceType.Transaction,
|
|
347
|
+
logMessage,
|
|
348
|
+
date: this.createdAt,
|
|
349
|
+
createdAt: this.createdAt,
|
|
350
|
+
createdBy: this.createdBy,
|
|
351
|
+
streamId: (0, uuid_1.v4)(),
|
|
352
|
+
version: 1,
|
|
353
|
+
};
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
exports.CurrencyChanged = CurrencyChanged;
|
|
357
|
+
class TransactionDateChanged {
|
|
358
|
+
constructor(props) {
|
|
359
|
+
this.transactionDate = props.transactionDate;
|
|
360
|
+
this.streamId = props.streamId;
|
|
361
|
+
this.version = props.version;
|
|
362
|
+
this.createdAt = props.createdAt;
|
|
363
|
+
this.createdBy = props.createdBy;
|
|
364
|
+
}
|
|
365
|
+
apply(existing) {
|
|
366
|
+
if (!existing) {
|
|
367
|
+
throw new Error('TransactionModel is required');
|
|
368
|
+
}
|
|
369
|
+
const existingTx = existing;
|
|
370
|
+
const dateChange = {
|
|
371
|
+
type: 'TRANSACTION_DATE_UPDATED',
|
|
372
|
+
changedAt: this.createdAt,
|
|
373
|
+
changedBy: this.createdBy,
|
|
374
|
+
oldValue: existingTx.transactionDate,
|
|
375
|
+
newValue: this.transactionDate,
|
|
376
|
+
};
|
|
377
|
+
return {
|
|
378
|
+
...existingTx,
|
|
379
|
+
transactionDate: this.transactionDate,
|
|
380
|
+
version: this.version,
|
|
381
|
+
updatedBy: this.createdBy,
|
|
382
|
+
updatedAt: this.createdAt,
|
|
383
|
+
history: {
|
|
384
|
+
changes: [dateChange, ...existingTx.history.changes],
|
|
385
|
+
},
|
|
386
|
+
};
|
|
387
|
+
}
|
|
388
|
+
activityLog(existing, actorName) {
|
|
389
|
+
if (!existing) {
|
|
390
|
+
return undefined;
|
|
391
|
+
}
|
|
392
|
+
const existingTx = existing;
|
|
393
|
+
const actor = actorName ?? 'You';
|
|
394
|
+
const logMessage = `${actor} changed transaction date from ${existingTx.transactionDate.toLocaleDateString()} to ${this.transactionDate.toLocaleDateString()}`;
|
|
395
|
+
return {
|
|
396
|
+
userId: existingTx.userId,
|
|
397
|
+
activityByUid: this.createdBy,
|
|
398
|
+
sourceStreamId: this.streamId,
|
|
399
|
+
sourceType: ActivityLogEvents_1.SourceType.Transaction,
|
|
400
|
+
logMessage,
|
|
401
|
+
date: this.createdAt,
|
|
402
|
+
createdAt: this.createdAt,
|
|
403
|
+
createdBy: this.createdBy,
|
|
404
|
+
streamId: (0, uuid_1.v4)(),
|
|
405
|
+
version: 1,
|
|
406
|
+
};
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
exports.TransactionDateChanged = TransactionDateChanged;
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
import { Event } from './common/Event';
|
|
2
|
+
import { Model } from './common/Model';
|
|
3
|
+
import { ActivityLogCreatedProps } from './ActivityLogEvents';
|
|
4
|
+
export declare enum UserEventType {
|
|
5
|
+
USER_CREATED = "USER_CREATED",
|
|
6
|
+
PLACEHOLDER_USER_CREATED = "PLACEHOLDER_USER_CREATED",
|
|
7
|
+
USER_DELETED = "USER_DELETED",
|
|
8
|
+
CURRENCY_CHANGED = "CURRENCY_CHANGED",
|
|
9
|
+
PHONE_NUMBER_CHANGED = "PHONE_NUMBER_CHANGED",
|
|
10
|
+
DISPLAY_NAME_CHANGED = "DISPLAY_NAME_CHANGED",
|
|
11
|
+
PLACEHOLDER_USER_MERGED = "PLACEHOLDER_USER_MERGED",
|
|
12
|
+
USER_CONVERTED_TO_PLACEHOLDER = "USER_CONVERTED_TO_PLACEHOLDER"
|
|
13
|
+
}
|
|
14
|
+
export interface UserModel extends Model {
|
|
15
|
+
uid?: string;
|
|
16
|
+
displayName: string;
|
|
17
|
+
phoneNumber?: string;
|
|
18
|
+
currency?: string;
|
|
19
|
+
email?: string;
|
|
20
|
+
photoUrl?: string;
|
|
21
|
+
emailVerified: boolean;
|
|
22
|
+
isPlaceholder: boolean;
|
|
23
|
+
createdAt: Date;
|
|
24
|
+
updatedAt: Date;
|
|
25
|
+
createdBy: string;
|
|
26
|
+
updatedBy: string;
|
|
27
|
+
}
|
|
28
|
+
export interface UserCreatedProps {
|
|
29
|
+
userId?: string;
|
|
30
|
+
firebaseUid: string;
|
|
31
|
+
displayName: string;
|
|
32
|
+
phoneNumber?: string;
|
|
33
|
+
email?: string;
|
|
34
|
+
photoUrl?: string;
|
|
35
|
+
emailVerified: boolean;
|
|
36
|
+
createdAt: Date;
|
|
37
|
+
createdBy: string;
|
|
38
|
+
streamId: string;
|
|
39
|
+
version: number;
|
|
40
|
+
}
|
|
41
|
+
export declare class UserCreated implements Event {
|
|
42
|
+
userId?: string;
|
|
43
|
+
firebaseUid: string;
|
|
44
|
+
displayName: string;
|
|
45
|
+
phoneNumber?: string;
|
|
46
|
+
email?: string;
|
|
47
|
+
photoUrl?: string;
|
|
48
|
+
emailVerified: boolean;
|
|
49
|
+
createdAt: Date;
|
|
50
|
+
createdBy: string;
|
|
51
|
+
streamId: string;
|
|
52
|
+
version: number;
|
|
53
|
+
constructor(props: UserCreatedProps);
|
|
54
|
+
apply(_existing?: Model): UserModel;
|
|
55
|
+
activityLog(_existing?: Model, actorName?: string): ActivityLogCreatedProps | undefined;
|
|
56
|
+
}
|
|
57
|
+
export interface PlaceholderUserCreatedProps {
|
|
58
|
+
userId?: string;
|
|
59
|
+
displayName: string;
|
|
60
|
+
phoneNumber?: string;
|
|
61
|
+
email?: string;
|
|
62
|
+
createdAt: Date;
|
|
63
|
+
createdBy: string;
|
|
64
|
+
streamId: string;
|
|
65
|
+
version: number;
|
|
66
|
+
}
|
|
67
|
+
export declare class PlaceholderUserCreated implements Event {
|
|
68
|
+
userId?: string;
|
|
69
|
+
displayName: string;
|
|
70
|
+
phoneNumber?: string;
|
|
71
|
+
email?: string;
|
|
72
|
+
createdAt: Date;
|
|
73
|
+
createdBy: string;
|
|
74
|
+
streamId: string;
|
|
75
|
+
version: number;
|
|
76
|
+
constructor(props: PlaceholderUserCreatedProps);
|
|
77
|
+
apply(_existing?: Model): UserModel;
|
|
78
|
+
}
|
|
79
|
+
export interface UserCurrencyChangedProps {
|
|
80
|
+
userId?: string;
|
|
81
|
+
currency?: string;
|
|
82
|
+
createdAt: Date;
|
|
83
|
+
createdBy: string;
|
|
84
|
+
streamId: string;
|
|
85
|
+
version: number;
|
|
86
|
+
}
|
|
87
|
+
export declare class UserCurrencyChanged implements Event {
|
|
88
|
+
userId?: string;
|
|
89
|
+
currency?: string;
|
|
90
|
+
createdAt: Date;
|
|
91
|
+
createdBy: string;
|
|
92
|
+
streamId: string;
|
|
93
|
+
version: number;
|
|
94
|
+
constructor(props: UserCurrencyChangedProps);
|
|
95
|
+
apply(existing?: Model): UserModel;
|
|
96
|
+
activityLog(existing?: Model, actorName?: string): ActivityLogCreatedProps | undefined;
|
|
97
|
+
}
|
|
98
|
+
export interface UserPhoneNumberChangedProps {
|
|
99
|
+
userId?: string;
|
|
100
|
+
phoneNumber?: string;
|
|
101
|
+
createdAt: Date;
|
|
102
|
+
createdBy: string;
|
|
103
|
+
streamId: string;
|
|
104
|
+
version: number;
|
|
105
|
+
}
|
|
106
|
+
export declare class UserPhoneNumberChanged implements Event {
|
|
107
|
+
userId?: string;
|
|
108
|
+
phoneNumber?: string;
|
|
109
|
+
createdAt: Date;
|
|
110
|
+
createdBy: string;
|
|
111
|
+
streamId: string;
|
|
112
|
+
version: number;
|
|
113
|
+
constructor(props: UserPhoneNumberChangedProps);
|
|
114
|
+
apply(existing?: Model): UserModel;
|
|
115
|
+
activityLog(existing?: Model, actorName?: string): ActivityLogCreatedProps | undefined;
|
|
116
|
+
}
|
|
117
|
+
export interface UserDisplayNameChangedProps {
|
|
118
|
+
userId?: string;
|
|
119
|
+
displayName: string;
|
|
120
|
+
createdAt: Date;
|
|
121
|
+
createdBy: string;
|
|
122
|
+
streamId: string;
|
|
123
|
+
version: number;
|
|
124
|
+
}
|
|
125
|
+
export declare class UserDisplayNameChanged implements Event {
|
|
126
|
+
userId?: string;
|
|
127
|
+
displayName: string;
|
|
128
|
+
createdAt: Date;
|
|
129
|
+
createdBy: string;
|
|
130
|
+
streamId: string;
|
|
131
|
+
version: number;
|
|
132
|
+
constructor(props: UserDisplayNameChangedProps);
|
|
133
|
+
apply(existing?: Model): UserModel;
|
|
134
|
+
activityLog(existing?: Model, actorName?: string): ActivityLogCreatedProps | undefined;
|
|
135
|
+
}
|
|
136
|
+
export interface UserDeletedProps {
|
|
137
|
+
userId?: string;
|
|
138
|
+
createdAt: Date;
|
|
139
|
+
createdBy: string;
|
|
140
|
+
streamId: string;
|
|
141
|
+
version: number;
|
|
142
|
+
}
|
|
143
|
+
export declare class UserDeleted implements Event {
|
|
144
|
+
userId?: string;
|
|
145
|
+
createdAt: Date;
|
|
146
|
+
createdBy: string;
|
|
147
|
+
streamId: string;
|
|
148
|
+
version: number;
|
|
149
|
+
constructor(props: UserDeletedProps);
|
|
150
|
+
apply(existing?: Model): UserModel;
|
|
151
|
+
}
|
|
152
|
+
export interface PlaceholderUserMergedProps {
|
|
153
|
+
userId?: string;
|
|
154
|
+
firebaseUid: string;
|
|
155
|
+
displayName: string;
|
|
156
|
+
email?: string;
|
|
157
|
+
phoneNumber?: string;
|
|
158
|
+
photoUrl?: string;
|
|
159
|
+
emailVerified: boolean;
|
|
160
|
+
createdAt: Date;
|
|
161
|
+
createdBy: string;
|
|
162
|
+
streamId: string;
|
|
163
|
+
version: number;
|
|
164
|
+
}
|
|
165
|
+
export declare class PlaceholderUserMerged implements Event {
|
|
166
|
+
userId?: string;
|
|
167
|
+
firebaseUid: string;
|
|
168
|
+
displayName: string;
|
|
169
|
+
email?: string;
|
|
170
|
+
phoneNumber?: string;
|
|
171
|
+
photoUrl?: string;
|
|
172
|
+
emailVerified: boolean;
|
|
173
|
+
createdAt: Date;
|
|
174
|
+
createdBy: string;
|
|
175
|
+
streamId: string;
|
|
176
|
+
version: number;
|
|
177
|
+
constructor(props: PlaceholderUserMergedProps);
|
|
178
|
+
apply(existing?: Model): UserModel;
|
|
179
|
+
}
|
|
180
|
+
export interface UserConvertedToPlaceholderProps {
|
|
181
|
+
userId?: string;
|
|
182
|
+
createdAt: Date;
|
|
183
|
+
createdBy: string;
|
|
184
|
+
streamId: string;
|
|
185
|
+
version: number;
|
|
186
|
+
}
|
|
187
|
+
export declare class UserConvertedToPlaceholder implements Event {
|
|
188
|
+
userId?: string;
|
|
189
|
+
createdAt: Date;
|
|
190
|
+
createdBy: string;
|
|
191
|
+
streamId: string;
|
|
192
|
+
version: number;
|
|
193
|
+
constructor(props: UserConvertedToPlaceholderProps);
|
|
194
|
+
apply(existing?: Model): UserModel;
|
|
195
|
+
}
|
|
196
|
+
//# sourceMappingURL=UserEvents.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UserEvents.d.ts","sourceRoot":"","sources":["../src/UserEvents.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AACvC,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AACvC,OAAO,EAAE,uBAAuB,EAAc,MAAM,qBAAqB,CAAC;AAI1E,oBAAY,aAAa;IACvB,YAAY,iBAAiB;IAC7B,wBAAwB,6BAA6B;IACrD,YAAY,iBAAiB;IAC7B,gBAAgB,qBAAqB;IACrC,oBAAoB,yBAAyB;IAC7C,oBAAoB,yBAAyB;IAC7C,uBAAuB,4BAA4B;IACnD,6BAA6B,kCAAkC;CAChE;AAGD,MAAM,WAAW,SAAU,SAAQ,KAAK;IACtC,GAAG,CAAC,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