@stevenkellner/team-conduct-api 2.0.17 → 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.
- 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 +7 -6
- 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
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.Invitation = void 0;
|
|
4
4
|
const typescript_common_functionality_1 = require("@stevenkellner/typescript-common-functionality");
|
|
5
5
|
const Team_1 = require("./Team");
|
|
6
|
-
const Person_1 = require("
|
|
6
|
+
const Person_1 = require("../person/Person");
|
|
7
7
|
/**
|
|
8
8
|
* Represents an invitation to join a team.
|
|
9
9
|
*
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import { Flattable, Guid, ITypeBuilder, Tagged } from '@stevenkellner/typescript-common-functionality';
|
|
2
|
+
import { Locale } from '../localization/Locale';
|
|
3
|
+
import { Currency } from '../Currency';
|
|
4
|
+
/**
|
|
5
|
+
* Represents a team in the system with its basic information.
|
|
6
|
+
*
|
|
7
|
+
* A team is a group of people who can track fines and payments together.
|
|
8
|
+
*/
|
|
9
|
+
export declare class Team implements Flattable<Team.Flatten> {
|
|
10
|
+
id: Team.Id;
|
|
11
|
+
name: string;
|
|
12
|
+
logoUrl: string | null;
|
|
13
|
+
sportCategory: string | null;
|
|
14
|
+
description: string | null;
|
|
15
|
+
settings: Team.Settings;
|
|
16
|
+
/**
|
|
17
|
+
* Creates a new Team instance.
|
|
18
|
+
*
|
|
19
|
+
* @param id - The unique identifier for this team
|
|
20
|
+
* @param name - The display name of the team
|
|
21
|
+
* @param logoUrl - Optional URL for the team's logo (null if not set)
|
|
22
|
+
* @param sportCategory - Optional sport category label (null if not set)
|
|
23
|
+
* @param description - Optional description of the team (null if not set)
|
|
24
|
+
* @param settings - Team configuration settings
|
|
25
|
+
*/
|
|
26
|
+
constructor(id: Team.Id, name: string, logoUrl: string | null, sportCategory: string | null, description: string | null, settings: Team.Settings);
|
|
27
|
+
/**
|
|
28
|
+
* Gets the flattened representation of this team for serialization.
|
|
29
|
+
*/
|
|
30
|
+
get flatten(): Team.Flatten;
|
|
31
|
+
}
|
|
32
|
+
export declare namespace Team {
|
|
33
|
+
/**
|
|
34
|
+
* Tagged type for team identifiers to prevent mixing with other GUID types.
|
|
35
|
+
*/
|
|
36
|
+
type Id = Tagged<Guid, 'team'>;
|
|
37
|
+
namespace Id {
|
|
38
|
+
/**
|
|
39
|
+
* Flattened representation of a team ID (plain GUID string).
|
|
40
|
+
*/
|
|
41
|
+
type Flatten = string;
|
|
42
|
+
/**
|
|
43
|
+
* Builder for constructing Team.Id instances from GUID strings.
|
|
44
|
+
*/
|
|
45
|
+
const builder: Tagged.TypeBuilder<Guid, "team">;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Configurable settings for a team.
|
|
49
|
+
*/
|
|
50
|
+
class Settings implements Flattable<Settings.Flatten> {
|
|
51
|
+
paypalMeLink: string | null;
|
|
52
|
+
allowMembersToAddFines: boolean;
|
|
53
|
+
fineVisibility: Settings.FineVisibility;
|
|
54
|
+
joinRequestType: Settings.JoinRequestType;
|
|
55
|
+
currency: Currency;
|
|
56
|
+
locale: Locale;
|
|
57
|
+
/**
|
|
58
|
+
* Creates new team settings.
|
|
59
|
+
*
|
|
60
|
+
* @param paypalMeLink - Optional PayPal.Me link for payment collection (null if not set)
|
|
61
|
+
* @param allowMembersToAddFines - Whether regular members can add fines
|
|
62
|
+
* @param fineVisibility - Controls which fines are visible to members
|
|
63
|
+
* @param joinRequestType - Controls how new members can join the team
|
|
64
|
+
* @param currency - The currency used for monetary fines
|
|
65
|
+
* @param locale - The locale for localized output
|
|
66
|
+
*/
|
|
67
|
+
constructor(paypalMeLink: string | null, allowMembersToAddFines: boolean, fineVisibility: Settings.FineVisibility, joinRequestType: Settings.JoinRequestType, currency: Currency, locale: Locale);
|
|
68
|
+
/**
|
|
69
|
+
* Gets the flattened representation of these settings for serialization.
|
|
70
|
+
*/
|
|
71
|
+
get flatten(): Settings.Flatten;
|
|
72
|
+
}
|
|
73
|
+
namespace Settings {
|
|
74
|
+
/**
|
|
75
|
+
* Controls which fines are visible to team members.
|
|
76
|
+
*
|
|
77
|
+
* - 'only-own-fines': Members can only see their own fines
|
|
78
|
+
* - 'all-fines': Members can see all fines in the team
|
|
79
|
+
*/
|
|
80
|
+
type FineVisibility = 'only-own-fines' | 'all-fines';
|
|
81
|
+
/**
|
|
82
|
+
* Controls how new members can join the team.
|
|
83
|
+
*
|
|
84
|
+
* - 'public-link-without-approval': Anyone with the link can join directly
|
|
85
|
+
* - 'public-link-with-approval': Anyone with the link can request to join (requires approval)
|
|
86
|
+
* - 'invite-only': Only invited people can join
|
|
87
|
+
*/
|
|
88
|
+
type JoinRequestType = 'public-link-without-approval' | 'public-link-with-approval' | 'invite-only';
|
|
89
|
+
/**
|
|
90
|
+
* Flattened representation of team settings for serialization.
|
|
91
|
+
*/
|
|
92
|
+
type Flatten = {
|
|
93
|
+
paypalMeLink: string | null;
|
|
94
|
+
allowMembersToAddFines: boolean;
|
|
95
|
+
fineVisibility: FineVisibility;
|
|
96
|
+
joinRequestType: JoinRequestType;
|
|
97
|
+
currency: Currency;
|
|
98
|
+
locale: Locale;
|
|
99
|
+
};
|
|
100
|
+
/**
|
|
101
|
+
* Builder for constructing Settings instances from flattened data.
|
|
102
|
+
*/
|
|
103
|
+
class TypeBuilder implements ITypeBuilder<Flatten, Settings> {
|
|
104
|
+
/**
|
|
105
|
+
* Builds a Settings instance from flattened data.
|
|
106
|
+
*
|
|
107
|
+
* @param value - The flattened team settings data
|
|
108
|
+
* @returns A new Settings instance
|
|
109
|
+
*/
|
|
110
|
+
build(value: Flatten): Settings;
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Singleton builder instance for Settings.
|
|
114
|
+
*/
|
|
115
|
+
const builder: TypeBuilder;
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Flattened representation of a Team for serialization.
|
|
119
|
+
*/
|
|
120
|
+
type Flatten = {
|
|
121
|
+
id: Id.Flatten;
|
|
122
|
+
name: string;
|
|
123
|
+
logoUrl: string | null;
|
|
124
|
+
sportCategory: string | null;
|
|
125
|
+
description: string | null;
|
|
126
|
+
settings: Settings.Flatten;
|
|
127
|
+
};
|
|
128
|
+
/**
|
|
129
|
+
* Builder for constructing Team instances from flattened data.
|
|
130
|
+
*/
|
|
131
|
+
class TypeBuilder implements ITypeBuilder<Flatten, Team> {
|
|
132
|
+
/**
|
|
133
|
+
* Builds a Team instance from flattened data.
|
|
134
|
+
*
|
|
135
|
+
* @param value - The flattened team data
|
|
136
|
+
* @returns A new Team instance
|
|
137
|
+
*/
|
|
138
|
+
build(value: Flatten): Team;
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Singleton builder instance for Team.
|
|
142
|
+
*/
|
|
143
|
+
const builder: TypeBuilder;
|
|
144
|
+
}
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Team = void 0;
|
|
4
|
+
const typescript_common_functionality_1 = require("@stevenkellner/typescript-common-functionality");
|
|
5
|
+
/**
|
|
6
|
+
* Represents a team in the system with its basic information.
|
|
7
|
+
*
|
|
8
|
+
* A team is a group of people who can track fines and payments together.
|
|
9
|
+
*/
|
|
10
|
+
class Team {
|
|
11
|
+
id;
|
|
12
|
+
name;
|
|
13
|
+
logoUrl;
|
|
14
|
+
sportCategory;
|
|
15
|
+
description;
|
|
16
|
+
settings;
|
|
17
|
+
/**
|
|
18
|
+
* Creates a new Team instance.
|
|
19
|
+
*
|
|
20
|
+
* @param id - The unique identifier for this team
|
|
21
|
+
* @param name - The display name of the team
|
|
22
|
+
* @param logoUrl - Optional URL for the team's logo (null if not set)
|
|
23
|
+
* @param sportCategory - Optional sport category label (null if not set)
|
|
24
|
+
* @param description - Optional description of the team (null if not set)
|
|
25
|
+
* @param settings - Team configuration settings
|
|
26
|
+
*/
|
|
27
|
+
constructor(id, name, logoUrl, sportCategory, description, settings) {
|
|
28
|
+
this.id = id;
|
|
29
|
+
this.name = name;
|
|
30
|
+
this.logoUrl = logoUrl;
|
|
31
|
+
this.sportCategory = sportCategory;
|
|
32
|
+
this.description = description;
|
|
33
|
+
this.settings = settings;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Gets the flattened representation of this team for serialization.
|
|
37
|
+
*/
|
|
38
|
+
get flatten() {
|
|
39
|
+
return {
|
|
40
|
+
id: this.id.flatten,
|
|
41
|
+
name: this.name,
|
|
42
|
+
logoUrl: this.logoUrl,
|
|
43
|
+
sportCategory: this.sportCategory,
|
|
44
|
+
description: this.description,
|
|
45
|
+
settings: this.settings.flatten
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
exports.Team = Team;
|
|
50
|
+
(function (Team) {
|
|
51
|
+
let Id;
|
|
52
|
+
(function (Id) {
|
|
53
|
+
/**
|
|
54
|
+
* Builder for constructing Team.Id instances from GUID strings.
|
|
55
|
+
*/
|
|
56
|
+
Id.builder = typescript_common_functionality_1.Tagged.builder('team', typescript_common_functionality_1.Guid.builder);
|
|
57
|
+
})(Id = Team.Id || (Team.Id = {}));
|
|
58
|
+
/**
|
|
59
|
+
* Configurable settings for a team.
|
|
60
|
+
*/
|
|
61
|
+
class Settings {
|
|
62
|
+
paypalMeLink;
|
|
63
|
+
allowMembersToAddFines;
|
|
64
|
+
fineVisibility;
|
|
65
|
+
joinRequestType;
|
|
66
|
+
currency;
|
|
67
|
+
locale;
|
|
68
|
+
/**
|
|
69
|
+
* Creates new team settings.
|
|
70
|
+
*
|
|
71
|
+
* @param paypalMeLink - Optional PayPal.Me link for payment collection (null if not set)
|
|
72
|
+
* @param allowMembersToAddFines - Whether regular members can add fines
|
|
73
|
+
* @param fineVisibility - Controls which fines are visible to members
|
|
74
|
+
* @param joinRequestType - Controls how new members can join the team
|
|
75
|
+
* @param currency - The currency used for monetary fines
|
|
76
|
+
* @param locale - The locale for localized output
|
|
77
|
+
*/
|
|
78
|
+
constructor(paypalMeLink, allowMembersToAddFines, fineVisibility, joinRequestType, currency, locale) {
|
|
79
|
+
this.paypalMeLink = paypalMeLink;
|
|
80
|
+
this.allowMembersToAddFines = allowMembersToAddFines;
|
|
81
|
+
this.fineVisibility = fineVisibility;
|
|
82
|
+
this.joinRequestType = joinRequestType;
|
|
83
|
+
this.currency = currency;
|
|
84
|
+
this.locale = locale;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Gets the flattened representation of these settings for serialization.
|
|
88
|
+
*/
|
|
89
|
+
get flatten() {
|
|
90
|
+
return {
|
|
91
|
+
paypalMeLink: this.paypalMeLink,
|
|
92
|
+
allowMembersToAddFines: this.allowMembersToAddFines,
|
|
93
|
+
fineVisibility: this.fineVisibility,
|
|
94
|
+
joinRequestType: this.joinRequestType,
|
|
95
|
+
currency: this.currency,
|
|
96
|
+
locale: this.locale
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
Team.Settings = Settings;
|
|
101
|
+
(function (Settings) {
|
|
102
|
+
/**
|
|
103
|
+
* Builder for constructing Settings instances from flattened data.
|
|
104
|
+
*/
|
|
105
|
+
class TypeBuilder {
|
|
106
|
+
/**
|
|
107
|
+
* Builds a Settings instance from flattened data.
|
|
108
|
+
*
|
|
109
|
+
* @param value - The flattened team settings data
|
|
110
|
+
* @returns A new Settings instance
|
|
111
|
+
*/
|
|
112
|
+
build(value) {
|
|
113
|
+
return new Settings(value.paypalMeLink, value.allowMembersToAddFines, value.fineVisibility, value.joinRequestType, value.currency, value.locale);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
Settings.TypeBuilder = TypeBuilder;
|
|
117
|
+
/**
|
|
118
|
+
* Singleton builder instance for Settings.
|
|
119
|
+
*/
|
|
120
|
+
Settings.builder = new TypeBuilder();
|
|
121
|
+
})(Settings = Team.Settings || (Team.Settings = {}));
|
|
122
|
+
/**
|
|
123
|
+
* Builder for constructing Team instances from flattened data.
|
|
124
|
+
*/
|
|
125
|
+
class TypeBuilder {
|
|
126
|
+
/**
|
|
127
|
+
* Builds a Team instance from flattened data.
|
|
128
|
+
*
|
|
129
|
+
* @param value - The flattened team data
|
|
130
|
+
* @returns A new Team instance
|
|
131
|
+
*/
|
|
132
|
+
build(value) {
|
|
133
|
+
return new Team(Id.builder.build(value.id), value.name, value.logoUrl, value.sportCategory, value.description, Settings.builder.build(value.settings));
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
Team.TypeBuilder = TypeBuilder;
|
|
137
|
+
/**
|
|
138
|
+
* Singleton builder instance for Team.
|
|
139
|
+
*/
|
|
140
|
+
Team.builder = new TypeBuilder();
|
|
141
|
+
})(Team || (exports.Team = Team = {}));
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { ValueTypeBuilder } from '@stevenkellner/typescript-common-functionality';
|
|
2
|
+
import { Locale } from '../localization/Locale';
|
|
3
|
+
/**
|
|
4
|
+
* Array of all available team roles.
|
|
5
|
+
*/
|
|
6
|
+
declare const teamRoles: readonly ["person-manager", "fineTemplate-manager", "fine-manager", "fine-can-add", "team-manager"];
|
|
7
|
+
/**
|
|
8
|
+
* Represents team roles in the application.
|
|
9
|
+
* Defines different levels of permissions for team members.
|
|
10
|
+
*/
|
|
11
|
+
export type TeamRole = typeof teamRoles[number];
|
|
12
|
+
export declare namespace TeamRole {
|
|
13
|
+
/**
|
|
14
|
+
* Array of all available team roles.
|
|
15
|
+
*/
|
|
16
|
+
const all: readonly TeamRole[];
|
|
17
|
+
/**
|
|
18
|
+
* Returns the localized, human-readable name for a team role.
|
|
19
|
+
*
|
|
20
|
+
* @param role - The team role to format
|
|
21
|
+
* @param locale - The locale to use for localization
|
|
22
|
+
* @returns The localized role name
|
|
23
|
+
*/
|
|
24
|
+
function formatted(role: TeamRole, locale: Locale): string;
|
|
25
|
+
/**
|
|
26
|
+
* Builder for constructing TeamRole values.
|
|
27
|
+
*/
|
|
28
|
+
const builder: ValueTypeBuilder<"person-manager" | "fineTemplate-manager" | "fine-manager" | "fine-can-add" | "team-manager">;
|
|
29
|
+
}
|
|
30
|
+
export {};
|
|
@@ -1,27 +1,28 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.TeamRole = void 0;
|
|
4
4
|
const typescript_common_functionality_1 = require("@stevenkellner/typescript-common-functionality");
|
|
5
|
-
const Localization_1 = require("
|
|
5
|
+
const Localization_1 = require("../localization/Localization");
|
|
6
6
|
/**
|
|
7
|
-
* Array of all available
|
|
7
|
+
* Array of all available team roles.
|
|
8
8
|
*/
|
|
9
|
-
const
|
|
9
|
+
const teamRoles = [
|
|
10
10
|
'person-manager', // Can manage persons, i.e. add/edit/remove persons of the team
|
|
11
11
|
'fineTemplate-manager', // Can manage fine templates, i.e. add/edit/remove fine templates
|
|
12
12
|
'fine-manager', // Can manage fines, i.e. add/edit/remove fines
|
|
13
13
|
'fine-can-add', // Can add fines, but not edit or remove them
|
|
14
14
|
'team-manager' // Can manage team settings, i.e. invite/remove team members, change team name, etc.
|
|
15
15
|
];
|
|
16
|
-
var
|
|
17
|
-
(function (
|
|
16
|
+
var TeamRole;
|
|
17
|
+
(function (TeamRole) {
|
|
18
18
|
/**
|
|
19
|
-
* Array of all available
|
|
19
|
+
* Array of all available team roles.
|
|
20
20
|
*/
|
|
21
|
-
|
|
21
|
+
TeamRole.all = teamRoles;
|
|
22
22
|
/**
|
|
23
|
-
* Returns the localized, human-readable name for a
|
|
24
|
-
*
|
|
23
|
+
* Returns the localized, human-readable name for a team role.
|
|
24
|
+
*
|
|
25
|
+
* @param role - The team role to format
|
|
25
26
|
* @param locale - The locale to use for localization
|
|
26
27
|
* @returns The localized role name
|
|
27
28
|
*/
|
|
@@ -33,11 +34,11 @@ var UserRole;
|
|
|
33
34
|
'fine-can-add': 'fineCanAdd',
|
|
34
35
|
'team-manager': 'teamManager'
|
|
35
36
|
};
|
|
36
|
-
return Localization_1.Localization.shared(locale).
|
|
37
|
+
return Localization_1.Localization.shared(locale).teamRole[localizationKeyMap[role]].value();
|
|
37
38
|
}
|
|
38
|
-
|
|
39
|
+
TeamRole.formatted = formatted;
|
|
39
40
|
/**
|
|
40
|
-
* Builder for constructing
|
|
41
|
+
* Builder for constructing TeamRole values.
|
|
41
42
|
*/
|
|
42
|
-
|
|
43
|
-
})(
|
|
43
|
+
TeamRole.builder = new typescript_common_functionality_1.ValueTypeBuilder();
|
|
44
|
+
})(TeamRole || (exports.TeamRole = TeamRole = {}));
|
|
@@ -0,0 +1,19 @@
|
|
|
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./Invitation"), exports);
|
|
18
|
+
__exportStar(require("./Team"), exports);
|
|
19
|
+
__exportStar(require("./TeamRole"), exports);
|
|
@@ -10,6 +10,7 @@ export declare class NotificationProperties implements Flattable<NotificationPro
|
|
|
10
10
|
subscriptions: NotificationProperties.Subscription[];
|
|
11
11
|
/**
|
|
12
12
|
* Creates new notification properties.
|
|
13
|
+
*
|
|
13
14
|
* @param tokens - Dictionary mapping token IDs to device tokens for push notifications (defaults to empty)
|
|
14
15
|
* @param subscriptions - Array of notification types the user is subscribed to (defaults to empty)
|
|
15
16
|
*/
|
|
@@ -29,6 +30,7 @@ export declare namespace NotificationProperties {
|
|
|
29
30
|
/**
|
|
30
31
|
* Creates a token ID from a device token by hashing it with SHA-512.
|
|
31
32
|
* Only the first 16 characters of the hash are used as the identifier.
|
|
33
|
+
*
|
|
32
34
|
* @param token - The device push notification token
|
|
33
35
|
* @returns A hashed token ID for secure storage and lookup
|
|
34
36
|
*/
|
|
@@ -45,12 +47,14 @@ export declare namespace NotificationProperties {
|
|
|
45
47
|
/**
|
|
46
48
|
* Available notification subscription types.
|
|
47
49
|
*/
|
|
48
|
-
const subscriptions: readonly ["new-fine", "fine-reminder", "fine-state-change"];
|
|
50
|
+
const subscriptions: readonly ["new-fine", "fine-changed", "fine-reminder", "fine-state-change"];
|
|
49
51
|
/**
|
|
50
52
|
* Type representing the available notification subscription options.
|
|
53
|
+
*
|
|
51
54
|
* - new-fine: Notifications when a new fine is created
|
|
55
|
+
* - fine-changed: Notifications when a fine is updated (non-payed-state change)
|
|
52
56
|
* - fine-reminder: Reminder notifications for unpaid fines
|
|
53
|
-
* - fine-state-change: Notifications when a fine's status changes
|
|
57
|
+
* - fine-state-change: Notifications when a fine's payed status changes or is deleted
|
|
54
58
|
*/
|
|
55
59
|
export type Subscription = typeof subscriptions[number];
|
|
56
60
|
export namespace Subscription {
|
|
@@ -61,7 +65,7 @@ export declare namespace NotificationProperties {
|
|
|
61
65
|
/**
|
|
62
66
|
* Builder for constructing Subscription values from strings.
|
|
63
67
|
*/
|
|
64
|
-
const builder: ValueTypeBuilder<"new-fine" | "fine-reminder" | "fine-state-change">;
|
|
68
|
+
const builder: ValueTypeBuilder<"new-fine" | "fine-changed" | "fine-reminder" | "fine-state-change">;
|
|
65
69
|
}
|
|
66
70
|
/**
|
|
67
71
|
* Flattened representation of notification properties for serialization.
|
|
@@ -76,6 +80,7 @@ export declare namespace NotificationProperties {
|
|
|
76
80
|
export class TypeBuilder implements ITypeBuilder<Flatten, NotificationProperties> {
|
|
77
81
|
/**
|
|
78
82
|
* Builds a NotificationProperties instance from flattened data.
|
|
83
|
+
*
|
|
79
84
|
* @param value - The flattened notification properties data
|
|
80
85
|
* @returns A new NotificationProperties instance
|
|
81
86
|
*/
|
|
@@ -13,6 +13,7 @@ class NotificationProperties {
|
|
|
13
13
|
subscriptions;
|
|
14
14
|
/**
|
|
15
15
|
* Creates new notification properties.
|
|
16
|
+
*
|
|
16
17
|
* @param tokens - Dictionary mapping token IDs to device tokens for push notifications (defaults to empty)
|
|
17
18
|
* @param subscriptions - Array of notification types the user is subscribed to (defaults to empty)
|
|
18
19
|
*/
|
|
@@ -37,6 +38,7 @@ exports.NotificationProperties = NotificationProperties;
|
|
|
37
38
|
/**
|
|
38
39
|
* Creates a token ID from a device token by hashing it with SHA-512.
|
|
39
40
|
* Only the first 16 characters of the hash are used as the identifier.
|
|
41
|
+
*
|
|
40
42
|
* @param token - The device push notification token
|
|
41
43
|
* @returns A hashed token ID for secure storage and lookup
|
|
42
44
|
*/
|
|
@@ -59,6 +61,7 @@ exports.NotificationProperties = NotificationProperties;
|
|
|
59
61
|
*/
|
|
60
62
|
const subscriptions = [
|
|
61
63
|
'new-fine',
|
|
64
|
+
'fine-changed',
|
|
62
65
|
'fine-reminder',
|
|
63
66
|
'fine-state-change'
|
|
64
67
|
];
|
|
@@ -79,6 +82,7 @@ exports.NotificationProperties = NotificationProperties;
|
|
|
79
82
|
class TypeBuilder {
|
|
80
83
|
/**
|
|
81
84
|
* Builds a NotificationProperties instance from flattened data.
|
|
85
|
+
*
|
|
82
86
|
* @param value - The flattened notification properties data
|
|
83
87
|
* @returns A new NotificationProperties instance
|
|
84
88
|
*/
|