@stevenkellner/team-conduct-api 2.0.18 → 2.0.19

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 (231) hide show
  1. package/lib/src/functions/fine/add.d.ts +3 -8
  2. package/lib/src/functions/fine/add.js +1 -2
  3. package/lib/src/functions/fine/delete.d.ts +1 -6
  4. package/lib/src/functions/fine/delete.js +2 -3
  5. package/lib/src/functions/fine/update.d.ts +2 -8
  6. package/lib/src/functions/fine/update.js +1 -3
  7. package/lib/src/functions/fineTemplate/add.d.ts +3 -3
  8. package/lib/src/functions/fineTemplate/update.d.ts +3 -3
  9. package/lib/src/functions/firebaseFunctionsContext.d.ts +34 -1
  10. package/lib/src/functions/firebaseFunctionsContext.js +33 -33
  11. package/lib/src/functions/index.d.ts +10 -8
  12. package/lib/src/functions/index.js +11 -8
  13. package/lib/src/functions/notification/markNotificationAsRead.d.ts +14 -0
  14. package/lib/src/functions/notification/{subscribe.js → markNotificationAsRead.js} +5 -7
  15. package/lib/src/functions/person/kickout.d.ts +6 -6
  16. package/lib/src/functions/person/kickout.js +4 -4
  17. package/lib/src/functions/person/roleEdit.d.ts +5 -5
  18. package/lib/src/functions/person/roleEdit.js +3 -3
  19. package/lib/src/functions/{paypalMe/edit.d.ts → team/delete.d.ts} +5 -7
  20. package/lib/src/functions/{paypalMe/edit.js → team/delete.js} +4 -5
  21. package/lib/src/functions/team/new.d.ts +18 -18
  22. package/lib/src/functions/team/new.js +8 -4
  23. package/lib/src/functions/team/update.d.ts +34 -0
  24. package/lib/src/functions/team/update.js +23 -0
  25. package/lib/src/functions/user/register.d.ts +4 -0
  26. package/lib/src/functions/user/register.js +3 -1
  27. package/lib/src/functions/user/update.d.ts +26 -0
  28. package/lib/src/functions/user/update.js +15 -0
  29. package/lib/src/index.d.ts +1 -1
  30. package/lib/src/index.js +1 -1
  31. package/lib/src/locales/de.d.ts +1 -1
  32. package/lib/src/locales/de.js +6 -2
  33. package/lib/src/locales/en.d.ts +6 -2
  34. package/lib/src/locales/en.js +6 -2
  35. package/lib/src/types/{MoneyAmount.d.ts → Money.d.ts} +23 -23
  36. package/lib/src/types/{MoneyAmount.js → Money.js} +25 -25
  37. package/lib/src/types/fine/Fine.d.ts +275 -0
  38. package/lib/src/types/fine/Fine.js +318 -0
  39. package/lib/src/types/fine/FineTemplate.d.ts +154 -0
  40. package/lib/src/types/fine/FineTemplate.js +170 -0
  41. package/lib/src/types/{PayedState.d.ts → fine/PayedState.d.ts} +1 -1
  42. package/lib/src/types/{PayedState.js → fine/PayedState.js} +1 -1
  43. package/lib/src/types/fine/index.d.ts +3 -0
  44. package/lib/src/{firebase → types/fine}/index.js +3 -6
  45. package/lib/src/types/index.d.ts +7 -18
  46. package/lib/src/types/index.js +7 -18
  47. package/lib/src/types/{Localization.d.ts → localization/Localization.d.ts} +15 -43
  48. package/lib/src/types/localization/Localization.js +54 -0
  49. package/lib/src/types/localization/PluralLocalization.d.ts +23 -0
  50. package/lib/src/types/localization/PluralLocalization.js +35 -0
  51. package/lib/src/types/{Pluralization.d.ts → localization/Pluralization.d.ts} +1 -0
  52. package/lib/src/types/{Pluralization.js → localization/Pluralization.js} +1 -0
  53. package/lib/src/types/localization/ValueLocalization.d.ts +22 -0
  54. package/lib/src/types/localization/ValueLocalization.js +41 -0
  55. package/lib/src/types/localization/index.d.ts +5 -0
  56. package/lib/src/types/localization/index.js +21 -0
  57. package/lib/src/types/notification/InAppNotification.d.ts +152 -0
  58. package/lib/src/types/notification/InAppNotification.js +136 -0
  59. package/lib/src/types/notification/index.d.ts +1 -0
  60. package/lib/src/types/notification/index.js +17 -0
  61. package/lib/src/types/{Person.d.ts → person/Person.d.ts} +3 -3
  62. package/lib/src/types/{Person.js → person/Person.js} +3 -3
  63. package/lib/src/types/{PersonProperties.d.ts → person/PersonProperties.d.ts} +8 -7
  64. package/lib/src/types/{PersonProperties.js → person/PersonProperties.js} +7 -6
  65. package/lib/src/types/{PersonSignInProperties.d.ts → person/PersonSignInProperties.d.ts} +9 -11
  66. package/lib/src/types/{PersonSignInProperties.js → person/PersonSignInProperties.js} +7 -10
  67. package/lib/src/types/person/index.d.ts +3 -0
  68. package/lib/src/types/person/index.js +19 -0
  69. package/lib/src/types/{Invitation.d.ts → team/Invitation.d.ts} +1 -1
  70. package/lib/src/types/{Invitation.js → team/Invitation.js} +1 -1
  71. package/lib/src/types/team/Team.d.ts +144 -0
  72. package/lib/src/types/team/Team.js +141 -0
  73. package/lib/src/types/team/TeamRole.d.ts +30 -0
  74. package/lib/src/types/{UserRole.js → team/TeamRole.js} +16 -15
  75. package/lib/src/types/team/index.d.ts +3 -0
  76. package/lib/src/types/team/index.js +19 -0
  77. package/lib/src/types/{NotificationProperties.d.ts → user/NotificationProperties.d.ts} +8 -3
  78. package/lib/src/types/{NotificationProperties.js → user/NotificationProperties.js} +4 -0
  79. package/lib/src/types/user/User.d.ts +328 -0
  80. package/lib/src/types/user/User.js +355 -0
  81. package/lib/src/types/user/index.d.ts +2 -0
  82. package/lib/src/types/user/index.js +18 -0
  83. package/lib/src/utils/StaticUnionTypeBuilder.d.ts +9 -0
  84. package/lib/src/utils/StaticUnionTypeBuilder.js +23 -0
  85. package/lib/src/utils/index.d.ts +1 -0
  86. package/lib/src/utils/index.js +17 -0
  87. package/lib/tsconfig.tsbuildinfo +1 -1
  88. package/package.json +4 -3
  89. package/src/functions/fine/add.ts +3 -5
  90. package/src/functions/fine/delete.ts +3 -5
  91. package/src/functions/fine/update.ts +2 -5
  92. package/src/functions/firebaseFunctionsContext.ts +40 -40
  93. package/src/functions/index.ts +11 -9
  94. package/src/functions/notification/markNotificationAsRead.ts +19 -0
  95. package/src/functions/person/add.ts +1 -1
  96. package/src/functions/person/kickout.ts +6 -6
  97. package/src/functions/person/roleEdit.ts +5 -5
  98. package/src/functions/{paypalMe/edit.ts → team/delete.ts} +5 -7
  99. package/src/functions/team/new.ts +19 -11
  100. package/src/functions/team/update.ts +40 -0
  101. package/src/functions/user/register.ts +7 -3
  102. package/src/functions/user/update.ts +29 -0
  103. package/src/index.ts +1 -1
  104. package/src/locales/de.ts +7 -3
  105. package/src/locales/en.ts +7 -3
  106. package/src/types/{MoneyAmount.ts → Money.ts} +29 -29
  107. package/src/types/fine/Fine.ts +399 -0
  108. package/src/types/fine/FineTemplate.ts +219 -0
  109. package/src/types/{PayedState.ts → fine/PayedState.ts} +2 -2
  110. package/src/types/fine/index.ts +3 -0
  111. package/src/types/index.ts +7 -18
  112. package/src/types/{Localization.ts → localization/Localization.ts} +7 -64
  113. package/src/types/localization/PluralLocalization.ts +32 -0
  114. package/src/types/{Pluralization.ts → localization/Pluralization.ts} +1 -0
  115. package/src/types/localization/ValueLocalization.ts +36 -0
  116. package/src/types/localization/index.ts +5 -0
  117. package/src/types/notification/InAppNotification.ts +184 -0
  118. package/src/types/notification/index.ts +1 -0
  119. package/src/types/{Person.ts → person/Person.ts} +3 -3
  120. package/src/types/{PersonProperties.ts → person/PersonProperties.ts} +8 -7
  121. package/src/types/{PersonSignInProperties.ts → person/PersonSignInProperties.ts} +13 -12
  122. package/src/types/person/index.ts +3 -0
  123. package/src/types/{Invitation.ts → team/Invitation.ts} +1 -1
  124. package/src/types/team/Team.ts +204 -0
  125. package/src/types/{UserRole.ts → team/TeamRole.ts} +19 -17
  126. package/src/types/team/index.ts +3 -0
  127. package/src/types/{NotificationProperties.ts → user/NotificationProperties.ts} +12 -3
  128. package/src/types/user/User.ts +451 -0
  129. package/src/types/user/index.ts +2 -0
  130. package/src/utils/StaticUnionTypeBuilder.ts +23 -0
  131. package/src/utils/index.ts +1 -0
  132. package/lib/src/firebase/FirebaseConfiguration.d.ts +0 -64
  133. package/lib/src/firebase/FirebaseConfiguration.js +0 -79
  134. package/lib/src/firebase/Firestore.d.ts +0 -201
  135. package/lib/src/firebase/Firestore.js +0 -244
  136. package/lib/src/firebase/FirestoreScheme.d.ts +0 -42
  137. package/lib/src/firebase/FirestoreScheme.js +0 -2
  138. package/lib/src/firebase/Messaging.d.ts +0 -90
  139. package/lib/src/firebase/Messaging.js +0 -2
  140. package/lib/src/firebase/checkAuthentication.d.ts +0 -38
  141. package/lib/src/firebase/checkAuthentication.js +0 -64
  142. package/lib/src/firebase/index.d.ts +0 -6
  143. package/lib/src/firebase/pushNotification.d.ts +0 -39
  144. package/lib/src/firebase/pushNotification.js +0 -88
  145. package/lib/src/functions/notification/subscribe.d.ts +0 -18
  146. package/lib/src/types/Configuration.d.ts +0 -46
  147. package/lib/src/types/Configuration.js +0 -51
  148. package/lib/src/types/Fine.d.ts +0 -71
  149. package/lib/src/types/Fine.js +0 -74
  150. package/lib/src/types/FineAmount.d.ts +0 -207
  151. package/lib/src/types/FineAmount.js +0 -238
  152. package/lib/src/types/FineTemplate.d.ts +0 -69
  153. package/lib/src/types/FineTemplate.js +0 -72
  154. package/lib/src/types/FineTemplateRepetition.d.ts +0 -87
  155. package/lib/src/types/FineTemplateRepetition.js +0 -103
  156. package/lib/src/types/Localization.js +0 -115
  157. package/lib/src/types/Team.d.ts +0 -62
  158. package/lib/src/types/Team.js +0 -64
  159. package/lib/src/types/User.d.ts +0 -221
  160. package/lib/src/types/User.js +0 -235
  161. package/lib/src/types/UserRole.d.ts +0 -29
  162. package/lib/test/firebase/FirebaseConfiguration.test.d.ts +0 -1
  163. package/lib/test/firebase/FirebaseConfiguration.test.js +0 -158
  164. package/lib/test/firebase/Firestore.test.d.ts +0 -1
  165. package/lib/test/firebase/Firestore.test.js +0 -46
  166. package/lib/test/firebase/checkAuthentication.test.d.ts +0 -1
  167. package/lib/test/firebase/checkAuthentication.test.js +0 -356
  168. package/lib/test/firebase/firebase-utils.d.ts +0 -32
  169. package/lib/test/firebase/firebase-utils.js +0 -134
  170. package/lib/test/firebase/pushNotification.test.d.ts +0 -1
  171. package/lib/test/firebase/pushNotification.test.js +0 -300
  172. package/lib/test/locales/localization.de.test.d.ts +0 -1
  173. package/lib/test/locales/localization.de.test.js +0 -144
  174. package/lib/test/locales/localization.en.test.d.ts +0 -1
  175. package/lib/test/locales/localization.en.test.js +0 -144
  176. package/lib/test/types/Configuration.test.d.ts +0 -1
  177. package/lib/test/types/Configuration.test.js +0 -84
  178. package/lib/test/types/Currency.test.d.ts +0 -1
  179. package/lib/test/types/Currency.test.js +0 -41
  180. package/lib/test/types/Fine.test.d.ts +0 -1
  181. package/lib/test/types/Fine.test.js +0 -265
  182. package/lib/test/types/FineAmount.test.d.ts +0 -1
  183. package/lib/test/types/FineAmount.test.js +0 -445
  184. package/lib/test/types/FineTemplate.test.d.ts +0 -1
  185. package/lib/test/types/FineTemplate.test.js +0 -271
  186. package/lib/test/types/FineTemplateRepetition.test.d.ts +0 -1
  187. package/lib/test/types/FineTemplateRepetition.test.js +0 -361
  188. package/lib/test/types/Invitation.test.d.ts +0 -1
  189. package/lib/test/types/Invitation.test.js +0 -269
  190. package/lib/test/types/Locale.test.d.ts +0 -1
  191. package/lib/test/types/Locale.test.js +0 -46
  192. package/lib/test/types/Localization.test.d.ts +0 -1
  193. package/lib/test/types/Localization.test.js +0 -241
  194. package/lib/test/types/MoneyAmount.test.d.ts +0 -1
  195. package/lib/test/types/MoneyAmount.test.js +0 -276
  196. package/lib/test/types/NotificationProperties.test.d.ts +0 -1
  197. package/lib/test/types/NotificationProperties.test.js +0 -258
  198. package/lib/test/types/PayedState.test.d.ts +0 -1
  199. package/lib/test/types/PayedState.test.js +0 -136
  200. package/lib/test/types/Person.test.d.ts +0 -1
  201. package/lib/test/types/Person.test.js +0 -266
  202. package/lib/test/types/PersonProperties.test.d.ts +0 -1
  203. package/lib/test/types/PersonProperties.test.js +0 -155
  204. package/lib/test/types/PersonSignInProperties.test.d.ts +0 -1
  205. package/lib/test/types/PersonSignInProperties.test.js +0 -208
  206. package/lib/test/types/Pluralization.test.d.ts +0 -1
  207. package/lib/test/types/Pluralization.test.js +0 -206
  208. package/lib/test/types/Team.test.d.ts +0 -1
  209. package/lib/test/types/Team.test.js +0 -145
  210. package/lib/test/types/User.test.d.ts +0 -1
  211. package/lib/test/types/User.test.js +0 -450
  212. package/lib/test/types/UserRole.test.d.ts +0 -1
  213. package/lib/test/types/UserRole.test.js +0 -140
  214. package/src/firebase/FirebaseConfiguration.ts +0 -99
  215. package/src/firebase/Firestore.ts +0 -258
  216. package/src/firebase/FirestoreScheme.ts +0 -41
  217. package/src/firebase/Messaging.ts +0 -93
  218. package/src/firebase/checkAuthentication.ts +0 -91
  219. package/src/firebase/index.ts +0 -7
  220. package/src/firebase/pushNotification.ts +0 -90
  221. package/src/functions/notification/subscribe.ts +0 -23
  222. package/src/types/Configuration.ts +0 -65
  223. package/src/types/Fine.ts +0 -100
  224. package/src/types/FineAmount.ts +0 -303
  225. package/src/types/FineTemplate.ts +0 -96
  226. package/src/types/FineTemplateRepetition.ts +0 -125
  227. package/src/types/Team.ts +0 -87
  228. package/src/types/User.ts +0 -302
  229. /package/lib/src/types/{Locale.d.ts → localization/Locale.d.ts} +0 -0
  230. /package/lib/src/types/{Locale.js → localization/Locale.js} +0 -0
  231. /package/src/types/{Locale.ts → localization/Locale.ts} +0 -0
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TeamUpdateFunction = void 0;
4
+ const typescript_common_functionality_1 = require("@stevenkellner/typescript-common-functionality");
5
+ const types_1 = require("../../types");
6
+ const utils_1 = require("../../utils");
7
+ class TeamUpdateFunction {
8
+ parametersBuilder = new typescript_common_functionality_1.ObjectTypeBuilder({
9
+ id: types_1.Team.Id.builder,
10
+ name: utils_1.StaticUnionTypeBuilder.doNotUpdate(new typescript_common_functionality_1.ValueTypeBuilder()),
11
+ logoUrl: utils_1.StaticUnionTypeBuilder.doNotUpdateRemove(new typescript_common_functionality_1.ValueTypeBuilder()),
12
+ sportCategory: utils_1.StaticUnionTypeBuilder.doNotUpdateRemove(new typescript_common_functionality_1.ValueTypeBuilder()),
13
+ description: utils_1.StaticUnionTypeBuilder.doNotUpdateRemove(new typescript_common_functionality_1.ValueTypeBuilder()),
14
+ paypalMeLink: utils_1.StaticUnionTypeBuilder.doNotUpdateRemove(new typescript_common_functionality_1.ValueTypeBuilder()),
15
+ allowMembersToAddFines: utils_1.StaticUnionTypeBuilder.doNotUpdate(new typescript_common_functionality_1.ValueTypeBuilder()),
16
+ fineVisibility: utils_1.StaticUnionTypeBuilder.doNotUpdate(new typescript_common_functionality_1.ValueTypeBuilder()),
17
+ joinRequestType: utils_1.StaticUnionTypeBuilder.doNotUpdate(new typescript_common_functionality_1.ValueTypeBuilder()),
18
+ currency: utils_1.StaticUnionTypeBuilder.doNotUpdate(types_1.Currency.builder),
19
+ locale: utils_1.StaticUnionTypeBuilder.doNotUpdate(types_1.Locale.builder)
20
+ });
21
+ returnTypeBuilder = new typescript_common_functionality_1.ValueTypeBuilder();
22
+ }
23
+ exports.TeamUpdateFunction = TeamUpdateFunction;
@@ -5,6 +5,8 @@ export declare namespace UserRegisterFunction {
5
5
  type Parameters = {
6
6
  userId: User.Id;
7
7
  signInType: User.SignInType;
8
+ firstName: string;
9
+ lastName: string;
8
10
  };
9
11
  }
10
12
  export declare class UserRegisterFunction implements FirebaseFunction<UserRegisterFunction.Parameters, User> {
@@ -16,6 +18,8 @@ export declare class UserRegisterFunction implements FirebaseFunction<UserRegist
16
18
  } | {
17
19
  type: "google" | "apple";
18
20
  };
21
+ firstName: string;
22
+ lastName: string;
19
23
  }, UserRegisterFunction.Parameters>;
20
24
  returnTypeBuilder: User.TypeBuilder;
21
25
  }
@@ -6,7 +6,9 @@ const typescript_common_functionality_1 = require("@stevenkellner/typescript-com
6
6
  class UserRegisterFunction {
7
7
  parametersBuilder = new typescript_common_functionality_1.ObjectTypeBuilder({
8
8
  userId: types_1.User.Id.builder,
9
- signInType: types_1.User.SignInType.builder
9
+ signInType: types_1.User.SignInType.builder,
10
+ firstName: new typescript_common_functionality_1.ValueTypeBuilder(),
11
+ lastName: new typescript_common_functionality_1.ValueTypeBuilder()
10
12
  });
11
13
  returnTypeBuilder = types_1.User.builder;
12
14
  }
@@ -0,0 +1,26 @@
1
+ import { FirebaseFunction } from '@stevenkellner/firebase-function';
2
+ import { NotificationProperties } from '../../types';
3
+ import { ObjectTypeBuilder, ValueTypeBuilder } from '@stevenkellner/typescript-common-functionality';
4
+ export declare namespace UserUpdateFunction {
5
+ type Parameters = {
6
+ name: {
7
+ firstName: string;
8
+ lastName: string;
9
+ } | 'do-not-update';
10
+ bio: string | 'remove' | 'do-not-update';
11
+ profilePictureUrl: string | 'remove' | 'do-not-update';
12
+ notificationSubscriptions: NotificationProperties.Subscription[] | 'do-not-update';
13
+ };
14
+ }
15
+ export declare class UserUpdateFunction implements FirebaseFunction<UserUpdateFunction.Parameters, void> {
16
+ parametersBuilder: ObjectTypeBuilder<{
17
+ name: "do-not-update" | {
18
+ firstName: string;
19
+ lastName: string;
20
+ };
21
+ bio: string | "remove" | "do-not-update";
22
+ profilePictureUrl: string | "remove" | "do-not-update";
23
+ notificationSubscriptions: ("new-fine" | "fine-changed" | "fine-reminder" | "fine-state-change")[] | "do-not-update";
24
+ }, UserUpdateFunction.Parameters>;
25
+ returnTypeBuilder: ValueTypeBuilder<void>;
26
+ }
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.UserUpdateFunction = void 0;
4
+ const typescript_common_functionality_1 = require("@stevenkellner/typescript-common-functionality");
5
+ const utils_1 = require("../../utils");
6
+ class UserUpdateFunction {
7
+ parametersBuilder = new typescript_common_functionality_1.ObjectTypeBuilder({
8
+ name: utils_1.StaticUnionTypeBuilder.doNotUpdate(new typescript_common_functionality_1.ValueTypeBuilder()),
9
+ bio: utils_1.StaticUnionTypeBuilder.doNotUpdateRemove(new typescript_common_functionality_1.ValueTypeBuilder()),
10
+ profilePictureUrl: utils_1.StaticUnionTypeBuilder.doNotUpdateRemove(new typescript_common_functionality_1.ValueTypeBuilder()),
11
+ notificationSubscriptions: utils_1.StaticUnionTypeBuilder.doNotUpdate(new typescript_common_functionality_1.ArrayTypeBuilder(new typescript_common_functionality_1.ValueTypeBuilder()))
12
+ });
13
+ returnTypeBuilder = new typescript_common_functionality_1.ValueTypeBuilder();
14
+ }
15
+ exports.UserUpdateFunction = UserUpdateFunction;
@@ -1,3 +1,3 @@
1
- export * from './firebase';
2
1
  export * from './functions';
3
2
  export * from './types';
3
+ export * from './utils';
package/lib/src/index.js CHANGED
@@ -14,6 +14,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./firebase"), exports);
18
17
  __exportStar(require("./functions"), exports);
19
18
  __exportStar(require("./types"), exports);
19
+ __exportStar(require("./utils"), exports);
@@ -1,4 +1,4 @@
1
- import { LocalizationDict } from '../types/Localization';
1
+ import { LocalizationDict } from '../types/localization/Localization';
2
2
  /**
3
3
  * German (de) localization strings for the application.
4
4
  * Contains translations for notifications, fine amounts, fine template repetitions,
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.localizationDE = void 0;
4
- const Pluralization_1 = require("../types/Pluralization");
4
+ const Pluralization_1 = require("../types/localization/Pluralization");
5
5
  /**
6
6
  * German (de) localization strings for the application.
7
7
  * Contains translations for notifications, fine amounts, fine template repetitions,
@@ -26,6 +26,10 @@ exports.localizationDE = {
26
26
  bodyPayed: 'Du hast eine Strafe von {{amount}} bezahlt ({{reason}}).',
27
27
  bodyUnpayed: '{{reason}}, {{amount}} ist noch offen.',
28
28
  bodyDeleted: '{{reason}}, {{amount}} wurde gelöscht.'
29
+ },
30
+ changed: {
31
+ title: '{{reason}}',
32
+ body: 'Deine Strafe für {{reason}} wurde aktualisiert.'
29
33
  }
30
34
  }
31
35
  },
@@ -98,7 +102,7 @@ exports.localizationDE = {
98
102
  payed: 'Bezahlt',
99
103
  notPayed: 'Offen'
100
104
  },
101
- userRole: {
105
+ teamRole: {
102
106
  personManager: 'Personenmanager',
103
107
  fineTemplateManager: 'Strafvorlagenmanager',
104
108
  fineManager: 'Strafenmanager',
@@ -1,4 +1,4 @@
1
- import { Pluralization } from '../types/Pluralization';
1
+ import { Pluralization } from '../types/localization/Pluralization';
2
2
  /**
3
3
  * English (en) localization strings for the application.
4
4
  * Contains translations for notifications, fine amounts, fine template repetitions,
@@ -26,6 +26,10 @@ export declare const localizationEN: {
26
26
  bodyUnpayed: string;
27
27
  bodyDeleted: string;
28
28
  };
29
+ changed: {
30
+ title: string;
31
+ body: string;
32
+ };
29
33
  };
30
34
  };
31
35
  fineAmount: {
@@ -67,7 +71,7 @@ export declare const localizationEN: {
67
71
  payed: string;
68
72
  notPayed: string;
69
73
  };
70
- userRole: {
74
+ teamRole: {
71
75
  personManager: string;
72
76
  fineTemplateManager: string;
73
77
  fineManager: string;
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.localizationEN = void 0;
4
- const Pluralization_1 = require("../types/Pluralization");
4
+ const Pluralization_1 = require("../types/localization/Pluralization");
5
5
  /**
6
6
  * Helper function to ensure a value satisfies the Localization structure
7
7
  * while preserving its concrete type (as const) for type inference.
@@ -35,6 +35,10 @@ exports.localizationEN = satisfiesLocalization({
35
35
  bodyPayed: 'You have paid a fine of {{amount}} ({{reason}}).',
36
36
  bodyUnpayed: '{{reason}}, {{amount}} is still outstanding.',
37
37
  bodyDeleted: '{{reason}}, {{amount}} has been deleted.'
38
+ },
39
+ changed: {
40
+ title: '{{reason}}',
41
+ body: 'Your fine for {{reason}} has been updated.'
38
42
  }
39
43
  }
40
44
  },
@@ -107,7 +111,7 @@ exports.localizationEN = satisfiesLocalization({
107
111
  payed: 'Paid',
108
112
  notPayed: 'Outstanding'
109
113
  },
110
- userRole: {
114
+ teamRole: {
111
115
  personManager: 'Person Manager',
112
116
  fineTemplateManager: 'Fine Template Manager',
113
117
  fineManager: 'Fine Manager',
@@ -1,54 +1,54 @@
1
1
  import { Flattable, ITypeBuilder } from '@stevenkellner/typescript-common-functionality';
2
- import { Configuration } from './Configuration';
3
2
  import { Currency } from './Currency';
3
+ import { Locale } from './localization/Locale';
4
4
  /**
5
5
  * Represents a monetary amount with integer value and subunit components.
6
6
  *
7
7
  * Stores money as two parts: main value (e.g., dollars) and subunit value (e.g., cents).
8
8
  * This prevents floating-point precision issues in financial calculations.
9
9
  */
10
- export declare class MoneyAmount implements Flattable<MoneyAmount.Flatten> {
10
+ export declare class Money implements Flattable<Money.Flatten> {
11
11
  value: number;
12
12
  subunitValue: number;
13
13
  /**
14
- * Creates a new MoneyAmount instance.
14
+ * Creates a new Money instance.
15
15
  *
16
16
  * @param value - The main value (e.g., dollars, euros)
17
17
  * @param subunitValue - The subunit value (e.g., cents), should be 0-99
18
18
  */
19
19
  constructor(value: number, subunitValue: number);
20
20
  /**
21
- * Returns a MoneyAmount representing zero.
21
+ * Returns a Money instance representing zero.
22
22
  */
23
- static get zero(): MoneyAmount;
23
+ static get zero(): Money;
24
24
  /**
25
- * Adds another MoneyAmount to this one and returns the result.
25
+ * Adds another Money instance to this one and returns the result.
26
26
  *
27
27
  * Properly handles subunit overflow (e.g., 50 cents + 60 cents = 1 dollar 10 cents).
28
28
  *
29
- * @param amount - The MoneyAmount to add
30
- * @returns A new MoneyAmount representing the sum
29
+ * @param amount - The Money instance to add
30
+ * @returns A new Money instance representing the sum
31
31
  */
32
- added(amount: MoneyAmount): MoneyAmount;
32
+ added(amount: Money): Money;
33
33
  /**
34
- * Multiplies this MoneyAmount by a factor and returns the result.
34
+ * Multiplies this Money instance by a factor and returns the result.
35
35
  *
36
36
  * Properly handles subunit calculations and overflow.
37
37
  *
38
38
  * @param factor - The multiplication factor
39
- * @returns A new MoneyAmount representing the product
39
+ * @returns A new Money instance representing the product
40
40
  */
41
- multiplied(factor: number): MoneyAmount;
41
+ multiplied(factor: number): Money;
42
42
  /**
43
43
  * Returns a localized formatted string representation of the amount.
44
44
  *
45
45
  * Uses Intl.NumberFormat for proper currency formatting based on locale.
46
46
  *
47
47
  * @param currency - The currency code (e.g., 'USD', 'EUR')
48
- * @param configuration - Configuration containing locale information
48
+ * @param locale - The locale information for formatting
49
49
  * @returns Formatted currency string (e.g., "$12.50", "12,50 €")
50
50
  */
51
- formatted(currency: Currency, configuration: Configuration): string;
51
+ formatted(currency: Currency, locale: Locale): string;
52
52
  /**
53
53
  * Returns the complete monetary value as a decimal number.
54
54
  *
@@ -58,29 +58,29 @@ export declare class MoneyAmount implements Flattable<MoneyAmount.Flatten> {
58
58
  /**
59
59
  * Returns the flattened representation as a decimal number.
60
60
  */
61
- get flatten(): MoneyAmount.Flatten;
61
+ get flatten(): Money.Flatten;
62
62
  }
63
- export declare namespace MoneyAmount {
63
+ export declare namespace Money {
64
64
  /**
65
- * Flattened representation of MoneyAmount as a decimal number.
65
+ * Flattened representation of Money as a decimal number.
66
66
  */
67
67
  type Flatten = number;
68
68
  /**
69
- * Type builder for MoneyAmount serialization/deserialization.
69
+ * Type builder for Money serialization/deserialization.
70
70
  */
71
- class TypeBuilder implements ITypeBuilder<Flatten, MoneyAmount> {
71
+ class TypeBuilder implements ITypeBuilder<Flatten, Money> {
72
72
  /**
73
- * Builds a MoneyAmount instance from a flattened decimal value.
73
+ * Builds a Money instance from a flattened decimal value.
74
74
  *
75
75
  * Separates the decimal into integer and subunit parts.
76
76
  *
77
77
  * @param value - Decimal value (e.g., 12.50)
78
- * @returns MoneyAmount instance
78
+ * @returns Money instance
79
79
  */
80
- build(value: Flatten): MoneyAmount;
80
+ build(value: Flatten): Money;
81
81
  }
82
82
  /**
83
- * Singleton instance of TypeBuilder for MoneyAmount.
83
+ * Singleton instance of TypeBuilder for Money.
84
84
  */
85
85
  const builder: TypeBuilder;
86
86
  }
@@ -1,17 +1,17 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.MoneyAmount = void 0;
3
+ exports.Money = void 0;
4
4
  /**
5
5
  * Represents a monetary amount with integer value and subunit components.
6
6
  *
7
7
  * Stores money as two parts: main value (e.g., dollars) and subunit value (e.g., cents).
8
8
  * This prevents floating-point precision issues in financial calculations.
9
9
  */
10
- class MoneyAmount {
10
+ class Money {
11
11
  value;
12
12
  subunitValue;
13
13
  /**
14
- * Creates a new MoneyAmount instance.
14
+ * Creates a new Money instance.
15
15
  *
16
16
  * @param value - The main value (e.g., dollars, euros)
17
17
  * @param subunitValue - The subunit value (e.g., cents), should be 0-99
@@ -21,36 +21,36 @@ class MoneyAmount {
21
21
  this.subunitValue = subunitValue;
22
22
  }
23
23
  /**
24
- * Returns a MoneyAmount representing zero.
24
+ * Returns a Money instance representing zero.
25
25
  */
26
26
  static get zero() {
27
- return new MoneyAmount(0, 0);
27
+ return new Money(0, 0);
28
28
  }
29
29
  /**
30
- * Adds another MoneyAmount to this one and returns the result.
30
+ * Adds another Money instance to this one and returns the result.
31
31
  *
32
32
  * Properly handles subunit overflow (e.g., 50 cents + 60 cents = 1 dollar 10 cents).
33
33
  *
34
- * @param amount - The MoneyAmount to add
35
- * @returns A new MoneyAmount representing the sum
34
+ * @param amount - The Money instance to add
35
+ * @returns A new Money instance representing the sum
36
36
  */
37
37
  added(amount) {
38
38
  const subunitValue = this.subunitValue + amount.subunitValue;
39
39
  const value = this.value + amount.value + Math.floor(subunitValue / 100);
40
- return new MoneyAmount(value, subunitValue % 100);
40
+ return new Money(value, subunitValue % 100);
41
41
  }
42
42
  /**
43
- * Multiplies this MoneyAmount by a factor and returns the result.
43
+ * Multiplies this Money instance by a factor and returns the result.
44
44
  *
45
45
  * Properly handles subunit calculations and overflow.
46
46
  *
47
47
  * @param factor - The multiplication factor
48
- * @returns A new MoneyAmount representing the product
48
+ * @returns A new Money instance representing the product
49
49
  */
50
50
  multiplied(factor) {
51
51
  const subunitValue = this.subunitValue * factor;
52
52
  const value = this.value * factor + Math.floor(subunitValue / 100);
53
- return new MoneyAmount(value, subunitValue % 100);
53
+ return new Money(value, subunitValue % 100);
54
54
  }
55
55
  /**
56
56
  * Returns a localized formatted string representation of the amount.
@@ -58,11 +58,11 @@ class MoneyAmount {
58
58
  * Uses Intl.NumberFormat for proper currency formatting based on locale.
59
59
  *
60
60
  * @param currency - The currency code (e.g., 'USD', 'EUR')
61
- * @param configuration - Configuration containing locale information
61
+ * @param locale - The locale information for formatting
62
62
  * @returns Formatted currency string (e.g., "$12.50", "12,50 €")
63
63
  */
64
- formatted(currency, configuration) {
65
- const numberFormat = Intl.NumberFormat(configuration.locale, {
64
+ formatted(currency, locale) {
65
+ const numberFormat = Intl.NumberFormat(locale, {
66
66
  style: 'currency',
67
67
  currency: currency
68
68
  });
@@ -83,27 +83,27 @@ class MoneyAmount {
83
83
  return this.value + this.subunitValue / 100;
84
84
  }
85
85
  }
86
- exports.MoneyAmount = MoneyAmount;
87
- (function (MoneyAmount) {
86
+ exports.Money = Money;
87
+ (function (Money) {
88
88
  /**
89
- * Type builder for MoneyAmount serialization/deserialization.
89
+ * Type builder for Money serialization/deserialization.
90
90
  */
91
91
  class TypeBuilder {
92
92
  /**
93
- * Builds a MoneyAmount instance from a flattened decimal value.
93
+ * Builds a Money instance from a flattened decimal value.
94
94
  *
95
95
  * Separates the decimal into integer and subunit parts.
96
96
  *
97
97
  * @param value - Decimal value (e.g., 12.50)
98
- * @returns MoneyAmount instance
98
+ * @returns Money instance
99
99
  */
100
100
  build(value) {
101
- return new MoneyAmount(Math.floor(value), Math.round((value - Math.floor(value)) * 100));
101
+ return new Money(Math.floor(value), Math.round((value - Math.floor(value)) * 100));
102
102
  }
103
103
  }
104
- MoneyAmount.TypeBuilder = TypeBuilder;
104
+ Money.TypeBuilder = TypeBuilder;
105
105
  /**
106
- * Singleton instance of TypeBuilder for MoneyAmount.
106
+ * Singleton instance of TypeBuilder for Money.
107
107
  */
108
- MoneyAmount.builder = new MoneyAmount.TypeBuilder();
109
- })(MoneyAmount || (exports.MoneyAmount = MoneyAmount = {}));
108
+ Money.builder = new Money.TypeBuilder();
109
+ })(Money || (exports.Money = Money = {}));