@stevenkellner/team-conduct-api 1.0.16 → 1.0.18

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.
@@ -39,20 +39,36 @@
39
39
  "one": "1 Minute",
40
40
  "other": "%s Minuten"
41
41
  },
42
+ "minuteWithoutCount?count=%s": {
43
+ "one": "Minute",
44
+ "other": "Minuten"
45
+ },
42
46
  "day": "Tag",
43
47
  "day?count=%s": {
44
48
  "one": "1 Tag",
45
49
  "other": "%s Tage"
46
50
  },
51
+ "dayWithoutCount?count=%s": {
52
+ "one": "Tag",
53
+ "other": "Tage"
54
+ },
47
55
  "item": "Teil",
48
56
  "item?count=%s": {
49
57
  "one": "1 Teil",
50
58
  "other": "%s Teile"
51
59
  },
60
+ "itemWithoutCount?count=%s": {
61
+ "one": "Teil",
62
+ "other": "Teile"
63
+ },
52
64
  "count": "Anzahl",
53
65
  "count?count=%s": {
54
66
  "one": "1 mal",
55
67
  "other": "%s mal"
68
+ },
69
+ "countWithoutCount?count=%s": {
70
+ "one": "mal",
71
+ "other": "mal"
56
72
  }
57
73
  }
58
74
  },
@@ -39,20 +39,36 @@
39
39
  "one": "1 minute",
40
40
  "other": "%s minutes"
41
41
  },
42
+ "minuteWithoutCount?count=%s": {
43
+ "one": "Minute",
44
+ "other": "Minutes"
45
+ },
42
46
  "day": "Day",
43
47
  "day?count=%s": {
44
48
  "one": "1 day",
45
49
  "other": "%s days"
46
50
  },
51
+ "dayWithoutCount?count=%s": {
52
+ "one": "Day",
53
+ "other": "Days"
54
+ },
47
55
  "item": "Item",
48
56
  "item?count=%s": {
49
57
  "one": "1 item",
50
58
  "other": "%s items"
51
59
  },
60
+ "itemWithoutCount?count=%s": {
61
+ "one": "Item",
62
+ "other": "Items"
63
+ },
52
64
  "count": "Count",
53
65
  "count?count=%s": {
54
66
  "one": "1 time",
55
67
  "other": "%s times"
68
+ },
69
+ "countWithoutCount?count=%s": {
70
+ "one": "time",
71
+ "other": "times"
56
72
  }
57
73
  }
58
74
  },
@@ -4,6 +4,7 @@ export declare class FineTemplateRepetition implements Flattable<FineTemplateRep
4
4
  maxCount: number | null;
5
5
  constructor(item: FineTemplateRepetition.Item, maxCount: number | null);
6
6
  formatted(count: number): string;
7
+ formattedWithoutCount(count: number): string;
7
8
  get flatten(): FineTemplateRepetition.Flatten;
8
9
  }
9
10
  export declare namespace FineTemplateRepetition {
@@ -13,6 +13,9 @@ class FineTemplateRepetition {
13
13
  formatted(count) {
14
14
  return Localization_1.Localization.shared.getN(key => key.fineTemplateRepetition.item[this.item], count);
15
15
  }
16
+ formattedWithoutCount(count) {
17
+ return Localization_1.Localization.shared.getN(key => key.fineTemplateRepetition.item[`${this.item}WithoutCount`], count);
18
+ }
16
19
  get flatten() {
17
20
  return {
18
21
  item: this.item,
@@ -56,9 +56,13 @@ export declare const localizationNKey: {
56
56
  fineTemplateRepetition: {
57
57
  item: {
58
58
  minute: string;
59
+ minuteWithoutCount: string;
59
60
  day: string;
61
+ dayWithoutCount: string;
60
62
  item: string;
63
+ itemWithoutCount: string;
61
64
  count: string;
65
+ countWithoutCount: string;
62
66
  };
63
67
  };
64
68
  };
@@ -93,9 +93,13 @@ exports.localizationNKey = {
93
93
  fineTemplateRepetition: {
94
94
  item: {
95
95
  minute: 'fineTemplateRepetition.item.minute?count=%s',
96
+ minuteWithoutCount: 'fineTemplateRepetition.item.minuteWithoutCount?count=%s',
96
97
  day: 'fineTemplateRepetition.item.day?count=%s',
98
+ dayWithoutCount: 'fineTemplateRepetition.item.dayWithoutCount?count=%s',
97
99
  item: 'fineTemplateRepetition.item.item?count=%s',
98
- count: 'fineTemplateRepetition.item.count?count=%s'
100
+ itemWithoutCount: 'fineTemplateRepetition.item.itemWithoutCount?count=%s',
101
+ count: 'fineTemplateRepetition.item.count?count=%s',
102
+ countWithoutCount: 'fineTemplateRepetition.item.countWithoutCount?count=%s'
99
103
  }
100
104
  }
101
105
  };
@@ -9,6 +9,7 @@ export declare class Person implements Flattable<Person.Flatten> {
9
9
  signInProperties: PersonSignInProperties | null;
10
10
  constructor(id: Person.Id, properties: PersonPrivateProperties, fineIds?: Fine.Id[], signInProperties?: PersonSignInProperties | null);
11
11
  get flatten(): Person.Flatten;
12
+ get name(): string;
12
13
  }
13
14
  export declare namespace Person {
14
15
  type Id = Tagged<Guid, 'person'>;
@@ -24,6 +24,11 @@ class Person {
24
24
  signInProperties: this.signInProperties?.flatten ?? null
25
25
  };
26
26
  }
27
+ get name() {
28
+ if (this.properties.lastName === null)
29
+ return this.properties.firstName;
30
+ return `${this.properties.firstName} ${this.properties.lastName}`;
31
+ }
27
32
  }
28
33
  exports.Person = Person;
29
34
  (function (Person) {
@@ -86,41 +86,57 @@ describe('Localization for de', () => {
86
86
  testedKeys.test(key => key.fineTemplateRepetition.item.minute, 'Minute');
87
87
  testedKeys.testN(key => key.fineTemplateRepetition.item.minute, 1, '1 Minute');
88
88
  testedKeys.testN(key => key.fineTemplateRepetition.item.minute, 4, '4 Minuten');
89
+ testedKeys.testN(key => key.fineTemplateRepetition.item.minuteWithoutCount, 1, 'Minute');
90
+ testedKeys.testN(key => key.fineTemplateRepetition.item.minuteWithoutCount, 4, 'Minuten');
89
91
  });
90
92
  it('fineTemplateRepetition.item.minute should be formatted correctly', () => {
91
93
  (0, core_1.expect)(types_1.FineTemplateRepetition.Item.formatted('minute')).toBeEqual('Minute');
92
94
  (0, core_1.expect)(new types_1.FineTemplateRepetition('minute', null).formatted(1)).toBeEqual('1 Minute');
93
95
  (0, core_1.expect)(new types_1.FineTemplateRepetition('minute', null).formatted(4)).toBeEqual('4 Minuten');
96
+ (0, core_1.expect)(new types_1.FineTemplateRepetition('minute', null).formattedWithoutCount(1)).toBeEqual('Minute');
97
+ (0, core_1.expect)(new types_1.FineTemplateRepetition('minute', null).formattedWithoutCount(4)).toBeEqual('Minuten');
94
98
  });
95
99
  it('fineTemplateRepetition.item.day should be tested', () => {
96
100
  testedKeys.test(key => key.fineTemplateRepetition.item.day, 'Tag');
97
101
  testedKeys.testN(key => key.fineTemplateRepetition.item.day, 1, '1 Tag');
98
102
  testedKeys.testN(key => key.fineTemplateRepetition.item.day, 4, '4 Tage');
103
+ testedKeys.testN(key => key.fineTemplateRepetition.item.dayWithoutCount, 1, 'Tag');
104
+ testedKeys.testN(key => key.fineTemplateRepetition.item.dayWithoutCount, 4, 'Tage');
99
105
  });
100
106
  it('fineTemplateRepetition.item.day should be formatted correctly', () => {
101
107
  (0, core_1.expect)(types_1.FineTemplateRepetition.Item.formatted('day')).toBeEqual('Tag');
102
108
  (0, core_1.expect)(new types_1.FineTemplateRepetition('day', null).formatted(1)).toBeEqual('1 Tag');
103
109
  (0, core_1.expect)(new types_1.FineTemplateRepetition('day', null).formatted(4)).toBeEqual('4 Tage');
110
+ (0, core_1.expect)(new types_1.FineTemplateRepetition('day', null).formattedWithoutCount(1)).toBeEqual('Tag');
111
+ (0, core_1.expect)(new types_1.FineTemplateRepetition('day', null).formattedWithoutCount(4)).toBeEqual('Tage');
104
112
  });
105
113
  it('fineTemplateRepetition.item.item should be tested', () => {
106
114
  testedKeys.test(key => key.fineTemplateRepetition.item.item, 'Teil');
107
115
  testedKeys.testN(key => key.fineTemplateRepetition.item.item, 1, '1 Teil');
108
116
  testedKeys.testN(key => key.fineTemplateRepetition.item.item, 4, '4 Teile');
117
+ testedKeys.testN(key => key.fineTemplateRepetition.item.itemWithoutCount, 1, 'Teil');
118
+ testedKeys.testN(key => key.fineTemplateRepetition.item.itemWithoutCount, 4, 'Teile');
109
119
  });
110
120
  it('fineTemplateRepetition.item.item should be formatted correctly', () => {
111
121
  (0, core_1.expect)(types_1.FineTemplateRepetition.Item.formatted('item')).toBeEqual('Teil');
112
122
  (0, core_1.expect)(new types_1.FineTemplateRepetition('item', null).formatted(1)).toBeEqual('1 Teil');
113
123
  (0, core_1.expect)(new types_1.FineTemplateRepetition('item', null).formatted(4)).toBeEqual('4 Teile');
124
+ (0, core_1.expect)(new types_1.FineTemplateRepetition('item', null).formattedWithoutCount(1)).toBeEqual('Teil');
125
+ (0, core_1.expect)(new types_1.FineTemplateRepetition('item', null).formattedWithoutCount(4)).toBeEqual('Teile');
114
126
  });
115
127
  it('fineTemplateRepetition.item.count should be tested', () => {
116
128
  testedKeys.test(key => key.fineTemplateRepetition.item.count, 'Anzahl');
117
129
  testedKeys.testN(key => key.fineTemplateRepetition.item.count, 1, '1 mal');
118
130
  testedKeys.testN(key => key.fineTemplateRepetition.item.count, 4, '4 mal');
131
+ testedKeys.testN(key => key.fineTemplateRepetition.item.countWithoutCount, 1, 'mal');
132
+ testedKeys.testN(key => key.fineTemplateRepetition.item.countWithoutCount, 4, 'mal');
119
133
  });
120
134
  it('fineTemplateRepetition.item.count should be formatted correctly', () => {
121
135
  (0, core_1.expect)(types_1.FineTemplateRepetition.Item.formatted('count')).toBeEqual('Anzahl');
122
136
  (0, core_1.expect)(new types_1.FineTemplateRepetition('count', null).formatted(1)).toBeEqual('1 mal');
123
137
  (0, core_1.expect)(new types_1.FineTemplateRepetition('count', null).formatted(4)).toBeEqual('4 mal');
138
+ (0, core_1.expect)(new types_1.FineTemplateRepetition('count', null).formattedWithoutCount(1)).toBeEqual('mal');
139
+ (0, core_1.expect)(new types_1.FineTemplateRepetition('count', null).formattedWithoutCount(4)).toBeEqual('mal');
124
140
  });
125
141
  });
126
142
  describe('payedState should be tested', () => {
@@ -82,41 +82,57 @@ describe('Localization for en', () => {
82
82
  testedKeys.test(key => key.fineTemplateRepetition.item.minute, 'Minute');
83
83
  testedKeys.testN(key => key.fineTemplateRepetition.item.minute, 1, '1 minute');
84
84
  testedKeys.testN(key => key.fineTemplateRepetition.item.minute, 4, '4 minutes');
85
+ testedKeys.testN(key => key.fineTemplateRepetition.item.minuteWithoutCount, 1, 'Minute');
86
+ testedKeys.testN(key => key.fineTemplateRepetition.item.minuteWithoutCount, 4, 'Minutes');
85
87
  });
86
88
  it('fineTemplateRepetition.item.minute should be formatted correctly', () => {
87
89
  (0, core_1.expect)(types_1.FineTemplateRepetition.Item.formatted('minute')).toBeEqual('Minute');
88
90
  (0, core_1.expect)(new types_1.FineTemplateRepetition('minute', null).formatted(1)).toBeEqual('1 minute');
89
91
  (0, core_1.expect)(new types_1.FineTemplateRepetition('minute', null).formatted(4)).toBeEqual('4 minutes');
92
+ (0, core_1.expect)(new types_1.FineTemplateRepetition('minute', null).formattedWithoutCount(1)).toBeEqual('Minute');
93
+ (0, core_1.expect)(new types_1.FineTemplateRepetition('minute', null).formattedWithoutCount(4)).toBeEqual('Minutes');
90
94
  });
91
95
  it('fineTemplateRepetition.item.day should be tested', () => {
92
96
  testedKeys.test(key => key.fineTemplateRepetition.item.day, 'Day');
93
97
  testedKeys.testN(key => key.fineTemplateRepetition.item.day, 1, '1 day');
94
98
  testedKeys.testN(key => key.fineTemplateRepetition.item.day, 4, '4 days');
99
+ testedKeys.testN(key => key.fineTemplateRepetition.item.dayWithoutCount, 1, 'Day');
100
+ testedKeys.testN(key => key.fineTemplateRepetition.item.dayWithoutCount, 4, 'Days');
95
101
  });
96
102
  it('fineTemplateRepetition.item.day should be formatted correctly', () => {
97
103
  (0, core_1.expect)(types_1.FineTemplateRepetition.Item.formatted('day')).toBeEqual('Day');
98
104
  (0, core_1.expect)(new types_1.FineTemplateRepetition('day', null).formatted(1)).toBeEqual('1 day');
99
105
  (0, core_1.expect)(new types_1.FineTemplateRepetition('day', null).formatted(4)).toBeEqual('4 days');
106
+ (0, core_1.expect)(new types_1.FineTemplateRepetition('day', null).formattedWithoutCount(1)).toBeEqual('Day');
107
+ (0, core_1.expect)(new types_1.FineTemplateRepetition('day', null).formattedWithoutCount(4)).toBeEqual('Days');
100
108
  });
101
109
  it('fineTemplateRepetition.item.item should be tested', () => {
102
110
  testedKeys.test(key => key.fineTemplateRepetition.item.item, 'Item');
103
111
  testedKeys.testN(key => key.fineTemplateRepetition.item.item, 1, '1 item');
104
112
  testedKeys.testN(key => key.fineTemplateRepetition.item.item, 4, '4 items');
113
+ testedKeys.testN(key => key.fineTemplateRepetition.item.itemWithoutCount, 1, 'Item');
114
+ testedKeys.testN(key => key.fineTemplateRepetition.item.itemWithoutCount, 4, 'Items');
105
115
  });
106
116
  it('fineTemplateRepetition.item.item should be formatted correctly', () => {
107
117
  (0, core_1.expect)(types_1.FineTemplateRepetition.Item.formatted('item')).toBeEqual('Item');
108
118
  (0, core_1.expect)(new types_1.FineTemplateRepetition('item', null).formatted(1)).toBeEqual('1 item');
109
119
  (0, core_1.expect)(new types_1.FineTemplateRepetition('item', null).formatted(4)).toBeEqual('4 items');
120
+ (0, core_1.expect)(new types_1.FineTemplateRepetition('item', null).formattedWithoutCount(1)).toBeEqual('Item');
121
+ (0, core_1.expect)(new types_1.FineTemplateRepetition('item', null).formattedWithoutCount(4)).toBeEqual('Items');
110
122
  });
111
123
  it('fineTemplateRepetition.item.count should be tested', () => {
112
124
  testedKeys.test(key => key.fineTemplateRepetition.item.count, 'Count');
113
125
  testedKeys.testN(key => key.fineTemplateRepetition.item.count, 1, '1 time');
114
126
  testedKeys.testN(key => key.fineTemplateRepetition.item.count, 4, '4 times');
127
+ testedKeys.testN(key => key.fineTemplateRepetition.item.countWithoutCount, 1, 'time');
128
+ testedKeys.testN(key => key.fineTemplateRepetition.item.countWithoutCount, 4, 'times');
115
129
  });
116
130
  it('fineTemplateRepetition.item.count should be formatted correctly', () => {
117
131
  (0, core_1.expect)(types_1.FineTemplateRepetition.Item.formatted('count')).toBeEqual('Count');
118
132
  (0, core_1.expect)(new types_1.FineTemplateRepetition('count', null).formatted(1)).toBeEqual('1 time');
119
133
  (0, core_1.expect)(new types_1.FineTemplateRepetition('count', null).formatted(4)).toBeEqual('4 times');
134
+ (0, core_1.expect)(new types_1.FineTemplateRepetition('count', null).formattedWithoutCount(1)).toBeEqual('time');
135
+ (0, core_1.expect)(new types_1.FineTemplateRepetition('count', null).formattedWithoutCount(4)).toBeEqual('times');
120
136
  });
121
137
  });
122
138
  describe('payedState should be tested', () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stevenkellner/team-conduct-api",
3
- "version": "1.0.16",
3
+ "version": "1.0.18",
4
4
  "description": "Firebase API for Team Conduct",
5
5
  "license": "MIT",
6
6
  "author": "Steven Kellner",
@@ -39,21 +39,37 @@
39
39
  "one": "1 Minute",
40
40
  "other": "%s Minuten"
41
41
  },
42
+ "minuteWithoutCount?count=%s": {
43
+ "one": "Minute",
44
+ "other": "Minuten"
45
+ },
42
46
  "day": "Tag",
43
47
  "day?count=%s": {
44
48
  "one": "1 Tag",
45
49
  "other": "%s Tage"
46
50
  },
51
+ "dayWithoutCount?count=%s": {
52
+ "one": "Tag",
53
+ "other": "Tage"
54
+ },
47
55
  "item": "Teil",
48
56
  "item?count=%s": {
49
57
  "one": "1 Teil",
50
58
  "other": "%s Teile"
51
59
  },
60
+ "itemWithoutCount?count=%s": {
61
+ "one": "Teil",
62
+ "other": "Teile"
63
+ },
52
64
  "count": "Anzahl",
53
65
  "count?count=%s": {
54
66
  "one": "1 mal",
55
67
  "other": "%s mal"
56
- }
68
+ },
69
+ "countWithoutCount?count=%s": {
70
+ "one": "mal",
71
+ "other": "mal"
72
+ }
57
73
  }
58
74
  },
59
75
  "payedState": {
@@ -39,21 +39,37 @@
39
39
  "one": "1 minute",
40
40
  "other": "%s minutes"
41
41
  },
42
+ "minuteWithoutCount?count=%s": {
43
+ "one": "Minute",
44
+ "other": "Minutes"
45
+ },
42
46
  "day": "Day",
43
47
  "day?count=%s": {
44
48
  "one": "1 day",
45
49
  "other": "%s days"
46
50
  },
51
+ "dayWithoutCount?count=%s": {
52
+ "one": "Day",
53
+ "other": "Days"
54
+ },
47
55
  "item": "Item",
48
56
  "item?count=%s": {
49
57
  "one": "1 item",
50
58
  "other": "%s items"
51
59
  },
60
+ "itemWithoutCount?count=%s": {
61
+ "one": "Item",
62
+ "other": "Items"
63
+ },
52
64
  "count": "Count",
53
65
  "count?count=%s": {
54
66
  "one": "1 time",
55
67
  "other": "%s times"
56
- }
68
+ },
69
+ "countWithoutCount?count=%s": {
70
+ "one": "time",
71
+ "other": "times"
72
+ }
57
73
  }
58
74
  },
59
75
  "payedState": {
@@ -12,6 +12,10 @@ export class FineTemplateRepetition implements Flattable<FineTemplateRepetition.
12
12
  return Localization.shared.getN(key => key.fineTemplateRepetition.item[this.item], count);
13
13
  }
14
14
 
15
+ public formattedWithoutCount(count: number): string {
16
+ return Localization.shared.getN(key => key.fineTemplateRepetition.item[`${this.item}WithoutCount`], count);
17
+ }
18
+
15
19
  public get flatten(): FineTemplateRepetition.Flatten {
16
20
  return {
17
21
  item: this.item,
@@ -59,9 +59,13 @@ export const localizationNKey = {
59
59
  fineTemplateRepetition: {
60
60
  item: {
61
61
  minute: 'fineTemplateRepetition.item.minute?count=%s',
62
+ minuteWithoutCount: 'fineTemplateRepetition.item.minuteWithoutCount?count=%s',
62
63
  day: 'fineTemplateRepetition.item.day?count=%s',
64
+ dayWithoutCount: 'fineTemplateRepetition.item.dayWithoutCount?count=%s',
63
65
  item: 'fineTemplateRepetition.item.item?count=%s',
64
- count: 'fineTemplateRepetition.item.count?count=%s'
66
+ itemWithoutCount: 'fineTemplateRepetition.item.itemWithoutCount?count=%s',
67
+ count: 'fineTemplateRepetition.item.count?count=%s',
68
+ countWithoutCount: 'fineTemplateRepetition.item.countWithoutCount?count=%s'
65
69
  }
66
70
  }
67
71
  }
@@ -20,6 +20,12 @@ export class Person implements Flattable<Person.Flatten> {
20
20
  signInProperties: this.signInProperties?.flatten ?? null
21
21
  };
22
22
  }
23
+
24
+ public get name(): string {
25
+ if (this.properties.lastName === null)
26
+ return this.properties.firstName;
27
+ return `${this.properties.firstName} ${this.properties.lastName}`;
28
+ }
23
29
  }
24
30
 
25
31
  export namespace Person {