@blocklet/payment-types 1.13.151 → 1.13.152

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.
package/lib/customer.d.ts CHANGED
@@ -117,6 +117,12 @@ export declare class Customer extends Model<InferAttributes<Customer>, InferCrea
117
117
  };
118
118
  };
119
119
  getInvoiceNumber(): Promise<string>;
120
+ getSummary(): Promise<{
121
+ paid: any;
122
+ due: any;
123
+ refunded: any;
124
+ }>;
125
+ canMakeNewPurchase(excludedInvoiceId?: string): Promise<boolean>;
120
126
  getBalanceToApply(currencyId: string, amount: string): string;
121
127
  decreaseTokenBalance(currencyId: string, amount: string, dryRun?: boolean): Promise<{
122
128
  starting: Record<string, string>;
package/lib/invoice.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { CreationOptional, DataTypes, InferAttributes, InferCreationAttributes, Model } from 'sequelize';
2
2
  import type { LiteralUnion } from 'type-fest';
3
- import type { CustomerAddress, CustomerShipping, DiscountAmount, PaymentError, PaymentSettings, SimpleCustomField } from './types';
3
+ import type { CustomerAddress, CustomerShipping, DiscountAmount, GroupedBN, PaymentError, PaymentSettings, SimpleCustomField } from './types';
4
4
  export declare const nextInvoiceId: (size?: number | undefined) => string;
5
5
  export declare class Invoice extends Model<InferAttributes<Invoice>, InferCreationAttributes<Invoice>> {
6
6
  id: CreationOptional<string>;
@@ -352,5 +352,6 @@ export declare class Invoice extends Model<InferAttributes<Invoice>, InferCreati
352
352
  static initialize(sequelize: any): void;
353
353
  static associate(models: any): void;
354
354
  isImmutable(): boolean;
355
+ static getUncollectibleAmountByCustomer(customerId: string, excludedInvoiceId?: string): Promise<GroupedBN>;
355
356
  }
356
357
  export type TInvoice = InferAttributes<Invoice>;
@@ -1,6 +1,6 @@
1
1
  import { CreationOptional, DataTypes, InferAttributes, InferCreationAttributes, Model } from 'sequelize';
2
2
  import type { LiteralUnion } from 'type-fest';
3
- import type { PaymentDetails, PaymentError } from './types';
3
+ import type { GroupedBN, PaymentDetails, PaymentError } from './types';
4
4
  export declare const nextPaymentIntentId: (size?: number | undefined) => string;
5
5
  export declare class PaymentIntent extends Model<InferAttributes<PaymentIntent>, InferCreationAttributes<PaymentIntent>> {
6
6
  id: CreationOptional<string>;
@@ -154,5 +154,6 @@ export declare class PaymentIntent extends Model<InferAttributes<PaymentIntent>,
154
154
  static initialize(sequelize: any): void;
155
155
  static associate(models: any): void;
156
156
  isImmutable(): boolean;
157
+ static getPaidAmountByCustomer(customerId: string): Promise<GroupedBN>;
157
158
  }
158
159
  export type TPaymentIntent = InferAttributes<PaymentIntent>;
package/lib/refund.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { CreationOptional, DataTypes, InferAttributes, InferCreationAttributes, Model } from 'sequelize';
2
2
  import type { LiteralUnion } from 'type-fest';
3
- import type { PaymentDetails, PaymentError } from './types';
3
+ import type { GroupedBN, PaymentDetails, PaymentError } from './types';
4
4
  export declare const nextRefundId: (size?: number | undefined) => string;
5
5
  export declare class Refund extends Model<InferAttributes<Refund>, InferCreationAttributes<Refund>> {
6
6
  id: CreationOptional<string>;
@@ -133,5 +133,6 @@ export declare class Refund extends Model<InferAttributes<Refund>, InferCreation
133
133
  static initialize(sequelize: any): void;
134
134
  static associate(models: any): void;
135
135
  isImmutable(): boolean;
136
+ static getRefundAmountByCustomer(customerId: string, status?: string): Promise<GroupedBN>;
136
137
  }
137
138
  export type TRefund = InferAttributes<Refund>;
package/lib/types.d.ts CHANGED
@@ -1,4 +1,7 @@
1
1
  import type { LiteralUnion } from 'type-fest';
2
+ export type GroupedBN = {
3
+ [currencyId: string]: string;
4
+ };
2
5
  export type Pagination<T = any> = T & {
3
6
  page?: number;
4
7
  pageSize?: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blocklet/payment-types",
3
- "version": "1.13.151",
3
+ "version": "1.13.152",
4
4
  "description": "Typings for Payment Kit SDK",
5
5
  "keywords": [
6
6
  "types",
@@ -48,5 +48,5 @@
48
48
  "sequelize": "^6.36.0",
49
49
  "type-fest": "^4.10.2"
50
50
  },
51
- "gitHead": "1697697b65f9372e868fb10d5766edb3144f44f8"
51
+ "gitHead": "5d6d2b6a8c0422e1055ddcec4e3179fd734cdbc5"
52
52
  }