@glissandoo/lib 1.39.2 → 1.40.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.
- package/functions/group.d.ts +2 -1
- package/helpers/musicStyles/index.d.ts +2 -0
- package/helpers/musicStyles/index.js +15 -1
- package/models/Group/index.d.ts +1 -0
- package/models/Group/index.js +3 -0
- package/models/Group/types.d.ts +6 -0
- package/models/Group/types.js +7 -1
- package/package.json +1 -1
- package/models/Partner/Partnership/Group/index.d.ts +0 -18
- package/models/Partner/Partnership/Group/index.js +0 -48
- package/models/Partner/Partnership/Group/types.d.ts +0 -15
- package/models/Partner/Partnership/Group/types.js +0 -2
- package/models/Partner/Partnership/Partner/Subscription/index.d.ts +0 -19
- package/models/Partner/Partnership/Partner/Subscription/index.js +0 -56
- package/models/Partner/Partnership/Partner/Subscription/types.d.ts +0 -21
- package/models/Partner/Partnership/Partner/Subscription/types.js +0 -9
- package/models/Partner/Partnership/Partner/index.d.ts +0 -9
- package/models/Partner/Partnership/Partner/index.js +0 -22
- package/models/Partner/Partnership/Partner/types.d.ts +0 -5
- package/models/Partner/Partnership/Partner/types.js +0 -2
- package/models/Partner/Partnership/Payment/index.d.ts +0 -8
- package/models/Partner/Partnership/Payment/index.js +0 -18
- package/models/Partner/Partnership/Payment/types.d.ts +0 -6
- package/models/Partner/Partnership/Payment/types.js +0 -2
- package/models/Partner/Partnership/Plan/basic.d.ts +0 -19
- package/models/Partner/Partnership/Plan/basic.js +0 -65
- package/models/Partner/Partnership/Plan/index.d.ts +0 -12
- package/models/Partner/Partnership/Plan/index.js +0 -31
- package/models/Partner/Partnership/Plan/types.d.ts +0 -23
- package/models/Partner/Partnership/Plan/types.js +0 -10
- package/models/Partner/Partnership/basic.d.ts +0 -17
- package/models/Partner/Partnership/basic.js +0 -58
- package/models/Partner/Partnership/index.d.ts +0 -23
- package/models/Partner/Partnership/index.js +0 -62
- package/models/Partner/Partnership/types.d.ts +0 -47
- package/models/Partner/Partnership/types.js +0 -13
package/functions/group.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { GroupBasicData, GroupStatus } from '../models/Group/types';
|
|
1
|
+
import { GroupBasicData, GroupCreatedOn, GroupStatus } from '../models/Group/types';
|
|
2
2
|
export declare namespace GroupFbFunctionsTypes {
|
|
3
3
|
interface PublishParams {
|
|
4
4
|
displayName: string;
|
|
@@ -9,6 +9,7 @@ export declare namespace GroupFbFunctionsTypes {
|
|
|
9
9
|
musicStyle: string;
|
|
10
10
|
photoURL: string;
|
|
11
11
|
metadata?: Record<string, string>;
|
|
12
|
+
createdOn: GroupCreatedOn;
|
|
12
13
|
}
|
|
13
14
|
interface PublishResult {
|
|
14
15
|
id: string;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { LanguagesTypes } from '../../lang';
|
|
2
2
|
import MusicStyle from '../../models/MusicStyle';
|
|
3
|
+
import { InstrumentId } from '../instruments';
|
|
3
4
|
export declare enum MusicStyleId {
|
|
4
5
|
Orchestra = "orquesta-sinfonica",
|
|
5
6
|
Band = "banda-de-musica",
|
|
@@ -13,6 +14,7 @@ export declare enum MusicStyleId {
|
|
|
13
14
|
Choir = "coro",
|
|
14
15
|
Batucada = "batucada"
|
|
15
16
|
}
|
|
17
|
+
export declare const musicStylesIcon: Record<MusicStyleId, InstrumentId>;
|
|
16
18
|
export declare const MusicStylesCover: Record<MusicStyleId, string>;
|
|
17
19
|
export type MusicStyleType = MusicStyleId | string;
|
|
18
20
|
export declare const musicStyleByCountry: Record<LanguagesTypes, MusicStyleId[]>;
|
|
@@ -3,9 +3,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.list = exports.musicStyleByCountry = exports.MusicStylesCover = exports.MusicStyleId = void 0;
|
|
6
|
+
exports.list = exports.musicStyleByCountry = exports.MusicStylesCover = exports.musicStylesIcon = exports.MusicStyleId = void 0;
|
|
7
7
|
const lang_1 = require("../../lang");
|
|
8
8
|
const MusicStyle_1 = __importDefault(require("../../models/MusicStyle"));
|
|
9
|
+
const instruments_1 = require("../instruments");
|
|
9
10
|
var MusicStyleId;
|
|
10
11
|
(function (MusicStyleId) {
|
|
11
12
|
MusicStyleId["Orchestra"] = "orquesta-sinfonica";
|
|
@@ -20,6 +21,19 @@ var MusicStyleId;
|
|
|
20
21
|
MusicStyleId["Choir"] = "coro";
|
|
21
22
|
MusicStyleId["Batucada"] = "batucada";
|
|
22
23
|
})(MusicStyleId = exports.MusicStyleId || (exports.MusicStyleId = {}));
|
|
24
|
+
exports.musicStylesIcon = {
|
|
25
|
+
[MusicStyleId.Orchestra]: instruments_1.InstrumentId.Violin,
|
|
26
|
+
[MusicStyleId.Band]: instruments_1.InstrumentId.Clarinet,
|
|
27
|
+
[MusicStyleId.MarchingBand]: instruments_1.InstrumentId.MarchingToms,
|
|
28
|
+
[MusicStyleId.BigBand]: instruments_1.InstrumentId.Trombone,
|
|
29
|
+
[MusicStyleId.JazzBand]: instruments_1.InstrumentId.SaxTenor,
|
|
30
|
+
[MusicStyleId.Colla]: instruments_1.InstrumentId.Dulzaina,
|
|
31
|
+
[MusicStyleId.TxistularisBand]: instruments_1.InstrumentId.Txistu,
|
|
32
|
+
[MusicStyleId.BandaCornetasYTambores]: instruments_1.InstrumentId.Cornet,
|
|
33
|
+
[MusicStyleId.Charanga]: instruments_1.InstrumentId.BassDrum,
|
|
34
|
+
[MusicStyleId.Choir]: instruments_1.InstrumentId.Tenor,
|
|
35
|
+
[MusicStyleId.Batucada]: instruments_1.InstrumentId.Repique,
|
|
36
|
+
};
|
|
23
37
|
exports.MusicStylesCover = {
|
|
24
38
|
[MusicStyleId.Orchestra]: 'orquestra',
|
|
25
39
|
[MusicStyleId.Band]: 'bandaDeMusica',
|
package/models/Group/index.d.ts
CHANGED
package/models/Group/index.js
CHANGED
|
@@ -185,5 +185,8 @@ class Group extends basic_1.default {
|
|
|
185
185
|
get glissandooAdminUrl() {
|
|
186
186
|
return (0, glissandooAdmin_1.getGlissandooAdminEntityURL)(collections_1.CollectionNames.Group, this.id);
|
|
187
187
|
}
|
|
188
|
+
get createdOn() {
|
|
189
|
+
return this.data.createdOn;
|
|
190
|
+
}
|
|
188
191
|
}
|
|
189
192
|
exports.default = Group;
|
package/models/Group/types.d.ts
CHANGED
|
@@ -4,6 +4,11 @@ import { StageTemplate } from '../../helpers/types';
|
|
|
4
4
|
import { DocumentReference, GeoPoint, Timestamp } from '../../types/firestore';
|
|
5
5
|
import { EventType } from '../Evento/types';
|
|
6
6
|
import { PlayerBasicData } from '../Player/types';
|
|
7
|
+
export declare enum GroupCreatedOn {
|
|
8
|
+
Web = "web",
|
|
9
|
+
App = "app",
|
|
10
|
+
Dashboard = "dashboard"
|
|
11
|
+
}
|
|
7
12
|
export declare enum GroupConfig {
|
|
8
13
|
IncludesMembersToEventsWhenJoined = "includesMembersToEventsWhenJoined"
|
|
9
14
|
}
|
|
@@ -111,6 +116,7 @@ export interface GroupData extends GroupBasicData {
|
|
|
111
116
|
firstAnswerAt: Timestamp | null;
|
|
112
117
|
repertoireTags: Record<string, GroupRepertoireTag>;
|
|
113
118
|
trialEndAt: Timestamp | null;
|
|
119
|
+
readonly createdOn: GroupCreatedOn;
|
|
114
120
|
readonly owner: DocumentReference;
|
|
115
121
|
readonly createdAt: Timestamp;
|
|
116
122
|
}
|
package/models/Group/types.js
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.GroupRepertoireTagDefault = exports.GroupRepertoireTagReserved = exports.SocialNetwork = exports.GroupStatus = exports.GroupConfig = void 0;
|
|
3
|
+
exports.GroupRepertoireTagDefault = exports.GroupRepertoireTagReserved = exports.SocialNetwork = exports.GroupStatus = exports.GroupConfig = exports.GroupCreatedOn = void 0;
|
|
4
|
+
var GroupCreatedOn;
|
|
5
|
+
(function (GroupCreatedOn) {
|
|
6
|
+
GroupCreatedOn["Web"] = "web";
|
|
7
|
+
GroupCreatedOn["App"] = "app";
|
|
8
|
+
GroupCreatedOn["Dashboard"] = "dashboard";
|
|
9
|
+
})(GroupCreatedOn = exports.GroupCreatedOn || (exports.GroupCreatedOn = {}));
|
|
4
10
|
var GroupConfig;
|
|
5
11
|
(function (GroupConfig) {
|
|
6
12
|
GroupConfig["IncludesMembersToEventsWhenJoined"] = "includesMembersToEventsWhenJoined";
|
package/package.json
CHANGED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { LanguagesTypes } from '../../../lang';
|
|
2
|
-
import { DocumentSnapshot } from '../../../types/firestore';
|
|
3
|
-
import GroupBasic from '../../Group/basic';
|
|
4
|
-
import { PartnershipGroupData } from './types';
|
|
5
|
-
export default class PartnershipGroup extends GroupBasic<PartnershipGroupData> {
|
|
6
|
-
constructor(doc: DocumentSnapshot, lang?: LanguagesTypes);
|
|
7
|
-
get linkedAt(): any;
|
|
8
|
-
get linkedBy(): any;
|
|
9
|
-
get upgradedAt(): any;
|
|
10
|
-
get upgradedBy(): any;
|
|
11
|
-
get upgradedMethod(): any;
|
|
12
|
-
get planId(): any;
|
|
13
|
-
get planPeriod(): any;
|
|
14
|
-
get planDiscount(): any;
|
|
15
|
-
get planStripeId(): any;
|
|
16
|
-
get subscriptionStripeId(): any;
|
|
17
|
-
get partnershipId(): string;
|
|
18
|
-
}
|
|
@@ -1,48 +0,0 @@
|
|
|
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 get_1 = __importDefault(require("lodash/get"));
|
|
7
|
-
const plans_1 = require("../../../helpers/plans");
|
|
8
|
-
const lang_1 = require("../../../lang");
|
|
9
|
-
const basic_1 = __importDefault(require("../../Group/basic"));
|
|
10
|
-
class PartnershipGroup extends basic_1.default {
|
|
11
|
-
constructor(doc, lang = lang_1.defaultLocale) {
|
|
12
|
-
super(doc, lang);
|
|
13
|
-
}
|
|
14
|
-
get linkedAt() {
|
|
15
|
-
return this.data.linkedAt;
|
|
16
|
-
}
|
|
17
|
-
get linkedBy() {
|
|
18
|
-
return this.data.linkedBy;
|
|
19
|
-
}
|
|
20
|
-
get upgradedAt() {
|
|
21
|
-
return this.data.upgradedAt || null;
|
|
22
|
-
}
|
|
23
|
-
get upgradedBy() {
|
|
24
|
-
return this.data.upgradedBy || null;
|
|
25
|
-
}
|
|
26
|
-
get upgradedMethod() {
|
|
27
|
-
return this.data.upgradedMethod || null;
|
|
28
|
-
}
|
|
29
|
-
get planId() {
|
|
30
|
-
return this.data.planId || plans_1.PlansGroup.Piano;
|
|
31
|
-
}
|
|
32
|
-
get planPeriod() {
|
|
33
|
-
return this.data.planPeriod || null;
|
|
34
|
-
}
|
|
35
|
-
get planDiscount() {
|
|
36
|
-
return this.data.planDiscount || null;
|
|
37
|
-
}
|
|
38
|
-
get planStripeId() {
|
|
39
|
-
return this.data.planStripeId || null;
|
|
40
|
-
}
|
|
41
|
-
get subscriptionStripeId() {
|
|
42
|
-
return this.data.subscriptionStripeId || null;
|
|
43
|
-
}
|
|
44
|
-
get partnershipId() {
|
|
45
|
-
return (0, get_1.default)(this.ref, ['parent', 'parent', 'id']);
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
exports.default = PartnershipGroup;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { PlanPeriod, PlansGroup } from '../../../helpers/plans';
|
|
2
|
-
import { DocumentReference, Timestamp } from '../../../types/firestore';
|
|
3
|
-
import { GroupBasicData } from '../../Group/types';
|
|
4
|
-
export interface PartnershipGroupData extends GroupBasicData {
|
|
5
|
-
upgradedAt: Timestamp | null;
|
|
6
|
-
upgradedBy: DocumentReference | null;
|
|
7
|
-
upgradedMethod: string | null;
|
|
8
|
-
planId: PlansGroup;
|
|
9
|
-
planPeriod: PlanPeriod | null;
|
|
10
|
-
planDiscount: string | null;
|
|
11
|
-
planStripeId: string | null;
|
|
12
|
-
subscriptionStripeId: string | null;
|
|
13
|
-
readonly linkedBy: DocumentReference;
|
|
14
|
-
readonly linkedAt: Timestamp;
|
|
15
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { DocumentSnapshot } from '../../../../types/firestore';
|
|
2
|
-
import PartnershipPlanBasic from '../../Plan/basic';
|
|
3
|
-
import { SubscriptionData } from './types';
|
|
4
|
-
export default class PartnerSubscription extends PartnershipPlanBasic<SubscriptionData> {
|
|
5
|
-
constructor(doc: DocumentSnapshot);
|
|
6
|
-
get planRef(): any;
|
|
7
|
-
get partnerId(): string;
|
|
8
|
-
get partnershipId(): string;
|
|
9
|
-
get status(): any;
|
|
10
|
-
get lastPayment(): any;
|
|
11
|
-
get hasPayments(): boolean;
|
|
12
|
-
get isLastPaymentAnError(): any;
|
|
13
|
-
get paymentDate(): any;
|
|
14
|
-
get createdAt(): any;
|
|
15
|
-
get createdBy(): any;
|
|
16
|
-
get isStatusActive(): boolean;
|
|
17
|
-
get isActive(): any;
|
|
18
|
-
get isAllowPayment(): any;
|
|
19
|
-
}
|
|
@@ -1,56 +0,0 @@
|
|
|
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 get_1 = __importDefault(require("lodash/get"));
|
|
7
|
-
const payments_1 = require("../../../../helpers/payments");
|
|
8
|
-
const basic_1 = __importDefault(require("../../Plan/basic"));
|
|
9
|
-
const types_1 = require("./types");
|
|
10
|
-
class PartnerSubscription extends basic_1.default {
|
|
11
|
-
constructor(doc) {
|
|
12
|
-
super(doc);
|
|
13
|
-
}
|
|
14
|
-
get planRef() {
|
|
15
|
-
return this.data.planRef;
|
|
16
|
-
}
|
|
17
|
-
get partnerId() {
|
|
18
|
-
return (0, get_1.default)(this.ref, ['parent', 'parent', 'id']);
|
|
19
|
-
}
|
|
20
|
-
get partnershipId() {
|
|
21
|
-
return (0, get_1.default)(this.ref, ['parent', 'parent', 'parent', 'parent', 'id']);
|
|
22
|
-
}
|
|
23
|
-
get status() {
|
|
24
|
-
return this.data.status;
|
|
25
|
-
}
|
|
26
|
-
get lastPayment() {
|
|
27
|
-
return this.data.lastPayment;
|
|
28
|
-
}
|
|
29
|
-
get hasPayments() {
|
|
30
|
-
return this.lastPayment !== null;
|
|
31
|
-
}
|
|
32
|
-
get isLastPaymentAnError() {
|
|
33
|
-
if (!this.lastPayment)
|
|
34
|
-
return false;
|
|
35
|
-
return payments_1.paymentStatusErrors.includes(this.lastPayment.status);
|
|
36
|
-
}
|
|
37
|
-
get paymentDate() {
|
|
38
|
-
return this.data.paymentDate;
|
|
39
|
-
}
|
|
40
|
-
get createdAt() {
|
|
41
|
-
return this.data.createdAt;
|
|
42
|
-
}
|
|
43
|
-
get createdBy() {
|
|
44
|
-
return this.data.createdBy;
|
|
45
|
-
}
|
|
46
|
-
get isStatusActive() {
|
|
47
|
-
return this.status === types_1.SubscriptionStatus.Active;
|
|
48
|
-
}
|
|
49
|
-
get isActive() {
|
|
50
|
-
return this.exists;
|
|
51
|
-
}
|
|
52
|
-
get isAllowPayment() {
|
|
53
|
-
return this.isActive && this.isStatusActive;
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
exports.default = PartnerSubscription;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { DocumentReference, Timestamp } from '../../../../types/firestore';
|
|
2
|
-
import { PaymentStatus } from '../../../Payment/types';
|
|
3
|
-
import { PartnershipPlanBasicData } from '../../Plan/types';
|
|
4
|
-
export declare enum SubscriptionStatus {
|
|
5
|
-
Active = "active",
|
|
6
|
-
Pause = "pause",
|
|
7
|
-
Cancel = "cancel"
|
|
8
|
-
}
|
|
9
|
-
export interface LastPaymentType {
|
|
10
|
-
id: string;
|
|
11
|
-
status: PaymentStatus;
|
|
12
|
-
timestamp: number;
|
|
13
|
-
}
|
|
14
|
-
export interface SubscriptionData extends PartnershipPlanBasicData {
|
|
15
|
-
paymentDate: Timestamp;
|
|
16
|
-
status: SubscriptionStatus;
|
|
17
|
-
lastPayment: LastPaymentType | null;
|
|
18
|
-
readonly planRef: DocumentReference;
|
|
19
|
-
readonly createdBy: DocumentReference;
|
|
20
|
-
readonly createdAt: Timestamp;
|
|
21
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SubscriptionStatus = void 0;
|
|
4
|
-
var SubscriptionStatus;
|
|
5
|
-
(function (SubscriptionStatus) {
|
|
6
|
-
SubscriptionStatus["Active"] = "active";
|
|
7
|
-
SubscriptionStatus["Pause"] = "pause";
|
|
8
|
-
SubscriptionStatus["Cancel"] = "cancel";
|
|
9
|
-
})(SubscriptionStatus = exports.SubscriptionStatus || (exports.SubscriptionStatus = {}));
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { DocumentSnapshot } from '../../../types/firestore';
|
|
2
|
-
import PartnerBasic from '../../Partner/basic';
|
|
3
|
-
import { PartnershipPartnerData } from './types';
|
|
4
|
-
export default class PartnershipPartner extends PartnerBasic<PartnershipPartnerData> {
|
|
5
|
-
constructor(doc: DocumentSnapshot);
|
|
6
|
-
get partnershipId(): string;
|
|
7
|
-
get subscriptionIds(): any;
|
|
8
|
-
get subscriptionActivesIds(): any;
|
|
9
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
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 get_1 = __importDefault(require("lodash/get"));
|
|
7
|
-
const basic_1 = __importDefault(require("../../Partner/basic"));
|
|
8
|
-
class PartnershipPartner extends basic_1.default {
|
|
9
|
-
constructor(doc) {
|
|
10
|
-
super(doc);
|
|
11
|
-
}
|
|
12
|
-
get partnershipId() {
|
|
13
|
-
return (0, get_1.default)(this.ref, ['parent', 'parent', 'id']);
|
|
14
|
-
}
|
|
15
|
-
get subscriptionIds() {
|
|
16
|
-
return this.data.subscriptionIds || [];
|
|
17
|
-
}
|
|
18
|
-
get subscriptionActivesIds() {
|
|
19
|
-
return this.data.subscriptionActivesIds || [];
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
exports.default = PartnershipPartner;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { DocumentSnapshot } from '../../../types/firestore';
|
|
2
|
-
import PaymentBasic from '../../Payment/basic';
|
|
3
|
-
import { PartnershipPaymentsData } from './types';
|
|
4
|
-
export default class PartnershipPayments extends PaymentBasic<PartnershipPaymentsData> {
|
|
5
|
-
constructor(doc: DocumentSnapshot);
|
|
6
|
-
get partnerId(): any;
|
|
7
|
-
get partnerInfo(): any;
|
|
8
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
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 {
|
|
8
|
-
constructor(doc) {
|
|
9
|
-
super(doc);
|
|
10
|
-
}
|
|
11
|
-
get partnerId() {
|
|
12
|
-
return this.data.partnerId;
|
|
13
|
-
}
|
|
14
|
-
get partnerInfo() {
|
|
15
|
-
return this.data.partnerInfo;
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
exports.default = PartnershipPayments;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { DocumentSnapshot } from '../../../types/firestore';
|
|
2
|
-
import Model from '../../Model';
|
|
3
|
-
import { PartnershipPlanBasicData } from './types';
|
|
4
|
-
export default class PartnershipPlanBasic<D> extends Model<D & PartnershipPlanBasicData> {
|
|
5
|
-
constructor(doc: DocumentSnapshot);
|
|
6
|
-
get basicInfo(): PartnershipPlanBasicData;
|
|
7
|
-
private setPaymentDay;
|
|
8
|
-
private setPaymentMonth;
|
|
9
|
-
private setPaymentDate;
|
|
10
|
-
getNextPaymentDate(base: Date): Date;
|
|
11
|
-
getFirstPaymentDate(): Date;
|
|
12
|
-
get name(): any;
|
|
13
|
-
get price(): any;
|
|
14
|
-
get displayPrice(): string;
|
|
15
|
-
get description(): any;
|
|
16
|
-
get schedule(): any;
|
|
17
|
-
get isAnnuallySchedule(): boolean;
|
|
18
|
-
get isPaymentDayEndOfMonth(): boolean;
|
|
19
|
-
}
|
|
@@ -1,65 +0,0 @@
|
|
|
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 {
|
|
11
|
-
constructor(doc) {
|
|
12
|
-
super(doc);
|
|
13
|
-
}
|
|
14
|
-
get basicInfo() {
|
|
15
|
-
return {
|
|
16
|
-
name: this.name,
|
|
17
|
-
price: this.price,
|
|
18
|
-
description: this.description,
|
|
19
|
-
schedule: this.schedule,
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
setPaymentDay(date) {
|
|
23
|
-
return this.isPaymentDayEndOfMonth
|
|
24
|
-
? (0, date_fns_1.endOfMonth)(date)
|
|
25
|
-
: (0, date_fns_1.setDate)(date, this.schedule.paymentDay);
|
|
26
|
-
}
|
|
27
|
-
setPaymentMonth(date) {
|
|
28
|
-
return (0, lodash_1.isNumber)(this.schedule.paymentMonth) && this.isAnnuallySchedule
|
|
29
|
-
? (0, date_fns_1.setMonth)(date, this.schedule.paymentMonth)
|
|
30
|
-
: date;
|
|
31
|
-
}
|
|
32
|
-
setPaymentDate(date) {
|
|
33
|
-
return this.setPaymentMonth(this.setPaymentDay(date));
|
|
34
|
-
}
|
|
35
|
-
getNextPaymentDate(base) {
|
|
36
|
-
const newDate = (0, date_fns_1.addMonths)(base, this.schedule.period);
|
|
37
|
-
return this.setPaymentDate(newDate);
|
|
38
|
-
}
|
|
39
|
-
getFirstPaymentDate() {
|
|
40
|
-
const newDate = this.setPaymentDate(new Date());
|
|
41
|
-
return (0, date_fns_1.isPast)(newDate) ? (0, date_fns_1.addMonths)(newDate, this.isAnnuallySchedule ? 12 : 1) : newDate;
|
|
42
|
-
}
|
|
43
|
-
get name() {
|
|
44
|
-
return this.data.name;
|
|
45
|
-
}
|
|
46
|
-
get price() {
|
|
47
|
-
return this.data.price;
|
|
48
|
-
}
|
|
49
|
-
get displayPrice() {
|
|
50
|
-
return `${this.price} €`;
|
|
51
|
-
}
|
|
52
|
-
get description() {
|
|
53
|
-
return this.data.description;
|
|
54
|
-
}
|
|
55
|
-
get schedule() {
|
|
56
|
-
return this.data.schedule;
|
|
57
|
-
}
|
|
58
|
-
get isAnnuallySchedule() {
|
|
59
|
-
return this.schedule.period === types_1.PlanSchedulePeriod.Annually;
|
|
60
|
-
}
|
|
61
|
-
get isPaymentDayEndOfMonth() {
|
|
62
|
-
return this.schedule.paymentDay === -1;
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
exports.default = PartnershipPlanBasic;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { DocumentSnapshot } from '../../../types/firestore';
|
|
2
|
-
import PartnershipPlanBasic from './basic';
|
|
3
|
-
import { PartnershipPlanData } from './types';
|
|
4
|
-
export default class PartnershipPlan extends PartnershipPlanBasic<PartnershipPlanData> {
|
|
5
|
-
constructor(doc: DocumentSnapshot);
|
|
6
|
-
get partnershipId(): string;
|
|
7
|
-
get deletedAt(): any;
|
|
8
|
-
get isDeleted(): boolean;
|
|
9
|
-
get isActive(): any;
|
|
10
|
-
get subscriptionsCount(): any;
|
|
11
|
-
get createdAt(): any;
|
|
12
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
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 get_1 = __importDefault(require("lodash/get"));
|
|
7
|
-
const basic_1 = __importDefault(require("./basic"));
|
|
8
|
-
class PartnershipPlan extends basic_1.default {
|
|
9
|
-
constructor(doc) {
|
|
10
|
-
super(doc);
|
|
11
|
-
}
|
|
12
|
-
get partnershipId() {
|
|
13
|
-
return (0, get_1.default)(this.ref, ['parent', 'parent', 'id']);
|
|
14
|
-
}
|
|
15
|
-
get deletedAt() {
|
|
16
|
-
return this.data.deletedAt || null;
|
|
17
|
-
}
|
|
18
|
-
get isDeleted() {
|
|
19
|
-
return this.deletedAt !== null;
|
|
20
|
-
}
|
|
21
|
-
get isActive() {
|
|
22
|
-
return this.exists && !this.isDeleted;
|
|
23
|
-
}
|
|
24
|
-
get subscriptionsCount() {
|
|
25
|
-
return this.data.subscriptionsCount || 0;
|
|
26
|
-
}
|
|
27
|
-
get createdAt() {
|
|
28
|
-
return this.data.createdAt;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
exports.default = PartnershipPlan;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { Timestamp } from '../../../types/firestore';
|
|
2
|
-
export declare enum PlanSchedulePeriod {
|
|
3
|
-
Monthly = 1,
|
|
4
|
-
Quarterly = 3,
|
|
5
|
-
SemiAnnually = 6,
|
|
6
|
-
Annually = 12
|
|
7
|
-
}
|
|
8
|
-
export interface PlanScheduleType {
|
|
9
|
-
period: PlanSchedulePeriod;
|
|
10
|
-
paymentDay: number;
|
|
11
|
-
paymentMonth: number | null;
|
|
12
|
-
}
|
|
13
|
-
export interface PartnershipPlanBasicData {
|
|
14
|
-
name: string;
|
|
15
|
-
readonly price: number;
|
|
16
|
-
description: string;
|
|
17
|
-
readonly schedule: PlanScheduleType;
|
|
18
|
-
}
|
|
19
|
-
export interface PartnershipPlanData extends PartnershipPlanBasicData {
|
|
20
|
-
deletedAt: Timestamp | null;
|
|
21
|
-
subscriptionsCount: number;
|
|
22
|
-
readonly createdAt: Timestamp;
|
|
23
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PlanSchedulePeriod = void 0;
|
|
4
|
-
var PlanSchedulePeriod;
|
|
5
|
-
(function (PlanSchedulePeriod) {
|
|
6
|
-
PlanSchedulePeriod[PlanSchedulePeriod["Monthly"] = 1] = "Monthly";
|
|
7
|
-
PlanSchedulePeriod[PlanSchedulePeriod["Quarterly"] = 3] = "Quarterly";
|
|
8
|
-
PlanSchedulePeriod[PlanSchedulePeriod["SemiAnnually"] = 6] = "SemiAnnually";
|
|
9
|
-
PlanSchedulePeriod[PlanSchedulePeriod["Annually"] = 12] = "Annually";
|
|
10
|
-
})(PlanSchedulePeriod = exports.PlanSchedulePeriod || (exports.PlanSchedulePeriod = {}));
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { DocumentSnapshot } from '../../types/firestore';
|
|
2
|
-
import Model from '../Model';
|
|
3
|
-
import { PartnershipBasicData } from './types';
|
|
4
|
-
export default class PartnershipBasic<D> extends Model<D & PartnershipBasicData> {
|
|
5
|
-
constructor(doc: DocumentSnapshot);
|
|
6
|
-
get basicInfo(): PartnershipBasicData;
|
|
7
|
-
get displayName(): any;
|
|
8
|
-
get photoURL(): any;
|
|
9
|
-
get email(): any;
|
|
10
|
-
get address(): any;
|
|
11
|
-
get displayAddress(): string;
|
|
12
|
-
get phone(): any;
|
|
13
|
-
get groupIds(): any;
|
|
14
|
-
get CIF(): any;
|
|
15
|
-
get partnerCount(): any;
|
|
16
|
-
get memberCount(): any;
|
|
17
|
-
}
|
|
@@ -1,58 +0,0 @@
|
|
|
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 {
|
|
9
|
-
constructor(doc) {
|
|
10
|
-
super(doc);
|
|
11
|
-
}
|
|
12
|
-
get basicInfo() {
|
|
13
|
-
return {
|
|
14
|
-
displayName: this.displayName,
|
|
15
|
-
photoURL: this.photoURL,
|
|
16
|
-
email: this.email,
|
|
17
|
-
phone: this.phone,
|
|
18
|
-
address: this.address,
|
|
19
|
-
CIF: this.CIF,
|
|
20
|
-
groupIds: this.groupIds,
|
|
21
|
-
partnerCount: this.partnerCount,
|
|
22
|
-
memberCount: this.memberCount,
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
get displayName() {
|
|
26
|
-
return this.data.displayName;
|
|
27
|
-
}
|
|
28
|
-
get photoURL() {
|
|
29
|
-
return this.data.photoURL;
|
|
30
|
-
}
|
|
31
|
-
get email() {
|
|
32
|
-
return this.data.email;
|
|
33
|
-
}
|
|
34
|
-
get address() {
|
|
35
|
-
return this.data.address || {};
|
|
36
|
-
}
|
|
37
|
-
get displayAddress() {
|
|
38
|
-
const { street, city, postalCode, province, country } = this.address;
|
|
39
|
-
const fields = [street, postalCode, city, province, country];
|
|
40
|
-
return fields.filter((field) => (0, lodash_1.isString)(field)).join(', ');
|
|
41
|
-
}
|
|
42
|
-
get phone() {
|
|
43
|
-
return this.data.phone;
|
|
44
|
-
}
|
|
45
|
-
get groupIds() {
|
|
46
|
-
return this.data.groupIds || [];
|
|
47
|
-
}
|
|
48
|
-
get CIF() {
|
|
49
|
-
return this.data.CIF || null;
|
|
50
|
-
}
|
|
51
|
-
get partnerCount() {
|
|
52
|
-
return this.data.partnerCount || 0;
|
|
53
|
-
}
|
|
54
|
-
get memberCount() {
|
|
55
|
-
return this.data.memberCount || 0;
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
exports.default = PartnershipBasic;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { AdminItemStatus } from '../../helpers/types';
|
|
2
|
-
import { DocumentSnapshot } from '../../types/firestore';
|
|
3
|
-
import PartnershipBasic from './basic';
|
|
4
|
-
import { PartnershipData } from './types';
|
|
5
|
-
export default class Partnership extends PartnershipBasic<PartnershipData> {
|
|
6
|
-
constructor(doc: DocumentSnapshot);
|
|
7
|
-
get description(): any;
|
|
8
|
-
get admins(): any;
|
|
9
|
-
get adminList(): any;
|
|
10
|
-
adminListByStatus(status: AdminItemStatus): any;
|
|
11
|
-
isAdmin(userId: string): any;
|
|
12
|
-
get createdAt(): any;
|
|
13
|
-
private get deletedAt();
|
|
14
|
-
get isDeleted(): boolean;
|
|
15
|
-
get isActive(): any;
|
|
16
|
-
get federationIds(): any;
|
|
17
|
-
get gocardlessCustomerId(): any;
|
|
18
|
-
get stripeCustomerId(): any;
|
|
19
|
-
get stripeTaxIds(): any;
|
|
20
|
-
get howDidYouHearAboutUs(): any;
|
|
21
|
-
get groupIds(): any;
|
|
22
|
-
get glissandooAdminUrl(): any;
|
|
23
|
-
}
|
|
@@ -1,62 +0,0 @@
|
|
|
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 {
|
|
10
|
-
constructor(doc) {
|
|
11
|
-
super(doc);
|
|
12
|
-
}
|
|
13
|
-
get description() {
|
|
14
|
-
return this.data.description;
|
|
15
|
-
}
|
|
16
|
-
get admins() {
|
|
17
|
-
return this.data.administrators || [];
|
|
18
|
-
}
|
|
19
|
-
get adminList() {
|
|
20
|
-
return this.data.administratorsList || [];
|
|
21
|
-
}
|
|
22
|
-
adminListByStatus(status) {
|
|
23
|
-
return this.adminList.filter((item) => item.status === status);
|
|
24
|
-
}
|
|
25
|
-
isAdmin(userId) {
|
|
26
|
-
return this.admins.includes(userId);
|
|
27
|
-
}
|
|
28
|
-
get createdAt() {
|
|
29
|
-
return this.data.createdAt;
|
|
30
|
-
}
|
|
31
|
-
get deletedAt() {
|
|
32
|
-
return this.data.deletedAt || null;
|
|
33
|
-
}
|
|
34
|
-
get isDeleted() {
|
|
35
|
-
return this.deletedAt !== null;
|
|
36
|
-
}
|
|
37
|
-
get isActive() {
|
|
38
|
-
return this.exists && !this.deletedAt;
|
|
39
|
-
}
|
|
40
|
-
get federationIds() {
|
|
41
|
-
return this.data.federationIds || [];
|
|
42
|
-
}
|
|
43
|
-
get gocardlessCustomerId() {
|
|
44
|
-
return this.data.gocardlessCustomerId || null;
|
|
45
|
-
}
|
|
46
|
-
get stripeCustomerId() {
|
|
47
|
-
return this.data.stripeCustomerId || null;
|
|
48
|
-
}
|
|
49
|
-
get stripeTaxIds() {
|
|
50
|
-
return this.data.stripeTaxIds || [];
|
|
51
|
-
}
|
|
52
|
-
get howDidYouHearAboutUs() {
|
|
53
|
-
return this.data.howDidYouHearAboutUs || null;
|
|
54
|
-
}
|
|
55
|
-
get groupIds() {
|
|
56
|
-
return this.data.groupIds || [];
|
|
57
|
-
}
|
|
58
|
-
get glissandooAdminUrl() {
|
|
59
|
-
return (0, glissandooAdmin_1.getGlissandooAdminEntityURL)(collections_1.CollectionNames.Partnership, this.id);
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
exports.default = Partnership;
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { AdminItem } from '../../helpers/types';
|
|
2
|
-
import { DocumentReference, Timestamp } from '../../types/firestore';
|
|
3
|
-
import { BasicAddressData } from '../Partner/types';
|
|
4
|
-
export declare enum PartnershipRoles {
|
|
5
|
-
Admin = "admin"
|
|
6
|
-
}
|
|
7
|
-
export declare enum PartnershipStatus {
|
|
8
|
-
Verified = "verified",
|
|
9
|
-
PendingVerification = "pendingVerification",
|
|
10
|
-
Deleted = "deleted"
|
|
11
|
-
}
|
|
12
|
-
export interface LegalContactData {
|
|
13
|
-
name: string;
|
|
14
|
-
lastname: string;
|
|
15
|
-
birthdate: number;
|
|
16
|
-
email: string;
|
|
17
|
-
}
|
|
18
|
-
export interface PartnershipAlgoliaData extends Pick<PartnershipData, 'displayName' | 'photoURL' | 'partnerCount'> {
|
|
19
|
-
createdAt: number;
|
|
20
|
-
}
|
|
21
|
-
export interface PartnershipBasicData {
|
|
22
|
-
displayName: string;
|
|
23
|
-
photoURL: string;
|
|
24
|
-
email: string;
|
|
25
|
-
phone: string | null;
|
|
26
|
-
address: BasicAddressData;
|
|
27
|
-
CIF: string | null;
|
|
28
|
-
groupIds: string[];
|
|
29
|
-
partnerCount: number;
|
|
30
|
-
memberCount: number;
|
|
31
|
-
}
|
|
32
|
-
export interface PartnershipData extends PartnershipBasicData {
|
|
33
|
-
description: string;
|
|
34
|
-
administrators: string[];
|
|
35
|
-
administratorsList: AdminItem[];
|
|
36
|
-
deletedAt: Timestamp | null;
|
|
37
|
-
federationIds: string[];
|
|
38
|
-
gocardlessCustomerId: string | null;
|
|
39
|
-
stripeCustomerId: string | null;
|
|
40
|
-
stripeTaxIds: {
|
|
41
|
-
type: string;
|
|
42
|
-
value: string;
|
|
43
|
-
}[];
|
|
44
|
-
howDidYouHearAboutUs: string | null;
|
|
45
|
-
readonly createdAt: Timestamp;
|
|
46
|
-
readonly createdBy: DocumentReference;
|
|
47
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PartnershipStatus = exports.PartnershipRoles = void 0;
|
|
4
|
-
var PartnershipRoles;
|
|
5
|
-
(function (PartnershipRoles) {
|
|
6
|
-
PartnershipRoles["Admin"] = "admin";
|
|
7
|
-
})(PartnershipRoles = exports.PartnershipRoles || (exports.PartnershipRoles = {}));
|
|
8
|
-
var PartnershipStatus;
|
|
9
|
-
(function (PartnershipStatus) {
|
|
10
|
-
PartnershipStatus["Verified"] = "verified";
|
|
11
|
-
PartnershipStatus["PendingVerification"] = "pendingVerification";
|
|
12
|
-
PartnershipStatus["Deleted"] = "deleted";
|
|
13
|
-
})(PartnershipStatus = exports.PartnershipStatus || (exports.PartnershipStatus = {}));
|