@glissandoo/lib 1.41.0 → 1.43.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.
@@ -44,9 +44,7 @@ export declare namespace FederationFbFunctionsTypes {
44
44
  federationId: string;
45
45
  }
46
46
  type ConfirmAdminResult = void;
47
- interface GetConfederationParams {
48
- federationIds: string[];
49
- }
47
+ type GetConfederationParams = void;
50
48
  type ConfederationPartnershipType = Pick<FederationPartnership, 'id' | 'displayName' | 'email' | 'hasSchool' | 'leaderCount' | 'photoURL' | 'phone' | 'address' | 'CIF' | 'partnerCount' | 'memberCount' | 'connectedAt' | 'teacherCount' | 'studentCount' | 'updatedAt'>;
51
49
  type FederationConfederationType = Pick<Federation, 'id' | 'displayName' | 'email' | 'photoURL' | 'phone' | 'web' | 'address' | 'partnershipIds'>;
52
50
  interface GetConfederationResult {
@@ -1,5 +1,5 @@
1
- export declare const mapToArray: <V>(obj: Record<string, V>) => (V & {
2
- id: string;
1
+ export declare const mapToArray: <K extends string, V, O extends Record<K, V>>(obj: O) => (O[`${Exclude<keyof O, symbol>}`] & {
2
+ id: keyof O;
3
3
  })[];
4
4
  export declare const map: <KIn extends string, VIn, KOut extends string, VOut>(obj: Record<KIn, VIn>, fn: (key: `${KIn}`, value: VIn, index?: number) => [KOut, VOut]) => Record<KOut, VOut>;
5
5
  export declare const filter: <K extends string, V>(obj: Record<K, V>, fn: (key: `${Exclude<K, symbol>}`, value: V, index?: number) => unknown) => Record<`${Exclude<K, symbol>}`, V>;
@@ -22,4 +22,5 @@ export default class Federation extends Model<FederationData> {
22
22
  get deletedAt(): import("../../types/firestore").Timestamp | null;
23
23
  get isActive(): boolean;
24
24
  get glissandooAdminUrl(): string;
25
+ get besm(): boolean;
25
26
  }
@@ -67,5 +67,8 @@ class Federation extends Model_1.default {
67
67
  get glissandooAdminUrl() {
68
68
  return (0, glissandooAdmin_1.getGlissandooAdminEntityURL)(collections_1.CollectionNames.Federation, this.id);
69
69
  }
70
+ get besm() {
71
+ return this.data.besm || false;
72
+ }
70
73
  }
71
74
  exports.default = Federation;
@@ -13,6 +13,7 @@ export interface FederationData {
13
13
  adminIds: string[];
14
14
  adminList: AdminItem[];
15
15
  deletedAt: Timestamp | null;
16
+ besm: boolean;
16
17
  readonly createdAt: Timestamp;
17
18
  readonly createdBy: DocumentReference;
18
19
  }
@@ -70,4 +70,8 @@ export default class Group extends GroupBasic<GroupData> {
70
70
  get trialEndAt(): Date;
71
71
  get glissandooAdminUrl(): string;
72
72
  get createdOn(): import("./types").GroupCreatedOn;
73
+ get instruments(): Partial<Record<import("../../helpers/instruments").InstrumentId, import("./types").GroupInstrument>>;
74
+ get instrumentsList(): (import("./types").GroupInstrument & {
75
+ id: import("../../helpers/instruments").InstrumentId;
76
+ })[];
73
77
  }
@@ -191,5 +191,11 @@ class Group extends basic_1.default {
191
191
  get createdOn() {
192
192
  return this.data.createdOn;
193
193
  }
194
+ get instruments() {
195
+ return this.data.instruments;
196
+ }
197
+ get instrumentsList() {
198
+ return (0, objects_1.mapToArray)(this.instruments).sort((a, b) => a.order - b.order);
199
+ }
194
200
  }
195
201
  exports.default = Group;
@@ -1,3 +1,4 @@
1
+ import { InstrumentId } from '../../helpers/instruments';
1
2
  import { MusicStyleType } from '../../helpers/musicStyles';
2
3
  import { PlansGroup } from '../../helpers/plans';
3
4
  import { StageTemplate } from '../../helpers/types';
@@ -85,6 +86,12 @@ export interface GroupRepertoireTag {
85
86
  export interface AGroupRepertoireTag extends GroupRepertoireTag {
86
87
  id: string;
87
88
  }
89
+ export interface GroupInstrument {
90
+ order: number;
91
+ }
92
+ export interface AGroupInstrument extends GroupInstrument {
93
+ id: InstrumentId;
94
+ }
88
95
  export interface GroupData extends GroupBasicData {
89
96
  playerIds: string[];
90
97
  players: Record<string, PlayerBasicData>;
@@ -113,6 +120,7 @@ export interface GroupData extends GroupBasicData {
113
120
  communicationCount: number;
114
121
  country: string;
115
122
  stageTemplates: Record<string, StageTemplate>;
123
+ instruments: Partial<Record<InstrumentId, GroupInstrument>>;
116
124
  metadata: Record<string, string>;
117
125
  firstAnswerAt: Timestamp | null;
118
126
  repertoireTags: Record<string, GroupRepertoireTag>;
@@ -1,4 +1,3 @@
1
- import { PlansGroup } from '../../../helpers/plans';
2
1
  import { LanguagesTypes } from '../../../lang';
3
2
  import { DocumentSnapshot } from '../../../types/firestore';
4
3
  import GroupBasic from '../../Group/basic';
@@ -7,21 +6,5 @@ export default class PartnershipGroup extends GroupBasic<PartnershipGroupData> {
7
6
  constructor(doc: DocumentSnapshot, lang?: LanguagesTypes);
8
7
  get linkedAt(): import("../../../types/firestore").Timestamp;
9
8
  get linkedBy(): import("../../../types/firestore").DocumentReference<import("../../../types/firestore").DocumentData>;
10
- /** @deprecated use customer */
11
- get upgradedAt(): import("../../../types/firestore").Timestamp | null;
12
- /** @deprecated use customer */
13
- get upgradedBy(): import("../../../types/firestore").DocumentReference<import("../../../types/firestore").DocumentData> | null;
14
- /** @deprecated use customer */
15
- get upgradedMethod(): string | null;
16
- /** @deprecated use customer */
17
- get planId(): PlansGroup;
18
- /** @deprecated use customer */
19
- get planPeriod(): import("../../../helpers/plans").PlanPeriod | null;
20
- /** @deprecated use customer */
21
- get planDiscount(): string | null;
22
- /** @deprecated use customer */
23
- get planStripeId(): string | null;
24
- /** @deprecated use customer */
25
- get subscriptionStripeId(): string | null;
26
9
  get partnershipId(): string;
27
10
  }
@@ -4,7 +4,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const get_1 = __importDefault(require("lodash/get"));
7
- const plans_1 = require("../../../helpers/plans");
8
7
  const lang_1 = require("../../../lang");
9
8
  const basic_1 = __importDefault(require("../../Group/basic"));
10
9
  class PartnershipGroup extends basic_1.default {
@@ -17,38 +16,6 @@ class PartnershipGroup extends basic_1.default {
17
16
  get linkedBy() {
18
17
  return this.data.linkedBy;
19
18
  }
20
- /** @deprecated use customer */
21
- get upgradedAt() {
22
- return this.data.upgradedAt || null;
23
- }
24
- /** @deprecated use customer */
25
- get upgradedBy() {
26
- return this.data.upgradedBy || null;
27
- }
28
- /** @deprecated use customer */
29
- get upgradedMethod() {
30
- return this.data.upgradedMethod || null;
31
- }
32
- /** @deprecated use customer */
33
- get planId() {
34
- return this.data.planId || plans_1.PlansGroup.Piano;
35
- }
36
- /** @deprecated use customer */
37
- get planPeriod() {
38
- return this.data.planPeriod || null;
39
- }
40
- /** @deprecated use customer */
41
- get planDiscount() {
42
- return this.data.planDiscount || null;
43
- }
44
- /** @deprecated use customer */
45
- get planStripeId() {
46
- return this.data.planStripeId || null;
47
- }
48
- /** @deprecated use customer */
49
- get subscriptionStripeId() {
50
- return this.data.subscriptionStripeId || null;
51
- }
52
19
  get partnershipId() {
53
20
  return (0, get_1.default)(this.ref, ['parent', 'parent', 'id']);
54
21
  }
@@ -1,23 +1,6 @@
1
- import { PlanPeriod, PlansGroup } from '../../../helpers/plans';
2
1
  import { DocumentReference, Timestamp } from '../../../types/firestore';
3
2
  import { GroupBasicData } from '../../Group/types';
4
3
  export interface PartnershipGroupData extends GroupBasicData {
5
- /** @deprecated use customer */
6
- upgradedAt: Timestamp | null;
7
- /** @deprecated use customer */
8
- upgradedBy: DocumentReference | null;
9
- /** @deprecated use customer */
10
- upgradedMethod: string | null;
11
- /** @deprecated use customer */
12
- planId: PlansGroup;
13
- /** @deprecated use customer */
14
- planPeriod: PlanPeriod | null;
15
- /** @deprecated use customer */
16
- planDiscount: string | null;
17
- /** @deprecated use customer */
18
- planStripeId: string | null;
19
- /** @deprecated use customer */
20
- subscriptionStripeId: string | null;
21
4
  readonly linkedBy: DocumentReference;
22
5
  readonly linkedAt: Timestamp;
23
6
  }
@@ -15,17 +15,6 @@ export default class Partnership extends PartnershipBasic<PartnershipData> {
15
15
  get isDeleted(): boolean;
16
16
  get isActive(): boolean;
17
17
  get federationIds(): string[];
18
- /** @deprecated use customer */
19
- get gocardlessCustomerId(): string | null;
20
- /** @deprecated use customer */
21
- get stripeCustomerId(): string | null;
22
- /** @deprecated use customer */
23
- get stripeTaxIds(): {
24
- type: string;
25
- value: string;
26
- }[];
27
- /** @deprecated use customer */
28
- get howDidYouHearAboutUs(): string | null;
29
18
  get groupIds(): string[];
30
19
  get glissandooAdminUrl(): string;
31
20
  }
@@ -43,22 +43,6 @@ class Partnership extends basic_1.default {
43
43
  get federationIds() {
44
44
  return this.data.federationIds || [];
45
45
  }
46
- /** @deprecated use customer */
47
- get gocardlessCustomerId() {
48
- return this.data.gocardlessCustomerId || null;
49
- }
50
- /** @deprecated use customer */
51
- get stripeCustomerId() {
52
- return this.data.stripeCustomerId || null;
53
- }
54
- /** @deprecated use customer */
55
- get stripeTaxIds() {
56
- return this.data.stripeTaxIds || [];
57
- }
58
- /** @deprecated use customer */
59
- get howDidYouHearAboutUs() {
60
- return this.data.howDidYouHearAboutUs || null;
61
- }
62
46
  get groupIds() {
63
47
  return this.data.groupIds || [];
64
48
  }
@@ -35,17 +35,6 @@ export interface PartnershipData extends PartnershipBasicData {
35
35
  administratorsList: AdminItem[];
36
36
  deletedAt: Timestamp | null;
37
37
  federationIds: string[];
38
- /** @deprecated use customer */
39
- gocardlessCustomerId: string | null;
40
- /** @deprecated use customer */
41
- stripeCustomerId: string | null;
42
- /** @deprecated use customer */
43
- stripeTaxIds: {
44
- type: string;
45
- value: string;
46
- }[];
47
- /** @deprecated use customer */
48
- howDidYouHearAboutUs: string | null;
49
38
  readonly createdAt: Timestamp;
50
39
  readonly createdBy: DocumentReference;
51
40
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@glissandoo/lib",
3
- "version": "1.41.0",
3
+ "version": "1.43.0",
4
4
  "description": "Glissandoo library js",
5
5
  "main": "./index.js",
6
6
  "types": "./index.d.ts",