@stevenkellner/team-conduct-api 1.0.0

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 (142) hide show
  1. package/.mocharc.js +22 -0
  2. package/.nyc_output/07911218-95ea-4964-b03a-325e6bcd9245.json +1 -0
  3. package/.nyc_output/ec4857fa-9793-4945-8be7-1f74d84b155e.json +1 -0
  4. package/.nyc_output/processinfo/07911218-95ea-4964-b03a-325e6bcd9245.json +131 -0
  5. package/.nyc_output/processinfo/ec4857fa-9793-4945-8be7-1f74d84b155e.json +131 -0
  6. package/.nyc_output/processinfo/index.json +131 -0
  7. package/.vscode/launch.json +14 -0
  8. package/LICENSE +21 -0
  9. package/coverage/base.css +224 -0
  10. package/coverage/block-navigation.js +87 -0
  11. package/coverage/favicon.png +0 -0
  12. package/coverage/index.html +251 -0
  13. package/coverage/prettify.css +1 -0
  14. package/coverage/prettify.js +2 -0
  15. package/coverage/sort-arrow-sprite.png +0 -0
  16. package/coverage/sorter.js +196 -0
  17. package/coverage/src/Firestore.ts.html +273 -0
  18. package/coverage/src/FirestoreScheme.ts.html +156 -0
  19. package/coverage/src/checkAuthentication.ts.html +192 -0
  20. package/coverage/src/firebaseFunctions.ts.html +252 -0
  21. package/coverage/src/functions/fine/add.ts.html +255 -0
  22. package/coverage/src/functions/fine/delete.ts.html +255 -0
  23. package/coverage/src/functions/fine/index.html +146 -0
  24. package/coverage/src/functions/fine/update.ts.html +258 -0
  25. package/coverage/src/functions/fineTemplate/add.ts.html +195 -0
  26. package/coverage/src/functions/fineTemplate/delete.ts.html +195 -0
  27. package/coverage/src/functions/fineTemplate/index.html +146 -0
  28. package/coverage/src/functions/fineTemplate/update.ts.html +195 -0
  29. package/coverage/src/functions/invitation/index.html +146 -0
  30. package/coverage/src/functions/invitation/invite.ts.html +177 -0
  31. package/coverage/src/functions/invitation/register.ts.html +258 -0
  32. package/coverage/src/functions/invitation/withdraw.ts.html +165 -0
  33. package/coverage/src/functions/notification/index.html +131 -0
  34. package/coverage/src/functions/notification/register.ts.html +210 -0
  35. package/coverage/src/functions/notification/subscribe.ts.html +207 -0
  36. package/coverage/src/functions/paypalMe/edit.ts.html +201 -0
  37. package/coverage/src/functions/paypalMe/index.html +116 -0
  38. package/coverage/src/functions/person/add.ts.html +201 -0
  39. package/coverage/src/functions/person/delete.ts.html +204 -0
  40. package/coverage/src/functions/person/index.html +146 -0
  41. package/coverage/src/functions/person/update.ts.html +204 -0
  42. package/coverage/src/functions/team/index.html +116 -0
  43. package/coverage/src/functions/team/new.ts.html +255 -0
  44. package/coverage/src/functions/user/index.html +131 -0
  45. package/coverage/src/functions/user/login.ts.html +165 -0
  46. package/coverage/src/functions/user/roleEdit.ts.html +225 -0
  47. package/coverage/src/index.html +191 -0
  48. package/coverage/src/index.ts.html +156 -0
  49. package/coverage/src/pushNotification.ts.html +199 -0
  50. package/coverage/src/types/Configuration.ts.html +220 -0
  51. package/coverage/src/types/Fine.ts.html +262 -0
  52. package/coverage/src/types/FineAmount.ts.html +457 -0
  53. package/coverage/src/types/FineTemplate.ts.html +250 -0
  54. package/coverage/src/types/FineTemplateRepetition.ts.html +241 -0
  55. package/coverage/src/types/Invitation.ts.html +253 -0
  56. package/coverage/src/types/MoneyAmount.ts.html +196 -0
  57. package/coverage/src/types/NotificationProperties.ts.html +280 -0
  58. package/coverage/src/types/PayedState.ts.html +121 -0
  59. package/coverage/src/types/Person.ts.html +253 -0
  60. package/coverage/src/types/PersonPrivateProperties.ts.html +196 -0
  61. package/coverage/src/types/PersonSignInProperties.ts.html +211 -0
  62. package/coverage/src/types/Team.ts.html +232 -0
  63. package/coverage/src/types/User.ts.html +313 -0
  64. package/coverage/src/types/UserRole.ts.html +142 -0
  65. package/coverage/src/types/index.html +341 -0
  66. package/coverage/src/types/index.ts.html +130 -0
  67. package/eslint.config.js +72 -0
  68. package/firestore-debug.log +0 -0
  69. package/index.ts +3 -0
  70. package/package.json +62 -0
  71. package/src/.env +1 -0
  72. package/src/Firestore.ts +63 -0
  73. package/src/FirestoreScheme.ts +24 -0
  74. package/src/checkAuthentication.ts +36 -0
  75. package/src/firebaseFunctionCreators.ts +56 -0
  76. package/src/functions/fine/add.ts +54 -0
  77. package/src/functions/fine/delete.ts +54 -0
  78. package/src/functions/fine/update.ts +55 -0
  79. package/src/functions/fineTemplate/add.ts +34 -0
  80. package/src/functions/fineTemplate/delete.ts +34 -0
  81. package/src/functions/fineTemplate/update.ts +34 -0
  82. package/src/functions/invitation/invite.ts +28 -0
  83. package/src/functions/invitation/register.ts +54 -0
  84. package/src/functions/invitation/withdraw.ts +24 -0
  85. package/src/functions/notification/register.ts +39 -0
  86. package/src/functions/notification/subscribe.ts +38 -0
  87. package/src/functions/paypalMe/edit.ts +36 -0
  88. package/src/functions/person/add.ts +36 -0
  89. package/src/functions/person/delete.ts +37 -0
  90. package/src/functions/person/update.ts +37 -0
  91. package/src/functions/team/new.ts +54 -0
  92. package/src/functions/user/login.ts +25 -0
  93. package/src/functions/user/roleEdit.ts +44 -0
  94. package/src/index.ts +24 -0
  95. package/src/locales/de.json +30 -0
  96. package/src/locales/en.json +30 -0
  97. package/src/pushNotification.ts +38 -0
  98. package/src/types/Configuration.ts +54 -0
  99. package/src/types/Fine.ts +59 -0
  100. package/src/types/FineAmount.ts +123 -0
  101. package/src/types/FineTemplate.ts +55 -0
  102. package/src/types/FineTemplateRepetition.ts +54 -0
  103. package/src/types/Invitation.ts +56 -0
  104. package/src/types/MoneyAmount.ts +37 -0
  105. package/src/types/NotificationProperties.ts +67 -0
  106. package/src/types/PayedState.ts +12 -0
  107. package/src/types/Person.ts +56 -0
  108. package/src/types/PersonPrivateProperties.ts +37 -0
  109. package/src/types/PersonSignInProperties.ts +42 -0
  110. package/src/types/Team.ts +49 -0
  111. package/src/types/User.ts +76 -0
  112. package/src/types/UserRole.ts +19 -0
  113. package/src/types/index.ts +15 -0
  114. package/test/FirebaseApp.ts +64 -0
  115. package/test/FirebaseAuth.ts +26 -0
  116. package/test/FirebaseFirestore.ts +20 -0
  117. package/test/FirebaseFunctions.ts +17 -0
  118. package/test/RandomData.ts +120 -0
  119. package/test/createTestTeam.ts +43 -0
  120. package/test/firebase-rules.test.ts +125 -0
  121. package/test/functions/fine/add.test.ts +52 -0
  122. package/test/functions/fine/delete.test.ts +50 -0
  123. package/test/functions/fine/update.test.ts +39 -0
  124. package/test/functions/fineTemplate/add.test.ts +35 -0
  125. package/test/functions/fineTemplate/delete.test.ts +33 -0
  126. package/test/functions/fineTemplate/update.test.ts +35 -0
  127. package/test/functions/invitation/invite.test.ts +48 -0
  128. package/test/functions/invitation/register.test.ts +137 -0
  129. package/test/functions/invitation/withdraw.test.ts +33 -0
  130. package/test/functions/notifcation/register.test.ts +47 -0
  131. package/test/functions/notifcation/subscribe.test.ts +46 -0
  132. package/test/functions/paypalMe/edit.test.ts +42 -0
  133. package/test/functions/person/add.test.ts +39 -0
  134. package/test/functions/person/delete.test.ts +41 -0
  135. package/test/functions/person/update.test.ts +39 -0
  136. package/test/functions/team/new.test.ts +139 -0
  137. package/test/functions/user/login.test.ts +37 -0
  138. package/test/functions/user/roleEdit.test.ts +47 -0
  139. package/test/testTeams/testTeam1.ts +63 -0
  140. package/test/waitForEmulator.ts +11 -0
  141. package/tsconfig.dev.json +5 -0
  142. package/tsconfig.json +21 -0
@@ -0,0 +1,63 @@
1
+ import { Tagged, UtcDate } from '@stevenkellner/typescript-common-functionality';
2
+ import { MoneyAmount, Fine, FineAmount, Person, PersonPrivateProperties, FineTemplate, FineTemplateRepetition } from '../../src/types';
3
+ import { TestTeam } from '../createTestTeam';
4
+
5
+ const fineIds: [Fine.Id, Fine.Id, Fine.Id] = [
6
+ Tagged.generate('fine'),
7
+ Tagged.generate('fine'),
8
+ Tagged.generate('fine')
9
+ ];
10
+
11
+ export const testTeam1: TestTeam = {
12
+ id: Tagged.generate('team'),
13
+ name: 'Test Team 1',
14
+ persons: [
15
+ new Person(
16
+ Tagged.generate('person'),
17
+ new PersonPrivateProperties('John', 'Doe'),
18
+ [fineIds[0], fineIds[1]]
19
+ ),
20
+ new Person(
21
+ Tagged.generate('person'),
22
+ new PersonPrivateProperties('Max', 'Mustermann'),
23
+ [fineIds[2]]
24
+ )
25
+ ],
26
+ fineTemplates: [
27
+ new FineTemplate(
28
+ Tagged.generate('fineTemplate'),
29
+ 'Fine Template 1',
30
+ FineAmount.money(new MoneyAmount(10, 50)),
31
+ null
32
+ ),
33
+ new FineTemplate(
34
+ Tagged.generate('fineTemplate'),
35
+ 'Fine Template 2',
36
+ FineAmount.item('crateOfBeer', 1),
37
+ new FineTemplateRepetition('day', 3)
38
+ )
39
+ ],
40
+ fines: [
41
+ new Fine(
42
+ fineIds[0],
43
+ 'notPayed',
44
+ UtcDate.now,
45
+ 'Fine 1',
46
+ FineAmount.money(new MoneyAmount(10, 50))
47
+ ),
48
+ new Fine(
49
+ fineIds[1],
50
+ 'payed',
51
+ UtcDate.now,
52
+ 'Fine 2',
53
+ FineAmount.item('crateOfBeer', 2)
54
+ ),
55
+ new Fine(
56
+ fineIds[2],
57
+ 'notPayed',
58
+ UtcDate.now,
59
+ 'Fine 3',
60
+ FineAmount.money(new MoneyAmount(5, 0))
61
+ )
62
+ ]
63
+ };
@@ -0,0 +1,11 @@
1
+ import { waitUntilUsed } from 'tcp-port-used';
2
+
3
+ async function waitForEmulators(): Promise<void> {
4
+ await waitUntilUsed(5001, 500, 60000);
5
+ await waitUntilUsed(8080, 500, 60000);
6
+ await new Promise(resolve => {
7
+ setTimeout(resolve, 5000);
8
+ });
9
+ }
10
+
11
+ void waitForEmulators();
@@ -0,0 +1,5 @@
1
+ {
2
+ "include": [
3
+ ".eslintrc.js"
4
+ ]
5
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,21 @@
1
+ {
2
+ "compilerOptions": {
3
+ "module": "CommonJS",
4
+ "esModuleInterop": true,
5
+ "noImplicitReturns": true,
6
+ "noUnusedLocals": true,
7
+ "outDir": "./lib",
8
+ "sourceMap": true,
9
+ "strict": true,
10
+ "target": "ESNext",
11
+ "resolveJsonModule": true,
12
+ "skipLibCheck": true,
13
+ "declaration": true
14
+ },
15
+ "compileOnSave": true,
16
+ "include": [
17
+ "index.ts",
18
+ "src/**/*.ts",
19
+ "test/**/*.ts",
20
+ ]
21
+ }