@glissandoo/lib 1.32.12 → 1.32.13
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/models/Group/index.d.ts +5 -5
- package/models/Group/index.js +5 -3
- package/package.json +1 -1
package/models/Group/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { PlansGroup } from '../../helpers/plans';
|
|
2
2
|
import { LanguagesTypes } from '../../lang';
|
|
3
|
-
import { DocumentReference, DocumentSnapshot
|
|
3
|
+
import { DocumentReference, DocumentSnapshot } from '../../types/firestore';
|
|
4
4
|
import GroupBasic from './basic';
|
|
5
5
|
import { GroupData, GroupStatus, SocialNetwork } from './types';
|
|
6
6
|
export default class Group extends GroupBasic<GroupData> {
|
|
@@ -17,8 +17,8 @@ export default class Group extends GroupBasic<GroupData> {
|
|
|
17
17
|
get invitationEmails(): string[];
|
|
18
18
|
get shortDynamicLink(): string;
|
|
19
19
|
get admins(): string[];
|
|
20
|
-
get createdAt(): Timestamp;
|
|
21
|
-
get deletedAt(): Timestamp | null;
|
|
20
|
+
get createdAt(): import("../../types/firestore").Timestamp;
|
|
21
|
+
get deletedAt(): import("../../types/firestore").Timestamp | null;
|
|
22
22
|
get repertoryCount(): number;
|
|
23
23
|
get eventCount(): Record<import("../Evento/types").EventType, number>;
|
|
24
24
|
get performanceCount(): number;
|
|
@@ -60,11 +60,11 @@ export default class Group extends GroupBasic<GroupData> {
|
|
|
60
60
|
get stageTemplatesList(): (import("../../helpers/types").StageTemplate & {
|
|
61
61
|
id: string;
|
|
62
62
|
})[];
|
|
63
|
-
get firstAnswerAt(): Timestamp | null;
|
|
63
|
+
get firstAnswerAt(): import("../../types/firestore").Timestamp | null;
|
|
64
64
|
get repertoireTags(): Record<string, import("./types").GroupRepertoireTag>;
|
|
65
65
|
get repertoireTagsList(): (import("./types").GroupRepertoireTag & {
|
|
66
66
|
id: string;
|
|
67
67
|
})[];
|
|
68
68
|
getRepertoireTagName(id: string): string | null;
|
|
69
|
-
get trialEndAt():
|
|
69
|
+
get trialEndAt(): Date;
|
|
70
70
|
}
|
package/models/Group/index.js
CHANGED
|
@@ -9,7 +9,6 @@ const orders_1 = require("../../helpers/musicStyles/orders");
|
|
|
9
9
|
const objects_1 = require("../../helpers/objects");
|
|
10
10
|
const plans_1 = require("../../helpers/plans");
|
|
11
11
|
const lang_1 = require("../../lang");
|
|
12
|
-
const firestore_1 = require("../../types/firestore");
|
|
13
12
|
const basic_1 = __importDefault(require("./basic"));
|
|
14
13
|
const types_1 = require("./types");
|
|
15
14
|
class Group extends basic_1.default {
|
|
@@ -149,7 +148,7 @@ class Group extends basic_1.default {
|
|
|
149
148
|
return this.data.metadata || {};
|
|
150
149
|
}
|
|
151
150
|
get isExpiredTrial() {
|
|
152
|
-
const isOutDateTrial = (0, date_fns_1.isPast)(this.trialEndAt
|
|
151
|
+
const isOutDateTrial = (0, date_fns_1.isPast)(this.trialEndAt);
|
|
153
152
|
const members = this.activePlayers.length;
|
|
154
153
|
const isAboveMembersLimitPlanFree = members > plans_1.membersPerPlan[plans_1.PlansGroup.Piano];
|
|
155
154
|
return this.status !== types_1.GroupStatus.Premium && isOutDateTrial && isAboveMembersLimitPlanFree;
|
|
@@ -176,7 +175,10 @@ class Group extends basic_1.default {
|
|
|
176
175
|
return tag.default ? (0, lang_1.getTranslation)(tag.title, this.lang) : tag.title;
|
|
177
176
|
}
|
|
178
177
|
get trialEndAt() {
|
|
179
|
-
|
|
178
|
+
if (this.data.trialEndAt) {
|
|
179
|
+
return this.data.trialEndAt.toDate();
|
|
180
|
+
}
|
|
181
|
+
return (0, date_fns_1.addMonths)(this.createdAt.toDate(), 1);
|
|
180
182
|
}
|
|
181
183
|
}
|
|
182
184
|
exports.default = Group;
|