@merkaly/api 0.37.3 → 0.37.5
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/dist/finance/payment/payment.entity.d.ts +0 -1
- package/dist/finance/refund/refund.entity.d.ts +3 -0
- package/dist/finance/refund/refund.enum.d.ts +1 -0
- package/dist/finance/refund/refund.enum.js +1 -0
- package/dist/finance/withdrawal/withdrawal.entity.d.ts +2 -1
- package/dist/finance/withdrawal/withdrawal.enum.d.ts +4 -0
- package/dist/finance/withdrawal/withdrawal.enum.js +5 -0
- package/dist/integration/payment/account.d.ts +2 -0
- package/dist/order/sale/fulfillment.d.ts +10 -0
- package/package.json +1 -1
|
@@ -2,6 +2,7 @@ import { Schema as MongoSchema } from 'mongoose';
|
|
|
2
2
|
import { AbstractEntity } from '../../abstract.entity.js';
|
|
3
3
|
import { FinanceRefundOriginEnum, FinanceRefundStatusEnum } from './refund.enum.js';
|
|
4
4
|
import { FinancePaymentEntity } from '../payment';
|
|
5
|
+
import type { OrderPurchaseEntity } from '../../order/purchase';
|
|
5
6
|
export interface FinanceRefundPixDetails {
|
|
6
7
|
bankReference: string | null;
|
|
7
8
|
}
|
|
@@ -12,6 +13,7 @@ export declare class FinanceRefundGatewayEntity {
|
|
|
12
13
|
status?: string | null;
|
|
13
14
|
receiptUrl?: string | null;
|
|
14
15
|
details?: FinanceRefundGatewayDetails | null;
|
|
16
|
+
description?: string | null;
|
|
15
17
|
}
|
|
16
18
|
export declare const FinanceRefundGatewaySchema: MongoSchema<FinanceRefundGatewayEntity, import("mongoose").Model<FinanceRefundGatewayEntity, any, any, any, import("mongoose").Document<unknown, any, FinanceRefundGatewayEntity, any, {}> & FinanceRefundGatewayEntity & {
|
|
17
19
|
_id: import("mongoose").Types.ObjectId;
|
|
@@ -24,6 +26,7 @@ export declare const FinanceRefundGatewaySchema: MongoSchema<FinanceRefundGatewa
|
|
|
24
26
|
}>;
|
|
25
27
|
export declare class FinanceRefundEntity extends AbstractEntity {
|
|
26
28
|
payment: FinancePaymentEntity | string;
|
|
29
|
+
purchase?: OrderPurchaseEntity | string | null;
|
|
27
30
|
amount: number;
|
|
28
31
|
isPartial: boolean;
|
|
29
32
|
origin: FinanceRefundOriginEnum;
|
|
@@ -2,6 +2,7 @@ export var FinanceRefundOriginEnum;
|
|
|
2
2
|
(function (FinanceRefundOriginEnum) {
|
|
3
3
|
FinanceRefundOriginEnum["MERKALY"] = "MERKALY";
|
|
4
4
|
FinanceRefundOriginEnum["AUTOMATIC"] = "AUTOMATIC";
|
|
5
|
+
FinanceRefundOriginEnum["PURCHASE"] = "PURCHASE";
|
|
5
6
|
FinanceRefundOriginEnum["EXTERNAL"] = "EXTERNAL";
|
|
6
7
|
})(FinanceRefundOriginEnum || (FinanceRefundOriginEnum = {}));
|
|
7
8
|
export var FinanceRefundStatusEnum;
|
|
@@ -2,7 +2,7 @@ import { Schema as MongoSchema } from 'mongoose';
|
|
|
2
2
|
import { AccountUserEntity } from '../../account/user';
|
|
3
3
|
import { PaymentPixKeyTypeEnum } from '../../integration/payment';
|
|
4
4
|
import { AbstractEntity } from '../../abstract.entity.js';
|
|
5
|
-
import { FinanceWithdrawalStatusEnum } from './withdrawal.enum.js';
|
|
5
|
+
import { FinanceWithdrawalKindEnum, FinanceWithdrawalStatusEnum } from './withdrawal.enum.js';
|
|
6
6
|
export declare class FinanceWithdrawalHistoryEntity {
|
|
7
7
|
date: Date;
|
|
8
8
|
status: FinanceWithdrawalStatusEnum;
|
|
@@ -49,6 +49,7 @@ export declare class FinanceWithdrawalEntity extends AbstractEntity {
|
|
|
49
49
|
fee: number;
|
|
50
50
|
readonly netAmount: number;
|
|
51
51
|
status: FinanceWithdrawalStatusEnum;
|
|
52
|
+
kind: FinanceWithdrawalKindEnum;
|
|
52
53
|
history: FinanceWithdrawalHistoryEntity[];
|
|
53
54
|
error?: string | null;
|
|
54
55
|
requestedBy?: AccountUserEntity | string | null;
|
|
@@ -5,4 +5,8 @@ export declare enum FinanceWithdrawalStatusEnum {
|
|
|
5
5
|
FAILED = "FAILED",
|
|
6
6
|
CANCELLED = "CANCELLED"
|
|
7
7
|
}
|
|
8
|
+
export declare enum FinanceWithdrawalKindEnum {
|
|
9
|
+
WITHDRAWAL = "WITHDRAWAL",
|
|
10
|
+
DEBT = "DEBT"
|
|
11
|
+
}
|
|
8
12
|
export declare const FINANCE_WITHDRAWAL_OPEN_STATUSES: readonly FinanceWithdrawalStatusEnum[];
|
|
@@ -6,6 +6,11 @@ export var FinanceWithdrawalStatusEnum;
|
|
|
6
6
|
FinanceWithdrawalStatusEnum["FAILED"] = "FAILED";
|
|
7
7
|
FinanceWithdrawalStatusEnum["CANCELLED"] = "CANCELLED";
|
|
8
8
|
})(FinanceWithdrawalStatusEnum || (FinanceWithdrawalStatusEnum = {}));
|
|
9
|
+
export var FinanceWithdrawalKindEnum;
|
|
10
|
+
(function (FinanceWithdrawalKindEnum) {
|
|
11
|
+
FinanceWithdrawalKindEnum["WITHDRAWAL"] = "WITHDRAWAL";
|
|
12
|
+
FinanceWithdrawalKindEnum["DEBT"] = "DEBT";
|
|
13
|
+
})(FinanceWithdrawalKindEnum || (FinanceWithdrawalKindEnum = {}));
|
|
9
14
|
export const FINANCE_WITHDRAWAL_OPEN_STATUSES = [
|
|
10
15
|
FinanceWithdrawalStatusEnum.REQUESTED,
|
|
11
16
|
FinanceWithdrawalStatusEnum.PROCESSING,
|
|
@@ -60,6 +60,7 @@ export interface PaymentAccountBalance {
|
|
|
60
60
|
balance: number;
|
|
61
61
|
pending: PaymentAccountPending | null;
|
|
62
62
|
withdrawable: number;
|
|
63
|
+
withdrawableBeforeDebts: number;
|
|
63
64
|
retained: number;
|
|
64
65
|
debts: number;
|
|
65
66
|
reservedForRefunds: number;
|
|
@@ -74,6 +75,7 @@ export interface PaymentAccountTransfer {
|
|
|
74
75
|
amount: number;
|
|
75
76
|
fee: number;
|
|
76
77
|
netAmount: number;
|
|
78
|
+
debtsCollected: number;
|
|
77
79
|
status: string;
|
|
78
80
|
failReason: string | null;
|
|
79
81
|
createdAt: Date | null;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { FinancePaymentStatusEnum } from '../../finance/payment';
|
|
2
|
+
import type { FinanceRefundOriginEnum, FinanceRefundStatusEnum } from '../../finance/refund';
|
|
2
3
|
import type { LogisticsShipmentEntity } from '../../logistics/shipment';
|
|
3
4
|
import type { LogisticsBuyerShipment } from '../../logistics/shipment';
|
|
4
5
|
import type { OrderFulfillmentActionEnum, OrderSaleCostSourceEnum, OrderSaleHistoryEventEnum } from './fulfillment.enum.js';
|
|
@@ -31,6 +32,12 @@ export interface OrderSaleHistoryEntry {
|
|
|
31
32
|
status?: OrderPurchaseStatusEnum;
|
|
32
33
|
trackingNumber?: string;
|
|
33
34
|
}
|
|
35
|
+
export interface OrderSaleRefundSummary {
|
|
36
|
+
amount: number;
|
|
37
|
+
origin: FinanceRefundOriginEnum;
|
|
38
|
+
purchase: string | null;
|
|
39
|
+
status: FinanceRefundStatusEnum;
|
|
40
|
+
}
|
|
34
41
|
export interface OrderSaleSummary {
|
|
35
42
|
currency: string;
|
|
36
43
|
revenue: {
|
|
@@ -42,6 +49,9 @@ export interface OrderSaleSummary {
|
|
|
42
49
|
source: OrderSaleCostSourceEnum;
|
|
43
50
|
};
|
|
44
51
|
profit: number;
|
|
52
|
+
refunded: number;
|
|
53
|
+
refundFees: number;
|
|
54
|
+
refunds: OrderSaleRefundSummary[];
|
|
45
55
|
margin: number | null;
|
|
46
56
|
estimate: OrderSaleEstimate;
|
|
47
57
|
variance: number | null;
|