@glissandoo/lib 1.0.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/communication.d.ts +31 -0
- package/functions/communication.js +2 -0
- package/functions/event.d.ts +113 -0
- package/functions/event.js +18 -0
- package/functions/eventPlayer.d.ts +20 -0
- package/functions/eventPlayer.js +13 -0
- package/functions/eventRepertory.d.ts +9 -0
- package/functions/eventRepertory.js +2 -0
- package/functions/federation.d.ts +23 -0
- package/functions/federation.js +2 -0
- package/functions/federationPartnership.d.ts +34 -0
- package/functions/federationPartnership.js +2 -0
- package/functions/group.d.ts +32 -0
- package/functions/group.js +2 -0
- package/functions/groupPlayer.d.ts +37 -0
- package/functions/groupPlayer.js +2 -0
- package/functions/groupRepertory.d.ts +54 -0
- package/functions/groupRepertory.js +2 -0
- package/functions/index.d.ts +73 -0
- package/functions/index.js +77 -0
- package/functions/misc.d.ts +9 -0
- package/functions/misc.js +2 -0
- package/functions/notification.d.ts +4 -0
- package/functions/notification.js +2 -0
- package/functions/partner.d.ts +63 -0
- package/functions/partner.js +2 -0
- package/functions/partnership.d.ts +23 -0
- package/functions/partnership.js +2 -0
- package/functions/partnershipGroup.d.ts +12 -0
- package/functions/partnershipGroup.js +2 -0
- package/functions/partnershipPlan.d.ts +23 -0
- package/functions/partnershipPlan.js +2 -0
- package/functions/regions.d.ts +6 -0
- package/functions/regions.js +85 -0
- package/functions/subscription.d.ts +20 -0
- package/functions/subscription.js +2 -0
- package/functions/user.d.ts +19 -0
- package/functions/user.js +2 -0
- package/helpers/appScenes.d.ts +45 -0
- package/helpers/appScenes.js +49 -0
- package/helpers/badges.d.ts +21 -0
- package/helpers/badges.js +162 -0
- package/helpers/collections.d.ts +28 -0
- package/helpers/collections.js +32 -0
- package/helpers/instruments/index.d.ts +67 -0
- package/helpers/instruments/index.js +145 -0
- package/helpers/musicStyles/index.d.ts +9 -0
- package/helpers/musicStyles/index.js +16 -0
- package/helpers/musicStyles/orders.d.ts +4 -0
- package/helpers/musicStyles/orders.js +128 -0
- package/helpers/notifications.d.ts +40 -0
- package/helpers/notifications.js +120 -0
- package/helpers/payments.d.ts +2 -0
- package/helpers/payments.js +9 -0
- package/helpers/utils.d.ts +6 -0
- package/helpers/utils.js +99 -0
- package/index.d.ts +0 -0
- package/index.js +1 -0
- package/lang/ca.json +194 -0
- package/lang/de.json +194 -0
- package/lang/en.json +194 -0
- package/lang/es.json +194 -0
- package/lang/gl.json +194 -0
- package/lang/index.d.ts +1078 -0
- package/lang/index.js +101 -0
- package/models/Communication/index.d.ts +47 -0
- package/models/Communication/index.js +138 -0
- package/models/Communication/types.d.ts +53 -0
- package/models/Communication/types.js +13 -0
- package/models/Counters/index.d.ts +7 -0
- package/models/Counters/index.js +15 -0
- package/models/Counters/types.d.ts +3 -0
- package/models/Counters/types.js +2 -0
- package/models/Evento/Player/index.d.ts +17 -0
- package/models/Evento/Player/index.js +45 -0
- package/models/Evento/Player/types.d.ts +15 -0
- package/models/Evento/Player/types.js +8 -0
- package/models/Evento/Repertory/index.d.ts +9 -0
- package/models/Evento/Repertory/index.js +22 -0
- package/models/Evento/Repertory/types.d.ts +5 -0
- package/models/Evento/Repertory/types.js +2 -0
- package/models/Evento/basic.d.ts +22 -0
- package/models/Evento/basic.js +72 -0
- package/models/Evento/index.d.ts +66 -0
- package/models/Evento/index.js +178 -0
- package/models/Evento/promoter.d.ts +11 -0
- package/models/Evento/promoter.js +24 -0
- package/models/Evento/tiny.d.ts +13 -0
- package/models/Evento/tiny.js +32 -0
- package/models/Evento/types.d.ts +76 -0
- package/models/Evento/types.js +22 -0
- package/models/Federation/Partnership/index.d.ts +12 -0
- package/models/Federation/Partnership/index.js +31 -0
- package/models/Federation/Partnership/types.d.ts +8 -0
- package/models/Federation/Partnership/types.js +2 -0
- package/models/Federation/index.d.ts +20 -0
- package/models/Federation/index.js +54 -0
- package/models/Federation/types.d.ts +16 -0
- package/models/Federation/types.js +2 -0
- package/models/Group/Analytics/index.d.ts +11 -0
- package/models/Group/Analytics/index.js +29 -0
- package/models/Group/Analytics/types.d.ts +20 -0
- package/models/Group/Analytics/types.js +13 -0
- package/models/Group/Event/index.d.ts +15 -0
- package/models/Group/Event/index.js +38 -0
- package/models/Group/Event/types.d.ts +11 -0
- package/models/Group/Event/types.js +2 -0
- package/models/Group/Player/Event/index.d.ts +17 -0
- package/models/Group/Player/Event/index.js +42 -0
- package/models/Group/Player/Event/types.d.ts +8 -0
- package/models/Group/Player/Event/types.js +2 -0
- package/models/Group/Player/Log/index.d.ts +12 -0
- package/models/Group/Player/Log/index.js +24 -0
- package/models/Group/Player/Log/types.d.ts +11 -0
- package/models/Group/Player/Log/types.js +2 -0
- package/models/Group/Player/index.d.ts +55 -0
- package/models/Group/Player/index.js +221 -0
- package/models/Group/Player/types.d.ts +43 -0
- package/models/Group/Player/types.js +9 -0
- package/models/Group/Repertory/index.d.ts +67 -0
- package/models/Group/Repertory/index.js +149 -0
- package/models/Group/Repertory/types.d.ts +43 -0
- package/models/Group/Repertory/types.js +2 -0
- package/models/Group/basic.d.ts +17 -0
- package/models/Group/basic.js +51 -0
- package/models/Group/index.d.ts +43 -0
- package/models/Group/index.js +115 -0
- package/models/Group/types.d.ts +68 -0
- package/models/Group/types.js +21 -0
- package/models/Instrument/index.d.ts +9 -0
- package/models/Instrument/index.js +17 -0
- package/models/Metrics/index.d.ts +17 -0
- package/models/Metrics/index.js +47 -0
- package/models/Metrics/types.d.ts +12 -0
- package/models/Metrics/types.js +2 -0
- package/models/Model.d.ts +10 -0
- package/models/Model.js +21 -0
- package/models/MusicStyle/index.d.ts +8 -0
- package/models/MusicStyle/index.js +13 -0
- package/models/Notification/index.d.ts +12 -0
- package/models/Notification/index.js +26 -0
- package/models/Notification/types.d.ts +71 -0
- package/models/Notification/types.js +68 -0
- package/models/Partner/basic.d.ts +14 -0
- package/models/Partner/basic.js +43 -0
- package/models/Partner/index.d.ts +16 -0
- package/models/Partner/index.js +48 -0
- package/models/Partner/tiny.d.ts +9 -0
- package/models/Partner/tiny.js +24 -0
- package/models/Partner/types.d.ts +43 -0
- package/models/Partner/types.js +9 -0
- package/models/Partnership/Group/index.d.ts +8 -0
- package/models/Partnership/Group/index.js +17 -0
- package/models/Partnership/Group/types.d.ts +2 -0
- package/models/Partnership/Group/types.js +2 -0
- package/models/Partnership/Partner/Subscription/index.d.ts +19 -0
- package/models/Partnership/Partner/Subscription/index.js +56 -0
- package/models/Partnership/Partner/Subscription/types.d.ts +21 -0
- package/models/Partnership/Partner/Subscription/types.js +9 -0
- package/models/Partnership/Partner/index.d.ts +9 -0
- package/models/Partnership/Partner/index.js +22 -0
- package/models/Partnership/Partner/types.d.ts +5 -0
- package/models/Partnership/Partner/types.js +2 -0
- package/models/Partnership/Payment/index.d.ts +8 -0
- package/models/Partnership/Payment/index.js +18 -0
- package/models/Partnership/Payment/types.d.ts +6 -0
- package/models/Partnership/Payment/types.js +2 -0
- package/models/Partnership/Plan/basic.d.ts +19 -0
- package/models/Partnership/Plan/basic.js +65 -0
- package/models/Partnership/Plan/index.d.ts +12 -0
- package/models/Partnership/Plan/index.js +31 -0
- package/models/Partnership/Plan/types.d.ts +23 -0
- package/models/Partnership/Plan/types.js +10 -0
- package/models/Partnership/basic.d.ts +17 -0
- package/models/Partnership/basic.js +58 -0
- package/models/Partnership/index.d.ts +18 -0
- package/models/Partnership/index.js +55 -0
- package/models/Partnership/types.d.ts +37 -0
- package/models/Partnership/types.js +9 -0
- package/models/Payment/basic.d.ts +17 -0
- package/models/Payment/basic.js +53 -0
- package/models/Payment/index.d.ts +13 -0
- package/models/Payment/index.js +33 -0
- package/models/Payment/types.d.ts +32 -0
- package/models/Payment/types.js +17 -0
- package/models/Player/basic.d.ts +10 -0
- package/models/Player/basic.js +27 -0
- package/models/Player/types.d.ts +8 -0
- package/models/Player/types.js +2 -0
- package/models/Repertory/basic.d.ts +11 -0
- package/models/Repertory/basic.js +32 -0
- package/models/Repertory/types.d.ts +21 -0
- package/models/Repertory/types.js +2 -0
- package/models/User/Group/index.d.ts +15 -0
- package/models/User/Group/index.js +36 -0
- package/models/User/Group/types.d.ts +10 -0
- package/models/User/Group/types.js +2 -0
- package/models/User/Notification/index.d.ts +25 -0
- package/models/User/Notification/index.js +73 -0
- package/models/User/Notification/types.d.ts +25 -0
- package/models/User/Notification/types.js +2 -0
- package/models/User/basic.d.ts +13 -0
- package/models/User/basic.js +35 -0
- package/models/User/index.d.ts +46 -0
- package/models/User/index.js +119 -0
- package/models/User/types.d.ts +68 -0
- package/models/User/types.js +26 -0
- package/package.json +39 -0
|
@@ -0,0 +1,65 @@
|
|
|
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
|
+
? date_fns_1.endOfMonth(date)
|
|
25
|
+
: date_fns_1.setDate(date, this.schedule.paymentDay);
|
|
26
|
+
}
|
|
27
|
+
setPaymentMonth(date) {
|
|
28
|
+
return lodash_1.isNumber(this.schedule.paymentMonth) && this.isAnnuallySchedule
|
|
29
|
+
? 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 = 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 date_fns_1.isPast(newDate) ? 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;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { DocumentSnapshot } from '@google-cloud/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(): FirebaseFirestore.Timestamp | null;
|
|
8
|
+
get isDeleted(): boolean;
|
|
9
|
+
get isActive(): boolean;
|
|
10
|
+
get subscriptionsCount(): number;
|
|
11
|
+
get createdAt(): FirebaseFirestore.Timestamp;
|
|
12
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
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 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;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Timestamp } from '@google-cloud/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
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
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 = {}));
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { DocumentSnapshot } from '@google-cloud/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(): string;
|
|
8
|
+
get photoURL(): string;
|
|
9
|
+
get email(): string;
|
|
10
|
+
get address(): import("../Partner/types").BasicAddressData;
|
|
11
|
+
get displayAddress(): string;
|
|
12
|
+
get phone(): string | null;
|
|
13
|
+
get groupIds(): string[];
|
|
14
|
+
get CIF(): string | null;
|
|
15
|
+
get partnerCount(): number;
|
|
16
|
+
get memberCount(): number;
|
|
17
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
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) => 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;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { DocumentSnapshot } from '@google-cloud/firestore';
|
|
2
|
+
import PartnershipBasic from './basic';
|
|
3
|
+
import { PartnershipData, PartnershipStatus } from './types';
|
|
4
|
+
export default class Partnership extends PartnershipBasic<PartnershipData> {
|
|
5
|
+
constructor(doc: DocumentSnapshot);
|
|
6
|
+
get description(): string;
|
|
7
|
+
get admins(): string[];
|
|
8
|
+
get status(): PartnershipStatus;
|
|
9
|
+
get legalContact(): import("./types").LegalContactData | null;
|
|
10
|
+
get createdAt(): FirebaseFirestore.Timestamp;
|
|
11
|
+
private get verifiedAt();
|
|
12
|
+
get isVerified(): boolean;
|
|
13
|
+
private get deletedAt();
|
|
14
|
+
get isDeleted(): boolean;
|
|
15
|
+
get isActive(): boolean;
|
|
16
|
+
get federationIds(): string[];
|
|
17
|
+
isAdmin(userId: string): boolean;
|
|
18
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
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
|
+
const types_1 = require("./types");
|
|
8
|
+
class Partnership extends basic_1.default {
|
|
9
|
+
constructor(doc) {
|
|
10
|
+
super(doc);
|
|
11
|
+
}
|
|
12
|
+
get description() {
|
|
13
|
+
return this.data.description;
|
|
14
|
+
}
|
|
15
|
+
get admins() {
|
|
16
|
+
return this.data.administrators || [];
|
|
17
|
+
}
|
|
18
|
+
get status() {
|
|
19
|
+
if (this.isDeleted) {
|
|
20
|
+
return types_1.PartnershipStatus.Deleted;
|
|
21
|
+
}
|
|
22
|
+
if (this.isVerified) {
|
|
23
|
+
return types_1.PartnershipStatus.Verified;
|
|
24
|
+
}
|
|
25
|
+
return types_1.PartnershipStatus.PendingVerification;
|
|
26
|
+
}
|
|
27
|
+
get legalContact() {
|
|
28
|
+
return this.data.legalContact;
|
|
29
|
+
}
|
|
30
|
+
get createdAt() {
|
|
31
|
+
return this.data.createdAt;
|
|
32
|
+
}
|
|
33
|
+
get verifiedAt() {
|
|
34
|
+
return this.data.verifiedAt || null;
|
|
35
|
+
}
|
|
36
|
+
get isVerified() {
|
|
37
|
+
return this.verifiedAt !== null;
|
|
38
|
+
}
|
|
39
|
+
get deletedAt() {
|
|
40
|
+
return this.data.deletedAt || null;
|
|
41
|
+
}
|
|
42
|
+
get isDeleted() {
|
|
43
|
+
return this.deletedAt !== null;
|
|
44
|
+
}
|
|
45
|
+
get isActive() {
|
|
46
|
+
return this.exists && !this.deletedAt;
|
|
47
|
+
}
|
|
48
|
+
get federationIds() {
|
|
49
|
+
return this.data.federationIds || [];
|
|
50
|
+
}
|
|
51
|
+
isAdmin(userId) {
|
|
52
|
+
return this.admins.includes(userId);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
exports.default = Partnership;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { Timestamp } from '@google-cloud/firestore';
|
|
2
|
+
import { BasicAddressData } from '../Partner/types';
|
|
3
|
+
export declare enum PartnershipStatus {
|
|
4
|
+
Verified = "verified",
|
|
5
|
+
PendingVerification = "pendingVerification",
|
|
6
|
+
Deleted = "deleted"
|
|
7
|
+
}
|
|
8
|
+
export interface LegalContactData {
|
|
9
|
+
name: string;
|
|
10
|
+
lastname: string;
|
|
11
|
+
birthdate: number;
|
|
12
|
+
email: string;
|
|
13
|
+
}
|
|
14
|
+
export interface PartnershipAlgoliaData extends Pick<PartnershipData, 'displayName' | 'photoURL' | 'partnerCount'> {
|
|
15
|
+
status: PartnershipStatus;
|
|
16
|
+
createdAt: number;
|
|
17
|
+
}
|
|
18
|
+
export interface PartnershipBasicData {
|
|
19
|
+
displayName: string;
|
|
20
|
+
photoURL: string;
|
|
21
|
+
email: string;
|
|
22
|
+
phone: string | null;
|
|
23
|
+
address: BasicAddressData;
|
|
24
|
+
CIF: string | null;
|
|
25
|
+
groupIds: string[];
|
|
26
|
+
partnerCount: number;
|
|
27
|
+
memberCount: number;
|
|
28
|
+
}
|
|
29
|
+
export interface PartnershipData extends PartnershipBasicData {
|
|
30
|
+
description: string;
|
|
31
|
+
legalContact: LegalContactData | null;
|
|
32
|
+
administrators: string[];
|
|
33
|
+
verifiedAt: Timestamp | null;
|
|
34
|
+
deletedAt: Timestamp | null;
|
|
35
|
+
federationIds: string[];
|
|
36
|
+
readonly createdAt: Timestamp;
|
|
37
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PartnershipStatus = void 0;
|
|
4
|
+
var PartnershipStatus;
|
|
5
|
+
(function (PartnershipStatus) {
|
|
6
|
+
PartnershipStatus["Verified"] = "verified";
|
|
7
|
+
PartnershipStatus["PendingVerification"] = "pendingVerification";
|
|
8
|
+
PartnershipStatus["Deleted"] = "deleted";
|
|
9
|
+
})(PartnershipStatus = exports.PartnershipStatus || (exports.PartnershipStatus = {}));
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as firestore from '@google-cloud/firestore';
|
|
2
|
+
import Model from '../Model';
|
|
3
|
+
import { PaymentBasicData, PaymentType } from './types';
|
|
4
|
+
export default class PaymentBasic<D> extends Model<D & PaymentBasicData> {
|
|
5
|
+
constructor(doc: firestore.DocumentSnapshot);
|
|
6
|
+
get basicInfo(): PaymentBasicData;
|
|
7
|
+
get title(): string;
|
|
8
|
+
get amount(): number;
|
|
9
|
+
get displayAmount(): string;
|
|
10
|
+
get lastAction(): import("./types").PaymentHistory;
|
|
11
|
+
get lastActionStatus(): import("./types").PaymentStatus;
|
|
12
|
+
get lastActionAt(): Date;
|
|
13
|
+
get type(): PaymentType;
|
|
14
|
+
get isRecurrent(): boolean;
|
|
15
|
+
get isOneTime(): boolean;
|
|
16
|
+
get createdAt(): firestore.Timestamp;
|
|
17
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
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 {
|
|
10
|
+
constructor(doc) {
|
|
11
|
+
super(doc);
|
|
12
|
+
}
|
|
13
|
+
get basicInfo() {
|
|
14
|
+
return {
|
|
15
|
+
title: this.title,
|
|
16
|
+
amount: this.amount,
|
|
17
|
+
lastAction: this.lastAction,
|
|
18
|
+
createdAt: this.createdAt,
|
|
19
|
+
type: this.type,
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
get title() {
|
|
23
|
+
return this.data.title;
|
|
24
|
+
}
|
|
25
|
+
get amount() {
|
|
26
|
+
return this.data.amount;
|
|
27
|
+
}
|
|
28
|
+
get displayAmount() {
|
|
29
|
+
return `${this.amount} €`;
|
|
30
|
+
}
|
|
31
|
+
get lastAction() {
|
|
32
|
+
return this.data.lastAction;
|
|
33
|
+
}
|
|
34
|
+
get lastActionStatus() {
|
|
35
|
+
return this.lastAction.status;
|
|
36
|
+
}
|
|
37
|
+
get lastActionAt() {
|
|
38
|
+
return fromUnixTime_1.default(this.lastAction.timestamp);
|
|
39
|
+
}
|
|
40
|
+
get type() {
|
|
41
|
+
return this.data.type;
|
|
42
|
+
}
|
|
43
|
+
get isRecurrent() {
|
|
44
|
+
return this.type === types_1.PaymentType.Recurring;
|
|
45
|
+
}
|
|
46
|
+
get isOneTime() {
|
|
47
|
+
return this.type === types_1.PaymentType.OneTime;
|
|
48
|
+
}
|
|
49
|
+
get createdAt() {
|
|
50
|
+
return this.data.createdAt;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
exports.default = PaymentBasic;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { DocumentSnapshot } from '@google-cloud/firestore';
|
|
2
|
+
import PaymentBasic from './basic';
|
|
3
|
+
import { PaymentData } from './types';
|
|
4
|
+
export default class Payment extends PaymentBasic<PaymentData> {
|
|
5
|
+
constructor(doc: DocumentSnapshot);
|
|
6
|
+
get partnershipId(): string;
|
|
7
|
+
get partnerId(): string;
|
|
8
|
+
get subscriptionId(): string | null;
|
|
9
|
+
get onetimeId(): string | null;
|
|
10
|
+
get transactionId(): string;
|
|
11
|
+
get history(): import("./types").PaymentHistory[];
|
|
12
|
+
get historyOrdered(): import("./types").PaymentHistory[];
|
|
13
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
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 {
|
|
8
|
+
constructor(doc) {
|
|
9
|
+
super(doc);
|
|
10
|
+
}
|
|
11
|
+
get partnershipId() {
|
|
12
|
+
return this.data.partnershipId;
|
|
13
|
+
}
|
|
14
|
+
get partnerId() {
|
|
15
|
+
return this.data.partnerId;
|
|
16
|
+
}
|
|
17
|
+
get subscriptionId() {
|
|
18
|
+
return this.data.subscriptionId;
|
|
19
|
+
}
|
|
20
|
+
get onetimeId() {
|
|
21
|
+
return this.data.onetimeId;
|
|
22
|
+
}
|
|
23
|
+
get transactionId() {
|
|
24
|
+
return this.data.transactionId;
|
|
25
|
+
}
|
|
26
|
+
get history() {
|
|
27
|
+
return this.data.history || [];
|
|
28
|
+
}
|
|
29
|
+
get historyOrdered() {
|
|
30
|
+
return this.history.sort((a, b) => (a.timestamp < b.timestamp ? 1 : -1));
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
exports.default = Payment;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Timestamp } from '@google-cloud/firestore';
|
|
2
|
+
export declare enum PaymentType {
|
|
3
|
+
Recurring = "recurring",
|
|
4
|
+
OneTime = "one-time"
|
|
5
|
+
}
|
|
6
|
+
export declare enum PaymentStatus {
|
|
7
|
+
Pending = 0,
|
|
8
|
+
Waiting = 1,
|
|
9
|
+
Success = 2,
|
|
10
|
+
Error = 3,
|
|
11
|
+
Chargeback = 4,
|
|
12
|
+
Canceled = 5
|
|
13
|
+
}
|
|
14
|
+
export interface PaymentHistory {
|
|
15
|
+
readonly status: PaymentStatus;
|
|
16
|
+
readonly timestamp: number;
|
|
17
|
+
}
|
|
18
|
+
export interface PaymentBasicData {
|
|
19
|
+
readonly title: string;
|
|
20
|
+
readonly amount: number;
|
|
21
|
+
lastAction: PaymentHistory;
|
|
22
|
+
readonly createdAt: Timestamp;
|
|
23
|
+
readonly type: PaymentType;
|
|
24
|
+
}
|
|
25
|
+
export interface PaymentData extends PaymentBasicData {
|
|
26
|
+
readonly partnershipId: string;
|
|
27
|
+
readonly partnerId: string;
|
|
28
|
+
readonly subscriptionId: string | null;
|
|
29
|
+
readonly onetimeId: string | null;
|
|
30
|
+
readonly transactionId: string;
|
|
31
|
+
history: PaymentHistory[];
|
|
32
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PaymentStatus = exports.PaymentType = void 0;
|
|
4
|
+
var PaymentType;
|
|
5
|
+
(function (PaymentType) {
|
|
6
|
+
PaymentType["Recurring"] = "recurring";
|
|
7
|
+
PaymentType["OneTime"] = "one-time";
|
|
8
|
+
})(PaymentType = exports.PaymentType || (exports.PaymentType = {}));
|
|
9
|
+
var PaymentStatus;
|
|
10
|
+
(function (PaymentStatus) {
|
|
11
|
+
PaymentStatus[PaymentStatus["Pending"] = 0] = "Pending";
|
|
12
|
+
PaymentStatus[PaymentStatus["Waiting"] = 1] = "Waiting";
|
|
13
|
+
PaymentStatus[PaymentStatus["Success"] = 2] = "Success";
|
|
14
|
+
PaymentStatus[PaymentStatus["Error"] = 3] = "Error";
|
|
15
|
+
PaymentStatus[PaymentStatus["Chargeback"] = 4] = "Chargeback";
|
|
16
|
+
PaymentStatus[PaymentStatus["Canceled"] = 5] = "Canceled";
|
|
17
|
+
})(PaymentStatus = exports.PaymentStatus || (exports.PaymentStatus = {}));
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as firestore from '@google-cloud/firestore';
|
|
2
|
+
import { LanguagesTypes } from '../../lang';
|
|
3
|
+
import UserBasic from '../User/basic';
|
|
4
|
+
import { PlayerBasicData } from './types';
|
|
5
|
+
export default class PlayerBasic<D> extends UserBasic<PlayerBasicData & D> {
|
|
6
|
+
constructor(doc: firestore.DocumentSnapshot, lang: LanguagesTypes);
|
|
7
|
+
get basicInfo(): PlayerBasicData;
|
|
8
|
+
get mainInstrument(): import("../../helpers/instruments").InstrumentId;
|
|
9
|
+
get instrument(): string;
|
|
10
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
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 {
|
|
9
|
+
constructor(doc, lang) {
|
|
10
|
+
super(doc, lang);
|
|
11
|
+
}
|
|
12
|
+
get basicInfo() {
|
|
13
|
+
return {
|
|
14
|
+
displayName: this.displayName,
|
|
15
|
+
photoURL: this.photoURL,
|
|
16
|
+
username: this.username,
|
|
17
|
+
mainInstrument: this.mainInstrument,
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
get mainInstrument() {
|
|
21
|
+
return this.data.mainInstrument;
|
|
22
|
+
}
|
|
23
|
+
get instrument() {
|
|
24
|
+
return lang_1.getTranslation(`instruments.${this.mainInstrument}`, this.lang);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
exports.default = PlayerBasic;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { InstrumentId } from '../../helpers/instruments';
|
|
2
|
+
import { UserBasicData } from '../User/types';
|
|
3
|
+
export interface APlayerBasicData extends PlayerBasicData {
|
|
4
|
+
id: string;
|
|
5
|
+
}
|
|
6
|
+
export interface PlayerBasicData extends UserBasicData {
|
|
7
|
+
mainInstrument: InstrumentId;
|
|
8
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as firestore from '@google-cloud/firestore';
|
|
2
|
+
import Model from '../Model';
|
|
3
|
+
import { ThemeBasicData } from './types';
|
|
4
|
+
export default class Theme<D> extends Model<D & ThemeBasicData> {
|
|
5
|
+
constructor(doc: firestore.DocumentSnapshot);
|
|
6
|
+
get basicInfo(): ThemeBasicData;
|
|
7
|
+
get title(): string;
|
|
8
|
+
get compositor(): string | null;
|
|
9
|
+
get tags(): string[];
|
|
10
|
+
get media(): import("./types").ThemeMediaType | null;
|
|
11
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
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 {
|
|
8
|
+
constructor(doc) {
|
|
9
|
+
super(doc);
|
|
10
|
+
}
|
|
11
|
+
get basicInfo() {
|
|
12
|
+
return {
|
|
13
|
+
title: this.title,
|
|
14
|
+
compositor: this.compositor,
|
|
15
|
+
media: this.media,
|
|
16
|
+
tags: this.tags,
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
get title() {
|
|
20
|
+
return this.data.title;
|
|
21
|
+
}
|
|
22
|
+
get compositor() {
|
|
23
|
+
return this.data.compositor || null;
|
|
24
|
+
}
|
|
25
|
+
get tags() {
|
|
26
|
+
return this.data.tags || [];
|
|
27
|
+
}
|
|
28
|
+
get media() {
|
|
29
|
+
return this.data.media || null;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
exports.default = Theme;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export declare type ThumbnailSizesTypes = 'default' | 'medium' | 'high';
|
|
2
|
+
export interface ThumbnailType {
|
|
3
|
+
url: string;
|
|
4
|
+
width: string;
|
|
5
|
+
height: string;
|
|
6
|
+
}
|
|
7
|
+
export interface ThemeMediaType {
|
|
8
|
+
id: string;
|
|
9
|
+
title: string;
|
|
10
|
+
description: string;
|
|
11
|
+
thumbnails: Record<ThumbnailSizesTypes, ThumbnailType>;
|
|
12
|
+
}
|
|
13
|
+
export interface ThemeBasicData {
|
|
14
|
+
title: string;
|
|
15
|
+
compositor: string | null;
|
|
16
|
+
tags: string[];
|
|
17
|
+
media: ThemeMediaType | null;
|
|
18
|
+
}
|
|
19
|
+
export interface AThemeBasicData extends ThemeBasicData {
|
|
20
|
+
id: string;
|
|
21
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { DocumentSnapshot } from '@google-cloud/firestore';
|
|
2
|
+
import { LanguagesTypes } from '../../../lang';
|
|
3
|
+
import GroupBasic from '../../Group/basic';
|
|
4
|
+
import { GroupPlayerRole } from '../../Group/Player/types';
|
|
5
|
+
import { UserGroupData } from './types';
|
|
6
|
+
export default class UserGroup extends GroupBasic<UserGroupData> {
|
|
7
|
+
constructor(doc: DocumentSnapshot, lang?: LanguagesTypes);
|
|
8
|
+
get groupId(): string;
|
|
9
|
+
get mainInstrument(): import("../../../helpers/instruments").InstrumentId;
|
|
10
|
+
get instrument(): string;
|
|
11
|
+
get instruments(): import("../../../helpers/instruments").InstrumentId[];
|
|
12
|
+
get role(): GroupPlayerRole;
|
|
13
|
+
get isAdmin(): boolean;
|
|
14
|
+
get joinedAt(): FirebaseFirestore.Timestamp;
|
|
15
|
+
}
|