@smartico/public-api 0.0.417 → 0.0.418

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smartico/public-api",
3
- "version": "0.0.417",
3
+ "version": "0.0.418",
4
4
  "description": "Smartico public API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -1,5 +1,3 @@
1
- import { UserBalanceType } from './UserBalanceType';
2
-
3
1
  /** Activity-log entry type as returned on the v2 wire (`type_id`). */
4
2
  export enum ActivityLogActivities {
5
3
  Gems = 1,
@@ -22,45 +20,3 @@ export enum ActivityLogActivities {
22
20
  Tournament = 18,
23
21
  ClanTournament = 19,
24
22
  }
25
-
26
- export enum WalletChangeType {
27
- Add = 1,
28
- Deduct = 2,
29
- Set = 3,
30
- }
31
-
32
- export enum LevelChangeType {
33
- Increase = 1,
34
- Decrease = 2,
35
- }
36
-
37
- /** Wire ctx_1 for Mission / Badge / Task — see SMR-44986. */
38
- export enum AchievementChangeType {
39
- Complete = 1,
40
- Unlock = 2,
41
- }
42
-
43
- /** Wire ctx_1 for Jackpot rows — SMR-44986. */
44
- export enum JackpotContextValue {
45
- Registration = 1,
46
- Win = 3,
47
- }
48
-
49
- const WALLET_TYPE_IDS = new Set<number>([
50
- ActivityLogActivities.Gems,
51
- ActivityLogActivities.Diamonds,
52
- ActivityLogActivities.Points,
53
- ]);
54
-
55
- export const isWalletActivityTypeId = (typeId: number): boolean => WALLET_TYPE_IDS.has(typeId);
56
-
57
- export const activityTypeIdToBalanceType = (typeId: ActivityLogActivities): UserBalanceType => {
58
- switch (typeId) {
59
- case ActivityLogActivities.Gems:
60
- return UserBalanceType.Gems;
61
- case ActivityLogActivities.Diamonds:
62
- return UserBalanceType.Diamonds;
63
- default:
64
- return UserBalanceType.Points;
65
- }
66
- };
@@ -1,27 +1,8 @@
1
- export interface ActivityLogPublicMeta {
2
- name?: string;
3
- image_url?: string;
4
- image?: string;
5
- url?: string;
6
- avatar_url?: string;
7
- avatar_id?: string;
8
- icon_url?: string;
9
- position?: number;
10
- }
11
-
12
1
  export interface ActivityLogMeta {
13
- image_url?: string;
14
- image?: string;
15
- url?: string;
16
- avatar_url?: string;
17
- avatar_id?: string;
18
- icon_url?: string;
19
2
  name?: string;
3
+ image_url?: string;
20
4
  position?: number;
21
- score?: number;
22
5
  user_points_balance_before?: number;
23
6
  points_requested?: number;
24
7
  user_points_ever?: number;
25
- public_meta?: ActivityLogPublicMeta;
26
- public_map?: ActivityLogPublicMeta;
27
8
  }
@@ -1,42 +1,76 @@
1
1
  import { ProtocolResponse } from '../Base/ProtocolResponse';
2
2
  import { ActivityLogEntry } from './ActivityLogEntry';
3
- import { mapActivityLogHistory, resolveWalletDisplayType } from './ActivityLogMapper';
3
+ import { ActivityLogActivities } from './ActivityLogActivities';
4
4
  import { TActivityLog, TActivityLogEntry } from '../WSAPI/WSAPITypes';
5
+ import { UserBalanceType } from './UserBalanceType';
5
6
 
6
7
  export interface GetActivityLogResponse extends ProtocolResponse {
7
8
  logHistory: ActivityLogEntry[];
8
9
  }
9
10
 
10
- const toTActivityLog = (entry: TActivityLogEntry): TActivityLog => {
11
- const row: TActivityLog = {
12
- create_date: entry.create_date,
13
- user_ext_id: entry.user_ext_id,
14
- crm_brand_id: entry.crm_brand_id,
15
- type: resolveWalletDisplayType(entry),
16
- amount: entry.amount,
17
- balance: entry.balance,
18
- source_type_id: entry.source_type_id,
19
- };
20
- if (entry.total_ever !== undefined) {
21
- row.total_ever = entry.total_ever;
22
- }
23
- return row;
24
- };
25
-
26
- /** Maps wire rows to wallet-only {@link TActivityLog} — legacy consumer contract. */
27
- export const ActivityLogTransform = (items: ActivityLogEntry[] | unknown[]): TActivityLog[] => {
11
+ export const ActivityLogTransform = (items: ActivityLogEntry[]): TActivityLog[] => {
28
12
  if (!items) {
29
13
  return [];
30
14
  }
31
- return mapActivityLogHistory(items)
32
- .filter((entry) => entry.is_wallet_entry)
33
- .map(toTActivityLog);
15
+
16
+ return items.map((item: any): TActivityLog => {
17
+ const itemTransformed: Partial<TActivityLog> = {
18
+ create_date: item.create_date?.seconds ?? item.create_date,
19
+ user_ext_id: item.user_ext_id,
20
+ crm_brand_id: item.crm_brand_id,
21
+ source_type_id: item.source_type_id,
22
+ };
23
+
24
+ item.type = item.type ?? UserBalanceType.Points;
25
+
26
+ if (item.type === UserBalanceType.Diamonds || item.type === UserBalanceType.Gems) {
27
+ itemTransformed.type = item.type;
28
+ itemTransformed.amount = item.amount;
29
+ itemTransformed.balance = item.balance;
30
+ }
31
+
32
+ if (item.type === UserBalanceType.Points) {
33
+ itemTransformed.type = UserBalanceType.Points;
34
+ itemTransformed.amount = item.points_collected;
35
+ itemTransformed.balance = item.user_points_balance;
36
+ itemTransformed.total_ever = item.user_points_ever;
37
+ }
38
+
39
+ return itemTransformed as TActivityLog;
40
+ });
34
41
  };
35
42
 
36
- /** Maps wire rows to the full v2 {@link TActivityLogEntry} shape. */
37
- export const ActivityLogV2Transform = (items: ActivityLogEntry[] | unknown[]): TActivityLogEntry[] => {
43
+ export const ActivityLogV2Transform = (items: any[]): TActivityLogEntry[] => {
38
44
  if (!items) {
39
45
  return [];
40
46
  }
41
- return mapActivityLogHistory(items);
47
+
48
+ return items.map((r) => {
49
+ const isGems = r.type_id === ActivityLogActivities.Gems || r.type === UserBalanceType.Gems;
50
+ const isDiamonds = r.type_id === ActivityLogActivities.Diamonds || r.type === UserBalanceType.Diamonds;
51
+
52
+ const x: TActivityLogEntry = {
53
+ create_date: r.create_date?.seconds ?? r.create_date,
54
+ user_ext_id: r.user_ext_id,
55
+ crm_brand_id: r.crm_brand_id,
56
+ type: isGems ? UserBalanceType.Gems : isDiamonds ? UserBalanceType.Diamonds : UserBalanceType.Points,
57
+ amount: r.points_collected ?? r.amount,
58
+ balance: r.user_points_balance ?? r.balance,
59
+ total_ever: r.user_points_ever,
60
+ source_type_id: r.source_type_id,
61
+ activity_type_id: r.type_id,
62
+ context_value_1: r.context_value_1,
63
+ meta: r.context_value_meta,
64
+ source_entity_name: r.source_entity_name,
65
+ source_entity_id: r.source_entity_id,
66
+ source_reference_id: r.source_reference_id,
67
+ source_root_id: r.source_root_id,
68
+ is_wallet_entry:
69
+ r.type_id == null
70
+ || r.type_id === ActivityLogActivities.Gems
71
+ || r.type_id === ActivityLogActivities.Diamonds
72
+ || r.type_id === ActivityLogActivities.Points,
73
+ };
74
+ return x;
75
+ });
42
76
  };
@@ -3,6 +3,5 @@ export * from './GetActivityLogResponse';
3
3
  export * from './ActivityLogEntry';
4
4
  export * from './ActivityLogActivities';
5
5
  export * from './ActivityLogMeta';
6
- export * from './ActivityLogMapper';
7
6
  export * from './PointChangeSourceType';
8
7
  export * from './UserBalanceType';
@@ -1811,7 +1811,6 @@ export interface TActivityLog {
1811
1811
  * Includes wallet changes and non-wallet activities (missions, badges, levels, …).
1812
1812
  */
1813
1813
  export interface TActivityLogEntry {
1814
- entry_key: string;
1815
1814
  create_date: number;
1816
1815
  user_ext_id: string;
1817
1816
  crm_brand_id: number;
@@ -1828,7 +1827,6 @@ export interface TActivityLogEntry {
1828
1827
  source_reference_id?: number;
1829
1828
  source_root_id?: number;
1830
1829
  is_wallet_entry: boolean;
1831
- is_level_entry?: boolean;
1832
1830
  }
1833
1831
 
1834
1832
 
@@ -1,358 +0,0 @@
1
- import { PointChangeSourceType } from './PointChangeSourceType';
2
- import { UserBalanceType } from './UserBalanceType';
3
- import {
4
- ActivityLogActivities,
5
- activityTypeIdToBalanceType,
6
- isWalletActivityTypeId,
7
- } from './ActivityLogActivities';
8
- import { ActivityLogMeta, ActivityLogPublicMeta } from './ActivityLogMeta';
9
- import { TActivityLogEntry } from '../WSAPI/WSAPITypes';
10
-
11
- const POINTS_COLLECTED_SENTINEL = -1;
12
-
13
- const parseCreateDate = (raw: unknown): number => {
14
- if (raw === undefined || raw === null) {
15
- return 0;
16
- }
17
- if (typeof raw === 'number') {
18
- return raw;
19
- }
20
- if (typeof raw === 'object' && raw !== null) {
21
- if ('seconds' in raw) {
22
- return Number((raw as { seconds: number }).seconds);
23
- }
24
- if ('epochSecond' in raw) {
25
- return Number((raw as { epochSecond: number }).epochSecond);
26
- }
27
- }
28
- if (typeof raw === 'string') {
29
- const ms = Date.parse(raw);
30
- if (!Number.isNaN(ms)) {
31
- return Math.floor(ms / 1000);
32
- }
33
- }
34
- return 0;
35
- };
36
-
37
- const readWireNumber = (log: Record<string, unknown>, ...keys: string[]): number | undefined => {
38
- for (const key of keys) {
39
- const value = log[key];
40
- if (value !== undefined && value !== null && value !== '') {
41
- return Number(value);
42
- }
43
- }
44
- return undefined;
45
- };
46
-
47
- const normalizeWireLog = (raw: Record<string, unknown>): Record<string, unknown> => {
48
- const log: Record<string, unknown> = { ...raw };
49
- const explicitTypeId = readWireNumber(log, 'type_id');
50
- if (explicitTypeId !== undefined) {
51
- log.type_id = explicitTypeId;
52
- } else {
53
- const wireType = readWireNumber(log, 'type');
54
- if (wireType !== undefined && wireType > UserBalanceType.Diamonds) {
55
- log.type_id = wireType;
56
- }
57
- }
58
- if (log.context_value_1 === undefined && log.ctx_1 !== undefined) {
59
- log.context_value_1 = log.ctx_1;
60
- }
61
- if (log.context_value_meta === undefined && log.ctx_meta !== undefined) {
62
- log.context_value_meta = log.ctx_meta;
63
- }
64
- if (log.source_reference_id === undefined && log.source_ref_id !== undefined) {
65
- log.source_reference_id = log.source_ref_id;
66
- }
67
- if (log.source_entity_id === undefined && log.source_root_id !== undefined) {
68
- log.source_entity_id = log.source_root_id;
69
- }
70
- return log;
71
- };
72
-
73
- const isActivityLogWireEntry = (log: Record<string, unknown>): boolean => {
74
- if (log.is_activity_log === true) {
75
- return true;
76
- }
77
- if (log.label_id !== undefined && log.label_id !== null) {
78
- return true;
79
- }
80
- if (log.ctx_meta !== undefined || log.context_value_meta !== undefined) {
81
- return true;
82
- }
83
- if (log.ctx_1 !== undefined || log.context_value_1 !== undefined) {
84
- return true;
85
- }
86
- if (log.user_id !== undefined && log.user_id !== null) {
87
- return true;
88
- }
89
- const wireTypeId = readWireNumber(log, 'type_id');
90
- return wireTypeId !== undefined && wireTypeId > UserBalanceType.Diamonds;
91
- };
92
-
93
- const readWireBalanceType = (log: Record<string, unknown>): UserBalanceType | undefined => {
94
- const balanceType = readWireNumber(log, 'type');
95
- if (balanceType === UserBalanceType.Gems || balanceType === UserBalanceType.Diamonds) {
96
- return balanceType;
97
- }
98
- return undefined;
99
- };
100
-
101
- const hasGemsOrDiamondsWalletFields = (log: Record<string, unknown>): boolean =>
102
- log.amount !== undefined
103
- || log.balance !== undefined
104
- || readWireNumber(log, 'amount', 'collected_amount') !== undefined
105
- || readWireNumber(log, 'balance', 'user_balance') !== undefined;
106
-
107
- const isGemsOrDiamondsWalletWireEntry = (log: Record<string, unknown>): boolean => {
108
- const balanceType = readWireBalanceType(log);
109
- return balanceType !== undefined && hasGemsOrDiamondsWalletFields(log);
110
- };
111
-
112
- const resolveWalletAmount = (log: Record<string, unknown>, isPoints: boolean): number => {
113
- const pointsCollected = readWireNumber(log, 'points_collected');
114
- if (isPoints && pointsCollected !== undefined && pointsCollected !== POINTS_COLLECTED_SENTINEL) {
115
- return pointsCollected;
116
- }
117
- if (isPoints) {
118
- const amount = readWireNumber(log, 'amount', 'collected_amount');
119
- return amount === undefined ? 0 : amount;
120
- }
121
- const amount = readWireNumber(log, 'amount', 'collected_amount');
122
- return amount === undefined ? 0 : amount;
123
- };
124
-
125
- const resolveWalletBalance = (log: Record<string, unknown>, isPoints: boolean): number => {
126
- if (isPoints) {
127
- const balance = readWireNumber(log, 'balance', 'user_points_balance', 'user_balance');
128
- return balance === undefined ? 0 : balance;
129
- }
130
- const balance = readWireNumber(log, 'balance', 'user_balance');
131
- return balance === undefined ? 0 : balance;
132
- };
133
-
134
- const resolveSourceTypeId = (log: Record<string, unknown>): PointChangeSourceType => {
135
- const sourceTypeId = readWireNumber(log, 'source_type_id', 'entity_type_id');
136
- return (sourceTypeId === undefined ? 0 : sourceTypeId) as PointChangeSourceType;
137
- };
138
-
139
- const parseMeta = (contextValueMeta: unknown): ActivityLogMeta | undefined => {
140
- if (!contextValueMeta) {
141
- return undefined;
142
- }
143
- let meta: ActivityLogMeta | undefined;
144
- if (typeof contextValueMeta === 'object') {
145
- meta = contextValueMeta as ActivityLogMeta;
146
- } else if (typeof contextValueMeta === 'string') {
147
- try {
148
- meta = JSON.parse(contextValueMeta) as ActivityLogMeta;
149
- } catch {
150
- return undefined;
151
- }
152
- }
153
- if (!meta) {
154
- return undefined;
155
- }
156
- const nested = meta.public_meta ?? meta.public_map;
157
- const pickImage = (src?: ActivityLogMeta | ActivityLogPublicMeta): string | undefined =>
158
- src?.image_url ?? src?.image ?? src?.url ?? src?.avatar_url ?? src?.icon_url ?? src?.avatar_id;
159
- if (nested) {
160
- return {
161
- ...meta,
162
- name: meta.name ?? nested.name,
163
- image_url: pickImage(meta) ?? pickImage(nested),
164
- position: meta.position ?? nested.position ?? meta.score,
165
- };
166
- }
167
- const topImage = pickImage(meta);
168
- if (topImage && meta.image_url === undefined) {
169
- return { ...meta, image_url: topImage, position: meta.position ?? meta.score };
170
- }
171
- if (meta.score !== undefined && meta.position === undefined) {
172
- return { ...meta, position: meta.score };
173
- }
174
- return meta;
175
- };
176
-
177
- const isLegacyPointsEntry = (log: Record<string, unknown>): boolean => {
178
- if (isActivityLogWireEntry(log)) {
179
- return false;
180
- }
181
- const pointsCollected = readWireNumber(log, 'points_collected');
182
- return pointsCollected !== undefined && pointsCollected !== POINTS_COLLECTED_SENTINEL;
183
- };
184
-
185
- const isLegacyGemsDiamondsEntry = (log: Record<string, unknown>): boolean => {
186
- if (isActivityLogWireEntry(log)) {
187
- return false;
188
- }
189
- const balanceType = readWireNumber(log, 'type');
190
- return (balanceType === UserBalanceType.Gems || balanceType === UserBalanceType.Diamonds)
191
- && log.amount !== undefined;
192
- };
193
-
194
- const isV2Entry = (log: Record<string, unknown>): boolean =>
195
- isActivityLogWireEntry(log) || (log.type_id !== undefined && log.type_id !== null);
196
-
197
- const resolveSourceEntityName = (log: Record<string, unknown>, meta: ActivityLogMeta | undefined): string | undefined => {
198
- const fromWire = log.source_entity_name ?? log.source_public_name;
199
- if (typeof fromWire === 'string' && fromWire.length > 0) {
200
- return fromWire;
201
- }
202
- if (meta?.name) {
203
- return meta.name;
204
- }
205
- return undefined;
206
- };
207
-
208
- const buildEntryKey = (log: Record<string, unknown>, index: number): string =>
209
- [
210
- parseCreateDate(log.create_date),
211
- log.type_id ?? log.type ?? 'legacy',
212
- log.source_type_id ?? '',
213
- log.source_entity_id ?? log.source_root_id ?? '',
214
- log.context_value_1 ?? log.ctx_1 ?? '',
215
- index,
216
- ].join('-');
217
-
218
- const mapLegacyPointsEntry = (log: Record<string, unknown>, index: number): TActivityLogEntry => ({
219
- entry_key: buildEntryKey(log, index),
220
- create_date: parseCreateDate(log.create_date),
221
- user_ext_id: String(log.user_ext_id ?? ''),
222
- crm_brand_id: Number(log.crm_brand_id ?? 0),
223
- type: UserBalanceType.Points,
224
- amount: resolveWalletAmount(log, true),
225
- balance: resolveWalletBalance(log, true),
226
- total_ever: readWireNumber(log, 'user_points_ever', 'collected_ever'),
227
- context_value_1: readWireNumber(log, 'context_value_1', 'ctx_1'),
228
- source_type_id: resolveSourceTypeId(log),
229
- activity_type_id: ActivityLogActivities.Points,
230
- is_wallet_entry: true,
231
- });
232
-
233
- const mapLegacyGemsDiamondsEntry = (log: Record<string, unknown>, index: number): TActivityLogEntry => {
234
- const wireType = readWireNumber(log, 'type') as UserBalanceType;
235
- const activityTypeId = wireType === UserBalanceType.Gems
236
- ? ActivityLogActivities.Gems
237
- : ActivityLogActivities.Diamonds;
238
- return {
239
- entry_key: buildEntryKey(log, index),
240
- create_date: parseCreateDate(log.create_date),
241
- user_ext_id: String(log.user_ext_id ?? ''),
242
- crm_brand_id: Number(log.crm_brand_id ?? 0),
243
- type: activityTypeIdToBalanceType(activityTypeId),
244
- amount: resolveWalletAmount(log, false),
245
- balance: resolveWalletBalance(log, false),
246
- context_value_1: readWireNumber(log, 'context_value_1', 'ctx_1'),
247
- source_type_id: resolveSourceTypeId(log),
248
- activity_type_id: activityTypeId,
249
- is_wallet_entry: true,
250
- };
251
- };
252
-
253
- const mapV2Entry = (log: Record<string, unknown>, index: number): TActivityLogEntry | null => {
254
- const typeId = readWireNumber(log, 'type_id');
255
- const contextValue1 = readWireNumber(log, 'context_value_1', 'ctx_1');
256
-
257
- const meta = parseMeta(log.context_value_meta);
258
- const sourceEntityName = resolveSourceEntityName(log, meta);
259
- const sourceEntityId = readWireNumber(log, 'source_entity_id', 'source_root_id');
260
- const sourceReferenceId = readWireNumber(log, 'source_reference_id', 'source_ref_id');
261
- const sourceRootId = readWireNumber(log, 'source_root_id');
262
- const gemsOrDiamondsWallet = isGemsOrDiamondsWalletWireEntry(log);
263
- const isWalletEntry = (typeId !== undefined && isWalletActivityTypeId(typeId)) || gemsOrDiamondsWallet;
264
-
265
- const base = {
266
- entry_key: buildEntryKey(log, index),
267
- create_date: parseCreateDate(log.create_date),
268
- user_ext_id: String(log.user_ext_id ?? ''),
269
- crm_brand_id: Number(log.crm_brand_id ?? 0),
270
- source_type_id: resolveSourceTypeId(log),
271
- activity_type_id: typeId as ActivityLogActivities,
272
- context_value_1: contextValue1,
273
- meta,
274
- source_entity_name: sourceEntityName,
275
- source_entity_id: sourceEntityId && sourceEntityId > 0 ? sourceEntityId : undefined,
276
- source_reference_id: sourceReferenceId && sourceReferenceId > 0 ? sourceReferenceId : undefined,
277
- source_root_id: sourceRootId && sourceRootId > 0 ? sourceRootId : undefined,
278
- };
279
-
280
- if (isWalletEntry) {
281
- const wireBalanceType = readWireBalanceType(log);
282
- const balanceType = wireBalanceType ?? (typeId !== undefined ? activityTypeIdToBalanceType(typeId as ActivityLogActivities) : UserBalanceType.Points);
283
- const walletActivityTypeId = typeId !== undefined && isWalletActivityTypeId(typeId)
284
- ? typeId
285
- : balanceType === UserBalanceType.Gems
286
- ? ActivityLogActivities.Gems
287
- : balanceType === UserBalanceType.Diamonds
288
- ? ActivityLogActivities.Diamonds
289
- : ActivityLogActivities.Points;
290
- const isPoints = balanceType === UserBalanceType.Points;
291
- const totalEver = isPoints
292
- ? readWireNumber(log, 'user_points_ever', 'collected_ever')
293
- ?? (meta?.user_points_ever !== undefined ? Number(meta.user_points_ever) : undefined)
294
- : undefined;
295
- return {
296
- ...base,
297
- activity_type_id: walletActivityTypeId as ActivityLogActivities,
298
- type: balanceType,
299
- amount: resolveWalletAmount(log, isPoints),
300
- balance: resolveWalletBalance(log, isPoints),
301
- total_ever: totalEver === POINTS_COLLECTED_SENTINEL ? undefined : totalEver,
302
- is_wallet_entry: true,
303
- };
304
- }
305
-
306
- return {
307
- ...base,
308
- type: UserBalanceType.Points,
309
- amount: 0,
310
- balance: 0,
311
- is_wallet_entry: false,
312
- is_level_entry: typeId === ActivityLogActivities.LevelChanged,
313
- };
314
- };
315
-
316
- const mapWireEntry = (log: Record<string, unknown>, index: number): TActivityLogEntry | null => {
317
- const normalized = normalizeWireLog(log);
318
- if (isLegacyPointsEntry(normalized)) {
319
- return mapLegacyPointsEntry(normalized, index);
320
- }
321
- if (isLegacyGemsDiamondsEntry(normalized)) {
322
- return mapLegacyGemsDiamondsEntry(normalized, index);
323
- }
324
- if (isV2Entry(normalized)) {
325
- return mapV2Entry(normalized, index);
326
- }
327
- return null;
328
- };
329
-
330
- export const mapActivityLogHistory = (logHistory: unknown[]): TActivityLogEntry[] => {
331
- const entries: TActivityLogEntry[] = [];
332
- (logHistory || []).forEach((raw, index) => {
333
- const mapped = mapWireEntry(raw as Record<string, unknown>, index);
334
- if (mapped) {
335
- entries.push(mapped);
336
- }
337
- });
338
- return entries;
339
- };
340
-
341
- export const resolveWalletDisplayType = (entry: TActivityLogEntry): UserBalanceType => {
342
- switch (entry.activity_type_id) {
343
- case ActivityLogActivities.Gems:
344
- return UserBalanceType.Gems;
345
- case ActivityLogActivities.Diamonds:
346
- return UserBalanceType.Diamonds;
347
- case ActivityLogActivities.Points:
348
- return UserBalanceType.Points;
349
- }
350
- switch (Number(entry.type)) {
351
- case UserBalanceType.Gems:
352
- return UserBalanceType.Gems;
353
- case UserBalanceType.Diamonds:
354
- return UserBalanceType.Diamonds;
355
- default:
356
- return UserBalanceType.Points;
357
- }
358
- };