@glissandoo/lib 1.102.6 → 1.102.8
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.
|
@@ -2,11 +2,14 @@ import { BadgesTypes } from '../../../helpers/badges';
|
|
|
2
2
|
import { LanguagesTypes } from '../../../lang';
|
|
3
3
|
import { EventType } from '../../Evento/types';
|
|
4
4
|
import { DocumentModel } from '../../Model';
|
|
5
|
-
import
|
|
5
|
+
import { PlayerBasicData } from '../../Player/types';
|
|
6
|
+
import UserExtended from '../../User/extended';
|
|
6
7
|
import { GroupPlayerData, GroupPlayerRole } from './types';
|
|
7
|
-
export default class GroupPlayer extends
|
|
8
|
+
export default class GroupPlayer extends UserExtended<GroupPlayerData> {
|
|
8
9
|
constructor(doc: DocumentModel, lang?: LanguagesTypes);
|
|
10
|
+
get basicInfo(): PlayerBasicData;
|
|
9
11
|
get groupId(): string;
|
|
12
|
+
get mainInstrument(): import("../../../helpers/instruments").InstrumentId;
|
|
10
13
|
get instruments(): import("../../../helpers/instruments").InstrumentId[];
|
|
11
14
|
get instrumentsLastUpdatedBy(): string | null;
|
|
12
15
|
get role(): GroupPlayerRole;
|
|
@@ -5,17 +5,27 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const lodash_1 = require("lodash");
|
|
7
7
|
const badges_1 = require("../../../helpers/badges");
|
|
8
|
+
const instruments_1 = require("../../../helpers/instruments");
|
|
8
9
|
const utils_1 = require("../../../helpers/utils");
|
|
9
10
|
const lang_1 = require("../../../lang");
|
|
10
|
-
const
|
|
11
|
+
const extended_1 = __importDefault(require("../../User/extended"));
|
|
11
12
|
const types_1 = require("./types");
|
|
12
|
-
class GroupPlayer extends
|
|
13
|
+
class GroupPlayer extends extended_1.default {
|
|
13
14
|
constructor(doc, lang = lang_1.defaultLocale) {
|
|
14
15
|
super(doc, lang);
|
|
15
16
|
}
|
|
17
|
+
get basicInfo() {
|
|
18
|
+
return {
|
|
19
|
+
...super.basicInfo,
|
|
20
|
+
mainInstrument: this.mainInstrument,
|
|
21
|
+
};
|
|
22
|
+
}
|
|
16
23
|
get groupId() {
|
|
17
24
|
return (0, utils_1.at)(this.ref.path.split('/'), 1) || '';
|
|
18
25
|
}
|
|
26
|
+
get mainInstrument() {
|
|
27
|
+
return this.data.mainInstrument || instruments_1.DefaultInstrumentId.Maracas;
|
|
28
|
+
}
|
|
19
29
|
get instruments() {
|
|
20
30
|
return this.data.instruments || [];
|
|
21
31
|
}
|
|
@@ -23,7 +33,7 @@ class GroupPlayer extends basic_1.default {
|
|
|
23
33
|
return this.data.instrumentsLastUpdatedBy || null;
|
|
24
34
|
}
|
|
25
35
|
get role() {
|
|
26
|
-
return this.data.role;
|
|
36
|
+
return this.data.role || types_1.GroupPlayerRole.Member;
|
|
27
37
|
}
|
|
28
38
|
get isAdmin() {
|
|
29
39
|
return this.role === types_1.GroupPlayerRole.Admin;
|