@glissandoo/lib 1.61.0 → 1.61.2
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/functions/auth.js +2 -1
- package/functions/communication.js +2 -1
- package/functions/communicationComment.js +2 -1
- package/functions/customer.js +2 -1
- package/functions/customerGroup.js +2 -1
- package/functions/event.js +5 -2
- package/functions/eventPlayer.js +5 -2
- package/functions/eventRepertory.js +2 -1
- package/functions/federation.js +2 -1
- package/functions/federationPartnership.js +2 -1
- package/functions/group.js +2 -1
- package/functions/groupPlayer.js +2 -1
- package/functions/groupRepertory.js +2 -1
- package/functions/index.js +5 -2
- package/functions/jwt.js +2 -1
- package/functions/misc.js +2 -1
- package/functions/notification.js +2 -1
- package/functions/partner.js +2 -1
- package/functions/partnership.js +2 -1
- package/functions/partnershipGroup.js +2 -1
- package/functions/partnershipPlan.js +2 -1
- package/functions/regions.js +128 -124
- package/functions/subscription.js +2 -1
- package/functions/user.js +2 -1
- package/helpers/appScenes.js +5 -2
- package/helpers/audios.js +9 -5
- package/helpers/auth.js +9 -5
- package/helpers/badges.js +19 -10
- package/helpers/collections.js +5 -2
- package/helpers/countries.js +4 -1
- package/helpers/dlinks.js +5 -2
- package/helpers/errors.js +5 -2
- package/helpers/fileSections/index.js +8 -5
- package/helpers/fileSections/orders.js +16 -11
- package/helpers/glissandooAdmin.js +6 -2
- package/helpers/instruments/index.js +6 -3
- package/helpers/instruments/lists.js +19 -11
- package/helpers/musicStyles/index.js +36 -29
- package/helpers/musicStyles/orders.js +179 -174
- package/helpers/notifications/index.js +122 -119
- package/helpers/notifications/placeholders.js +26 -18
- package/helpers/objects.js +23 -15
- package/helpers/payments.js +8 -5
- package/helpers/plans.js +9 -6
- package/helpers/rates.js +6 -2
- package/helpers/reasons.js +21 -17
- package/helpers/slate.js +12 -5
- package/helpers/styles.js +4 -1
- package/helpers/ts-extras/array-includes.js +5 -1
- package/helpers/ts-extras/as-mutable.js +5 -1
- package/helpers/ts-extras/assert-error.js +5 -1
- package/helpers/ts-extras/index.js +33 -15
- package/helpers/ts-extras/is-defined.js +5 -1
- package/helpers/ts-extras/is-empty.js +5 -1
- package/helpers/ts-extras/is-finite.js +4 -1
- package/helpers/ts-extras/is-infinite.js +5 -1
- package/helpers/ts-extras/is-integer.js +4 -1
- package/helpers/ts-extras/is-present.js +5 -1
- package/helpers/ts-extras/is-safe-integer.js +4 -1
- package/helpers/ts-extras/object-entries.js +4 -1
- package/helpers/ts-extras/object-from-entries.js +4 -1
- package/helpers/ts-extras/object-has-own.js +5 -1
- package/helpers/ts-extras/object-keys.js +4 -1
- package/helpers/ts-extras/set-has.js +5 -1
- package/helpers/types.js +5 -2
- package/helpers/utils.d.ts +1 -0
- package/helpers/utils.js +23 -8
- package/lang/index.js +51 -42
- package/models/Communication/Comment/index.js +12 -5
- package/models/Communication/Comment/types.js +2 -1
- package/models/Communication/index.js +21 -15
- package/models/Communication/types.js +7 -4
- package/models/Counters/Group/Analytics/index.js +12 -5
- package/models/Counters/Group/Analytics/types.js +5 -2
- package/models/Counters/Group/index.js +8 -2
- package/models/Counters/Group/types.js +2 -1
- package/models/Counters/event.js +8 -2
- package/models/Counters/index.js +8 -2
- package/models/Counters/types.js +2 -1
- package/models/Customer/Group/index.js +14 -7
- package/models/Customer/Group/types.js +2 -1
- package/models/Customer/basic.js +10 -4
- package/models/Customer/index.js +11 -5
- package/models/Customer/types.js +5 -2
- package/models/Evento/Player/basic.js +11 -10
- package/models/Evento/Player/index.js +19 -12
- package/models/Evento/Player/types.js +7 -4
- package/models/Evento/Repertory/index.js +10 -3
- package/models/Evento/Repertory/types.js +2 -1
- package/models/Evento/basic.js +18 -12
- package/models/Evento/index.js +38 -32
- package/models/Evento/promoter.js +8 -2
- package/models/Evento/tiny.js +9 -9
- package/models/Evento/types.js +17 -14
- package/models/Federation/Partnership/index.js +10 -3
- package/models/Federation/Partnership/types.js +2 -1
- package/models/Federation/index.js +13 -7
- package/models/Federation/types.js +2 -1
- package/models/Group/Analytics/index.js +12 -5
- package/models/Group/Analytics/types.js +5 -2
- package/models/Group/Event/index.js +12 -6
- package/models/Group/Event/types.js +2 -1
- package/models/Group/Player/Event/index.js +18 -11
- package/models/Group/Player/Event/types.js +2 -1
- package/models/Group/Player/Log/index.js +8 -2
- package/models/Group/Player/Log/types.js +2 -1
- package/models/Group/Player/index.js +25 -18
- package/models/Group/Player/types.js +5 -2
- package/models/Group/Repertory/File/Section/index.js +16 -12
- package/models/Group/Repertory/File/Section/types.js +5 -2
- package/models/Group/Repertory/File/index.js +12 -11
- package/models/Group/Repertory/File/types.js +2 -1
- package/models/Group/Repertory/FilePath/index.js +15 -12
- package/models/Group/Repertory/index.js +32 -25
- package/models/Group/Repertory/types.js +5 -2
- package/models/Group/StageTemplate/index.js +8 -2
- package/models/Group/StageTemplate/types.js +2 -1
- package/models/Group/basic.js +11 -5
- package/models/Group/index.js +47 -41
- package/models/Group/types.js +17 -14
- package/models/Instrument/group.js +11 -6
- package/models/Instrument/index.js +9 -8
- package/models/Metrics/index.js +16 -10
- package/models/Metrics/types.js +2 -1
- package/models/Model/index.js +6 -7
- package/models/Model/lang.js +10 -5
- package/models/MusicStyle/index.js +10 -9
- package/models/Notification/index.js +8 -2
- package/models/Notification/types.js +5 -2
- package/models/Partner/basic.js +12 -6
- package/models/Partner/index.js +10 -4
- package/models/Partner/tiny.js +8 -2
- package/models/Partner/types.js +5 -2
- package/models/Partnership/Group/index.js +12 -5
- package/models/Partnership/Group/types.js +2 -1
- package/models/Partnership/Partner/Subscription/index.js +15 -8
- package/models/Partnership/Partner/Subscription/types.js +5 -2
- package/models/Partnership/Partner/index.js +10 -3
- package/models/Partnership/Partner/types.js +2 -1
- package/models/Partnership/Payment/index.js +8 -2
- package/models/Partnership/Payment/types.js +2 -1
- package/models/Partnership/Plan/basic.js +18 -12
- package/models/Partnership/Plan/index.js +10 -3
- package/models/Partnership/Plan/types.js +5 -2
- package/models/Partnership/basic.js +10 -4
- package/models/Partnership/index.js +11 -5
- package/models/Partnership/types.js +7 -4
- package/models/Payment/basic.js +13 -7
- package/models/Payment/index.js +8 -2
- package/models/Payment/types.js +7 -4
- package/models/Player/basic.js +10 -4
- package/models/Player/types.js +2 -1
- package/models/Repertory/basic.js +8 -2
- package/models/Repertory/types.js +2 -1
- package/models/User/Group/index.js +15 -8
- package/models/User/Group/types.js +2 -1
- package/models/User/Notification/index.js +22 -16
- package/models/User/Notification/types.js +2 -1
- package/models/User/basic.js +10 -4
- package/models/User/index.js +24 -18
- package/models/User/types.js +15 -12
- package/models/WebhookEvent/index.js +8 -2
- package/models/WebhookEvent/types.js +5 -2
- package/package.json +1 -1
- package/types/firestore.js +5 -2
- package/types/messagebirdChatWidget.js +2 -1
package/models/Partner/basic.js
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const tiny_1 = __importDefault(require("./tiny"));
|
|
7
|
+
const types_1 = require("./types");
|
|
8
|
+
class PartnerBasic extends tiny_1.default {
|
|
4
9
|
constructor(doc) {
|
|
5
10
|
super(doc);
|
|
6
11
|
}
|
|
@@ -14,12 +19,12 @@ export default class PartnerBasic extends PartnerTiny {
|
|
|
14
19
|
}
|
|
15
20
|
get status() {
|
|
16
21
|
if (this.isDeleted) {
|
|
17
|
-
return PartnerStatus.Deleted;
|
|
22
|
+
return types_1.PartnerStatus.Deleted;
|
|
18
23
|
}
|
|
19
24
|
if (this.isVerified) {
|
|
20
|
-
return PartnerStatus.Verified;
|
|
25
|
+
return types_1.PartnerStatus.Verified;
|
|
21
26
|
}
|
|
22
|
-
return PartnerStatus.PendingVerification;
|
|
27
|
+
return types_1.PartnerStatus.PendingVerification;
|
|
23
28
|
}
|
|
24
29
|
get createdAt() {
|
|
25
30
|
return this.data.createdAt;
|
|
@@ -40,3 +45,4 @@ export default class PartnerBasic extends PartnerTiny {
|
|
|
40
45
|
return this.exists && !this.isDeleted;
|
|
41
46
|
}
|
|
42
47
|
}
|
|
48
|
+
exports.default = PartnerBasic;
|
package/models/Partner/index.js
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const isString_1 = __importDefault(require("lodash/isString"));
|
|
7
|
+
const basic_1 = __importDefault(require("./basic"));
|
|
8
|
+
class Partner extends basic_1.default {
|
|
4
9
|
constructor(doc) {
|
|
5
10
|
super(doc);
|
|
6
11
|
}
|
|
@@ -37,6 +42,7 @@ export default class Partner extends PartnerBasic {
|
|
|
37
42
|
return null;
|
|
38
43
|
const { street, city, postalCode, province, country } = this.address;
|
|
39
44
|
const fields = [street, postalCode, city, province, country];
|
|
40
|
-
return fields.filter((field) =>
|
|
45
|
+
return fields.filter((field) => (0, isString_1.default)(field)).join(', ');
|
|
41
46
|
}
|
|
42
47
|
}
|
|
48
|
+
exports.default = Partner;
|
package/models/Partner/tiny.js
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const Model_1 = __importDefault(require("../Model"));
|
|
7
|
+
class PartnerTiny extends Model_1.default {
|
|
3
8
|
constructor(doc) {
|
|
4
9
|
super(doc);
|
|
5
10
|
}
|
|
@@ -16,3 +21,4 @@ export default class PartnerTiny extends Model {
|
|
|
16
21
|
return this.data.displayName;
|
|
17
22
|
}
|
|
18
23
|
}
|
|
24
|
+
exports.default = PartnerTiny;
|
package/models/Partner/types.js
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PartnerStatus = void 0;
|
|
4
|
+
var PartnerStatus;
|
|
2
5
|
(function (PartnerStatus) {
|
|
3
6
|
PartnerStatus["Verified"] = "verified";
|
|
4
7
|
PartnerStatus["PendingVerification"] = "pendingVerification";
|
|
5
8
|
PartnerStatus["Deleted"] = "deleted";
|
|
6
|
-
})(PartnerStatus || (PartnerStatus = {}));
|
|
9
|
+
})(PartnerStatus = exports.PartnerStatus || (exports.PartnerStatus = {}));
|
|
@@ -1,7 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const utils_1 = require("../../../helpers/utils");
|
|
7
|
+
const lang_1 = require("../../../lang");
|
|
8
|
+
const basic_1 = __importDefault(require("../../Group/basic"));
|
|
9
|
+
class PartnershipGroup extends basic_1.default {
|
|
10
|
+
constructor(doc, lang = lang_1.defaultLocale) {
|
|
5
11
|
super(doc, lang);
|
|
6
12
|
}
|
|
7
13
|
get linkedAt() {
|
|
@@ -11,6 +17,7 @@ export default class PartnershipGroup extends GroupBasic {
|
|
|
11
17
|
return this.data.linkedBy;
|
|
12
18
|
}
|
|
13
19
|
get partnershipId() {
|
|
14
|
-
return this.ref.path.split('/')
|
|
20
|
+
return (0, utils_1.at)(this.ref.path.split('/'), 1) || '';
|
|
15
21
|
}
|
|
16
22
|
}
|
|
23
|
+
exports.default = PartnershipGroup;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -1,7 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const payments_1 = require("../../../../helpers/payments");
|
|
7
|
+
const utils_1 = require("../../../../helpers/utils");
|
|
8
|
+
const basic_1 = __importDefault(require("../../Plan/basic"));
|
|
9
|
+
const types_1 = require("./types");
|
|
10
|
+
class PartnerSubscription extends basic_1.default {
|
|
5
11
|
constructor(doc) {
|
|
6
12
|
super(doc);
|
|
7
13
|
}
|
|
@@ -9,10 +15,10 @@ export default class PartnerSubscription extends PartnershipPlanBasic {
|
|
|
9
15
|
return this.data.planRef;
|
|
10
16
|
}
|
|
11
17
|
get partnerId() {
|
|
12
|
-
return this.ref.path.split('/')
|
|
18
|
+
return (0, utils_1.at)(this.ref.path.split('/'), 3) || '';
|
|
13
19
|
}
|
|
14
20
|
get partnershipId() {
|
|
15
|
-
return this.ref.path.split('/')
|
|
21
|
+
return (0, utils_1.at)(this.ref.path.split('/'), 1) || '';
|
|
16
22
|
}
|
|
17
23
|
get status() {
|
|
18
24
|
return this.data.status;
|
|
@@ -26,7 +32,7 @@ export default class PartnerSubscription extends PartnershipPlanBasic {
|
|
|
26
32
|
get isLastPaymentAnError() {
|
|
27
33
|
if (!this.lastPayment)
|
|
28
34
|
return false;
|
|
29
|
-
return paymentStatusErrors.includes(this.lastPayment.status);
|
|
35
|
+
return payments_1.paymentStatusErrors.includes(this.lastPayment.status);
|
|
30
36
|
}
|
|
31
37
|
get paymentDate() {
|
|
32
38
|
return this.data.paymentDate;
|
|
@@ -38,7 +44,7 @@ export default class PartnerSubscription extends PartnershipPlanBasic {
|
|
|
38
44
|
return this.data.createdBy;
|
|
39
45
|
}
|
|
40
46
|
get isStatusActive() {
|
|
41
|
-
return this.status === SubscriptionStatus.Active;
|
|
47
|
+
return this.status === types_1.SubscriptionStatus.Active;
|
|
42
48
|
}
|
|
43
49
|
get isActive() {
|
|
44
50
|
return this.exists;
|
|
@@ -47,3 +53,4 @@ export default class PartnerSubscription extends PartnershipPlanBasic {
|
|
|
47
53
|
return this.isActive && this.isStatusActive;
|
|
48
54
|
}
|
|
49
55
|
}
|
|
56
|
+
exports.default = PartnerSubscription;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SubscriptionStatus = void 0;
|
|
4
|
+
var SubscriptionStatus;
|
|
2
5
|
(function (SubscriptionStatus) {
|
|
3
6
|
SubscriptionStatus["Active"] = "active";
|
|
4
7
|
SubscriptionStatus["Pause"] = "pause";
|
|
5
8
|
SubscriptionStatus["Cancel"] = "cancel";
|
|
6
|
-
})(SubscriptionStatus || (SubscriptionStatus = {}));
|
|
9
|
+
})(SubscriptionStatus = exports.SubscriptionStatus || (exports.SubscriptionStatus = {}));
|
|
@@ -1,10 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const utils_1 = require("../../../helpers/utils");
|
|
7
|
+
const basic_1 = __importDefault(require("../../Partner/basic"));
|
|
8
|
+
class PartnershipPartner extends basic_1.default {
|
|
3
9
|
constructor(doc) {
|
|
4
10
|
super(doc);
|
|
5
11
|
}
|
|
6
12
|
get partnershipId() {
|
|
7
|
-
return this.ref.path.split('/')
|
|
13
|
+
return (0, utils_1.at)(this.ref.path.split('/'), 1) || '';
|
|
8
14
|
}
|
|
9
15
|
get subscriptionIds() {
|
|
10
16
|
return this.data.subscriptionIds || [];
|
|
@@ -13,3 +19,4 @@ export default class PartnershipPartner extends PartnerBasic {
|
|
|
13
19
|
return this.data.subscriptionActivesIds || [];
|
|
14
20
|
}
|
|
15
21
|
}
|
|
22
|
+
exports.default = PartnershipPartner;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -1,5 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const basic_1 = __importDefault(require("../../Payment/basic"));
|
|
7
|
+
class PartnershipPayments extends basic_1.default {
|
|
3
8
|
constructor(doc) {
|
|
4
9
|
super(doc);
|
|
5
10
|
}
|
|
@@ -10,3 +15,4 @@ export default class PartnershipPayments extends PaymentBasic {
|
|
|
10
15
|
return this.data.partnerInfo;
|
|
11
16
|
}
|
|
12
17
|
}
|
|
18
|
+
exports.default = PartnershipPayments;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -1,8 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const date_fns_1 = require("date-fns");
|
|
7
|
+
const lodash_1 = require("lodash");
|
|
8
|
+
const Model_1 = __importDefault(require("../../Model"));
|
|
9
|
+
const types_1 = require("./types");
|
|
10
|
+
class PartnershipPlanBasic extends Model_1.default {
|
|
6
11
|
constructor(doc) {
|
|
7
12
|
super(doc);
|
|
8
13
|
}
|
|
@@ -16,24 +21,24 @@ export default class PartnershipPlanBasic extends Model {
|
|
|
16
21
|
}
|
|
17
22
|
setPaymentDay(date) {
|
|
18
23
|
return this.isPaymentDayEndOfMonth
|
|
19
|
-
? endOfMonth(date)
|
|
20
|
-
: setDate(date, this.schedule.paymentDay);
|
|
24
|
+
? (0, date_fns_1.endOfMonth)(date)
|
|
25
|
+
: (0, date_fns_1.setDate)(date, this.schedule.paymentDay);
|
|
21
26
|
}
|
|
22
27
|
setPaymentMonth(date) {
|
|
23
|
-
return isNumber(this.schedule.paymentMonth) && this.isAnnuallySchedule
|
|
24
|
-
? setMonth(date, this.schedule.paymentMonth)
|
|
28
|
+
return (0, lodash_1.isNumber)(this.schedule.paymentMonth) && this.isAnnuallySchedule
|
|
29
|
+
? (0, date_fns_1.setMonth)(date, this.schedule.paymentMonth)
|
|
25
30
|
: date;
|
|
26
31
|
}
|
|
27
32
|
setPaymentDate(date) {
|
|
28
33
|
return this.setPaymentMonth(this.setPaymentDay(date));
|
|
29
34
|
}
|
|
30
35
|
getNextPaymentDate(base) {
|
|
31
|
-
const newDate = addMonths(base, this.schedule.period);
|
|
36
|
+
const newDate = (0, date_fns_1.addMonths)(base, this.schedule.period);
|
|
32
37
|
return this.setPaymentDate(newDate);
|
|
33
38
|
}
|
|
34
39
|
getFirstPaymentDate() {
|
|
35
40
|
const newDate = this.setPaymentDate(new Date());
|
|
36
|
-
return isPast(newDate) ? addMonths(newDate, this.isAnnuallySchedule ? 12 : 1) : newDate;
|
|
41
|
+
return (0, date_fns_1.isPast)(newDate) ? (0, date_fns_1.addMonths)(newDate, this.isAnnuallySchedule ? 12 : 1) : newDate;
|
|
37
42
|
}
|
|
38
43
|
get name() {
|
|
39
44
|
return this.data.name;
|
|
@@ -51,9 +56,10 @@ export default class PartnershipPlanBasic extends Model {
|
|
|
51
56
|
return this.data.schedule;
|
|
52
57
|
}
|
|
53
58
|
get isAnnuallySchedule() {
|
|
54
|
-
return this.schedule.period === PlanSchedulePeriod.Annually;
|
|
59
|
+
return this.schedule.period === types_1.PlanSchedulePeriod.Annually;
|
|
55
60
|
}
|
|
56
61
|
get isPaymentDayEndOfMonth() {
|
|
57
62
|
return this.schedule.paymentDay === -1;
|
|
58
63
|
}
|
|
59
64
|
}
|
|
65
|
+
exports.default = PartnershipPlanBasic;
|
|
@@ -1,10 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const utils_1 = require("../../../helpers/utils");
|
|
7
|
+
const basic_1 = __importDefault(require("./basic"));
|
|
8
|
+
class PartnershipPlan extends basic_1.default {
|
|
3
9
|
constructor(doc) {
|
|
4
10
|
super(doc);
|
|
5
11
|
}
|
|
6
12
|
get partnershipId() {
|
|
7
|
-
return this.ref.path.split('/')
|
|
13
|
+
return (0, utils_1.at)(this.ref.path.split('/'), 1) || '';
|
|
8
14
|
}
|
|
9
15
|
get deletedAt() {
|
|
10
16
|
return this.data.deletedAt || null;
|
|
@@ -22,3 +28,4 @@ export default class PartnershipPlan extends PartnershipPlanBasic {
|
|
|
22
28
|
return this.data.createdAt;
|
|
23
29
|
}
|
|
24
30
|
}
|
|
31
|
+
exports.default = PartnershipPlan;
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PlanSchedulePeriod = void 0;
|
|
4
|
+
var PlanSchedulePeriod;
|
|
2
5
|
(function (PlanSchedulePeriod) {
|
|
3
6
|
PlanSchedulePeriod[PlanSchedulePeriod["Monthly"] = 1] = "Monthly";
|
|
4
7
|
PlanSchedulePeriod[PlanSchedulePeriod["Quarterly"] = 3] = "Quarterly";
|
|
5
8
|
PlanSchedulePeriod[PlanSchedulePeriod["SemiAnnually"] = 6] = "SemiAnnually";
|
|
6
9
|
PlanSchedulePeriod[PlanSchedulePeriod["Annually"] = 12] = "Annually";
|
|
7
|
-
})(PlanSchedulePeriod || (PlanSchedulePeriod = {}));
|
|
10
|
+
})(PlanSchedulePeriod = exports.PlanSchedulePeriod || (exports.PlanSchedulePeriod = {}));
|
|
@@ -1,6 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const lodash_1 = require("lodash");
|
|
7
|
+
const Model_1 = __importDefault(require("../Model"));
|
|
8
|
+
class PartnershipBasic extends Model_1.default {
|
|
4
9
|
constructor(doc) {
|
|
5
10
|
super(doc);
|
|
6
11
|
}
|
|
@@ -32,7 +37,7 @@ export default class PartnershipBasic extends Model {
|
|
|
32
37
|
get displayAddress() {
|
|
33
38
|
const { street, city, postalCode, province, country } = this.address;
|
|
34
39
|
const fields = [street, postalCode, city, province, country];
|
|
35
|
-
return fields.filter((field) => isString(field)).join(', ');
|
|
40
|
+
return fields.filter((field) => (0, lodash_1.isString)(field)).join(', ');
|
|
36
41
|
}
|
|
37
42
|
get phone() {
|
|
38
43
|
return this.data.phone;
|
|
@@ -50,3 +55,4 @@ export default class PartnershipBasic extends Model {
|
|
|
50
55
|
return this.data.memberCount || 0;
|
|
51
56
|
}
|
|
52
57
|
}
|
|
58
|
+
exports.default = PartnershipBasic;
|
|
@@ -1,7 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const collections_1 = require("../../helpers/collections");
|
|
7
|
+
const glissandooAdmin_1 = require("../../helpers/glissandooAdmin");
|
|
8
|
+
const basic_1 = __importDefault(require("./basic"));
|
|
9
|
+
class Partnership extends basic_1.default {
|
|
5
10
|
constructor(doc) {
|
|
6
11
|
super(doc);
|
|
7
12
|
}
|
|
@@ -42,6 +47,7 @@ export default class Partnership extends PartnershipBasic {
|
|
|
42
47
|
return this.data.groupIds || [];
|
|
43
48
|
}
|
|
44
49
|
get glissandooAdminUrl() {
|
|
45
|
-
return getGlissandooAdminEntityURL(CollectionNames.Partnership, this.id);
|
|
50
|
+
return (0, glissandooAdmin_1.getGlissandooAdminEntityURL)(collections_1.CollectionNames.Partnership, this.id);
|
|
46
51
|
}
|
|
47
52
|
}
|
|
53
|
+
exports.default = Partnership;
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PartnershipStatus = exports.PartnershipRoles = void 0;
|
|
4
|
+
var PartnershipRoles;
|
|
2
5
|
(function (PartnershipRoles) {
|
|
3
6
|
PartnershipRoles["Admin"] = "admin";
|
|
4
|
-
})(PartnershipRoles || (PartnershipRoles = {}));
|
|
5
|
-
|
|
7
|
+
})(PartnershipRoles = exports.PartnershipRoles || (exports.PartnershipRoles = {}));
|
|
8
|
+
var PartnershipStatus;
|
|
6
9
|
(function (PartnershipStatus) {
|
|
7
10
|
PartnershipStatus["Verified"] = "verified";
|
|
8
11
|
PartnershipStatus["PendingVerification"] = "pendingVerification";
|
|
9
12
|
PartnershipStatus["Deleted"] = "deleted";
|
|
10
|
-
})(PartnershipStatus || (PartnershipStatus = {}));
|
|
13
|
+
})(PartnershipStatus = exports.PartnershipStatus || (exports.PartnershipStatus = {}));
|
package/models/Payment/basic.js
CHANGED
|
@@ -1,7 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const fromUnixTime_1 = __importDefault(require("date-fns/fromUnixTime"));
|
|
7
|
+
const Model_1 = __importDefault(require("../Model"));
|
|
8
|
+
const types_1 = require("./types");
|
|
9
|
+
class PaymentBasic extends Model_1.default {
|
|
5
10
|
constructor(doc) {
|
|
6
11
|
super(doc);
|
|
7
12
|
}
|
|
@@ -30,18 +35,19 @@ export default class PaymentBasic extends Model {
|
|
|
30
35
|
return this.lastAction.status;
|
|
31
36
|
}
|
|
32
37
|
get lastActionAt() {
|
|
33
|
-
return
|
|
38
|
+
return (0, fromUnixTime_1.default)(this.lastAction.timestamp);
|
|
34
39
|
}
|
|
35
40
|
get type() {
|
|
36
41
|
return this.data.type;
|
|
37
42
|
}
|
|
38
43
|
get isRecurrent() {
|
|
39
|
-
return this.type === PaymentType.Recurring;
|
|
44
|
+
return this.type === types_1.PaymentType.Recurring;
|
|
40
45
|
}
|
|
41
46
|
get isOneTime() {
|
|
42
|
-
return this.type === PaymentType.OneTime;
|
|
47
|
+
return this.type === types_1.PaymentType.OneTime;
|
|
43
48
|
}
|
|
44
49
|
get createdAt() {
|
|
45
50
|
return this.data.createdAt;
|
|
46
51
|
}
|
|
47
52
|
}
|
|
53
|
+
exports.default = PaymentBasic;
|
package/models/Payment/index.js
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const basic_1 = __importDefault(require("./basic"));
|
|
7
|
+
class Payment extends basic_1.default {
|
|
3
8
|
constructor(doc) {
|
|
4
9
|
super(doc);
|
|
5
10
|
}
|
|
@@ -25,3 +30,4 @@ export default class Payment extends PaymentBasic {
|
|
|
25
30
|
return this.history.sort((a, b) => (a.timestamp < b.timestamp ? 1 : -1));
|
|
26
31
|
}
|
|
27
32
|
}
|
|
33
|
+
exports.default = Payment;
|
package/models/Payment/types.js
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PaymentStatus = exports.PaymentType = void 0;
|
|
4
|
+
var PaymentType;
|
|
2
5
|
(function (PaymentType) {
|
|
3
6
|
PaymentType["Recurring"] = "recurring";
|
|
4
7
|
PaymentType["OneTime"] = "one-time";
|
|
5
|
-
})(PaymentType || (PaymentType = {}));
|
|
6
|
-
|
|
8
|
+
})(PaymentType = exports.PaymentType || (exports.PaymentType = {}));
|
|
9
|
+
var PaymentStatus;
|
|
7
10
|
(function (PaymentStatus) {
|
|
8
11
|
PaymentStatus[PaymentStatus["Pending"] = 0] = "Pending";
|
|
9
12
|
PaymentStatus[PaymentStatus["Waiting"] = 1] = "Waiting";
|
|
@@ -11,4 +14,4 @@ export var PaymentStatus;
|
|
|
11
14
|
PaymentStatus[PaymentStatus["Error"] = 3] = "Error";
|
|
12
15
|
PaymentStatus[PaymentStatus["Chargeback"] = 4] = "Chargeback";
|
|
13
16
|
PaymentStatus[PaymentStatus["Canceled"] = 5] = "Canceled";
|
|
14
|
-
})(PaymentStatus || (PaymentStatus = {}));
|
|
17
|
+
})(PaymentStatus = exports.PaymentStatus || (exports.PaymentStatus = {}));
|
package/models/Player/basic.js
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const lang_1 = require("../../lang");
|
|
7
|
+
const basic_1 = __importDefault(require("../User/basic"));
|
|
8
|
+
class PlayerBasic extends basic_1.default {
|
|
4
9
|
constructor(doc, lang) {
|
|
5
10
|
super(doc, lang);
|
|
6
11
|
}
|
|
@@ -16,7 +21,8 @@ export default class PlayerBasic extends UserBasic {
|
|
|
16
21
|
return this.data.mainInstrument;
|
|
17
22
|
}
|
|
18
23
|
get instrument() {
|
|
19
|
-
const translation = getTranslation(`instruments.${this.mainInstrument}`, this.lang);
|
|
24
|
+
const translation = (0, lang_1.getTranslation)(`instruments.${this.mainInstrument}`, this.lang);
|
|
20
25
|
return translation || this.mainInstrument;
|
|
21
26
|
}
|
|
22
27
|
}
|
|
28
|
+
exports.default = PlayerBasic;
|
package/models/Player/types.js
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -1,5 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const Model_1 = __importDefault(require("../Model"));
|
|
7
|
+
class Theme extends Model_1.default {
|
|
3
8
|
constructor(doc) {
|
|
4
9
|
super(doc);
|
|
5
10
|
}
|
|
@@ -24,3 +29,4 @@ export default class Theme extends Model {
|
|
|
24
29
|
return this.data.media || null;
|
|
25
30
|
}
|
|
26
31
|
}
|
|
32
|
+
exports.default = Theme;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -1,18 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const utils_1 = require("../../../helpers/utils");
|
|
7
|
+
const lang_1 = require("../../../lang");
|
|
8
|
+
const basic_1 = __importDefault(require("../../Group/basic"));
|
|
9
|
+
const types_1 = require("../../Group/Player/types");
|
|
10
|
+
class UserGroup extends basic_1.default {
|
|
11
|
+
constructor(doc, lang = lang_1.defaultLocale) {
|
|
6
12
|
super(doc, lang);
|
|
7
13
|
}
|
|
8
14
|
get groupId() {
|
|
9
|
-
return this.ref.path.split('/')
|
|
15
|
+
return (0, utils_1.at)(this.ref.path.split('/'), 1) || '';
|
|
10
16
|
}
|
|
11
17
|
get mainInstrument() {
|
|
12
18
|
return this.data.mainInstrument;
|
|
13
19
|
}
|
|
14
20
|
get instrument() {
|
|
15
|
-
const translation = getTranslation(`instruments.${this.mainInstrument}`, this.lang);
|
|
21
|
+
const translation = (0, lang_1.getTranslation)(`instruments.${this.mainInstrument}`, this.lang);
|
|
16
22
|
return translation || this.mainInstrument;
|
|
17
23
|
}
|
|
18
24
|
get instruments() {
|
|
@@ -22,9 +28,10 @@ export default class UserGroup extends GroupBasic {
|
|
|
22
28
|
return this.data.role;
|
|
23
29
|
}
|
|
24
30
|
get isAdmin() {
|
|
25
|
-
return this.data.role === GroupPlayerRole.Admin;
|
|
31
|
+
return this.data.role === types_1.GroupPlayerRole.Admin;
|
|
26
32
|
}
|
|
27
33
|
get joinedAt() {
|
|
28
34
|
return this.data.joinedAt;
|
|
29
35
|
}
|
|
30
36
|
}
|
|
37
|
+
exports.default = UserGroup;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|