@glissandoo/lib 1.32.12 → 1.33.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.
@@ -82,6 +82,7 @@ export declare enum FbFunctionName {
82
82
  PartnerValidate = "partner-validate",
83
83
  PartnerValidateIBAN = "partner-validateIBAN",
84
84
  PartnershipAddConfirmedAdmin = "partnership-addConfirmedAdmin",
85
+ PartnershipPublish = "partnership-publish",
85
86
  PartnershipCreate = "partnership-create",
86
87
  PartnershipRemove = "partnership-remove",
87
88
  PartnershipEdit = "partnership-edit",
@@ -86,6 +86,7 @@ var FbFunctionName;
86
86
  FbFunctionName["PartnerValidate"] = "partner-validate";
87
87
  FbFunctionName["PartnerValidateIBAN"] = "partner-validateIBAN";
88
88
  FbFunctionName["PartnershipAddConfirmedAdmin"] = "partnership-addConfirmedAdmin";
89
+ FbFunctionName["PartnershipPublish"] = "partnership-publish";
89
90
  FbFunctionName["PartnershipCreate"] = "partnership-create";
90
91
  FbFunctionName["PartnershipRemove"] = "partnership-remove";
91
92
  FbFunctionName["PartnershipEdit"] = "partnership-edit";
@@ -1,18 +1,30 @@
1
1
  import { PlanPeriod, PlansGroup } from '../helpers/plans';
2
2
  import { BasicAddressData } from '../models/Partner/types';
3
3
  export declare namespace PartnershipFbFunctionsTypes {
4
+ interface PublishParams {
5
+ partnershipId: string;
6
+ groupId: string;
7
+ displayName: string;
8
+ howDidYouHearAboutUs: string;
9
+ address: BasicAddressData;
10
+ CIF: string;
11
+ }
12
+ type PublishResult = void;
4
13
  interface CreateParams {
14
+ partnershipId: string;
5
15
  displayName: string;
6
16
  photoURL: string;
7
17
  email: string;
8
18
  phone: string | null;
9
19
  address: BasicAddressData;
10
- partnershipId: string;
11
20
  gocardlessCustomerId: string | null;
12
21
  CIF: string | null;
22
+ howDidYouHearAboutUs: string | null;
13
23
  }
14
24
  type CreateResult = void;
15
- type EditParams = CreateParams;
25
+ type EditParams = Partial<CreateParams> & {
26
+ partnershipId: string;
27
+ };
16
28
  type EditResult = void;
17
29
  interface RemoveParams {
18
30
  partnershipId: string;
@@ -95,6 +95,7 @@ const regionByFunctions = {
95
95
  [index_1.FbFunctionName.SubscriptionAdd]: GCloudRegions.EuropeWest6,
96
96
  [index_1.FbFunctionName.SubscriptionCancel]: GCloudRegions.EuropeWest6,
97
97
  [index_1.FbFunctionName.SubscriptionResume]: GCloudRegions.EuropeWest6,
98
+ [index_1.FbFunctionName.PartnershipPublish]: GCloudRegions.EuropeWest6,
98
99
  [index_1.FbFunctionName.PartnershipCreate]: GCloudRegions.EuropeWest6,
99
100
  [index_1.FbFunctionName.PartnershipEdit]: GCloudRegions.EuropeWest6,
100
101
  [index_1.FbFunctionName.PartnershipRemove]: GCloudRegions.EuropeWest6,
@@ -1,6 +1,6 @@
1
1
  import { PlansGroup } from '../../helpers/plans';
2
2
  import { LanguagesTypes } from '../../lang';
3
- import { DocumentReference, DocumentSnapshot, Timestamp } from '../../types/firestore';
3
+ import { DocumentReference, DocumentSnapshot } from '../../types/firestore';
4
4
  import GroupBasic from './basic';
5
5
  import { GroupData, GroupStatus, SocialNetwork } from './types';
6
6
  export default class Group extends GroupBasic<GroupData> {
@@ -17,8 +17,8 @@ export default class Group extends GroupBasic<GroupData> {
17
17
  get invitationEmails(): string[];
18
18
  get shortDynamicLink(): string;
19
19
  get admins(): string[];
20
- get createdAt(): Timestamp;
21
- get deletedAt(): Timestamp | null;
20
+ get createdAt(): import("../../types/firestore").Timestamp;
21
+ get deletedAt(): import("../../types/firestore").Timestamp | null;
22
22
  get repertoryCount(): number;
23
23
  get eventCount(): Record<import("../Evento/types").EventType, number>;
24
24
  get performanceCount(): number;
@@ -60,11 +60,11 @@ export default class Group extends GroupBasic<GroupData> {
60
60
  get stageTemplatesList(): (import("../../helpers/types").StageTemplate & {
61
61
  id: string;
62
62
  })[];
63
- get firstAnswerAt(): Timestamp | null;
63
+ get firstAnswerAt(): import("../../types/firestore").Timestamp | null;
64
64
  get repertoireTags(): Record<string, import("./types").GroupRepertoireTag>;
65
65
  get repertoireTagsList(): (import("./types").GroupRepertoireTag & {
66
66
  id: string;
67
67
  })[];
68
68
  getRepertoireTagName(id: string): string | null;
69
- get trialEndAt(): Timestamp;
69
+ get trialEndAt(): Date;
70
70
  }
@@ -9,7 +9,6 @@ const orders_1 = require("../../helpers/musicStyles/orders");
9
9
  const objects_1 = require("../../helpers/objects");
10
10
  const plans_1 = require("../../helpers/plans");
11
11
  const lang_1 = require("../../lang");
12
- const firestore_1 = require("../../types/firestore");
13
12
  const basic_1 = __importDefault(require("./basic"));
14
13
  const types_1 = require("./types");
15
14
  class Group extends basic_1.default {
@@ -149,7 +148,7 @@ class Group extends basic_1.default {
149
148
  return this.data.metadata || {};
150
149
  }
151
150
  get isExpiredTrial() {
152
- const isOutDateTrial = (0, date_fns_1.isPast)(this.trialEndAt.toDate());
151
+ const isOutDateTrial = (0, date_fns_1.isPast)(this.trialEndAt);
153
152
  const members = this.activePlayers.length;
154
153
  const isAboveMembersLimitPlanFree = members > plans_1.membersPerPlan[plans_1.PlansGroup.Piano];
155
154
  return this.status !== types_1.GroupStatus.Premium && isOutDateTrial && isAboveMembersLimitPlanFree;
@@ -176,7 +175,10 @@ class Group extends basic_1.default {
176
175
  return tag.default ? (0, lang_1.getTranslation)(tag.title, this.lang) : tag.title;
177
176
  }
178
177
  get trialEndAt() {
179
- return this.data.trialEndAt || firestore_1.Timestamp.fromDate((0, date_fns_1.addMonths)(this.createdAt.toDate(), 1));
178
+ if (this.data.trialEndAt) {
179
+ return this.data.trialEndAt.toDate();
180
+ }
181
+ return (0, date_fns_1.addMonths)(this.createdAt.toDate(), 1);
180
182
  }
181
183
  }
182
184
  exports.default = Group;
@@ -1,5 +1,5 @@
1
1
  import { AdminItem } from '../../helpers/types';
2
- import { Timestamp } from '../../types/firestore';
2
+ import { DocumentReference, Timestamp } from '../../types/firestore';
3
3
  import { BasicAddressData } from '../Partner/types';
4
4
  export declare enum PartnershipRoles {
5
5
  Admin = "admin"
@@ -43,4 +43,5 @@ export interface PartnershipData extends PartnershipBasicData {
43
43
  }[];
44
44
  howDidYouHearAboutUs: string | null;
45
45
  readonly createdAt: Timestamp;
46
+ readonly createdBy: DocumentReference;
46
47
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@glissandoo/lib",
3
- "version": "1.32.12",
3
+ "version": "1.33.0",
4
4
  "description": "Glissandoo library js",
5
5
  "main": "./index.js",
6
6
  "types": "./index.d.ts",