@glissandoo/lib 1.108.12 → 1.108.13

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.
@@ -6,6 +6,7 @@ export declare enum CollectionNames {
6
6
  Notification = "notification",
7
7
  User = "user",
8
8
  UserGroups = "groups",
9
+ UserPartnerships = "partnerships",
9
10
  UserNotifications = "notifications",
10
11
  UserOfferAlarms = "offerAlarms",
11
12
  Counters = "database",
@@ -10,6 +10,7 @@ var CollectionNames;
10
10
  CollectionNames["Notification"] = "notification";
11
11
  CollectionNames["User"] = "user";
12
12
  CollectionNames["UserGroups"] = "groups";
13
+ CollectionNames["UserPartnerships"] = "partnerships";
13
14
  CollectionNames["UserNotifications"] = "notifications";
14
15
  CollectionNames["UserOfferAlarms"] = "offerAlarms";
15
16
  CollectionNames["Counters"] = "database";
@@ -28,6 +28,7 @@ export declare enum HttpsErrorMessages {
28
28
  InvalidOffer = "error.offer.noValid",
29
29
  InvalidPartnership = "error.partnership.noValid",
30
30
  InvalidAdminPartnership = "error.partnership.noAdmin",
31
+ InvalidPartnershipLastAdmin = "error.partnership.lastAdmin",
31
32
  PartnershipSepaCreditorInfoMissing = "error.partnership.sepaCreditorInfoMissing",
32
33
  InvalidPartnershipPartner = "error.partnershipPartner.noValid",
33
34
  PartnershipPartnerNotSelf = "error.partnershipPartner.notSelf",
package/helpers/errors.js CHANGED
@@ -29,6 +29,7 @@ var HttpsErrorMessages;
29
29
  HttpsErrorMessages["InvalidOffer"] = "error.offer.noValid";
30
30
  HttpsErrorMessages["InvalidPartnership"] = "error.partnership.noValid";
31
31
  HttpsErrorMessages["InvalidAdminPartnership"] = "error.partnership.noAdmin";
32
+ HttpsErrorMessages["InvalidPartnershipLastAdmin"] = "error.partnership.lastAdmin";
32
33
  HttpsErrorMessages["PartnershipSepaCreditorInfoMissing"] = "error.partnership.sepaCreditorInfoMissing";
33
34
  HttpsErrorMessages["InvalidPartnershipPartner"] = "error.partnershipPartner.noValid";
34
35
  HttpsErrorMessages["PartnershipPartnerNotSelf"] = "error.partnershipPartner.notSelf";
@@ -21,5 +21,6 @@ export default class PartnershipPayment extends ModelWithLang<PartnershipPayment
21
21
  get createdBy(): string | null;
22
22
  get editedAt(): FirebaseFirestore.Timestamp | null;
23
23
  get editedBy(): string | null;
24
+ get receiptFilePath(): string | null;
24
25
  get isActive(): boolean;
25
26
  }
@@ -67,6 +67,9 @@ class PartnershipPayment extends lang_1.default {
67
67
  get editedBy() {
68
68
  return this.data.editedBy || null;
69
69
  }
70
+ get receiptFilePath() {
71
+ return this.data.receiptFilePath || null;
72
+ }
70
73
  get isActive() {
71
74
  return this.exists;
72
75
  }
@@ -28,4 +28,5 @@ export interface PartnershipPaymentData {
28
28
  createdBy: string | null;
29
29
  editedAt: Timestamp | null;
30
30
  editedBy: string | null;
31
+ receiptFilePath: string | null;
31
32
  }
@@ -23,6 +23,7 @@ export default class Partnership extends PartnershipBasic<PartnershipData> {
23
23
  get boardRoles(): string[];
24
24
  get boardMembers(): import("../../helpers/types").BoardMemberItem[];
25
25
  get boardDocuments(): import("../../helpers/types").BoardDocumentItem[];
26
+ get language(): import("../../lang").LanguagesTypes;
26
27
  get customFields(): Record<string, import("../Group/types").GroupCustomField>;
27
28
  get customFieldsList(): APartnershipCustomField[];
28
29
  }
@@ -5,6 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const collections_1 = require("../../helpers/collections");
7
7
  const glissandooAdmin_1 = require("../../helpers/glissandooAdmin");
8
+ const lang_1 = require("../../lang");
8
9
  const basic_1 = __importDefault(require("./basic"));
9
10
  class Partnership extends basic_1.default {
10
11
  get description() {
@@ -70,6 +71,9 @@ class Partnership extends basic_1.default {
70
71
  get boardDocuments() {
71
72
  return this.data.boardDocuments || [];
72
73
  }
74
+ get language() {
75
+ return this.data.language || lang_1.defaultLocale;
76
+ }
73
77
  get customFields() {
74
78
  return this.data.customFields || {};
75
79
  }
@@ -1,5 +1,6 @@
1
1
  import { DocumentReference, Timestamp } from '@google-cloud/firestore';
2
2
  import { AdminItem, BasicAddressData, BoardDocumentItem, BoardMemberItem } from '../../helpers/types';
3
+ import { LanguagesTypes } from '../../lang';
3
4
  import { AGroupCustomField, GroupCustomField } from '../Group/types';
4
5
  export type PartnershipCustomField = GroupCustomField;
5
6
  export type APartnershipCustomField = AGroupCustomField;
@@ -14,6 +15,8 @@ export interface PartnershipSepaCreditorInfo {
14
15
  creditorId: string;
15
16
  iban: string;
16
17
  swiftbic: string;
18
+ accountName?: string;
19
+ cif?: string;
17
20
  }
18
21
  export interface PartnershipTransferInfo {
19
22
  iban: string;
@@ -48,6 +51,7 @@ export interface PartnershipData extends PartnershipBasicData {
48
51
  boardRoles: string[];
49
52
  boardMembers: BoardMemberItem[];
50
53
  boardDocuments: BoardDocumentItem[];
54
+ language: LanguagesTypes;
51
55
  createdAt: Timestamp;
52
56
  createdBy: DocumentReference;
53
57
  editedAt: Timestamp | null;
@@ -0,0 +1,9 @@
1
+ import { DocumentModel } from '../../Model';
2
+ import PartnershipBasic from '../../Partnership/basic';
3
+ import { PartnershipRoles } from '../../Partnership/types';
4
+ import { UserPartnershipData } from './types';
5
+ export default class UserPartnership extends PartnershipBasic<UserPartnershipData> {
6
+ constructor(doc: DocumentModel);
7
+ get role(): PartnershipRoles;
8
+ get isAdmin(): boolean;
9
+ }
@@ -0,0 +1,19 @@
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("../../Partnership/basic"));
7
+ const types_1 = require("../../Partnership/types");
8
+ class UserPartnership extends basic_1.default {
9
+ constructor(doc) {
10
+ super(doc);
11
+ }
12
+ get role() {
13
+ return this.data.role;
14
+ }
15
+ get isAdmin() {
16
+ return this.data.role === types_1.PartnershipRoles.Admin;
17
+ }
18
+ }
19
+ exports.default = UserPartnership;
@@ -0,0 +1,4 @@
1
+ import { PartnershipBasicData, PartnershipRoles } from '../../Partnership/types';
2
+ export interface UserPartnershipData extends PartnershipBasicData {
3
+ role: PartnershipRoles;
4
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@glissandoo/lib",
3
- "version": "1.108.12",
3
+ "version": "1.108.13",
4
4
  "description": "Glissandoo library js",
5
5
  "main": "./index.js",
6
6
  "types": "./index.d.ts",