@glissandoo/lib 1.95.2 → 1.96.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.
Files changed (46) hide show
  1. package/functions/partnership.d.ts +24 -15
  2. package/functions/partnershipPartner.d.ts +4 -2
  3. package/helpers/collections.d.ts +5 -5
  4. package/helpers/collections.js +5 -5
  5. package/helpers/errors.d.ts +2 -1
  6. package/helpers/errors.js +1 -0
  7. package/helpers/types.d.ts +1 -0
  8. package/helpers/types.js +15 -1
  9. package/models/Customer/basic.js +2 -4
  10. package/models/Federation/index.js +2 -4
  11. package/models/Partnership/Partner/index.d.ts +17 -4
  12. package/models/Partnership/Partner/index.js +32 -13
  13. package/models/Partnership/Partner/types.d.ts +18 -11
  14. package/models/Partnership/Payment/index.d.ts +18 -11
  15. package/models/Partnership/Payment/index.js +39 -13
  16. package/models/Partnership/Payment/types.d.ts +22 -25
  17. package/models/Partnership/Payment/types.js +5 -8
  18. package/models/Partnership/Plan/index.d.ts +19 -7
  19. package/models/Partnership/Plan/index.js +61 -14
  20. package/models/Partnership/Plan/types.d.ts +11 -14
  21. package/models/Partnership/Plan/types.js +5 -8
  22. package/models/Partnership/SepaPaymentGroup/index.d.ts +12 -0
  23. package/models/Partnership/SepaPaymentGroup/index.js +34 -0
  24. package/models/Partnership/SepaPaymentGroup/types.d.ts +11 -0
  25. package/models/Partnership/Subscription/index.d.ts +9 -13
  26. package/models/Partnership/Subscription/index.js +18 -31
  27. package/models/Partnership/Subscription/types.d.ts +9 -18
  28. package/models/Partnership/Subscription/types.js +0 -7
  29. package/models/Partnership/basic.d.ts +1 -2
  30. package/models/Partnership/basic.js +2 -7
  31. package/models/Partnership/index.d.ts +2 -3
  32. package/models/Partnership/index.js +4 -4
  33. package/models/Partnership/types.d.ts +11 -3
  34. package/package.json +1 -1
  35. package/functions/partner.d.ts +0 -64
  36. package/helpers/payments.d.ts +0 -2
  37. package/helpers/payments.js +0 -9
  38. package/models/Partnership/Partner/basic.d.ts +0 -13
  39. package/models/Partnership/Partner/basic.js +0 -39
  40. package/models/Partnership/Partner/tiny.d.ts +0 -7
  41. package/models/Partnership/Partner/tiny.js +0 -21
  42. package/models/Partnership/Payment/basic.d.ts +0 -16
  43. package/models/Partnership/Payment/basic.js +0 -53
  44. package/models/Partnership/Plan/basic.d.ts +0 -18
  45. package/models/Partnership/Plan/basic.js +0 -65
  46. /package/{functions/partner.js → models/Partnership/SepaPaymentGroup/types.js} +0 -0
@@ -3,15 +3,71 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
+ const date_fns_1 = require("date-fns");
6
7
  const utils_1 = require("../../../helpers/utils");
7
- const basic_1 = __importDefault(require("./basic"));
8
- class PartnershipPlan extends basic_1.default {
9
- constructor(doc) {
10
- super(doc);
11
- }
8
+ const lang_1 = __importDefault(require("../../Model/lang"));
9
+ const isNumber_1 = __importDefault(require("lodash/isNumber"));
10
+ class PartnershipPlan extends lang_1.default {
12
11
  get partnershipId() {
13
12
  return (0, utils_1.at)(this.ref.path.split('/'), 1) || '';
14
13
  }
14
+ setPaymentDay(date) {
15
+ return this.isPaymentDayEndOfMonth
16
+ ? (0, date_fns_1.endOfMonth)(date)
17
+ : (0, date_fns_1.setDate)(date, this.schedule.paymentDay);
18
+ }
19
+ setPaymentMonth(date) {
20
+ return (0, isNumber_1.default)(this.schedule.paymentMonth) && this.isAnnuallySchedule
21
+ ? (0, date_fns_1.setMonth)(date, this.schedule.paymentMonth)
22
+ : date;
23
+ }
24
+ setPaymentDate(date) {
25
+ return this.setPaymentMonth(this.setPaymentDay(date));
26
+ }
27
+ getNextPaymentDate(base) {
28
+ const newDate = (0, date_fns_1.addMonths)(base, this.schedule.periodInMonths);
29
+ return this.setPaymentDate(newDate);
30
+ }
31
+ getFirstPaymentDate() {
32
+ const newDate = this.setPaymentDate(new Date());
33
+ return (0, date_fns_1.isPast)(newDate) ? (0, date_fns_1.addMonths)(newDate, this.isAnnuallySchedule ? 12 : 1) : newDate;
34
+ }
35
+ get name() {
36
+ return this.data.name;
37
+ }
38
+ get description() {
39
+ return this.data.description;
40
+ }
41
+ get price() {
42
+ return this.data.price;
43
+ }
44
+ get displayPrice() {
45
+ return `${this.price} €`;
46
+ }
47
+ get schedule() {
48
+ return this.data.schedule;
49
+ }
50
+ get paymentMethod() {
51
+ return this.data.paymentMethod;
52
+ }
53
+ get isAnnuallySchedule() {
54
+ return this.schedule.periodInMonths === 12;
55
+ }
56
+ get isPaymentDayEndOfMonth() {
57
+ return this.schedule.paymentDay === -1;
58
+ }
59
+ get createdAt() {
60
+ return this.data.createdAt;
61
+ }
62
+ get createdBy() {
63
+ return this.data.createdBy;
64
+ }
65
+ get editedAt() {
66
+ return this.data.editedAt || null;
67
+ }
68
+ get editedBy() {
69
+ return this.data.editedBy || null;
70
+ }
15
71
  get deletedAt() {
16
72
  return this.data.deletedAt || null;
17
73
  }
@@ -24,14 +80,5 @@ class PartnershipPlan extends basic_1.default {
24
80
  get isActive() {
25
81
  return this.exists && !this.isDeleted;
26
82
  }
27
- get subscriptionsCount() {
28
- return this.data.subscriptionsCount || 0;
29
- }
30
- get createdAt() {
31
- return this.data.createdAt;
32
- }
33
- get createdBy() {
34
- return this.data.createdBy;
35
- }
36
83
  }
37
84
  exports.default = PartnershipPlan;
@@ -1,25 +1,22 @@
1
1
  import { Timestamp } from '@google-cloud/firestore';
2
- export declare enum PlanSchedulePeriod {
3
- Monthly = 1,
4
- Quarterly = 3,
5
- SemiAnnually = 6,
6
- Annually = 12
2
+ export declare enum PaymentMethod {
3
+ SEPA = "SEPA"
7
4
  }
8
5
  export interface PlanScheduleType {
9
- period: PlanSchedulePeriod;
6
+ periodInMonths: number;
10
7
  paymentDay: number;
11
8
  paymentMonth: number | null;
12
9
  }
13
- export interface PartnershipPlanBasicData {
10
+ export interface PartnershipPlanData {
14
11
  name: string;
15
- readonly price: number;
16
12
  description: string;
17
- readonly schedule: PlanScheduleType;
18
- }
19
- export interface PartnershipPlanData extends PartnershipPlanBasicData {
13
+ price: number;
14
+ schedule: PlanScheduleType;
15
+ paymentMethod: PaymentMethod;
16
+ createdAt: Timestamp;
17
+ createdBy: string;
18
+ editedAt: Timestamp | null;
19
+ editedBy: string | null;
20
20
  deletedAt: Timestamp | null;
21
21
  deletedBy: string | null;
22
- subscriptionsCount: number;
23
- readonly createdAt: Timestamp;
24
- readonly createdBy: string;
25
22
  }
@@ -1,10 +1,7 @@
1
1
  "use strict";
2
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 = {}));
3
+ exports.PaymentMethod = void 0;
4
+ var PaymentMethod;
5
+ (function (PaymentMethod) {
6
+ PaymentMethod["SEPA"] = "SEPA";
7
+ })(PaymentMethod = exports.PaymentMethod || (exports.PaymentMethod = {}));
@@ -0,0 +1,12 @@
1
+ import ModelWithLang from '../../Model/lang';
2
+ import { SepaPaymentGroupData } from './types';
3
+ export default class PartnerSepaPaymentGroup extends ModelWithLang<SepaPaymentGroupData> {
4
+ get partnershipId(): string;
5
+ get creditorInfo(): import("../types").PartnershipSepaCreditorInfo;
6
+ get filePath(): string | null;
7
+ get paymentsIds(): string[];
8
+ get createdAt(): import("../../../types/firestore").Timestamp;
9
+ get createdBy(): string;
10
+ get editedAt(): import("../../../types/firestore").Timestamp | null;
11
+ get editedBy(): string | null;
12
+ }
@@ -0,0 +1,34 @@
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 utils_1 = require("../../../helpers/utils");
7
+ const lang_1 = __importDefault(require("../../Model/lang"));
8
+ class PartnerSepaPaymentGroup extends lang_1.default {
9
+ get partnershipId() {
10
+ return (0, utils_1.at)(this.ref.path.split('/'), 1) || '';
11
+ }
12
+ get creditorInfo() {
13
+ return this.data.creditorInfo;
14
+ }
15
+ get filePath() {
16
+ return this.data.filePath || null;
17
+ }
18
+ get paymentsIds() {
19
+ return this.data.paymentsIds || [];
20
+ }
21
+ get createdAt() {
22
+ return this.data.createdAt;
23
+ }
24
+ get createdBy() {
25
+ return this.data.createdBy;
26
+ }
27
+ get editedAt() {
28
+ return this.data.editedAt || null;
29
+ }
30
+ get editedBy() {
31
+ return this.data.editedBy || null;
32
+ }
33
+ }
34
+ exports.default = PartnerSepaPaymentGroup;
@@ -0,0 +1,11 @@
1
+ import { Timestamp } from '../../../types/firestore';
2
+ import { PartnershipSepaCreditorInfo } from '../types';
3
+ export interface SepaPaymentGroupData {
4
+ creditorInfo: PartnershipSepaCreditorInfo;
5
+ filePath: string | null;
6
+ createdAt: Timestamp;
7
+ createdBy: string;
8
+ paymentsIds: string[];
9
+ editedAt: Timestamp | null;
10
+ editedBy: string | null;
11
+ }
@@ -1,19 +1,15 @@
1
- import { DocumentModel } from '../../Model';
2
- import PartnershipPlanBasic from '../Plan/basic';
3
- import { SubscriptionData, SubscriptionStatus } from './types';
4
- export default class PartnerSubscription extends PartnershipPlanBasic<SubscriptionData> {
5
- constructor(doc: DocumentModel);
1
+ import Model from '../../Model';
2
+ import { SubscriptionData } from './types';
3
+ export default class PartnerSubscription extends Model<SubscriptionData> {
6
4
  get planId(): string;
7
5
  get partnerId(): string;
8
6
  get partnershipId(): string;
9
- get status(): SubscriptionStatus;
10
- get lastPayment(): import("./types").LastPaymentType | null;
11
- get hasPayments(): boolean;
12
- get isLastPaymentAnError(): boolean;
13
- get paymentDate(): FirebaseFirestore.Timestamp;
14
7
  get createdAt(): FirebaseFirestore.Timestamp;
15
- get createdBy(): FirebaseFirestore.DocumentReference<FirebaseFirestore.DocumentData, FirebaseFirestore.DocumentData>;
16
- get isStatusActive(): boolean;
8
+ get createdBy(): string;
9
+ get editedAt(): FirebaseFirestore.Timestamp | null;
10
+ get editedBy(): string | null;
11
+ get deletedAt(): FirebaseFirestore.Timestamp | null;
12
+ get deletedBy(): string | null;
13
+ get isDeleted(): boolean;
17
14
  get isActive(): boolean;
18
- get isAllowPayment(): boolean;
19
15
  }
@@ -3,54 +3,41 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- const payments_1 = require("../../../helpers/payments");
7
6
  const utils_1 = require("../../../helpers/utils");
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
- }
7
+ const Model_1 = __importDefault(require("../../Model"));
8
+ class PartnerSubscription extends Model_1.default {
14
9
  get planId() {
15
10
  return this.data.planId;
16
11
  }
17
12
  get partnerId() {
18
- return (0, utils_1.at)(this.ref.path.split('/'), 3) || '';
13
+ return this.data.partnerId;
19
14
  }
20
15
  get partnershipId() {
21
16
  return (0, utils_1.at)(this.ref.path.split('/'), 1) || '';
22
17
  }
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
18
  get createdAt() {
41
19
  return this.data.createdAt;
42
20
  }
43
21
  get createdBy() {
44
22
  return this.data.createdBy;
45
23
  }
46
- get isStatusActive() {
47
- return this.status === types_1.SubscriptionStatus.Active;
24
+ get editedAt() {
25
+ return this.data.editedAt || null;
48
26
  }
49
- get isActive() {
50
- return this.exists;
27
+ get editedBy() {
28
+ return this.data.editedBy || null;
29
+ }
30
+ get deletedAt() {
31
+ return this.data.deletedAt || null;
32
+ }
33
+ get deletedBy() {
34
+ return this.data.deletedBy || null;
51
35
  }
52
- get isAllowPayment() {
53
- return this.isActive && this.isStatusActive;
36
+ get isDeleted() {
37
+ return this.deletedAt !== null;
38
+ }
39
+ get isActive() {
40
+ return this.exists && !this.data.deletedAt;
54
41
  }
55
42
  }
56
43
  exports.default = PartnerSubscription;
@@ -1,21 +1,12 @@
1
- import { DocumentReference, Timestamp } from '@google-cloud/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;
1
+ import { Timestamp } from '@google-cloud/firestore';
2
+ export interface SubscriptionData {
18
3
  planId: string;
19
- createdBy: DocumentReference;
4
+ partnerId: string;
5
+ endDate: Timestamp | null;
20
6
  createdAt: Timestamp;
7
+ createdBy: string;
8
+ editedAt: Timestamp | null;
9
+ editedBy: string | null;
10
+ deletedAt: Timestamp | null;
11
+ deletedBy: string | null;
21
12
  }
@@ -1,9 +1,2 @@
1
1
  "use strict";
2
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,7 +1,6 @@
1
- import Model, { DocumentModel } from '../Model';
1
+ import Model from '../Model';
2
2
  import { PartnershipBasicData } from './types';
3
3
  export default class PartnershipBasic<D> extends Model<D & PartnershipBasicData> {
4
- constructor(doc: DocumentModel);
5
4
  get basicInfo(): PartnershipBasicData;
6
5
  get displayName(): string;
7
6
  get photoURL(): string;
@@ -3,12 +3,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- const lodash_1 = require("lodash");
6
+ const types_1 = require("../../helpers/types");
7
7
  const Model_1 = __importDefault(require("../Model"));
8
8
  class PartnershipBasic extends Model_1.default {
9
- constructor(doc) {
10
- super(doc);
11
- }
12
9
  get basicInfo() {
13
10
  return {
14
11
  displayName: this.displayName,
@@ -39,9 +36,7 @@ class PartnershipBasic extends Model_1.default {
39
36
  return this.data.address || {};
40
37
  }
41
38
  get displayAddress() {
42
- const { street, city, postalCode, province, country } = this.address;
43
- const fields = [street, postalCode, city, province, country];
44
- return fields.filter((field) => (0, lodash_1.isString)(field)).join(', ');
39
+ return (0, types_1.displayBasicAddress)(this.address);
45
40
  }
46
41
  get phone() {
47
42
  return this.data.phone;
@@ -1,10 +1,8 @@
1
1
  import { AdminItemStatus } from '../../helpers/types';
2
- import { DocumentModel } from '../Model';
3
2
  import PartnershipBasic from './basic';
4
3
  import { PartnershipData } from './types';
5
4
  export default class Partnership extends PartnershipBasic<PartnershipData> {
6
- constructor(doc: DocumentModel);
7
- get description(): string;
5
+ get description(): string | null;
8
6
  get admins(): string[];
9
7
  get adminList(): import("../../helpers/types").AdminItem[];
10
8
  adminListByStatus(status: AdminItemStatus): import("../../helpers/types").AdminItem[];
@@ -17,5 +15,6 @@ export default class Partnership extends PartnershipBasic<PartnershipData> {
17
15
  get isActive(): boolean;
18
16
  get federationIds(): string[];
19
17
  get groupIds(): string[];
18
+ get sepaCreditorInfo(): import("./types").PartnershipSepaCreditorInfo | null;
20
19
  get glissandooAdminUrl(): string;
21
20
  }
@@ -7,11 +7,8 @@ const collections_1 = require("../../helpers/collections");
7
7
  const glissandooAdmin_1 = require("../../helpers/glissandooAdmin");
8
8
  const basic_1 = __importDefault(require("./basic"));
9
9
  class Partnership extends basic_1.default {
10
- constructor(doc) {
11
- super(doc);
12
- }
13
10
  get description() {
14
- return this.data.description;
11
+ return this.data.description || null;
15
12
  }
16
13
  get admins() {
17
14
  return this.data.administrators || [];
@@ -49,6 +46,9 @@ class Partnership extends basic_1.default {
49
46
  get groupIds() {
50
47
  return this.data.groupIds || [];
51
48
  }
49
+ get sepaCreditorInfo() {
50
+ return this.data.sepaCreditorInfo || null;
51
+ }
52
52
  get glissandooAdminUrl() {
53
53
  return (0, glissandooAdmin_1.getGlissandooAdminEntityURL)(collections_1.CollectionNames.Partnership, this.id);
54
54
  }
@@ -6,6 +6,13 @@ export declare enum PartnershipRoles {
6
6
  export interface PartnershipAlgoliaData extends Pick<PartnershipData, 'displayName' | 'photoURL' | 'partnerCount'> {
7
7
  createdAt: number;
8
8
  }
9
+ export interface PartnershipSepaCreditorInfo {
10
+ creditorId: string;
11
+ legalName: string;
12
+ address: string;
13
+ iban: string;
14
+ swiftbic: string;
15
+ }
9
16
  export interface PartnershipBasicData {
10
17
  displayName: string;
11
18
  photoURL: string;
@@ -19,12 +26,13 @@ export interface PartnershipBasicData {
19
26
  website: string | null;
20
27
  }
21
28
  export interface PartnershipData extends PartnershipBasicData {
22
- description: string;
29
+ sepaCreditorInfo: PartnershipSepaCreditorInfo | null;
30
+ description: string | null;
23
31
  administrators: string[];
24
32
  administratorsList: AdminItem[];
25
33
  deletedAt: Timestamp | null;
26
34
  deletedBy: string | null;
27
35
  federationIds: string[];
28
- readonly createdAt: Timestamp;
29
- readonly createdBy: DocumentReference;
36
+ createdAt: Timestamp;
37
+ createdBy: DocumentReference;
30
38
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@glissandoo/lib",
3
- "version": "1.95.2",
3
+ "version": "1.96.0",
4
4
  "description": "Glissandoo library js",
5
5
  "main": "./index.js",
6
6
  "types": "./index.d.ts",
@@ -1,64 +0,0 @@
1
- import { PartnershipPartnerData } from '../models/Partnership/Partner/types';
2
- import { BasicAddressData } from '../helpers/types';
3
- import PartnerSubscription from '../models/Partnership/Subscription';
4
- import { PartnershipData } from '../models/Partnership/types';
5
- export declare namespace PartnerFbFunctionsTypes {
6
- interface CreateParams {
7
- partnershipId: string;
8
- name: string;
9
- lastname: string;
10
- email: string;
11
- phone: string | null;
12
- birthdate: number | null;
13
- address: BasicAddressData | null;
14
- }
15
- type CreateResult = void;
16
- type EditParams = CreateParams & {
17
- partnerId: string;
18
- };
19
- type EditResult = void;
20
- interface RemoveParams {
21
- partnerId: string;
22
- partnershipId: string;
23
- }
24
- type RemoveResult = void;
25
- interface ValidateParams {
26
- partnershipId: string;
27
- partnerId: string;
28
- name: string;
29
- lastname: string;
30
- email: string;
31
- iban: string;
32
- phone: string | null;
33
- birthdate: number | null;
34
- address: Required<BasicAddressData> | null;
35
- }
36
- type ValidateResult = void;
37
- interface GetByTokenParams {
38
- token: string;
39
- }
40
- interface GetByTokenResult {
41
- partner: Pick<PartnershipPartnerData, 'name' | 'lastname' | 'email' | 'phone' | 'address'> & {
42
- id: string;
43
- birthdate: number | null;
44
- };
45
- partnership: Pick<PartnershipData, 'displayName' | 'photoURL' | 'email' | 'phone'> & {
46
- id: string;
47
- address: string;
48
- };
49
- subscriptions: Array<Pick<PartnerSubscription, 'name' | 'displayPrice' | 'schedule' | 'id'> & {
50
- paymentDate: number;
51
- }>;
52
- }
53
- interface ValidateIBANParams {
54
- iban: string;
55
- }
56
- interface ValidateIBANResult {
57
- valid: boolean;
58
- }
59
- interface SendVerificationParams {
60
- partnerId: string;
61
- partnershipId: string;
62
- }
63
- type SendVerificationResult = void;
64
- }
@@ -1,2 +0,0 @@
1
- import { PaymentStatus } from '../models/Partnership/Payment/types';
2
- export declare const paymentStatusErrors: PaymentStatus[];
@@ -1,9 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.paymentStatusErrors = void 0;
4
- const types_1 = require("../models/Partnership/Payment/types");
5
- exports.paymentStatusErrors = [
6
- types_1.PaymentStatus.Error,
7
- types_1.PaymentStatus.Chargeback,
8
- types_1.PaymentStatus.Canceled,
9
- ];
@@ -1,13 +0,0 @@
1
- import { DocumentModel } from '../../Model';
2
- import PartnershipPartnerTiny from './tiny';
3
- import { PartnershipPartnerBasicData } from './types';
4
- export default class PartnershipPartnerBasic<D> extends PartnershipPartnerTiny<D & PartnershipPartnerBasicData> {
5
- constructor(doc: DocumentModel);
6
- get basicInfo(): PartnershipPartnerBasicData;
7
- get createdAt(): FirebaseFirestore.Timestamp;
8
- get createdBy(): import("../../../types/firestore").DocumentReference<import("../../../types/firestore").DocumentData>;
9
- get deletedAt(): FirebaseFirestore.Timestamp | null;
10
- get deletedBy(): string | null;
11
- get isDeleted(): boolean;
12
- get isActive(): boolean;
13
- }
@@ -1,39 +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 tiny_1 = __importDefault(require("./tiny"));
7
- class PartnershipPartnerBasic extends tiny_1.default {
8
- constructor(doc) {
9
- super(doc);
10
- }
11
- get basicInfo() {
12
- return {
13
- ...this.tinyInfo,
14
- deletedAt: this.deletedAt,
15
- deletedBy: this.deletedBy,
16
- createdAt: this.createdAt,
17
- createdBy: this.createdBy,
18
- };
19
- }
20
- get createdAt() {
21
- return this.data.createdAt;
22
- }
23
- get createdBy() {
24
- return this.data.createdBy;
25
- }
26
- get deletedAt() {
27
- return this.data.deletedAt || null;
28
- }
29
- get deletedBy() {
30
- return this.data.deletedBy || null;
31
- }
32
- get isDeleted() {
33
- return this.deletedAt !== null;
34
- }
35
- get isActive() {
36
- return this.exists && !this.isDeleted;
37
- }
38
- }
39
- exports.default = PartnershipPartnerBasic;
@@ -1,7 +0,0 @@
1
- import Model from '../../Model';
2
- import { PartnershipPartnerTinyData } from './types';
3
- export default class PartnershipPartnerTiny<D> extends Model<D & PartnershipPartnerTinyData> {
4
- get tinyInfo(): PartnershipPartnerTinyData;
5
- get photoURL(): string | null;
6
- get displayName(): string;
7
- }
@@ -1,21 +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 Model_1 = __importDefault(require("../../Model"));
7
- class PartnershipPartnerTiny extends Model_1.default {
8
- get tinyInfo() {
9
- return {
10
- displayName: this.displayName,
11
- photoURL: this.photoURL,
12
- };
13
- }
14
- get photoURL() {
15
- return this.data.photoURL || null;
16
- }
17
- get displayName() {
18
- return this.data.displayName;
19
- }
20
- }
21
- exports.default = PartnershipPartnerTiny;
@@ -1,16 +0,0 @@
1
- import Model, { DocumentModel } from '../../Model';
2
- import { PaymentBasicData, PaymentType } from './types';
3
- export default class PaymentBasic<D> extends Model<D & PaymentBasicData> {
4
- constructor(doc: DocumentModel);
5
- get basicInfo(): PaymentBasicData;
6
- get title(): string;
7
- get amount(): number;
8
- get displayAmount(): string;
9
- get lastAction(): import("./types").PaymentHistory;
10
- get lastActionStatus(): import("./types").PaymentStatus;
11
- get lastActionAt(): Date;
12
- get type(): PaymentType;
13
- get isRecurrent(): boolean;
14
- get isOneTime(): boolean;
15
- get createdAt(): FirebaseFirestore.Timestamp;
16
- }