@stevenkellner/team-conduct-api 2.0.18 → 2.0.20
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/lib/src/functions/fine/add.d.ts +3 -8
- package/lib/src/functions/fine/add.js +1 -2
- package/lib/src/functions/fine/delete.d.ts +1 -6
- package/lib/src/functions/fine/delete.js +2 -3
- package/lib/src/functions/fine/update.d.ts +2 -8
- package/lib/src/functions/fine/update.js +1 -3
- package/lib/src/functions/fineTemplate/add.d.ts +3 -3
- package/lib/src/functions/fineTemplate/update.d.ts +3 -3
- package/lib/src/functions/firebaseFunctionsContext.d.ts +34 -1
- package/lib/src/functions/firebaseFunctionsContext.js +33 -33
- package/lib/src/functions/index.d.ts +10 -8
- package/lib/src/functions/index.js +11 -8
- package/lib/src/functions/notification/markNotificationAsRead.d.ts +14 -0
- package/lib/src/functions/notification/{subscribe.js → markNotificationAsRead.js} +5 -7
- package/lib/src/functions/person/kickout.d.ts +6 -6
- package/lib/src/functions/person/kickout.js +4 -4
- package/lib/src/functions/person/roleEdit.d.ts +5 -5
- package/lib/src/functions/person/roleEdit.js +3 -3
- package/lib/src/functions/{paypalMe/edit.d.ts → team/delete.d.ts} +5 -7
- package/lib/src/functions/{paypalMe/edit.js → team/delete.js} +4 -5
- package/lib/src/functions/team/new.d.ts +18 -18
- package/lib/src/functions/team/new.js +8 -4
- package/lib/src/functions/team/update.d.ts +34 -0
- package/lib/src/functions/team/update.js +23 -0
- package/lib/src/functions/user/register.d.ts +4 -0
- package/lib/src/functions/user/register.js +3 -1
- package/lib/src/functions/user/update.d.ts +26 -0
- package/lib/src/functions/user/update.js +15 -0
- package/lib/src/index.d.ts +1 -1
- package/lib/src/index.js +1 -1
- package/lib/src/locales/de.d.ts +1 -1
- package/lib/src/locales/de.js +6 -2
- package/lib/src/locales/en.d.ts +6 -2
- package/lib/src/locales/en.js +6 -2
- package/lib/src/types/{MoneyAmount.d.ts → Money.d.ts} +23 -23
- package/lib/src/types/{MoneyAmount.js → Money.js} +25 -25
- package/lib/src/types/fine/Fine.d.ts +275 -0
- package/lib/src/types/fine/Fine.js +318 -0
- package/lib/src/types/fine/FineTemplate.d.ts +154 -0
- package/lib/src/types/fine/FineTemplate.js +170 -0
- package/lib/src/types/{PayedState.d.ts → fine/PayedState.d.ts} +1 -1
- package/lib/src/types/{PayedState.js → fine/PayedState.js} +1 -1
- package/lib/src/types/fine/index.d.ts +3 -0
- package/lib/src/{firebase → types/fine}/index.js +3 -6
- package/lib/src/types/index.d.ts +7 -18
- package/lib/src/types/index.js +7 -18
- package/lib/src/types/{Localization.d.ts → localization/Localization.d.ts} +15 -43
- package/lib/src/types/localization/Localization.js +54 -0
- package/lib/src/types/localization/PluralLocalization.d.ts +23 -0
- package/lib/src/types/localization/PluralLocalization.js +35 -0
- package/lib/src/types/{Pluralization.d.ts → localization/Pluralization.d.ts} +1 -0
- package/lib/src/types/{Pluralization.js → localization/Pluralization.js} +1 -0
- package/lib/src/types/localization/ValueLocalization.d.ts +22 -0
- package/lib/src/types/localization/ValueLocalization.js +41 -0
- package/lib/src/types/localization/index.d.ts +5 -0
- package/lib/src/types/localization/index.js +21 -0
- package/lib/src/types/notification/InAppNotification.d.ts +152 -0
- package/lib/src/types/notification/InAppNotification.js +136 -0
- package/lib/src/types/notification/index.d.ts +1 -0
- package/lib/src/types/notification/index.js +17 -0
- package/lib/src/types/{Person.d.ts → person/Person.d.ts} +3 -3
- package/lib/src/types/{Person.js → person/Person.js} +3 -3
- package/lib/src/types/{PersonProperties.d.ts → person/PersonProperties.d.ts} +8 -7
- package/lib/src/types/{PersonProperties.js → person/PersonProperties.js} +7 -6
- package/lib/src/types/{PersonSignInProperties.d.ts → person/PersonSignInProperties.d.ts} +9 -11
- package/lib/src/types/{PersonSignInProperties.js → person/PersonSignInProperties.js} +7 -10
- package/lib/src/types/person/index.d.ts +3 -0
- package/lib/src/types/person/index.js +19 -0
- package/lib/src/types/{Invitation.d.ts → team/Invitation.d.ts} +1 -1
- package/lib/src/types/{Invitation.js → team/Invitation.js} +1 -1
- package/lib/src/types/team/Team.d.ts +144 -0
- package/lib/src/types/team/Team.js +141 -0
- package/lib/src/types/team/TeamRole.d.ts +30 -0
- package/lib/src/types/{UserRole.js → team/TeamRole.js} +16 -15
- package/lib/src/types/team/index.d.ts +3 -0
- package/lib/src/types/team/index.js +19 -0
- package/lib/src/types/{NotificationProperties.d.ts → user/NotificationProperties.d.ts} +8 -3
- package/lib/src/types/{NotificationProperties.js → user/NotificationProperties.js} +4 -0
- package/lib/src/types/user/User.d.ts +328 -0
- package/lib/src/types/user/User.js +355 -0
- package/lib/src/types/user/index.d.ts +2 -0
- package/lib/src/types/user/index.js +18 -0
- package/lib/src/utils/StaticUnionTypeBuilder.d.ts +9 -0
- package/lib/src/utils/StaticUnionTypeBuilder.js +23 -0
- package/lib/src/utils/index.d.ts +1 -0
- package/lib/src/utils/index.js +17 -0
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +4 -3
- package/src/functions/fine/add.ts +3 -5
- package/src/functions/fine/delete.ts +3 -5
- package/src/functions/fine/update.ts +2 -5
- package/src/functions/firebaseFunctionsContext.ts +40 -40
- package/src/functions/index.ts +11 -9
- package/src/functions/notification/markNotificationAsRead.ts +19 -0
- package/src/functions/person/add.ts +1 -1
- package/src/functions/person/kickout.ts +6 -6
- package/src/functions/person/roleEdit.ts +5 -5
- package/src/functions/{paypalMe/edit.ts → team/delete.ts} +5 -7
- package/src/functions/team/new.ts +19 -11
- package/src/functions/team/update.ts +40 -0
- package/src/functions/user/register.ts +7 -3
- package/src/functions/user/update.ts +29 -0
- package/src/index.ts +1 -1
- package/src/locales/de.ts +7 -3
- package/src/locales/en.ts +7 -3
- package/src/types/{MoneyAmount.ts → Money.ts} +29 -29
- package/src/types/fine/Fine.ts +399 -0
- package/src/types/fine/FineTemplate.ts +219 -0
- package/src/types/{PayedState.ts → fine/PayedState.ts} +2 -2
- package/src/types/fine/index.ts +3 -0
- package/src/types/index.ts +7 -18
- package/src/types/{Localization.ts → localization/Localization.ts} +7 -64
- package/src/types/localization/PluralLocalization.ts +32 -0
- package/src/types/{Pluralization.ts → localization/Pluralization.ts} +1 -0
- package/src/types/localization/ValueLocalization.ts +36 -0
- package/src/types/localization/index.ts +5 -0
- package/src/types/notification/InAppNotification.ts +184 -0
- package/src/types/notification/index.ts +1 -0
- package/src/types/{Person.ts → person/Person.ts} +3 -3
- package/src/types/{PersonProperties.ts → person/PersonProperties.ts} +8 -7
- package/src/types/{PersonSignInProperties.ts → person/PersonSignInProperties.ts} +13 -12
- package/src/types/person/index.ts +3 -0
- package/src/types/{Invitation.ts → team/Invitation.ts} +1 -1
- package/src/types/team/Team.ts +204 -0
- package/src/types/{UserRole.ts → team/TeamRole.ts} +19 -17
- package/src/types/team/index.ts +3 -0
- package/src/types/{NotificationProperties.ts → user/NotificationProperties.ts} +12 -3
- package/src/types/user/User.ts +451 -0
- package/src/types/user/index.ts +2 -0
- package/src/utils/StaticUnionTypeBuilder.ts +23 -0
- package/src/utils/index.ts +1 -0
- package/lib/src/firebase/FirebaseConfiguration.d.ts +0 -64
- package/lib/src/firebase/FirebaseConfiguration.js +0 -79
- package/lib/src/firebase/Firestore.d.ts +0 -201
- package/lib/src/firebase/Firestore.js +0 -244
- package/lib/src/firebase/FirestoreScheme.d.ts +0 -42
- package/lib/src/firebase/FirestoreScheme.js +0 -2
- package/lib/src/firebase/Messaging.d.ts +0 -90
- package/lib/src/firebase/Messaging.js +0 -2
- package/lib/src/firebase/checkAuthentication.d.ts +0 -38
- package/lib/src/firebase/checkAuthentication.js +0 -64
- package/lib/src/firebase/index.d.ts +0 -6
- package/lib/src/firebase/pushNotification.d.ts +0 -39
- package/lib/src/firebase/pushNotification.js +0 -88
- package/lib/src/functions/notification/subscribe.d.ts +0 -18
- package/lib/src/types/Configuration.d.ts +0 -46
- package/lib/src/types/Configuration.js +0 -51
- package/lib/src/types/Fine.d.ts +0 -71
- package/lib/src/types/Fine.js +0 -74
- package/lib/src/types/FineAmount.d.ts +0 -207
- package/lib/src/types/FineAmount.js +0 -238
- package/lib/src/types/FineTemplate.d.ts +0 -69
- package/lib/src/types/FineTemplate.js +0 -72
- package/lib/src/types/FineTemplateRepetition.d.ts +0 -87
- package/lib/src/types/FineTemplateRepetition.js +0 -103
- package/lib/src/types/Localization.js +0 -115
- package/lib/src/types/Team.d.ts +0 -62
- package/lib/src/types/Team.js +0 -64
- package/lib/src/types/User.d.ts +0 -221
- package/lib/src/types/User.js +0 -235
- package/lib/src/types/UserRole.d.ts +0 -29
- package/lib/test/firebase/FirebaseConfiguration.test.d.ts +0 -1
- package/lib/test/firebase/FirebaseConfiguration.test.js +0 -158
- package/lib/test/firebase/Firestore.test.d.ts +0 -1
- package/lib/test/firebase/Firestore.test.js +0 -46
- package/lib/test/firebase/checkAuthentication.test.d.ts +0 -1
- package/lib/test/firebase/checkAuthentication.test.js +0 -356
- package/lib/test/firebase/firebase-utils.d.ts +0 -32
- package/lib/test/firebase/firebase-utils.js +0 -134
- package/lib/test/firebase/pushNotification.test.d.ts +0 -1
- package/lib/test/firebase/pushNotification.test.js +0 -300
- package/lib/test/locales/localization.de.test.d.ts +0 -1
- package/lib/test/locales/localization.de.test.js +0 -144
- package/lib/test/locales/localization.en.test.d.ts +0 -1
- package/lib/test/locales/localization.en.test.js +0 -144
- package/lib/test/types/Configuration.test.d.ts +0 -1
- package/lib/test/types/Configuration.test.js +0 -84
- package/lib/test/types/Currency.test.d.ts +0 -1
- package/lib/test/types/Currency.test.js +0 -41
- package/lib/test/types/Fine.test.d.ts +0 -1
- package/lib/test/types/Fine.test.js +0 -265
- package/lib/test/types/FineAmount.test.d.ts +0 -1
- package/lib/test/types/FineAmount.test.js +0 -445
- package/lib/test/types/FineTemplate.test.d.ts +0 -1
- package/lib/test/types/FineTemplate.test.js +0 -271
- package/lib/test/types/FineTemplateRepetition.test.d.ts +0 -1
- package/lib/test/types/FineTemplateRepetition.test.js +0 -361
- package/lib/test/types/Invitation.test.d.ts +0 -1
- package/lib/test/types/Invitation.test.js +0 -269
- package/lib/test/types/Locale.test.d.ts +0 -1
- package/lib/test/types/Locale.test.js +0 -46
- package/lib/test/types/Localization.test.d.ts +0 -1
- package/lib/test/types/Localization.test.js +0 -241
- package/lib/test/types/MoneyAmount.test.d.ts +0 -1
- package/lib/test/types/MoneyAmount.test.js +0 -276
- package/lib/test/types/NotificationProperties.test.d.ts +0 -1
- package/lib/test/types/NotificationProperties.test.js +0 -258
- package/lib/test/types/PayedState.test.d.ts +0 -1
- package/lib/test/types/PayedState.test.js +0 -136
- package/lib/test/types/Person.test.d.ts +0 -1
- package/lib/test/types/Person.test.js +0 -266
- package/lib/test/types/PersonProperties.test.d.ts +0 -1
- package/lib/test/types/PersonProperties.test.js +0 -155
- package/lib/test/types/PersonSignInProperties.test.d.ts +0 -1
- package/lib/test/types/PersonSignInProperties.test.js +0 -208
- package/lib/test/types/Pluralization.test.d.ts +0 -1
- package/lib/test/types/Pluralization.test.js +0 -206
- package/lib/test/types/Team.test.d.ts +0 -1
- package/lib/test/types/Team.test.js +0 -145
- package/lib/test/types/User.test.d.ts +0 -1
- package/lib/test/types/User.test.js +0 -450
- package/lib/test/types/UserRole.test.d.ts +0 -1
- package/lib/test/types/UserRole.test.js +0 -140
- package/src/firebase/FirebaseConfiguration.ts +0 -99
- package/src/firebase/Firestore.ts +0 -258
- package/src/firebase/FirestoreScheme.ts +0 -41
- package/src/firebase/Messaging.ts +0 -93
- package/src/firebase/checkAuthentication.ts +0 -91
- package/src/firebase/index.ts +0 -7
- package/src/firebase/pushNotification.ts +0 -90
- package/src/functions/notification/subscribe.ts +0 -23
- package/src/types/Configuration.ts +0 -65
- package/src/types/Fine.ts +0 -100
- package/src/types/FineAmount.ts +0 -303
- package/src/types/FineTemplate.ts +0 -96
- package/src/types/FineTemplateRepetition.ts +0 -125
- package/src/types/Team.ts +0 -87
- package/src/types/User.ts +0 -302
- /package/lib/src/types/{Locale.d.ts → localization/Locale.d.ts} +0 -0
- /package/lib/src/types/{Locale.js → localization/Locale.js} +0 -0
- /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;
|
package/lib/src/index.d.ts
CHANGED
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);
|
package/lib/src/locales/de.d.ts
CHANGED
|
@@ -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,
|
package/lib/src/locales/de.js
CHANGED
|
@@ -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
|
-
|
|
105
|
+
teamRole: {
|
|
102
106
|
personManager: 'Personenmanager',
|
|
103
107
|
fineTemplateManager: 'Strafvorlagenmanager',
|
|
104
108
|
fineManager: 'Strafenmanager',
|
package/lib/src/locales/en.d.ts
CHANGED
|
@@ -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
|
-
|
|
74
|
+
teamRole: {
|
|
71
75
|
personManager: string;
|
|
72
76
|
fineTemplateManager: string;
|
|
73
77
|
fineManager: string;
|
package/lib/src/locales/en.js
CHANGED
|
@@ -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
|
-
|
|
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
|
|
10
|
+
export declare class Money implements Flattable<Money.Flatten> {
|
|
11
11
|
value: number;
|
|
12
12
|
subunitValue: number;
|
|
13
13
|
/**
|
|
14
|
-
* Creates a new
|
|
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
|
|
21
|
+
* Returns a Money instance representing zero.
|
|
22
22
|
*/
|
|
23
|
-
static get zero():
|
|
23
|
+
static get zero(): Money;
|
|
24
24
|
/**
|
|
25
|
-
* Adds another
|
|
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
|
|
30
|
-
* @returns A new
|
|
29
|
+
* @param amount - The Money instance to add
|
|
30
|
+
* @returns A new Money instance representing the sum
|
|
31
31
|
*/
|
|
32
|
-
added(amount:
|
|
32
|
+
added(amount: Money): Money;
|
|
33
33
|
/**
|
|
34
|
-
* Multiplies this
|
|
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
|
|
39
|
+
* @returns A new Money instance representing the product
|
|
40
40
|
*/
|
|
41
|
-
multiplied(factor: number):
|
|
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
|
|
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,
|
|
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():
|
|
61
|
+
get flatten(): Money.Flatten;
|
|
62
62
|
}
|
|
63
|
-
export declare namespace
|
|
63
|
+
export declare namespace Money {
|
|
64
64
|
/**
|
|
65
|
-
* Flattened representation of
|
|
65
|
+
* Flattened representation of Money as a decimal number.
|
|
66
66
|
*/
|
|
67
67
|
type Flatten = number;
|
|
68
68
|
/**
|
|
69
|
-
* Type builder for
|
|
69
|
+
* Type builder for Money serialization/deserialization.
|
|
70
70
|
*/
|
|
71
|
-
class TypeBuilder implements ITypeBuilder<Flatten,
|
|
71
|
+
class TypeBuilder implements ITypeBuilder<Flatten, Money> {
|
|
72
72
|
/**
|
|
73
|
-
* Builds a
|
|
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
|
|
78
|
+
* @returns Money instance
|
|
79
79
|
*/
|
|
80
|
-
build(value: Flatten):
|
|
80
|
+
build(value: Flatten): Money;
|
|
81
81
|
}
|
|
82
82
|
/**
|
|
83
|
-
* Singleton instance of TypeBuilder for
|
|
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.
|
|
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
|
|
10
|
+
class Money {
|
|
11
11
|
value;
|
|
12
12
|
subunitValue;
|
|
13
13
|
/**
|
|
14
|
-
* Creates a new
|
|
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
|
|
24
|
+
* Returns a Money instance representing zero.
|
|
25
25
|
*/
|
|
26
26
|
static get zero() {
|
|
27
|
-
return new
|
|
27
|
+
return new Money(0, 0);
|
|
28
28
|
}
|
|
29
29
|
/**
|
|
30
|
-
* Adds another
|
|
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
|
|
35
|
-
* @returns A new
|
|
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
|
|
40
|
+
return new Money(value, subunitValue % 100);
|
|
41
41
|
}
|
|
42
42
|
/**
|
|
43
|
-
* Multiplies this
|
|
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
|
|
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
|
|
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
|
|
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,
|
|
65
|
-
const numberFormat = Intl.NumberFormat(
|
|
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.
|
|
87
|
-
(function (
|
|
86
|
+
exports.Money = Money;
|
|
87
|
+
(function (Money) {
|
|
88
88
|
/**
|
|
89
|
-
* Type builder for
|
|
89
|
+
* Type builder for Money serialization/deserialization.
|
|
90
90
|
*/
|
|
91
91
|
class TypeBuilder {
|
|
92
92
|
/**
|
|
93
|
-
* Builds a
|
|
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
|
|
98
|
+
* @returns Money instance
|
|
99
99
|
*/
|
|
100
100
|
build(value) {
|
|
101
|
-
return new
|
|
101
|
+
return new Money(Math.floor(value), Math.round((value - Math.floor(value)) * 100));
|
|
102
102
|
}
|
|
103
103
|
}
|
|
104
|
-
|
|
104
|
+
Money.TypeBuilder = TypeBuilder;
|
|
105
105
|
/**
|
|
106
|
-
* Singleton instance of TypeBuilder for
|
|
106
|
+
* Singleton instance of TypeBuilder for Money.
|
|
107
107
|
*/
|
|
108
|
-
|
|
109
|
-
})(
|
|
108
|
+
Money.builder = new Money.TypeBuilder();
|
|
109
|
+
})(Money || (exports.Money = Money = {}));
|