@stevenkellner/team-conduct-api 1.0.22 → 1.0.24

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.
Files changed (42) hide show
  1. package/lib/src/functions/fine/add.js +7 -3
  2. package/lib/src/functions/fine/delete.js +5 -3
  3. package/lib/src/functions/fine/update.js +9 -6
  4. package/lib/src/locales/de.d.ts +66 -0
  5. package/lib/src/locales/de.js +99 -0
  6. package/lib/src/locales/en.d.ts +66 -0
  7. package/lib/src/locales/en.js +99 -0
  8. package/lib/src/types/Configuration.d.ts +3 -2
  9. package/lib/src/types/Configuration.js +2 -1
  10. package/lib/src/types/FineAmount.js +3 -3
  11. package/lib/src/types/FineTemplateRepetition.js +3 -3
  12. package/lib/src/types/Localization.d.ts +205 -60
  13. package/lib/src/types/Localization.js +65 -117
  14. package/lib/src/types/PayedState.js +1 -1
  15. package/lib/src/types/Pluralization.d.ts +17 -0
  16. package/lib/src/types/Pluralization.js +33 -0
  17. package/lib/src/types/UserRole.js +1 -1
  18. package/lib/src/types/index.d.ts +1 -0
  19. package/lib/src/types/index.js +1 -0
  20. package/lib/test/localization-utils.d.ts +0 -11
  21. package/lib/test/localization-utils.js +5 -49
  22. package/lib/test/localization.de.test.js +43 -80
  23. package/lib/test/localization.en.test.js +46 -85
  24. package/lib/tsconfig.tsbuildinfo +1 -1
  25. package/package.json +8 -10
  26. package/src/functions/fine/add.ts +7 -3
  27. package/src/functions/fine/delete.ts +5 -3
  28. package/src/functions/fine/update.ts +10 -7
  29. package/src/locales/de.ts +97 -0
  30. package/src/locales/en.ts +97 -0
  31. package/src/types/Configuration.ts +4 -3
  32. package/src/types/FineAmount.ts +3 -3
  33. package/src/types/FineTemplateRepetition.ts +3 -3
  34. package/src/types/Localization.ts +67 -83
  35. package/src/types/PayedState.ts +1 -1
  36. package/src/types/Pluralization.ts +44 -0
  37. package/src/types/UserRole.ts +3 -3
  38. package/src/types/index.ts +1 -0
  39. package/lib/src/locales/de.json +0 -85
  40. package/lib/src/locales/en.json +0 -85
  41. package/src/locales/de.json +0 -85
  42. package/src/locales/en.json +0 -85
@@ -1,77 +1,40 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || (function () {
19
- var ownKeys = function(o) {
20
- ownKeys = Object.getOwnPropertyNames || function (o) {
21
- var ar = [];
22
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
- return ar;
24
- };
25
- return ownKeys(o);
26
- };
27
- return function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
- __setModuleDefault(result, mod);
32
- return result;
33
- };
34
- })();
35
2
  Object.defineProperty(exports, "__esModule", { value: true });
36
3
  const core_1 = require("@assertive-ts/core");
37
- const localizationEN = __importStar(require("../src/locales/en.json"));
38
- const localizationDE = __importStar(require("../src/locales/de.json"));
4
+ const en_1 = require("../src/locales/en");
5
+ const de_1 = require("../src/locales/de");
39
6
  const types_1 = require("../src/types");
40
7
  const localization_utils_1 = require("./localization-utils");
41
8
  describe('Localization for de', () => {
42
- const testedKeys = new localization_utils_1.TestedKeys((0, localization_utils_1.localizationWithoutDefault)(localizationDE));
43
9
  before(() => {
44
- types_1.Localization.shared.setLocale('de');
45
- });
46
- after('all values should be tested', () => {
47
- testedKeys.checkAllTested();
10
+ types_1.Localization.locale = 'de';
48
11
  });
49
12
  it('should have the same keys as en', () => {
50
- (0, localization_utils_1.hasSameKeys)((0, localization_utils_1.localizationWithoutDefault)(localizationDE), (0, localization_utils_1.localizationWithoutDefault)(localizationEN));
13
+ (0, localization_utils_1.hasSameKeys)(de_1.localizationDE, en_1.localizationEN);
51
14
  });
52
15
  describe('notification.fine should be tested', () => {
53
16
  it('notification.fine.new should be tested', () => {
54
- testedKeys.testArgs(key => key.notification.fine.new.title, ['fine-reason'], 'fine-reason');
55
- testedKeys.testArgs(key => key.notification.fine.new.body, ['10,50 €'], 'Du hast eine neue Strafe von 10,50 €. Bitte so schnell wie möglich zahlen.');
17
+ (0, core_1.expect)(types_1.Localization.shared.notification.fine.new.title.value({ reason: 'fine-reason' })).toBeEqual('fine-reason');
18
+ (0, core_1.expect)(types_1.Localization.shared.notification.fine.new.body.value({ amount: '10,50 €' })).toBeEqual('Du hast eine neue Strafe von 10,50 €. Bitte so schnell wie möglich zahlen.');
56
19
  });
57
20
  it('notification.fine.reminder should be tested', () => {
58
- testedKeys.test(key => key.notification.fine.reminder.title, 'Du hast noch offene Strafen');
59
- testedKeys.testArgs(key => key.notification.fine.reminder.body, ['10,50 €'], 'Bei dir sind noch 10,50 € offen. Bitte so schnell wie möglich zahlen.');
21
+ (0, core_1.expect)(types_1.Localization.shared.notification.fine.reminder.title.value()).toBeEqual('Du hast noch offene Strafen');
22
+ (0, core_1.expect)(types_1.Localization.shared.notification.fine.reminder.body.value({ amount: '10,50 €' })).toBeEqual('Bei dir sind noch 10,50 € offen. Bitte so schnell wie möglich zahlen.');
60
23
  });
61
24
  it('notification.fine.stateChange should be tested', () => {
62
- testedKeys.test(key => key.notification.fine.stateChange.title, 'Eine deiner Strafen hat sich geändert');
63
- testedKeys.testArgs(key => key.notification.fine.stateChange.bodyPayed, ['10,50 €', 'fine-reason'], 'Du hast eine Strafe von 10,50 € bezahlt (fine-reason).');
64
- testedKeys.testArgs(key => key.notification.fine.stateChange.bodyUnpayed, ['10,50 €', 'fine-reason'], '10,50 €, fine-reason ist noch offen.');
65
- testedKeys.testArgs(key => key.notification.fine.stateChange.bodyDeleted, ['10,50 €', 'fine-reason'], '10,50 €, fine-reason wurde gelöscht.');
25
+ (0, core_1.expect)(types_1.Localization.shared.notification.fine.stateChange.title.value()).toBeEqual('Eine deiner Strafen hat sich geändert');
26
+ (0, core_1.expect)(types_1.Localization.shared.notification.fine.stateChange.bodyPayed.value({ amount: '10,50 €', reason: 'fine-reason' })).toBeEqual('Du hast eine Strafe von 10,50 € bezahlt (fine-reason).');
27
+ (0, core_1.expect)(types_1.Localization.shared.notification.fine.stateChange.bodyUnpayed.value({ amount: '10,50 €', reason: 'fine-reason' })).toBeEqual('fine-reason, 10,50 ist noch offen.');
28
+ (0, core_1.expect)(types_1.Localization.shared.notification.fine.stateChange.bodyDeleted.value({ amount: '10,50 €', reason: 'fine-reason' })).toBeEqual('fine-reason, 10,50 wurde gelöscht.');
66
29
  });
67
30
  });
68
31
  describe('fineAmount should be tested', () => {
69
32
  it('fineAmount.item.type.crateOfBeer should be tested', () => {
70
- testedKeys.test(key => key.fineAmount.item.type.crateOfBeer, 'Kasten Bier');
71
- testedKeys.testN(key => key.fineAmount.item.type.crateOfBeer, 1, 'Ein Kasten Bier');
72
- testedKeys.testN(key => key.fineAmount.item.type.crateOfBeer, 4, '4 Kästen Bier');
73
- testedKeys.testN(key => key.fineAmount.item.type.crateOfBeerWithoutCount, 1, 'Kasten Bier');
74
- testedKeys.testN(key => key.fineAmount.item.type.crateOfBeerWithoutCount, 4, 'Kästen Bier');
33
+ (0, core_1.expect)(types_1.Localization.shared.fineAmount.item.type.crateOfBeer.name.value()).toBeEqual('Kasten Bier');
34
+ (0, core_1.expect)(types_1.Localization.shared.fineAmount.item.type.crateOfBeer.withCount.value(1)).toBeEqual('Ein Kasten Bier');
35
+ (0, core_1.expect)(types_1.Localization.shared.fineAmount.item.type.crateOfBeer.withCount.value(4)).toBeEqual('4 Kästen Bier');
36
+ (0, core_1.expect)(types_1.Localization.shared.fineAmount.item.type.crateOfBeer.withoutCount.value(1)).toBeEqual('Kasten Bier');
37
+ (0, core_1.expect)(types_1.Localization.shared.fineAmount.item.type.crateOfBeer.withoutCount.value(4)).toBeEqual('Kästen Bier');
75
38
  });
76
39
  it('fineAmount.item.type.crateOfBeer should be formatted correctly', () => {
77
40
  (0, core_1.expect)(types_1.FineAmount.Item.Type.formatted('crateOfBeer')).toBeEqual('Kasten Bier');
@@ -83,11 +46,11 @@ describe('Localization for de', () => {
83
46
  });
84
47
  describe('fineTemplateRepetition should be tested', () => {
85
48
  it('fineTemplateRepetition.item.minute should be tested', () => {
86
- testedKeys.test(key => key.fineTemplateRepetition.item.minute, 'Minute');
87
- testedKeys.testN(key => key.fineTemplateRepetition.item.minute, 1, '1 Minute');
88
- testedKeys.testN(key => key.fineTemplateRepetition.item.minute, 4, '4 Minuten');
89
- testedKeys.testN(key => key.fineTemplateRepetition.item.minuteWithoutCount, 1, 'Minute');
90
- testedKeys.testN(key => key.fineTemplateRepetition.item.minuteWithoutCount, 4, 'Minuten');
49
+ (0, core_1.expect)(types_1.Localization.shared.fineTemplateRepetition.item.minute.name.value()).toBeEqual('Minute');
50
+ (0, core_1.expect)(types_1.Localization.shared.fineTemplateRepetition.item.minute.withCount.value(1)).toBeEqual('1 Minute');
51
+ (0, core_1.expect)(types_1.Localization.shared.fineTemplateRepetition.item.minute.withCount.value(4)).toBeEqual('4 Minuten');
52
+ (0, core_1.expect)(types_1.Localization.shared.fineTemplateRepetition.item.minute.withoutCount.value(1)).toBeEqual('Minute');
53
+ (0, core_1.expect)(types_1.Localization.shared.fineTemplateRepetition.item.minute.withoutCount.value(4)).toBeEqual('Minuten');
91
54
  });
92
55
  it('fineTemplateRepetition.item.minute should be formatted correctly', () => {
93
56
  (0, core_1.expect)(types_1.FineTemplateRepetition.Item.formatted('minute')).toBeEqual('Minute');
@@ -97,11 +60,11 @@ describe('Localization for de', () => {
97
60
  (0, core_1.expect)(new types_1.FineTemplateRepetition('minute', null).formattedWithoutCount(4)).toBeEqual('Minuten');
98
61
  });
99
62
  it('fineTemplateRepetition.item.day should be tested', () => {
100
- testedKeys.test(key => key.fineTemplateRepetition.item.day, 'Tag');
101
- testedKeys.testN(key => key.fineTemplateRepetition.item.day, 1, '1 Tag');
102
- testedKeys.testN(key => key.fineTemplateRepetition.item.day, 4, '4 Tage');
103
- testedKeys.testN(key => key.fineTemplateRepetition.item.dayWithoutCount, 1, 'Tag');
104
- testedKeys.testN(key => key.fineTemplateRepetition.item.dayWithoutCount, 4, 'Tage');
63
+ (0, core_1.expect)(types_1.Localization.shared.fineTemplateRepetition.item.day.name.value()).toBeEqual('Tag');
64
+ (0, core_1.expect)(types_1.Localization.shared.fineTemplateRepetition.item.day.withCount.value(1)).toBeEqual('1 Tag');
65
+ (0, core_1.expect)(types_1.Localization.shared.fineTemplateRepetition.item.day.withCount.value(4)).toBeEqual('4 Tage');
66
+ (0, core_1.expect)(types_1.Localization.shared.fineTemplateRepetition.item.day.withoutCount.value(1)).toBeEqual('Tag');
67
+ (0, core_1.expect)(types_1.Localization.shared.fineTemplateRepetition.item.day.withoutCount.value(4)).toBeEqual('Tage');
105
68
  });
106
69
  it('fineTemplateRepetition.item.day should be formatted correctly', () => {
107
70
  (0, core_1.expect)(types_1.FineTemplateRepetition.Item.formatted('day')).toBeEqual('Tag');
@@ -111,11 +74,11 @@ describe('Localization for de', () => {
111
74
  (0, core_1.expect)(new types_1.FineTemplateRepetition('day', null).formattedWithoutCount(4)).toBeEqual('Tage');
112
75
  });
113
76
  it('fineTemplateRepetition.item.item should be tested', () => {
114
- testedKeys.test(key => key.fineTemplateRepetition.item.item, 'Teil');
115
- testedKeys.testN(key => key.fineTemplateRepetition.item.item, 1, '1 Teil');
116
- testedKeys.testN(key => key.fineTemplateRepetition.item.item, 4, '4 Teile');
117
- testedKeys.testN(key => key.fineTemplateRepetition.item.itemWithoutCount, 1, 'Teil');
118
- testedKeys.testN(key => key.fineTemplateRepetition.item.itemWithoutCount, 4, 'Teile');
77
+ (0, core_1.expect)(types_1.Localization.shared.fineTemplateRepetition.item.item.name.value()).toBeEqual('Teil');
78
+ (0, core_1.expect)(types_1.Localization.shared.fineTemplateRepetition.item.item.withCount.value(1)).toBeEqual('1 Teil');
79
+ (0, core_1.expect)(types_1.Localization.shared.fineTemplateRepetition.item.item.withCount.value(4)).toBeEqual('4 Teile');
80
+ (0, core_1.expect)(types_1.Localization.shared.fineTemplateRepetition.item.item.withoutCount.value(1)).toBeEqual('Teil');
81
+ (0, core_1.expect)(types_1.Localization.shared.fineTemplateRepetition.item.item.withoutCount.value(4)).toBeEqual('Teile');
119
82
  });
120
83
  it('fineTemplateRepetition.item.item should be formatted correctly', () => {
121
84
  (0, core_1.expect)(types_1.FineTemplateRepetition.Item.formatted('item')).toBeEqual('Teil');
@@ -125,11 +88,11 @@ describe('Localization for de', () => {
125
88
  (0, core_1.expect)(new types_1.FineTemplateRepetition('item', null).formattedWithoutCount(4)).toBeEqual('Teile');
126
89
  });
127
90
  it('fineTemplateRepetition.item.count should be tested', () => {
128
- testedKeys.test(key => key.fineTemplateRepetition.item.count, 'Anzahl');
129
- testedKeys.testN(key => key.fineTemplateRepetition.item.count, 1, '1 mal');
130
- testedKeys.testN(key => key.fineTemplateRepetition.item.count, 4, '4 mal');
131
- testedKeys.testN(key => key.fineTemplateRepetition.item.countWithoutCount, 1, 'mal');
132
- testedKeys.testN(key => key.fineTemplateRepetition.item.countWithoutCount, 4, 'mal');
91
+ (0, core_1.expect)(types_1.Localization.shared.fineTemplateRepetition.item.count.name.value()).toBeEqual('Anzahl');
92
+ (0, core_1.expect)(types_1.Localization.shared.fineTemplateRepetition.item.count.withCount.value(1)).toBeEqual('1 mal');
93
+ (0, core_1.expect)(types_1.Localization.shared.fineTemplateRepetition.item.count.withCount.value(4)).toBeEqual('4 mal');
94
+ (0, core_1.expect)(types_1.Localization.shared.fineTemplateRepetition.item.count.withoutCount.value(1)).toBeEqual('mal');
95
+ (0, core_1.expect)(types_1.Localization.shared.fineTemplateRepetition.item.count.withoutCount.value(4)).toBeEqual('mal');
133
96
  });
134
97
  it('fineTemplateRepetition.item.count should be formatted correctly', () => {
135
98
  (0, core_1.expect)(types_1.FineTemplateRepetition.Item.formatted('count')).toBeEqual('Anzahl');
@@ -141,13 +104,13 @@ describe('Localization for de', () => {
141
104
  });
142
105
  describe('payedState should be tested', () => {
143
106
  it('payedState.payed should be tested', () => {
144
- testedKeys.test(key => key.payedState.payed, 'Bezahlt');
107
+ (0, core_1.expect)(types_1.Localization.shared.payedState.payed.value()).toBeEqual('Bezahlt');
145
108
  });
146
109
  it('payedState.payed should be formatted correctly', () => {
147
110
  (0, core_1.expect)(types_1.PayedState.formatted('payed')).toBeEqual('Bezahlt');
148
111
  });
149
112
  it('payedState.notPayed should be tested', () => {
150
- testedKeys.test(key => key.payedState.notPayed, 'Offen');
113
+ (0, core_1.expect)(types_1.Localization.shared.payedState.notPayed.value()).toBeEqual('Offen');
151
114
  });
152
115
  it('payedState.notPayed should be formatted correctly', () => {
153
116
  (0, core_1.expect)(types_1.PayedState.formatted('notPayed')).toBeEqual('Offen');
@@ -155,25 +118,25 @@ describe('Localization for de', () => {
155
118
  });
156
119
  describe('userRole should be tested', () => {
157
120
  it('userRole.personManager should be tested', () => {
158
- testedKeys.test(key => key.userRole.personManager, 'Personenmanager');
121
+ (0, core_1.expect)(types_1.Localization.shared.userRole.personManager.value()).toBeEqual('Personenmanager');
159
122
  });
160
123
  it('userRole.personManager should be formatted correctly', () => {
161
124
  (0, core_1.expect)(types_1.UserRole.formatted('person-manager')).toBeEqual('Personenmanager');
162
125
  });
163
126
  it('userRole.fineTemplateManager should be tested', () => {
164
- testedKeys.test(key => key.userRole.fineTemplateManager, 'Strafvorlagenmanager');
127
+ (0, core_1.expect)(types_1.Localization.shared.userRole.fineTemplateManager.value()).toBeEqual('Strafvorlagenmanager');
165
128
  });
166
129
  it('userRole.fineTemplateManager should be formatted correctly', () => {
167
130
  (0, core_1.expect)(types_1.UserRole.formatted('fineTemplate-manager')).toBeEqual('Strafvorlagenmanager');
168
131
  });
169
132
  it('userRole.fineManager should be tested', () => {
170
- testedKeys.test(key => key.userRole.fineManager, 'Strafenmanager');
133
+ (0, core_1.expect)(types_1.Localization.shared.userRole.fineManager.value()).toBeEqual('Strafenmanager');
171
134
  });
172
135
  it('userRole.fineManager should be formatted correctly', () => {
173
136
  (0, core_1.expect)(types_1.UserRole.formatted('fine-manager')).toBeEqual('Strafenmanager');
174
137
  });
175
138
  it('userRole.teamManager should be tested', () => {
176
- testedKeys.test(key => key.userRole.teamManager, 'Teammanager');
139
+ (0, core_1.expect)(types_1.Localization.shared.userRole.teamManager.value()).toBeEqual('Teammanager');
177
140
  });
178
141
  it('userRole.teamManager should be formatted correctly', () => {
179
142
  (0, core_1.expect)(types_1.UserRole.formatted('team-manager')).toBeEqual('Teammanager');
@@ -1,73 +1,34 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || (function () {
19
- var ownKeys = function(o) {
20
- ownKeys = Object.getOwnPropertyNames || function (o) {
21
- var ar = [];
22
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
- return ar;
24
- };
25
- return ownKeys(o);
26
- };
27
- return function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
- __setModuleDefault(result, mod);
32
- return result;
33
- };
34
- })();
35
2
  Object.defineProperty(exports, "__esModule", { value: true });
36
3
  const core_1 = require("@assertive-ts/core");
37
- const localizationEN = __importStar(require("../src/locales/en.json"));
38
4
  const types_1 = require("../src/types");
39
- const localization_utils_1 = require("./localization-utils");
40
5
  describe('Localization for en', () => {
41
- const testedKeys = new localization_utils_1.TestedKeys((0, localization_utils_1.localizationWithoutDefault)(localizationEN));
42
6
  before(() => {
43
- types_1.Localization.shared.setLocale('en');
44
- });
45
- after('all values should be tested', () => {
46
- testedKeys.checkAllTested();
7
+ types_1.Localization.locale = 'en';
47
8
  });
48
9
  describe('notification.fine should be tested', () => {
49
10
  it('notification.fine.new should be tested', () => {
50
- testedKeys.testArgs(key => key.notification.fine.new.title, ['fine-reason'], 'fine-reason');
51
- testedKeys.testArgs(key => key.notification.fine.new.body, ['10.50 €'], 'You have a new fine of 10.50 €. Please pay it as soon as possible.');
11
+ (0, core_1.expect)(types_1.Localization.shared.notification.fine.new.title.value({ reason: 'fine-reason' })).toBeEqual('fine-reason');
12
+ (0, core_1.expect)(types_1.Localization.shared.notification.fine.new.body.value({ amount: '10.50 €' })).toBeEqual('You have a new fine of 10.50 €. Please pay it as soon as possible.');
52
13
  });
53
14
  it('notification.fine.reminder should be tested', () => {
54
- testedKeys.test(key => key.notification.fine.reminder.title, 'You still have outstanding fines');
55
- testedKeys.testArgs(key => key.notification.fine.reminder.body, ['10.50 €'], 'You still have 10.50 € outstanding. Please pay as soon as possible.');
15
+ (0, core_1.expect)(types_1.Localization.shared.notification.fine.reminder.title.value()).toBeEqual('You still have outstanding fines');
16
+ (0, core_1.expect)(types_1.Localization.shared.notification.fine.reminder.body.value({ amount: '10.50 €' })).toBeEqual('You still have 10.50 € outstanding. Please pay as soon as possible.');
56
17
  });
57
18
  it('notification.fine.stateChange should be tested', () => {
58
- testedKeys.test(key => key.notification.fine.stateChange.title, 'One of your fines has changed');
59
- testedKeys.testArgs(key => key.notification.fine.stateChange.bodyPayed, ['10.50 €', 'fine-reason'], 'You have paid a fine of 10.50 € (fine-reason).');
60
- testedKeys.testArgs(key => key.notification.fine.stateChange.bodyUnpayed, ['10.50 €', 'fine-reason'], '10.50 €, fine-reason is still outstanding.');
61
- testedKeys.testArgs(key => key.notification.fine.stateChange.bodyDeleted, ['10.50 €', 'fine-reason'], '10.50 €, fine-reason has been deleted.');
19
+ (0, core_1.expect)(types_1.Localization.shared.notification.fine.stateChange.title.value()).toBeEqual('One of your fines has changed');
20
+ (0, core_1.expect)(types_1.Localization.shared.notification.fine.stateChange.bodyPayed.value({ amount: '10.50 €', reason: 'fine-reason' })).toBeEqual('You have paid a fine of 10.50 € (fine-reason).');
21
+ (0, core_1.expect)(types_1.Localization.shared.notification.fine.stateChange.bodyUnpayed.value({ amount: '10.50 €', reason: 'fine-reason' })).toBeEqual('fine-reason, 10.50 is still outstanding.');
22
+ (0, core_1.expect)(types_1.Localization.shared.notification.fine.stateChange.bodyDeleted.value({ amount: '10.50 €', reason: 'fine-reason' })).toBeEqual('fine-reason, 10.50 has been deleted.');
62
23
  });
63
24
  });
64
25
  describe('fineAmount should be tested', () => {
65
26
  it('fineAmount.item.type.crateOfBeer should be tested', () => {
66
- testedKeys.test(key => key.fineAmount.item.type.crateOfBeer, 'Crate of Beer');
67
- testedKeys.testN(key => key.fineAmount.item.type.crateOfBeer, 1, 'a crate of beer');
68
- testedKeys.testN(key => key.fineAmount.item.type.crateOfBeer, 4, '4 crates of beer');
69
- testedKeys.testN(key => key.fineAmount.item.type.crateOfBeerWithoutCount, 1, 'Crate of Beer');
70
- testedKeys.testN(key => key.fineAmount.item.type.crateOfBeerWithoutCount, 4, 'Crates of Beer');
27
+ (0, core_1.expect)(types_1.Localization.shared.fineAmount.item.type.crateOfBeer.name.value()).toBeEqual('Crate of Beer');
28
+ (0, core_1.expect)(types_1.Localization.shared.fineAmount.item.type.crateOfBeer.withCount.value(1)).toBeEqual('a crate of beer');
29
+ (0, core_1.expect)(types_1.Localization.shared.fineAmount.item.type.crateOfBeer.withCount.value(4)).toBeEqual('4 crates of beer');
30
+ (0, core_1.expect)(types_1.Localization.shared.fineAmount.item.type.crateOfBeer.withoutCount.value(1)).toBeEqual('Crate of Beer');
31
+ (0, core_1.expect)(types_1.Localization.shared.fineAmount.item.type.crateOfBeer.withoutCount.value(4)).toBeEqual('Crates of Beer');
71
32
  });
72
33
  it('fineAmount.item.type.crateOfBeer should be formatted correctly', () => {
73
34
  (0, core_1.expect)(types_1.FineAmount.Item.Type.formatted('crateOfBeer')).toBeEqual('Crate of Beer');
@@ -79,53 +40,53 @@ describe('Localization for en', () => {
79
40
  });
80
41
  describe('fineTemplateRepetition should be tested', () => {
81
42
  it('fineTemplateRepetition.item.minute should be tested', () => {
82
- testedKeys.test(key => key.fineTemplateRepetition.item.minute, 'Minute');
83
- testedKeys.testN(key => key.fineTemplateRepetition.item.minute, 1, '1 minute');
84
- testedKeys.testN(key => key.fineTemplateRepetition.item.minute, 4, '4 minutes');
85
- testedKeys.testN(key => key.fineTemplateRepetition.item.minuteWithoutCount, 1, 'Minute');
86
- testedKeys.testN(key => key.fineTemplateRepetition.item.minuteWithoutCount, 4, 'Minutes');
43
+ (0, core_1.expect)(types_1.Localization.shared.fineTemplateRepetition.item.minute.name.value()).toBeEqual('Minute');
44
+ (0, core_1.expect)(types_1.Localization.shared.fineTemplateRepetition.item.minute.withCount.value(1)).toBeEqual('1 minute');
45
+ (0, core_1.expect)(types_1.Localization.shared.fineTemplateRepetition.item.minute.withCount.value(4)).toBeEqual('4 minutes');
46
+ (0, core_1.expect)(types_1.Localization.shared.fineTemplateRepetition.item.minute.withoutCount.value(1)).toBeEqual('minute');
47
+ (0, core_1.expect)(types_1.Localization.shared.fineTemplateRepetition.item.minute.withoutCount.value(4)).toBeEqual('minutes');
87
48
  });
88
49
  it('fineTemplateRepetition.item.minute should be formatted correctly', () => {
89
50
  (0, core_1.expect)(types_1.FineTemplateRepetition.Item.formatted('minute')).toBeEqual('Minute');
90
51
  (0, core_1.expect)(new types_1.FineTemplateRepetition('minute', null).formatted(1)).toBeEqual('1 minute');
91
52
  (0, core_1.expect)(new types_1.FineTemplateRepetition('minute', null).formatted(4)).toBeEqual('4 minutes');
92
- (0, core_1.expect)(new types_1.FineTemplateRepetition('minute', null).formattedWithoutCount(1)).toBeEqual('Minute');
93
- (0, core_1.expect)(new types_1.FineTemplateRepetition('minute', null).formattedWithoutCount(4)).toBeEqual('Minutes');
53
+ (0, core_1.expect)(new types_1.FineTemplateRepetition('minute', null).formattedWithoutCount(1)).toBeEqual('minute');
54
+ (0, core_1.expect)(new types_1.FineTemplateRepetition('minute', null).formattedWithoutCount(4)).toBeEqual('minutes');
94
55
  });
95
56
  it('fineTemplateRepetition.item.day should be tested', () => {
96
- testedKeys.test(key => key.fineTemplateRepetition.item.day, 'Day');
97
- testedKeys.testN(key => key.fineTemplateRepetition.item.day, 1, '1 day');
98
- testedKeys.testN(key => key.fineTemplateRepetition.item.day, 4, '4 days');
99
- testedKeys.testN(key => key.fineTemplateRepetition.item.dayWithoutCount, 1, 'Day');
100
- testedKeys.testN(key => key.fineTemplateRepetition.item.dayWithoutCount, 4, 'Days');
57
+ (0, core_1.expect)(types_1.Localization.shared.fineTemplateRepetition.item.day.name.value()).toBeEqual('Day');
58
+ (0, core_1.expect)(types_1.Localization.shared.fineTemplateRepetition.item.day.withCount.value(1)).toBeEqual('1 day');
59
+ (0, core_1.expect)(types_1.Localization.shared.fineTemplateRepetition.item.day.withCount.value(4)).toBeEqual('4 days');
60
+ (0, core_1.expect)(types_1.Localization.shared.fineTemplateRepetition.item.day.withoutCount.value(1)).toBeEqual('day');
61
+ (0, core_1.expect)(types_1.Localization.shared.fineTemplateRepetition.item.day.withoutCount.value(4)).toBeEqual('days');
101
62
  });
102
63
  it('fineTemplateRepetition.item.day should be formatted correctly', () => {
103
64
  (0, core_1.expect)(types_1.FineTemplateRepetition.Item.formatted('day')).toBeEqual('Day');
104
65
  (0, core_1.expect)(new types_1.FineTemplateRepetition('day', null).formatted(1)).toBeEqual('1 day');
105
66
  (0, core_1.expect)(new types_1.FineTemplateRepetition('day', null).formatted(4)).toBeEqual('4 days');
106
- (0, core_1.expect)(new types_1.FineTemplateRepetition('day', null).formattedWithoutCount(1)).toBeEqual('Day');
107
- (0, core_1.expect)(new types_1.FineTemplateRepetition('day', null).formattedWithoutCount(4)).toBeEqual('Days');
67
+ (0, core_1.expect)(new types_1.FineTemplateRepetition('day', null).formattedWithoutCount(1)).toBeEqual('day');
68
+ (0, core_1.expect)(new types_1.FineTemplateRepetition('day', null).formattedWithoutCount(4)).toBeEqual('days');
108
69
  });
109
70
  it('fineTemplateRepetition.item.item should be tested', () => {
110
- testedKeys.test(key => key.fineTemplateRepetition.item.item, 'Item');
111
- testedKeys.testN(key => key.fineTemplateRepetition.item.item, 1, '1 item');
112
- testedKeys.testN(key => key.fineTemplateRepetition.item.item, 4, '4 items');
113
- testedKeys.testN(key => key.fineTemplateRepetition.item.itemWithoutCount, 1, 'Item');
114
- testedKeys.testN(key => key.fineTemplateRepetition.item.itemWithoutCount, 4, 'Items');
71
+ (0, core_1.expect)(types_1.Localization.shared.fineTemplateRepetition.item.item.name.value()).toBeEqual('Item');
72
+ (0, core_1.expect)(types_1.Localization.shared.fineTemplateRepetition.item.item.withCount.value(1)).toBeEqual('1 item');
73
+ (0, core_1.expect)(types_1.Localization.shared.fineTemplateRepetition.item.item.withCount.value(4)).toBeEqual('4 items');
74
+ (0, core_1.expect)(types_1.Localization.shared.fineTemplateRepetition.item.item.withoutCount.value(1)).toBeEqual('item');
75
+ (0, core_1.expect)(types_1.Localization.shared.fineTemplateRepetition.item.item.withoutCount.value(4)).toBeEqual('items');
115
76
  });
116
77
  it('fineTemplateRepetition.item.item should be formatted correctly', () => {
117
78
  (0, core_1.expect)(types_1.FineTemplateRepetition.Item.formatted('item')).toBeEqual('Item');
118
79
  (0, core_1.expect)(new types_1.FineTemplateRepetition('item', null).formatted(1)).toBeEqual('1 item');
119
80
  (0, core_1.expect)(new types_1.FineTemplateRepetition('item', null).formatted(4)).toBeEqual('4 items');
120
- (0, core_1.expect)(new types_1.FineTemplateRepetition('item', null).formattedWithoutCount(1)).toBeEqual('Item');
121
- (0, core_1.expect)(new types_1.FineTemplateRepetition('item', null).formattedWithoutCount(4)).toBeEqual('Items');
81
+ (0, core_1.expect)(new types_1.FineTemplateRepetition('item', null).formattedWithoutCount(1)).toBeEqual('item');
82
+ (0, core_1.expect)(new types_1.FineTemplateRepetition('item', null).formattedWithoutCount(4)).toBeEqual('items');
122
83
  });
123
84
  it('fineTemplateRepetition.item.count should be tested', () => {
124
- testedKeys.test(key => key.fineTemplateRepetition.item.count, 'Count');
125
- testedKeys.testN(key => key.fineTemplateRepetition.item.count, 1, '1 time');
126
- testedKeys.testN(key => key.fineTemplateRepetition.item.count, 4, '4 times');
127
- testedKeys.testN(key => key.fineTemplateRepetition.item.countWithoutCount, 1, 'time');
128
- testedKeys.testN(key => key.fineTemplateRepetition.item.countWithoutCount, 4, 'times');
85
+ (0, core_1.expect)(types_1.Localization.shared.fineTemplateRepetition.item.count.name.value()).toBeEqual('Count');
86
+ (0, core_1.expect)(types_1.Localization.shared.fineTemplateRepetition.item.count.withCount.value(1)).toBeEqual('1 time');
87
+ (0, core_1.expect)(types_1.Localization.shared.fineTemplateRepetition.item.count.withCount.value(4)).toBeEqual('4 times');
88
+ (0, core_1.expect)(types_1.Localization.shared.fineTemplateRepetition.item.count.withoutCount.value(1)).toBeEqual('time');
89
+ (0, core_1.expect)(types_1.Localization.shared.fineTemplateRepetition.item.count.withoutCount.value(4)).toBeEqual('times');
129
90
  });
130
91
  it('fineTemplateRepetition.item.count should be formatted correctly', () => {
131
92
  (0, core_1.expect)(types_1.FineTemplateRepetition.Item.formatted('count')).toBeEqual('Count');
@@ -137,13 +98,13 @@ describe('Localization for en', () => {
137
98
  });
138
99
  describe('payedState should be tested', () => {
139
100
  it('payedState.payed should be tested', () => {
140
- testedKeys.test(key => key.payedState.payed, 'Paid');
101
+ (0, core_1.expect)(types_1.Localization.shared.payedState.payed.value()).toBeEqual('Paid');
141
102
  });
142
103
  it('payedState.payed should be formatted correctly', () => {
143
104
  (0, core_1.expect)(types_1.PayedState.formatted('payed')).toBeEqual('Paid');
144
105
  });
145
106
  it('payedState.notPayed should be tested', () => {
146
- testedKeys.test(key => key.payedState.notPayed, 'Outstanding');
107
+ (0, core_1.expect)(types_1.Localization.shared.payedState.notPayed.value()).toBeEqual('Outstanding');
147
108
  });
148
109
  it('payedState.notPayed should be formatted correctly', () => {
149
110
  (0, core_1.expect)(types_1.PayedState.formatted('notPayed')).toBeEqual('Outstanding');
@@ -151,25 +112,25 @@ describe('Localization for en', () => {
151
112
  });
152
113
  describe('userRole should be tested', () => {
153
114
  it('userRole.personManager should be tested', () => {
154
- testedKeys.test(key => key.userRole.personManager, 'Person Manager');
115
+ (0, core_1.expect)(types_1.Localization.shared.userRole.personManager.value()).toBeEqual('Person Manager');
155
116
  });
156
117
  it('userRole.personManager should be formatted correctly', () => {
157
118
  (0, core_1.expect)(types_1.UserRole.formatted('person-manager')).toBeEqual('Person Manager');
158
119
  });
159
120
  it('userRole.fineTemplateManager should be tested', () => {
160
- testedKeys.test(key => key.userRole.fineTemplateManager, 'Fine Template Manager');
121
+ (0, core_1.expect)(types_1.Localization.shared.userRole.fineTemplateManager.value()).toBeEqual('Fine Template Manager');
161
122
  });
162
123
  it('userRole.fineTemplateManager should be formatted correctly', () => {
163
124
  (0, core_1.expect)(types_1.UserRole.formatted('fineTemplate-manager')).toBeEqual('Fine Template Manager');
164
125
  });
165
126
  it('userRole.fineManager should be tested', () => {
166
- testedKeys.test(key => key.userRole.fineManager, 'Fine Manager');
127
+ (0, core_1.expect)(types_1.Localization.shared.userRole.fineManager.value()).toBeEqual('Fine Manager');
167
128
  });
168
129
  it('userRole.fineManager should be formatted correctly', () => {
169
130
  (0, core_1.expect)(types_1.UserRole.formatted('fine-manager')).toBeEqual('Fine Manager');
170
131
  });
171
132
  it('userRole.teamManager should be tested', () => {
172
- testedKeys.test(key => key.userRole.teamManager, 'Team Manager');
133
+ (0, core_1.expect)(types_1.Localization.shared.userRole.teamManager.value()).toBeEqual('Team Manager');
173
134
  });
174
135
  it('userRole.teamManager should be formatted correctly', () => {
175
136
  (0, core_1.expect)(types_1.UserRole.formatted('team-manager')).toBeEqual('Team Manager');
@@ -1 +1 @@
1
- {"root":["../index.ts","../src/Firestore.ts","../src/FirestoreScheme.ts","../src/checkAuthentication.ts","../src/firebaseFunctionsContext.ts","../src/index.ts","../src/pushNotification.ts","../src/firebase/FirebaseConfiguration.ts","../src/firebase/Messaging.ts","../src/firebase/index.ts","../src/functions/index.ts","../src/functions/fine/add.ts","../src/functions/fine/delete.ts","../src/functions/fine/update.ts","../src/functions/fineTemplate/add.ts","../src/functions/fineTemplate/delete.ts","../src/functions/fineTemplate/update.ts","../src/functions/invitation/invite.ts","../src/functions/invitation/register.ts","../src/functions/invitation/withdraw.ts","../src/functions/notification/register.ts","../src/functions/notification/subscribe.ts","../src/functions/paypalMe/edit.ts","../src/functions/person/add.ts","../src/functions/person/delete.ts","../src/functions/person/update.ts","../src/functions/team/new.ts","../src/functions/user/login.ts","../src/functions/user/roleEdit.ts","../src/types/Configuration.ts","../src/types/Fine.ts","../src/types/FineAmount.ts","../src/types/FineTemplate.ts","../src/types/FineTemplateRepetition.ts","../src/types/Invitation.ts","../src/types/Localization.ts","../src/types/MoneyAmount.ts","../src/types/NotificationProperties.ts","../src/types/PayedState.ts","../src/types/Person.ts","../src/types/PersonPrivateProperties.ts","../src/types/PersonSignInProperties.ts","../src/types/Team.ts","../src/types/User.ts","../src/types/UserRole.ts","../src/types/index.ts","../test/localization-utils.ts","../test/localization.de.test.ts","../test/localization.en.test.ts"],"version":"5.8.3"}
1
+ {"root":["../index.ts","../src/Firestore.ts","../src/FirestoreScheme.ts","../src/checkAuthentication.ts","../src/firebaseFunctionsContext.ts","../src/index.ts","../src/pushNotification.ts","../src/firebase/FirebaseConfiguration.ts","../src/firebase/Messaging.ts","../src/firebase/index.ts","../src/functions/index.ts","../src/functions/fine/add.ts","../src/functions/fine/delete.ts","../src/functions/fine/update.ts","../src/functions/fineTemplate/add.ts","../src/functions/fineTemplate/delete.ts","../src/functions/fineTemplate/update.ts","../src/functions/invitation/invite.ts","../src/functions/invitation/register.ts","../src/functions/invitation/withdraw.ts","../src/functions/notification/register.ts","../src/functions/notification/subscribe.ts","../src/functions/paypalMe/edit.ts","../src/functions/person/add.ts","../src/functions/person/delete.ts","../src/functions/person/update.ts","../src/functions/team/new.ts","../src/functions/user/login.ts","../src/functions/user/roleEdit.ts","../src/locales/de.ts","../src/locales/en.ts","../src/types/Configuration.ts","../src/types/Fine.ts","../src/types/FineAmount.ts","../src/types/FineTemplate.ts","../src/types/FineTemplateRepetition.ts","../src/types/Invitation.ts","../src/types/Localization.ts","../src/types/MoneyAmount.ts","../src/types/NotificationProperties.ts","../src/types/PayedState.ts","../src/types/Person.ts","../src/types/PersonPrivateProperties.ts","../src/types/PersonSignInProperties.ts","../src/types/Pluralization.ts","../src/types/Team.ts","../src/types/User.ts","../src/types/UserRole.ts","../src/types/index.ts","../test/localization-utils.ts","../test/localization.de.test.ts","../test/localization.en.test.ts"],"version":"5.8.3"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stevenkellner/team-conduct-api",
3
- "version": "1.0.22",
3
+ "version": "1.0.24",
4
4
  "description": "Firebase API for Team Conduct",
5
5
  "license": "MIT",
6
6
  "author": "Steven Kellner",
@@ -18,24 +18,22 @@
18
18
  "lint": "eslint --ext .js,.ts .",
19
19
  "lint:fix": "eslint --ext .js,.ts . --fix",
20
20
  "test": "mocha",
21
- "upgrade": "ncu --upgrade --install always",
21
+ "upgrade": "npm cache clean --force && ncu --upgrade --install always",
22
22
  "release": "npm run rebuild && npm run lint && npm version patch && git push --follow-tags"
23
23
  },
24
24
  "dependencies": {
25
- "@stevenkellner/firebase-function": "^1.4.137",
26
- "@stevenkellner/typescript-common-functionality": "^1.0.49",
27
- "i18n": "^0.15.1"
25
+ "@stevenkellner/firebase-function": "^1.4.138",
26
+ "@stevenkellner/typescript-common-functionality": "^1.0.54"
28
27
  },
29
28
  "devDependencies": {
30
29
  "@assertive-ts/core": "^2.1.0",
31
30
  "@eslint/compat": "^1.2.9",
32
31
  "@eslint/eslintrc": "^3.3.1",
33
- "@eslint/js": "^9.26.0",
34
- "@types/i18n": "^0.13.12",
32
+ "@eslint/js": "^9.27.0",
35
33
  "@types/mocha": "^10.0.10",
36
- "@typescript-eslint/eslint-plugin": "^8.32.0",
37
- "@typescript-eslint/parser": "^8.32.0",
38
- "eslint": "^9.26.0",
34
+ "@typescript-eslint/eslint-plugin": "^8.32.1",
35
+ "@typescript-eslint/parser": "^8.32.1",
36
+ "eslint": "^9.27.0",
39
37
  "eslint-config-google": "^0.14.0",
40
38
  "eslint-plugin-import": "^2.31.0",
41
39
  "mocha": "^11.3.0",
@@ -45,10 +45,14 @@ export class FineAddFunction extends FirebaseFunction<FineAddFunction.Parameters
45
45
  person.fineIds.push(parameters.fine.id);
46
46
  await Firestore.shared.person(parameters.teamId, parameters.personId).set(person);
47
47
 
48
- Localization.shared.setLocale(parameters.configuration.locale);
48
+ Localization.locale = parameters.configuration.locale;
49
49
  await pushNotification(parameters.teamId, parameters.personId, 'new-fine', {
50
- title: Localization.shared.get(key => key.notification.fine.new.title, parameters.fine.reason),
51
- body: Localization.shared.get(key => key.notification.fine.new.body, parameters.fine.amount.formatted(parameters.configuration))
50
+ title: Localization.shared.notification.fine.new.title.value({
51
+ reason: parameters.fine.reason
52
+ }),
53
+ body: Localization.shared.notification.fine.new.body.value({
54
+ amount: parameters.fine.amount.formatted(parameters.configuration)
55
+ })
52
56
  });
53
57
  }
54
58
  }
@@ -44,10 +44,12 @@ export class FineDeleteFunction extends FirebaseFunction<FineDeleteFunction.Para
44
44
  person.fineIds = person.fineIds.filter(id => id.guidString !== parameters.id.guidString);
45
45
  await Firestore.shared.person(parameters.teamId, parameters.personId).set(person);
46
46
 
47
- Localization.shared.setLocale(parameters.configuration.locale);
47
+ Localization.locale = parameters.configuration.locale;
48
48
  await pushNotification(parameters.teamId, parameters.personId, 'fine-state-change', {
49
- title: Localization.shared.get(key => key.notification.fine.stateChange.title),
50
- body: Localization.shared.get(key => key.notification.fine.stateChange.bodyDeleted, fineSnapshot.data.reason, FineAmount.builder.build(fineSnapshot.data.amount).formatted(parameters.configuration))
49
+ title: Localization.shared.notification.fine.stateChange.title.value(),
50
+ body: Localization.shared.notification.fine.stateChange.bodyDeleted.value({
51
+ amount: FineAmount.builder.build(fineSnapshot.data.amount).formatted(parameters.configuration)
52
+ })
51
53
  });
52
54
  }
53
55
  }
@@ -1,7 +1,7 @@
1
1
  import { Configuration } from '../../types/Configuration';
2
2
  import { FirebaseFunction, FunctionsError } from '@stevenkellner/firebase-function';
3
3
  import { pushNotification } from '../../pushNotification';
4
- import { Fine, Localization, Person, Team } from '../../types';
4
+ import { Fine, Localization, Person, Team, ValueLocalization } from '../../types';
5
5
  import { Flattable, ObjectTypeBuilder, ValueTypeBuilder } from '@stevenkellner/typescript-common-functionality';
6
6
  import { checkAuthentication } from '../../checkAuthentication';
7
7
  import { Firestore } from '../../Firestore';
@@ -37,16 +37,19 @@ export class FineUpdateFunction extends FirebaseFunction<FineUpdateFunction.Para
37
37
 
38
38
  await Firestore.shared.fine(parameters.teamId, parameters.fine.id).set(parameters.fine);
39
39
 
40
- Localization.shared.setLocale(parameters.configuration.locale);
40
+ Localization.locale = parameters.configuration.locale;
41
41
  if (parameters.fine.payedState !== fineSnapshot.data.payedState) {
42
- let body: string;
42
+ let bodyLocalization: ValueLocalization;
43
43
  if (parameters.fine.payedState === 'payed')
44
- body = Localization.shared.get(key => key.notification.fine.stateChange.bodyPayed, parameters.fine.amount.formatted(parameters.configuration), parameters.fine.reason);
44
+ bodyLocalization = Localization.shared.notification.fine.stateChange.bodyPayed;
45
45
  else
46
- body = Localization.shared.get(key => key.notification.fine.stateChange.bodyUnpayed, parameters.fine.reason, parameters.fine.amount.formatted(parameters.configuration));
46
+ bodyLocalization = Localization.shared.notification.fine.stateChange.bodyUnpayed;
47
47
  await pushNotification(parameters.teamId, parameters.personId, 'fine-state-change', {
48
- title: Localization.shared.get(key => key.notification.fine.stateChange.title),
49
- body: body
48
+ title: Localization.shared.notification.fine.stateChange.title.value(),
49
+ body: bodyLocalization.value({
50
+ reason: parameters.fine.reason,
51
+ amount: parameters.fine.amount.formatted(parameters.configuration)
52
+ })
50
53
  });
51
54
 
52
55
  }