@glissandoo/lib 1.39.2 → 1.39.3
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/helpers/fileSections/orders.js +1 -1
- package/helpers/musicStyles/orders.js +1 -1
- package/helpers/{notifications.d.ts → notifications/index.d.ts} +4 -4
- package/helpers/{notifications.js → notifications/index.js} +3 -3
- package/helpers/notifications/placeholders.d.ts +4 -0
- package/helpers/notifications/placeholders.js +80 -0
- package/helpers/slate.d.ts +1 -0
- package/helpers/slate.js +18 -0
- package/helpers/utils.d.ts +4 -8
- package/helpers/utils.js +4 -94
- package/lang/ca.json +26 -35
- package/lang/de.json +27 -36
- package/lang/en.json +26 -35
- package/lang/es.json +26 -35
- package/lang/eu.json +26 -35
- package/lang/gl.json +28 -37
- package/lang/pt.json +26 -35
- package/models/Communication/index.js +2 -2
- package/models/User/Notification/index.js +3 -3
- package/package.json +3 -3
- 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/lang/pt.json
CHANGED
|
@@ -19,15 +19,6 @@
|
|
|
19
19
|
"communication.create.title": "Nova publicação",
|
|
20
20
|
"communication.newComment.text": "{string:user.0.displayName} comentou uma publicação",
|
|
21
21
|
"communication.newComment.title": "Novo comentário",
|
|
22
|
-
"emails.biweeklyEventReminder.attendance.confirm": "Confirm",
|
|
23
|
-
"emails.biweeklyEventReminder.attendance.confirmed": "Going 😎",
|
|
24
|
-
"emails.biweeklyEventReminder.attendance.decline": "Decline",
|
|
25
|
-
"emails.biweeklyEventReminder.attendance.declined": "Not going 🥲",
|
|
26
|
-
"emails.biweeklyEventReminder.intro": "Hi {name}, here is a summary of the events you can't miss!",
|
|
27
|
-
"emails.biweeklyEventReminder.subject": "Don't miss these events!",
|
|
28
|
-
"emails.biweeklyEventReminder.title": "Events Summary",
|
|
29
|
-
"emails.common.footer.contact": "If you have any doubts, please don't hesitate to contact us.\nOur email is hello@glissandoo.com.",
|
|
30
|
-
"emails.common.footer.rights": "© 2023 Glissandoo.com, All rights reserved.",
|
|
31
22
|
"event": "Evento",
|
|
32
23
|
"group.delete.text": "O grupo {string:group.0.displayName} foi excluído",
|
|
33
24
|
"group.delete.title": "Grupo excluído",
|
|
@@ -161,13 +152,13 @@
|
|
|
161
152
|
"performance.edit.stage.title": "Concerto - o plano de veiculação mudou",
|
|
162
153
|
"performance.edit.title.text": "O título de {string:event.0.displayName} foi atualizado",
|
|
163
154
|
"performance.edit.title.title": "Concerto - o título mudou",
|
|
164
|
-
"performance.eveningReminder.confirm.text": "{string:event.0.displayName} de {string:group.0.displayName} amanhã às {date:event.0.datetime:time}",
|
|
155
|
+
"performance.eveningReminder.confirm.text": "{string:event.0.displayName} de {string:group.0.displayName} amanhã às {date:event.0.[datetime,timezone]:time}",
|
|
165
156
|
"performance.eveningReminder.confirm.title": "Lembrete de concerto",
|
|
166
|
-
"performance.eveningReminder.pending.text": "Confirme sua presença para {string:event.0.displayName} de {string:group.0.displayName} amanhã às {date:event.0.datetime:time}",
|
|
157
|
+
"performance.eveningReminder.pending.text": "Confirme sua presença para {string:event.0.displayName} de {string:group.0.displayName} amanhã às {date:event.0.[datetime,timezone]:time}",
|
|
167
158
|
"performance.eveningReminder.pending.title": "Lembrete do concerto",
|
|
168
|
-
"performance.morningReminder.confirm.text": "{string:event.0.displayName} de {string:group.0.displayName} hoje em {date:event.0.datetime:time}",
|
|
159
|
+
"performance.morningReminder.confirm.text": "{string:event.0.displayName} de {string:group.0.displayName} hoje em {date:event.0.[datetime,timezone]:time}",
|
|
169
160
|
"performance.morningReminder.confirm.title": "Lembrete do concerto",
|
|
170
|
-
"performance.morningReminder.pending.text": "Confirme sua presença para {string:event.0.displayName} de {string:group.0.displayName} hoje em {date:event.0.datetime:time}",
|
|
161
|
+
"performance.morningReminder.pending.text": "Confirme sua presença para {string:event.0.displayName} de {string:group.0.displayName} hoje em {date:event.0.[datetime,timezone]:time}",
|
|
171
162
|
"performance.morningReminder.pending.title": "Lembrete do concerto",
|
|
172
163
|
"performance.players.add.text": "Você foi adicionado a {string:event.0.displayName}",
|
|
173
164
|
"performance.players.add.title": "Novo concerto",
|
|
@@ -178,47 +169,47 @@
|
|
|
178
169
|
"performance.rollCallReminder.text": "Agora é o melhor momento para fazer uma votação.",
|
|
179
170
|
"performance.rollCallReminder.title": "Você pode fazer uma votação para o ensaio",
|
|
180
171
|
"practice": "Ensaio",
|
|
181
|
-
"practice.assistance.confirm.text": "{string:user.0.displayName} confirmou a participação no ensaio em {date:event.0.datetime:date}",
|
|
172
|
+
"practice.assistance.confirm.text": "{string:user.0.displayName} confirmou a participação no ensaio em {date:event.0.[datetime,timezone]:date}",
|
|
182
173
|
"practice.assistance.confirm.title": "Presença confirmada",
|
|
183
|
-
"practice.assistance.decline.text": "{string:user.0.displayName} recusou a participação no ensaio em {date:event.0.datetime:date}",
|
|
174
|
+
"practice.assistance.decline.text": "{string:user.0.displayName} recusou a participação no ensaio em {date:event.0.[datetime,timezone]:date}",
|
|
184
175
|
"practice.assistance.decline.title": "Participação recusada",
|
|
185
|
-
"practice.cancel.text": "{date:event.0.datetime:date} ensaio de {string:group.0.displayName} foi cancelado",
|
|
176
|
+
"practice.cancel.text": "{date:event.0.[datetime,timezone]:date} ensaio de {string:group.0.displayName} foi cancelado",
|
|
186
177
|
"practice.cancel.title": "Ensaio cancelado",
|
|
187
|
-
"practice.create.text": "Um novo ensaio de {string:group.0.displayName} em {date:event.0.datetime:datetime} foi adicionado",
|
|
178
|
+
"practice.create.text": "Um novo ensaio de {string:group.0.displayName} em {date:event.0.[datetime,timezone]:datetime} foi adicionado",
|
|
188
179
|
"practice.create.title": "Novo ensaio",
|
|
189
|
-
"practice.edit.attendance.text": "O limite de presenças no ensaio para o {date:event.0.datetime:date} foi atualizado",
|
|
180
|
+
"practice.edit.attendance.text": "O limite de presenças no ensaio para o {date:event.0.[datetime,timezone]:date} foi atualizado",
|
|
190
181
|
"practice.edit.attendance.title": "Ensaio - limite de presenças alterado",
|
|
191
|
-
"practice.edit.comments.text": "A descrição do ensaio {date:event.0.datetime:date} foi atualizada",
|
|
182
|
+
"practice.edit.comments.text": "A descrição do ensaio {date:event.0.[datetime,timezone]:date} foi atualizada",
|
|
192
183
|
"practice.edit.comments.title": "Ensaio - a descrição mudou",
|
|
193
|
-
"practice.edit.datetime.text": "A programação para o ensaio {date:event.0.datetime:date} foi modificada",
|
|
184
|
+
"practice.edit.datetime.text": "A programação para o ensaio {date:event.0.[datetime,timezone]:date} foi modificada",
|
|
194
185
|
"practice.edit.datetime.title": "Ensaio - horário alterado",
|
|
195
|
-
"practice.edit.locality.text": "O endereço do ensaio de {date:event.0.datetime:date} foi atualizado",
|
|
186
|
+
"practice.edit.locality.text": "O endereço do ensaio de {date:event.0.[datetime,timezone]:date} foi atualizado",
|
|
196
187
|
"practice.edit.locality.title": "Ensaio - endereço alterado",
|
|
197
|
-
"practice.edit.repertory.text": "O repertório para o ensaio {date:event.0.datetime:date} foi atualizado",
|
|
188
|
+
"practice.edit.repertory.text": "O repertório para o ensaio {date:event.0.[datetime,timezone]:date} foi atualizado",
|
|
198
189
|
"practice.edit.repertory.title": "Ensaio - repertório alterado",
|
|
199
|
-
"practice.edit.stage.text": "O plano de veiculação para o ensaio {date:event.0.datetime:date} foi atualizado",
|
|
190
|
+
"practice.edit.stage.text": "O plano de veiculação para o ensaio {date:event.0.[datetime,timezone]:date} foi atualizado",
|
|
200
191
|
"practice.edit.stage.title": "Ensaio - mudança de plano de veiculação",
|
|
201
|
-
"practice.edit.title.text": "O título do ensaio {date:event.0.datetime:date} foi atualizado",
|
|
192
|
+
"practice.edit.title.text": "O título do ensaio {date:event.0.[datetime,timezone]:date} foi atualizado",
|
|
202
193
|
"practice.edit.title.title": "Ensaio - título alterado",
|
|
203
|
-
"practice.eveningReminder.confirm.text": "{string:group.0.displayName} ensaio amanhã às {date:event.0.datetime:time}",
|
|
194
|
+
"practice.eveningReminder.confirm.text": "{string:group.0.displayName} ensaio amanhã às {date:event.0.[datetime,timezone]:time}",
|
|
204
195
|
"practice.eveningReminder.confirm.title": "Lembrete de ensaio",
|
|
205
|
-
"practice.eveningReminder.pending.text": "Confirme sua presença no ensaio de {string:group.0.displayName} amanhã às {date:event.0.datetime:time}",
|
|
196
|
+
"practice.eveningReminder.pending.text": "Confirme sua presença no ensaio de {string:group.0.displayName} amanhã às {date:event.0.[datetime,timezone]:time}",
|
|
206
197
|
"practice.eveningReminder.pending.title": "Lembrete de ensaio",
|
|
207
|
-
"practice.morningReminder.confirm.text": "{string:group.0.displayName} ensaio hoje em {date:event.0.datetime:time}",
|
|
198
|
+
"practice.morningReminder.confirm.text": "{string:group.0.displayName} ensaio hoje em {date:event.0.[datetime,timezone]:time}",
|
|
208
199
|
"practice.morningReminder.confirm.title": "Lembrete de ensaio",
|
|
209
|
-
"practice.morningReminder.pending.text": "Confirme sua participação no ensaio {string:group.0.displayName} hoje em {date:event.0.datetime:time}",
|
|
200
|
+
"practice.morningReminder.pending.text": "Confirme sua participação no ensaio {string:group.0.displayName} hoje em {date:event.0.[datetime,timezone]:time}",
|
|
210
201
|
"practice.morningReminder.pending.title": "Lembrete de ensaio",
|
|
211
|
-
"practice.players.add.text": "Você foi adicionado a {string:group.0.displayName} em {date:event.0.datetime:datetime}",
|
|
202
|
+
"practice.players.add.text": "Você foi adicionado a {string:group.0.displayName} em {date:event.0.[datetime,timezone]:datetime}",
|
|
212
203
|
"practice.players.add.title": "Novo ensaio",
|
|
213
|
-
"practice.players.remove.text": "Você foi removido de {string:group.0.displayName} em {date:event.0.datetime:date}",
|
|
204
|
+
"practice.players.remove.text": "Você foi removido de {string:group.0.displayName} em {date:event.0.[datetime,timezone]:date}",
|
|
214
205
|
"practice.players.remove.title": "Ensaio removido",
|
|
215
|
-
"practice.reminder.text": "Você precisa de confirmar a presença no {date:event.0.datetime:datetime} de {string:group.0.displayName, please}",
|
|
206
|
+
"practice.reminder.text": "Você precisa de confirmar a presença no {date:event.0.[datetime,timezone]:datetime} de {string:group.0.displayName, please}",
|
|
216
207
|
"practice.reminder.title": "Por favor, confirme sua presença",
|
|
217
208
|
"practice.rollCallReminder.text": "Agora é o melhor momento para fazer uma votação",
|
|
218
209
|
"practice.rollCallReminder.title": "Você pode fazer uma votação no seu último ensaio.",
|
|
219
|
-
"practices.cancel.text": "{string:extra.num} ensaios do {string:group.0.displayName} entre {date:event.0.datetime:shortDate} e {date:event.1.datetime:shortDate} foram cancelados",
|
|
210
|
+
"practices.cancel.text": "{string:extra.num} ensaios do {string:group.0.displayName} entre {date:event.0.[datetime,timezone]:shortDate} e {date:event.1.[datetime,timezone]:shortDate} foram cancelados",
|
|
220
211
|
"practices.cancel.title": "Ensaios cancelados",
|
|
221
|
-
"practices.create.text": "{string:extra.num} novos ensaios de {string:group.0.displayName} entre {date:event.0.datetime:shortDate} e {date:event.1.datetime:shortDate} foram adicionados",
|
|
212
|
+
"practices.create.text": "{string:extra.num} novos ensaios de {string:group.0.displayName} entre {date:event.0.[datetime,timezone]:shortDate} e {date:event.1.[datetime,timezone]:shortDate} foram adicionados",
|
|
222
213
|
"practices.create.title": "Novos ensaios",
|
|
223
214
|
"practices.edit.attendance.text": "O limite de presenças foi atualizado em vários ensaios",
|
|
224
215
|
"practices.edit.attendance.title": "Ensaios - limite de participação alterado",
|
|
@@ -234,9 +225,9 @@
|
|
|
234
225
|
"practices.edit.stage.title": "Ensaios - mudança de plano de veiculação",
|
|
235
226
|
"practices.edit.title.text": "O título foi atualizado em vários ensaios",
|
|
236
227
|
"practices.edit.title.title": "Ensaios - título alterado",
|
|
237
|
-
"practices.players.add.text": "Você foi adicionado a vários ensaios entre {date:event.0.datetime:shortDate} e {date:event.1.datetime:shortDate}",
|
|
228
|
+
"practices.players.add.text": "Você foi adicionado a vários ensaios entre {date:event.0.[datetime,timezone]:shortDate} e {date:event.1.[datetime,timezone]:shortDate}",
|
|
238
229
|
"practices.players.add.title": "Novos ensaios",
|
|
239
|
-
"practices.players.remove.text": "Você foi removido de vários ensaios entre {date:event.0.datetime:shortDate} e {date:event.1.datetime:shortDate}",
|
|
230
|
+
"practices.players.remove.text": "Você foi removido de vários ensaios entre {date:event.0.[datetime,timezone]:shortDate} e {date:event.1.[datetime,timezone]:shortDate}",
|
|
240
231
|
"practices.players.remove.title": "Ensaios removidos",
|
|
241
232
|
"repertoireTags.1": "1º",
|
|
242
233
|
"repertoireTags.2": "2º",
|
|
@@ -4,7 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const lodash_1 = require("lodash");
|
|
7
|
-
const
|
|
7
|
+
const slate_1 = require("../../helpers/slate");
|
|
8
8
|
const lang_1 = require("../../lang");
|
|
9
9
|
const lang_2 = __importDefault(require("../Model/lang"));
|
|
10
10
|
const types_1 = require("./types");
|
|
@@ -76,7 +76,7 @@ class Communication extends lang_2.default {
|
|
|
76
76
|
return !this.isDeleted;
|
|
77
77
|
}
|
|
78
78
|
get plainText() {
|
|
79
|
-
return (0,
|
|
79
|
+
return (0, slate_1.serializeSlateBlock)(this.message);
|
|
80
80
|
}
|
|
81
81
|
get createdAt() {
|
|
82
82
|
return this.data.createdAt;
|
|
@@ -4,7 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const lodash_1 = require("lodash");
|
|
7
|
-
const
|
|
7
|
+
const placeholders_1 = require("../../../helpers/notifications/placeholders");
|
|
8
8
|
const lang_1 = require("../../../lang");
|
|
9
9
|
const Model_1 = __importDefault(require("../../Model"));
|
|
10
10
|
class Notification extends Model_1.default {
|
|
@@ -14,7 +14,7 @@ class Notification extends Model_1.default {
|
|
|
14
14
|
const translation = (0, lang_1.getTranslation)(`${this.action}.${key}`, this.lang);
|
|
15
15
|
return !translation
|
|
16
16
|
? this.action
|
|
17
|
-
: (0,
|
|
17
|
+
: (0, placeholders_1.replaceKeysNotification)(translation, this.meta, this.lang);
|
|
18
18
|
};
|
|
19
19
|
this.lang = lang;
|
|
20
20
|
}
|
|
@@ -32,7 +32,7 @@ class Notification extends Model_1.default {
|
|
|
32
32
|
return this.data.action;
|
|
33
33
|
}
|
|
34
34
|
get cleanPhotoURL() {
|
|
35
|
-
return this.isAvatar ? (0,
|
|
35
|
+
return this.isAvatar ? (0, placeholders_1.replaceVarsBrackets)(this.photoURL, this.meta) : this.photoURL;
|
|
36
36
|
}
|
|
37
37
|
get isAvatar() {
|
|
38
38
|
return this.photoURL.slice(0, 1) === '[' && this.photoURL.slice(-1) === ']';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@glissandoo/lib",
|
|
3
|
-
"version": "1.39.
|
|
3
|
+
"version": "1.39.3",
|
|
4
4
|
"description": "Glissandoo library js",
|
|
5
5
|
"main": "./index.js",
|
|
6
6
|
"types": "./index.d.ts",
|
|
@@ -27,8 +27,7 @@
|
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"date-fns": "^2.20.3",
|
|
29
29
|
"date-fns-tz": "^1.1.3",
|
|
30
|
-
"lodash": "^4.17.21"
|
|
31
|
-
"type-fest": "^3.5.1"
|
|
30
|
+
"lodash": "^4.17.21"
|
|
32
31
|
},
|
|
33
32
|
"devDependencies": {
|
|
34
33
|
"@localazy/cli": "^1.6.5",
|
|
@@ -41,6 +40,7 @@
|
|
|
41
40
|
"husky": "^8.0.1",
|
|
42
41
|
"lint-staged": "^12.4.1",
|
|
43
42
|
"prettier": "^2.2.1",
|
|
43
|
+
"type-fest": "^3.12.0",
|
|
44
44
|
"typescript": "^4.9.4"
|
|
45
45
|
},
|
|
46
46
|
"lint-staged": {
|
|
@@ -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 = {}));
|