@glissandoo/lib 1.99.0 → 1.100.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.
@@ -0,0 +1,23 @@
1
+ export declare namespace PartnershipSubscriptionFbFunctionsTypes {
2
+ interface CreateData {
3
+ planId: string;
4
+ partnerId: string;
5
+ endDate: number | null;
6
+ }
7
+ interface CreateParams extends CreateData {
8
+ partnershipId: string;
9
+ subscriptionId: string;
10
+ }
11
+ type CreateResult = void;
12
+ interface EditParams {
13
+ partnershipId: string;
14
+ subscriptionId: string;
15
+ endDate: number | null;
16
+ }
17
+ type EditResult = void;
18
+ type RemoveParams = {
19
+ partnershipId: string;
20
+ subscriptionId: string;
21
+ };
22
+ type RemoveResult = void;
23
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -24,6 +24,7 @@ export declare enum HttpsErrorMessages {
24
24
  InvalidOffer = "error.offer.noValid",
25
25
  InvalidPartnership = "error.partnership.noValid",
26
26
  InvalidPartnershipPartner = "error.partner.noValid",
27
+ PartnershipPartnerNotSelf = "error.partner.notSelf",
27
28
  InvalidPartnershipPlan = "error.partnershipPlan.noValid",
28
29
  PartnershipPlanWithSubscriptions = "error.partnershipPlan.withSubscriptions",
29
30
  InvalidPartnershipSubscription = "error.partnershipSubscription.noValid",
package/helpers/errors.js CHANGED
@@ -25,6 +25,7 @@ var HttpsErrorMessages;
25
25
  HttpsErrorMessages["InvalidOffer"] = "error.offer.noValid";
26
26
  HttpsErrorMessages["InvalidPartnership"] = "error.partnership.noValid";
27
27
  HttpsErrorMessages["InvalidPartnershipPartner"] = "error.partner.noValid";
28
+ HttpsErrorMessages["PartnershipPartnerNotSelf"] = "error.partner.notSelf";
28
29
  HttpsErrorMessages["InvalidPartnershipPlan"] = "error.partnershipPlan.noValid";
29
30
  HttpsErrorMessages["PartnershipPlanWithSubscriptions"] = "error.partnershipPlan.withSubscriptions";
30
31
  HttpsErrorMessages["InvalidPartnershipSubscription"] = "error.partnershipSubscription.noValid";
@@ -1,9 +1,10 @@
1
1
  import Model from '../../Model';
2
- import { SubscriptionData } from './types';
3
- export default class PartnerSubscription extends Model<SubscriptionData> {
2
+ import { PartnershipSubscriptionData } from './types';
3
+ export default class PartnershipSubscription extends Model<PartnershipSubscriptionData> {
4
+ get partnershipId(): string;
4
5
  get planId(): string;
5
6
  get partnerId(): string;
6
- get partnershipId(): string;
7
+ get endDate(): FirebaseFirestore.Timestamp | null;
7
8
  get createdAt(): FirebaseFirestore.Timestamp;
8
9
  get createdBy(): string;
9
10
  get editedAt(): FirebaseFirestore.Timestamp | null;
@@ -5,15 +5,18 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const utils_1 = require("../../../helpers/utils");
7
7
  const Model_1 = __importDefault(require("../../Model"));
8
- class PartnerSubscription extends Model_1.default {
8
+ class PartnershipSubscription extends Model_1.default {
9
+ get partnershipId() {
10
+ return (0, utils_1.at)(this.ref.path.split('/'), 1) || '';
11
+ }
9
12
  get planId() {
10
13
  return this.data.planId;
11
14
  }
12
15
  get partnerId() {
13
16
  return this.data.partnerId;
14
17
  }
15
- get partnershipId() {
16
- return (0, utils_1.at)(this.ref.path.split('/'), 1) || '';
18
+ get endDate() {
19
+ return this.data.endDate || null;
17
20
  }
18
21
  get createdAt() {
19
22
  return this.data.createdAt;
@@ -40,4 +43,4 @@ class PartnerSubscription extends Model_1.default {
40
43
  return this.exists && !this.data.deletedAt;
41
44
  }
42
45
  }
43
- exports.default = PartnerSubscription;
46
+ exports.default = PartnershipSubscription;
@@ -1,5 +1,5 @@
1
1
  import { Timestamp } from '@google-cloud/firestore';
2
- export interface SubscriptionData {
2
+ export interface PartnershipSubscriptionData {
3
3
  planId: string;
4
4
  partnerId: string;
5
5
  endDate: Timestamp | null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@glissandoo/lib",
3
- "version": "1.99.0",
3
+ "version": "1.100.0",
4
4
  "description": "Glissandoo library js",
5
5
  "main": "./index.js",
6
6
  "types": "./index.d.ts",