@spytecgps/nova-orm 0.0.75 → 0.0.77

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,5 @@
1
+ import { BillingDeviceHistory } from '../../entities';
2
+ import { NovaDataSource } from '../../novaDataSource';
3
+ import { CreateBillingDeviceHistoryParams } from '../../types/billing';
4
+ import { Logger } from '../../types/logger';
5
+ export declare const createBillingDeviceHistory: (novaDataSource: NovaDataSource, params: CreateBillingDeviceHistoryParams, logger: Logger) => Promise<BillingDeviceHistory>;
@@ -0,0 +1,5 @@
1
+ import { BillingStatusHistoryBraintree } from '../../entities';
2
+ import { NovaDataSource } from '../../novaDataSource';
3
+ import { CreateBillingStatusHistoryBraintreeParams } from '../../types/billing';
4
+ import { Logger } from '../../types/logger';
5
+ export declare const createBillingStatusHistoryBraintree: (novaDataSource: NovaDataSource, params: CreateBillingStatusHistoryBraintreeParams, logger: Logger) => Promise<BillingStatusHistoryBraintree[]>;
@@ -0,0 +1,5 @@
1
+ import { BillingCustomerBraintree } from '../../entities';
2
+ import { NovaDataSource } from '../../novaDataSource';
3
+ import { GetBillingCustomerBraintreeByIdParams } from '../../types/billing';
4
+ import { Logger } from '../../types/logger';
5
+ export declare const getBillingCustomerBraintreeById: (novaDataSource: NovaDataSource, params: GetBillingCustomerBraintreeByIdParams, logger: Logger) => Promise<BillingCustomerBraintree>;
@@ -0,0 +1,4 @@
1
+ import { NovaDataSource } from '../../novaDataSource';
2
+ import { GetClientIdFromBraintreeCustomerParams } from '../../types/billing';
3
+ import { Logger } from '../../types/logger';
4
+ export declare const getClientIdFromBraintreeCustomer: (novaDataSource: NovaDataSource, params: GetClientIdFromBraintreeCustomerParams, logger: Logger) => Promise<number>;
@@ -1,5 +1,5 @@
1
- import { Billing } from '../../entities';
2
- import { CreateBillingParams, GetBillingsParams, UpdateBillingParams } from '../../types/billing';
1
+ import { Billing, BillingCustomerBraintree, BillingDeviceHistory, BillingStatusHistoryBraintree } from '../../entities';
2
+ import { CreateBillingDeviceHistoryParams, CreateBillingParams, CreateBillingStatusHistoryBraintreeParams, GetBillingCustomerBraintreeByIdParams, GetBillingsParams, GetClientIdFromBraintreeCustomerParams, UpdateBillingCustomerBraintreeParams, UpdateBillingParams, UpsertBillingCustomerBraintreeParams } from '../../types/billing';
3
3
  import { BaseRepository } from '../baseRepository';
4
4
  export declare class BillingRepository extends BaseRepository {
5
5
  /**
@@ -47,4 +47,69 @@ export declare class BillingRepository extends BaseRepository {
47
47
  * Whether the billing was updated or not
48
48
  */
49
49
  updateBilling(params: UpdateBillingParams): Promise<boolean>;
50
+ /**
51
+ * Get clientId from braintree customer
52
+ * @param {GetClientIdFromBraintreeCustomerParams} params containing information to get clientId from braintree customer
53
+ * - params.filters.customerId: The braintree customer id
54
+ * @returns The clientId
55
+ */
56
+ getClientIdFromBraintreeCustomer(params: GetClientIdFromBraintreeCustomerParams): Promise<number>;
57
+ /**
58
+ * Get billing customer braintree by id
59
+ * @param {GetBillingCustomerBraintreeByIdParams} params containing information to get billing customer braintree by id
60
+ * - params.filters.id: The billing customer braintree id
61
+ * @returns The billing customer braintree information
62
+ */
63
+ getBillingCustomerBraintreeById(params: GetBillingCustomerBraintreeByIdParams): Promise<BillingCustomerBraintree>;
64
+ /**
65
+ * Update billing customer braintree
66
+ * @param {UpdateBillingCustomerBraintreeParams} params containing information to update billing customer braintree
67
+ * - params.filters.id: The billing customer braintree id
68
+ * One of the following parameters is required:
69
+ * - params.values.firstName: The billing customer braintree firstName
70
+ * - params.values.lastName: The billing customer braintree lastName
71
+ * - params.values.company: The billing customer braintree company
72
+ * - params.values.email: The billing customer braintree email
73
+ * - params.values.phone: The billing customer braintree phone
74
+ * - params.values.churnStatus: The billing customer braintree churnStatus
75
+ * @returns Whether the billing customer braintree was updated or not
76
+ */
77
+ updateBillingCustomerBraintree(params: UpdateBillingCustomerBraintreeParams): Promise<boolean>;
78
+ /**
79
+ * Upsert billing customer braintree
80
+ * @param {UpsertBillingCustomerBraintreeParams} params containing information to upsert billing customer braintree
81
+ * If the billing customer braintree exists, it will be updated, otherwise it will be created.
82
+ * - params.id: The billing customer braintree id
83
+ * One of the following parameters is required:
84
+ * - params.firstName: The billing customer braintree firstName
85
+ * - params.lastName: The billing customer braintree lastName
86
+ * - params.company: The billing customer braintree company
87
+ * - params.email: The billing customer braintree email
88
+ * - params.phone: The billing customer braintree phone
89
+ * @returns The upserted billing customer braintree information
90
+ */
91
+ upsertBillingCustomerBraintree(params: UpsertBillingCustomerBraintreeParams): Promise<BillingCustomerBraintree>;
92
+ /**
93
+ * Create billing status history braintree
94
+ * @param {CreateBillingStatusHistoryBraintreeParams} params containing information to create billing status history braintree
95
+ * - params.subscriptionId: The subscriptionId, required
96
+ * - params.subscriptionHistories: The subscriptionHistories to create. At least one is required.
97
+ * @returns The created billing status history braintree information
98
+ */
99
+ createBillingStatusHistoryBraintree(params: CreateBillingStatusHistoryBraintreeParams): Promise<BillingStatusHistoryBraintree[]>;
100
+ /**
101
+ * Create billing device history
102
+ * @param {CreateBillingDeviceHistoryParams} params containing information to create billing device history
103
+ * One of the following parameters is required:
104
+ * - params.id: The billing device history id
105
+ * - params.deviceId: The deviceId
106
+ * - params.clientId: The clientId
107
+ * - params.subscriptionId: The subscriptionId
108
+ * - params.imei: The imei
109
+ * - params.planId: The planId
110
+ * - params.platform: The platform
111
+ * - params.status: The status
112
+ * @returns The created billing device history information
113
+ */
114
+ createBillingDeviceHistory(params: CreateBillingDeviceHistoryParams): Promise<BillingDeviceHistory>;
50
115
  }
@@ -0,0 +1,4 @@
1
+ import { NovaDataSource } from '../../novaDataSource';
2
+ import { UpdateBillingCustomerBraintreeParams } from '../../types/billing';
3
+ import { Logger } from '../../types/logger';
4
+ export declare const updateBillingCustomerBraintree: (novaDataSource: NovaDataSource, params: UpdateBillingCustomerBraintreeParams, logger: Logger) => Promise<boolean>;
@@ -0,0 +1,5 @@
1
+ import { BillingCustomerBraintree } from '../../entities';
2
+ import { NovaDataSource } from '../../novaDataSource';
3
+ import { UpsertBillingCustomerBraintreeParams } from '../../types/billing';
4
+ import { Logger } from '../../types/logger';
5
+ export declare const upsertBillingCustomerBraintree: (novaDataSource: NovaDataSource, params: UpsertBillingCustomerBraintreeParams, logger: Logger) => Promise<BillingCustomerBraintree>;
@@ -34,3 +34,56 @@ export interface UpdateBillingParams {
34
34
  clientId?: number;
35
35
  };
36
36
  }
37
+ export interface GetClientIdFromBraintreeCustomerParams {
38
+ filters: {
39
+ customerId: string;
40
+ };
41
+ }
42
+ export interface GetBillingCustomerBraintreeByIdParams {
43
+ filters: {
44
+ id: string;
45
+ };
46
+ }
47
+ export interface UpdateBillingCustomerBraintreeParams {
48
+ filters: {
49
+ id: string;
50
+ };
51
+ values: {
52
+ firstName?: string;
53
+ lastName?: string;
54
+ company?: string;
55
+ email?: string;
56
+ phone?: string;
57
+ churnStatus?: string;
58
+ };
59
+ }
60
+ export interface UpsertBillingCustomerBraintreeParams {
61
+ id: string;
62
+ firstName?: string;
63
+ lastName?: string;
64
+ company?: string;
65
+ email?: string;
66
+ phone?: string;
67
+ }
68
+ export interface CreateBillingStatusHistoryBraintreeParams {
69
+ subscriptionId: string;
70
+ subscriptionHistories: {
71
+ id?: number;
72
+ status?: string;
73
+ balance?: number;
74
+ price?: number;
75
+ currencyIsoCode?: string;
76
+ planId?: string;
77
+ timestamp?: string;
78
+ }[];
79
+ }
80
+ export interface CreateBillingDeviceHistoryParams {
81
+ id?: number;
82
+ clientId?: number;
83
+ deviceId?: number;
84
+ imei?: string;
85
+ planId?: string;
86
+ subscriptionId?: string;
87
+ platform?: string;
88
+ status?: string;
89
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spytecgps/nova-orm",
3
- "version": "0.0.75",
3
+ "version": "0.0.77",
4
4
  "description": "ORM with PlanetScale",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",