volleyballsimtypes 0.0.487 → 0.0.489
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/cjs/src/data/models/user-settings.d.ts +2 -0
- package/dist/cjs/src/data/models/user-settings.js +5 -0
- package/dist/cjs/src/service/notification/catalog/en.json +2 -2
- package/dist/cjs/src/service/notification/catalog/es.json +2 -2
- package/dist/cjs/src/service/notification/catalog/fr.json +2 -2
- package/dist/cjs/src/service/notification/catalog/it.json +2 -2
- package/dist/cjs/src/service/notification/catalog/pl.json +2 -2
- package/dist/cjs/src/service/notification/catalog/pt-BR.json +2 -2
- package/dist/cjs/src/service/notification/catalog/tr.json +2 -2
- package/dist/cjs/src/service/notification/notification-type.d.ts +2 -0
- package/dist/cjs/src/service/notification/notification-type.js +6 -0
- package/dist/cjs/src/service/notification/notification.test.js +18 -0
- package/dist/cjs/src/service/notification/registry.d.ts +1 -0
- package/dist/cjs/src/service/notification/registry.js +8 -2
- package/dist/esm/src/data/models/user-settings.d.ts +2 -0
- package/dist/esm/src/data/models/user-settings.js +5 -0
- package/dist/esm/src/service/notification/catalog/en.json +2 -2
- package/dist/esm/src/service/notification/catalog/es.json +2 -2
- package/dist/esm/src/service/notification/catalog/fr.json +2 -2
- package/dist/esm/src/service/notification/catalog/it.json +2 -2
- package/dist/esm/src/service/notification/catalog/pl.json +2 -2
- package/dist/esm/src/service/notification/catalog/pt-BR.json +2 -2
- package/dist/esm/src/service/notification/catalog/tr.json +2 -2
- package/dist/esm/src/service/notification/notification-type.d.ts +2 -0
- package/dist/esm/src/service/notification/notification-type.js +5 -0
- package/dist/esm/src/service/notification/notification.test.js +20 -2
- package/dist/esm/src/service/notification/registry.d.ts +1 -0
- package/dist/esm/src/service/notification/registry.js +7 -1
- package/package.json +1 -1
|
@@ -10,6 +10,7 @@ export interface UserSettingsAttributes {
|
|
|
10
10
|
user_id: string;
|
|
11
11
|
auto_dismiss: AutoDismissSettings;
|
|
12
12
|
locale: string | null;
|
|
13
|
+
notifications: Record<string, boolean>;
|
|
13
14
|
}
|
|
14
15
|
export type UserSettingsPk = 'user_id';
|
|
15
16
|
export type UserSettingsId = UserSettingsModel[UserSettingsPk];
|
|
@@ -18,6 +19,7 @@ export declare class UserSettingsModel extends Model<UserSettingsAttributes, Use
|
|
|
18
19
|
user_id: string;
|
|
19
20
|
auto_dismiss: AutoDismissSettings;
|
|
20
21
|
locale: string | null;
|
|
22
|
+
notifications: Record<string, boolean>;
|
|
21
23
|
user: AuthUserModel;
|
|
22
24
|
getUser: Sequelize.BelongsToGetAssociationMixin<AuthUserModel>;
|
|
23
25
|
setUser: Sequelize.BelongsToSetAssociationMixin<AuthUserModel, AuthUserId>;
|
|
@@ -23,6 +23,11 @@ class UserSettingsModel extends sequelize_1.Model {
|
|
|
23
23
|
type: sequelize_1.DataTypes.STRING(8),
|
|
24
24
|
allowNull: true,
|
|
25
25
|
defaultValue: null
|
|
26
|
+
},
|
|
27
|
+
notifications: {
|
|
28
|
+
type: sequelize_1.DataTypes.JSONB,
|
|
29
|
+
allowNull: false,
|
|
30
|
+
defaultValue: {}
|
|
26
31
|
}
|
|
27
32
|
}, {
|
|
28
33
|
sequelize,
|
|
@@ -27,8 +27,8 @@
|
|
|
27
27
|
"body": "Your team has been promoted to a higher division."
|
|
28
28
|
},
|
|
29
29
|
"dailyLogin": {
|
|
30
|
-
"title": "Daily reward
|
|
31
|
-
"body": "Your daily
|
|
30
|
+
"title": "Daily reward ready",
|
|
31
|
+
"body": "Your daily reward is ready to claim!"
|
|
32
32
|
},
|
|
33
33
|
"welcome": {
|
|
34
34
|
"title": "Welcome to World Aces",
|
|
@@ -27,8 +27,8 @@
|
|
|
27
27
|
"body": "Tu equipo ha ascendido a una división superior."
|
|
28
28
|
},
|
|
29
29
|
"dailyLogin": {
|
|
30
|
-
"title": "Recompensa diaria
|
|
31
|
-
"body": "Tu recompensa
|
|
30
|
+
"title": "Recompensa diaria lista",
|
|
31
|
+
"body": "¡Tu recompensa diaria está lista para reclamar!"
|
|
32
32
|
},
|
|
33
33
|
"welcome": {
|
|
34
34
|
"title": "Te damos la bienvenida a World Aces",
|
|
@@ -27,8 +27,8 @@
|
|
|
27
27
|
"body": "Votre équipe a été promue dans une division supérieure."
|
|
28
28
|
},
|
|
29
29
|
"dailyLogin": {
|
|
30
|
-
"title": "Récompense quotidienne
|
|
31
|
-
"body": "Votre récompense
|
|
30
|
+
"title": "Récompense quotidienne prête",
|
|
31
|
+
"body": "Votre récompense quotidienne est prête à être récupérée !"
|
|
32
32
|
},
|
|
33
33
|
"welcome": {
|
|
34
34
|
"title": "Bienvenue sur World Aces",
|
|
@@ -27,8 +27,8 @@
|
|
|
27
27
|
"body": "La tua squadra è stata promossa in una divisione superiore."
|
|
28
28
|
},
|
|
29
29
|
"dailyLogin": {
|
|
30
|
-
"title": "Ricompensa giornaliera
|
|
31
|
-
"body": "La tua ricompensa
|
|
30
|
+
"title": "Ricompensa giornaliera pronta",
|
|
31
|
+
"body": "La tua ricompensa giornaliera è pronta da riscattare!"
|
|
32
32
|
},
|
|
33
33
|
"welcome": {
|
|
34
34
|
"title": "Benvenuto in World Aces",
|
|
@@ -27,8 +27,8 @@
|
|
|
27
27
|
"body": "Twoja drużyna awansowała do wyższej dywizji."
|
|
28
28
|
},
|
|
29
29
|
"dailyLogin": {
|
|
30
|
-
"title": "
|
|
31
|
-
"body": "Twoja codzienna nagroda
|
|
30
|
+
"title": "Codzienna nagroda gotowa",
|
|
31
|
+
"body": "Twoja codzienna nagroda jest gotowa do odebrania!"
|
|
32
32
|
},
|
|
33
33
|
"welcome": {
|
|
34
34
|
"title": "Witaj w World Aces",
|
|
@@ -27,8 +27,8 @@
|
|
|
27
27
|
"body": "Seu time foi promovido para uma divisão superior."
|
|
28
28
|
},
|
|
29
29
|
"dailyLogin": {
|
|
30
|
-
"title": "Recompensa diária
|
|
31
|
-
"body": "Sua recompensa
|
|
30
|
+
"title": "Recompensa diária pronta",
|
|
31
|
+
"body": "Sua recompensa diária está pronta para coletar!"
|
|
32
32
|
},
|
|
33
33
|
"welcome": {
|
|
34
34
|
"title": "Boas-vindas ao World Aces",
|
|
@@ -27,8 +27,8 @@
|
|
|
27
27
|
"body": "Takımın bir üst gruba terfi etti."
|
|
28
28
|
},
|
|
29
29
|
"dailyLogin": {
|
|
30
|
-
"title": "Günlük ödül
|
|
31
|
-
"body": "Günlük
|
|
30
|
+
"title": "Günlük ödül hazır",
|
|
31
|
+
"body": "Günlük ödülün alınmaya hazır!"
|
|
32
32
|
},
|
|
33
33
|
"welcome": {
|
|
34
34
|
"title": "World Aces'e hoş geldin",
|
|
@@ -4,3 +4,5 @@ export declare const NOTIFICATION_LOCALES: readonly ["en", "es", "fr", "it", "pl
|
|
|
4
4
|
export type NotificationLocale = typeof NOTIFICATION_LOCALES[number];
|
|
5
5
|
export declare const DEFAULT_NOTIFICATION_LOCALE: NotificationLocale;
|
|
6
6
|
export declare function normalizeNotificationLocale(locale: string | null | undefined): NotificationLocale;
|
|
7
|
+
export type NotificationPreferences = Record<string, boolean>;
|
|
8
|
+
export declare function pushEnabledFor(prefs: NotificationPreferences | null | undefined, type: string): boolean;
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
7
|
exports.DEFAULT_NOTIFICATION_LOCALE = exports.NOTIFICATION_LOCALES = exports.NOTIFICATION_TYPES = void 0;
|
|
8
8
|
exports.normalizeNotificationLocale = normalizeNotificationLocale;
|
|
9
|
+
exports.pushEnabledFor = pushEnabledFor;
|
|
9
10
|
exports.NOTIFICATION_TYPES = [
|
|
10
11
|
'MATCH_RESULT',
|
|
11
12
|
'INJURY',
|
|
@@ -28,3 +29,8 @@ function normalizeNotificationLocale(locale) {
|
|
|
28
29
|
}
|
|
29
30
|
return exports.DEFAULT_NOTIFICATION_LOCALE;
|
|
30
31
|
}
|
|
32
|
+
// Whether `type`'s mobile push should be sent for a user with these preferences (absent/true = send, false = suppress).
|
|
33
|
+
// Accepts a plain string like renderPush so a loose/unknown type still resolves (unknown = enabled).
|
|
34
|
+
function pushEnabledFor(prefs, type) {
|
|
35
|
+
return prefs?.[type] !== false;
|
|
36
|
+
}
|
|
@@ -126,3 +126,21 @@ function flattenStrings(node, prefix = '') {
|
|
|
126
126
|
(0, globals_1.expect)((0, render_1.notificationPath)('COMPENSATION', {})).toBe('/');
|
|
127
127
|
});
|
|
128
128
|
});
|
|
129
|
+
(0, globals_1.describe)('push preferences (PUSH_NOTIFICATION_TYPES + pushEnabledFor)', () => {
|
|
130
|
+
(0, globals_1.it)('is exactly the emitsPush types, COMPENSATION excluded', () => {
|
|
131
|
+
(0, globals_1.expect)([...registry_1.PUSH_NOTIFICATION_TYPES].sort((a, b) => a.localeCompare(b)))
|
|
132
|
+
.toEqual(notification_type_1.NOTIFICATION_TYPES.filter((t) => registry_1.NOTIFICATION_REGISTRY[t].emitsPush).sort((a, b) => a.localeCompare(b)));
|
|
133
|
+
(0, globals_1.expect)(registry_1.PUSH_NOTIFICATION_TYPES).not.toContain('COMPENSATION');
|
|
134
|
+
(0, globals_1.expect)(registry_1.PUSH_NOTIFICATION_TYPES).toContain('MATCH_RESULT');
|
|
135
|
+
(0, globals_1.expect)(registry_1.PUSH_NOTIFICATION_TYPES).toHaveLength(8);
|
|
136
|
+
});
|
|
137
|
+
(0, globals_1.it)('is opt-out: absent / null / empty / true all enable, only explicit false suppresses', () => {
|
|
138
|
+
(0, globals_1.expect)((0, notification_type_1.pushEnabledFor)(undefined, 'MATCH_RESULT')).toBe(true);
|
|
139
|
+
(0, globals_1.expect)((0, notification_type_1.pushEnabledFor)(null, 'MATCH_RESULT')).toBe(true);
|
|
140
|
+
(0, globals_1.expect)((0, notification_type_1.pushEnabledFor)({}, 'MATCH_RESULT')).toBe(true);
|
|
141
|
+
(0, globals_1.expect)((0, notification_type_1.pushEnabledFor)({ MATCH_RESULT: true }, 'MATCH_RESULT')).toBe(true);
|
|
142
|
+
(0, globals_1.expect)((0, notification_type_1.pushEnabledFor)({ MATCH_RESULT: false }, 'MATCH_RESULT')).toBe(false);
|
|
143
|
+
// disabling one type does not affect another
|
|
144
|
+
(0, globals_1.expect)((0, notification_type_1.pushEnabledFor)({ MATCH_RESULT: false }, 'INJURY')).toBe(true);
|
|
145
|
+
});
|
|
146
|
+
});
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.NOTIFICATION_REGISTRY = void 0;
|
|
3
|
+
exports.PUSH_NOTIFICATION_TYPES = exports.NOTIFICATION_REGISTRY = void 0;
|
|
4
|
+
const notification_type_1 = require("./notification-type");
|
|
4
5
|
function readString(value) {
|
|
5
6
|
return typeof value === 'string' && value !== '' ? value : null;
|
|
6
7
|
}
|
|
@@ -89,7 +90,8 @@ exports.NOTIFICATION_REGISTRY = {
|
|
|
89
90
|
},
|
|
90
91
|
DAILY_LOGIN: {
|
|
91
92
|
emitsPush: true,
|
|
92
|
-
|
|
93
|
+
// Fires when the reward becomes claimable (00:00 UTC), so it opens the daily-login claim view.
|
|
94
|
+
deepLink: () => '/daily-login',
|
|
93
95
|
pushTitleKey: 'dailyLogin.title',
|
|
94
96
|
pushBodyKey: 'dailyLogin.body',
|
|
95
97
|
inAppMessageKey: 'dailyLogin.body',
|
|
@@ -110,3 +112,7 @@ exports.NOTIFICATION_REGISTRY = {
|
|
|
110
112
|
catalogKeys: []
|
|
111
113
|
}
|
|
112
114
|
};
|
|
115
|
+
// The notification types that emit a mobile push (everything except COMPENSATION). Source of truth = each
|
|
116
|
+
// descriptor's emitsPush, so this cannot drift. This is the user-toggleable set surfaced in the mobile app's
|
|
117
|
+
// notification settings and validated by the API before persisting a preference.
|
|
118
|
+
exports.PUSH_NOTIFICATION_TYPES = notification_type_1.NOTIFICATION_TYPES.filter((type) => exports.NOTIFICATION_REGISTRY[type].emitsPush);
|
|
@@ -10,6 +10,7 @@ export interface UserSettingsAttributes {
|
|
|
10
10
|
user_id: string;
|
|
11
11
|
auto_dismiss: AutoDismissSettings;
|
|
12
12
|
locale: string | null;
|
|
13
|
+
notifications: Record<string, boolean>;
|
|
13
14
|
}
|
|
14
15
|
export type UserSettingsPk = 'user_id';
|
|
15
16
|
export type UserSettingsId = UserSettingsModel[UserSettingsPk];
|
|
@@ -18,6 +19,7 @@ export declare class UserSettingsModel extends Model<UserSettingsAttributes, Use
|
|
|
18
19
|
user_id: string;
|
|
19
20
|
auto_dismiss: AutoDismissSettings;
|
|
20
21
|
locale: string | null;
|
|
22
|
+
notifications: Record<string, boolean>;
|
|
21
23
|
user: AuthUserModel;
|
|
22
24
|
getUser: Sequelize.BelongsToGetAssociationMixin<AuthUserModel>;
|
|
23
25
|
setUser: Sequelize.BelongsToSetAssociationMixin<AuthUserModel, AuthUserId>;
|
|
@@ -27,8 +27,8 @@
|
|
|
27
27
|
"body": "Your team has been promoted to a higher division."
|
|
28
28
|
},
|
|
29
29
|
"dailyLogin": {
|
|
30
|
-
"title": "Daily reward
|
|
31
|
-
"body": "Your daily
|
|
30
|
+
"title": "Daily reward ready",
|
|
31
|
+
"body": "Your daily reward is ready to claim!"
|
|
32
32
|
},
|
|
33
33
|
"welcome": {
|
|
34
34
|
"title": "Welcome to World Aces",
|
|
@@ -27,8 +27,8 @@
|
|
|
27
27
|
"body": "Tu equipo ha ascendido a una división superior."
|
|
28
28
|
},
|
|
29
29
|
"dailyLogin": {
|
|
30
|
-
"title": "Recompensa diaria
|
|
31
|
-
"body": "Tu recompensa
|
|
30
|
+
"title": "Recompensa diaria lista",
|
|
31
|
+
"body": "¡Tu recompensa diaria está lista para reclamar!"
|
|
32
32
|
},
|
|
33
33
|
"welcome": {
|
|
34
34
|
"title": "Te damos la bienvenida a World Aces",
|
|
@@ -27,8 +27,8 @@
|
|
|
27
27
|
"body": "Votre équipe a été promue dans une division supérieure."
|
|
28
28
|
},
|
|
29
29
|
"dailyLogin": {
|
|
30
|
-
"title": "Récompense quotidienne
|
|
31
|
-
"body": "Votre récompense
|
|
30
|
+
"title": "Récompense quotidienne prête",
|
|
31
|
+
"body": "Votre récompense quotidienne est prête à être récupérée !"
|
|
32
32
|
},
|
|
33
33
|
"welcome": {
|
|
34
34
|
"title": "Bienvenue sur World Aces",
|
|
@@ -27,8 +27,8 @@
|
|
|
27
27
|
"body": "La tua squadra è stata promossa in una divisione superiore."
|
|
28
28
|
},
|
|
29
29
|
"dailyLogin": {
|
|
30
|
-
"title": "Ricompensa giornaliera
|
|
31
|
-
"body": "La tua ricompensa
|
|
30
|
+
"title": "Ricompensa giornaliera pronta",
|
|
31
|
+
"body": "La tua ricompensa giornaliera è pronta da riscattare!"
|
|
32
32
|
},
|
|
33
33
|
"welcome": {
|
|
34
34
|
"title": "Benvenuto in World Aces",
|
|
@@ -27,8 +27,8 @@
|
|
|
27
27
|
"body": "Twoja drużyna awansowała do wyższej dywizji."
|
|
28
28
|
},
|
|
29
29
|
"dailyLogin": {
|
|
30
|
-
"title": "
|
|
31
|
-
"body": "Twoja codzienna nagroda
|
|
30
|
+
"title": "Codzienna nagroda gotowa",
|
|
31
|
+
"body": "Twoja codzienna nagroda jest gotowa do odebrania!"
|
|
32
32
|
},
|
|
33
33
|
"welcome": {
|
|
34
34
|
"title": "Witaj w World Aces",
|
|
@@ -27,8 +27,8 @@
|
|
|
27
27
|
"body": "Seu time foi promovido para uma divisão superior."
|
|
28
28
|
},
|
|
29
29
|
"dailyLogin": {
|
|
30
|
-
"title": "Recompensa diária
|
|
31
|
-
"body": "Sua recompensa
|
|
30
|
+
"title": "Recompensa diária pronta",
|
|
31
|
+
"body": "Sua recompensa diária está pronta para coletar!"
|
|
32
32
|
},
|
|
33
33
|
"welcome": {
|
|
34
34
|
"title": "Boas-vindas ao World Aces",
|
|
@@ -27,8 +27,8 @@
|
|
|
27
27
|
"body": "Takımın bir üst gruba terfi etti."
|
|
28
28
|
},
|
|
29
29
|
"dailyLogin": {
|
|
30
|
-
"title": "Günlük ödül
|
|
31
|
-
"body": "Günlük
|
|
30
|
+
"title": "Günlük ödül hazır",
|
|
31
|
+
"body": "Günlük ödülün alınmaya hazır!"
|
|
32
32
|
},
|
|
33
33
|
"welcome": {
|
|
34
34
|
"title": "World Aces'e hoş geldin",
|
|
@@ -4,3 +4,5 @@ export declare const NOTIFICATION_LOCALES: readonly ["en", "es", "fr", "it", "pl
|
|
|
4
4
|
export type NotificationLocale = typeof NOTIFICATION_LOCALES[number];
|
|
5
5
|
export declare const DEFAULT_NOTIFICATION_LOCALE: NotificationLocale;
|
|
6
6
|
export declare function normalizeNotificationLocale(locale: string | null | undefined): NotificationLocale;
|
|
7
|
+
export type NotificationPreferences = Record<string, boolean>;
|
|
8
|
+
export declare function pushEnabledFor(prefs: NotificationPreferences | null | undefined, type: string): boolean;
|
|
@@ -24,3 +24,8 @@ export function normalizeNotificationLocale(locale) {
|
|
|
24
24
|
}
|
|
25
25
|
return DEFAULT_NOTIFICATION_LOCALE;
|
|
26
26
|
}
|
|
27
|
+
// Whether `type`'s mobile push should be sent for a user with these preferences (absent/true = send, false = suppress).
|
|
28
|
+
// Accepts a plain string like renderPush so a loose/unknown type still resolves (unknown = enabled).
|
|
29
|
+
export function pushEnabledFor(prefs, type) {
|
|
30
|
+
return prefs?.[type] !== false;
|
|
31
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { describe, it, expect } from '@jest/globals';
|
|
2
|
-
import { NOTIFICATION_TYPES, NOTIFICATION_LOCALES } from './notification-type';
|
|
3
|
-
import { NOTIFICATION_REGISTRY } from './registry';
|
|
2
|
+
import { NOTIFICATION_TYPES, NOTIFICATION_LOCALES, pushEnabledFor } from './notification-type';
|
|
3
|
+
import { NOTIFICATION_REGISTRY, PUSH_NOTIFICATION_TYPES } from './registry';
|
|
4
4
|
import { NOTIFICATION_CATALOG } from './catalog';
|
|
5
5
|
import { renderPush, notificationPath, interpolate, translateNotification } from './render';
|
|
6
6
|
function readNested(node, dotKey) {
|
|
@@ -124,3 +124,21 @@ describe('translateNotification + interpolate + notificationPath', () => {
|
|
|
124
124
|
expect(notificationPath('COMPENSATION', {})).toBe('/');
|
|
125
125
|
});
|
|
126
126
|
});
|
|
127
|
+
describe('push preferences (PUSH_NOTIFICATION_TYPES + pushEnabledFor)', () => {
|
|
128
|
+
it('is exactly the emitsPush types, COMPENSATION excluded', () => {
|
|
129
|
+
expect([...PUSH_NOTIFICATION_TYPES].sort((a, b) => a.localeCompare(b)))
|
|
130
|
+
.toEqual(NOTIFICATION_TYPES.filter((t) => NOTIFICATION_REGISTRY[t].emitsPush).sort((a, b) => a.localeCompare(b)));
|
|
131
|
+
expect(PUSH_NOTIFICATION_TYPES).not.toContain('COMPENSATION');
|
|
132
|
+
expect(PUSH_NOTIFICATION_TYPES).toContain('MATCH_RESULT');
|
|
133
|
+
expect(PUSH_NOTIFICATION_TYPES).toHaveLength(8);
|
|
134
|
+
});
|
|
135
|
+
it('is opt-out: absent / null / empty / true all enable, only explicit false suppresses', () => {
|
|
136
|
+
expect(pushEnabledFor(undefined, 'MATCH_RESULT')).toBe(true);
|
|
137
|
+
expect(pushEnabledFor(null, 'MATCH_RESULT')).toBe(true);
|
|
138
|
+
expect(pushEnabledFor({}, 'MATCH_RESULT')).toBe(true);
|
|
139
|
+
expect(pushEnabledFor({ MATCH_RESULT: true }, 'MATCH_RESULT')).toBe(true);
|
|
140
|
+
expect(pushEnabledFor({ MATCH_RESULT: false }, 'MATCH_RESULT')).toBe(false);
|
|
141
|
+
// disabling one type does not affect another
|
|
142
|
+
expect(pushEnabledFor({ MATCH_RESULT: false }, 'INJURY')).toBe(true);
|
|
143
|
+
});
|
|
144
|
+
});
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { NOTIFICATION_TYPES } from './notification-type';
|
|
1
2
|
function readString(value) {
|
|
2
3
|
return typeof value === 'string' && value !== '' ? value : null;
|
|
3
4
|
}
|
|
@@ -86,7 +87,8 @@ export const NOTIFICATION_REGISTRY = {
|
|
|
86
87
|
},
|
|
87
88
|
DAILY_LOGIN: {
|
|
88
89
|
emitsPush: true,
|
|
89
|
-
|
|
90
|
+
// Fires when the reward becomes claimable (00:00 UTC), so it opens the daily-login claim view.
|
|
91
|
+
deepLink: () => '/daily-login',
|
|
90
92
|
pushTitleKey: 'dailyLogin.title',
|
|
91
93
|
pushBodyKey: 'dailyLogin.body',
|
|
92
94
|
inAppMessageKey: 'dailyLogin.body',
|
|
@@ -107,3 +109,7 @@ export const NOTIFICATION_REGISTRY = {
|
|
|
107
109
|
catalogKeys: []
|
|
108
110
|
}
|
|
109
111
|
};
|
|
112
|
+
// The notification types that emit a mobile push (everything except COMPENSATION). Source of truth = each
|
|
113
|
+
// descriptor's emitsPush, so this cannot drift. This is the user-toggleable set surfaced in the mobile app's
|
|
114
|
+
// notification settings and validated by the API before persisting a preference.
|
|
115
|
+
export const PUSH_NOTIFICATION_TYPES = NOTIFICATION_TYPES.filter((type) => NOTIFICATION_REGISTRY[type].emitsPush);
|