@longvansoftware/storefront-js-client 2.7.8 → 2.7.9
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/src/graphql/payment/mutations.d.ts +1 -0
- package/dist/src/graphql/payment/mutations.js +41 -1
- package/dist/src/lib/comhub/index.js +1 -1
- package/dist/src/lib/payment/index.d.ts +2 -0
- package/dist/src/lib/payment/index.js +27 -0
- package/dist/src/types/invoice.d.ts +12 -0
- package/dist/src/types/invoice.js +2 -0
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CREATE_PAYMENT_ORDER_MUTATION = void 0;
|
|
3
|
+
exports.REQUEST_UNPUBLISH_VAT_INVOICE = exports.CREATE_PAYMENT_ORDER_MUTATION = void 0;
|
|
4
4
|
const graphql_tag_1 = require("graphql-tag");
|
|
5
5
|
exports.CREATE_PAYMENT_ORDER_MUTATION = (0, graphql_tag_1.gql) `
|
|
6
6
|
mutation CreatePaymentOrder(
|
|
@@ -43,3 +43,43 @@ exports.CREATE_PAYMENT_ORDER_MUTATION = (0, graphql_tag_1.gql) `
|
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
45
|
`;
|
|
46
|
+
exports.REQUEST_UNPUBLISH_VAT_INVOICE = (0, graphql_tag_1.gql) `
|
|
47
|
+
mutation RequestUnpublishVatInvoice(
|
|
48
|
+
$partnerId: String!,
|
|
49
|
+
$sourceId: String!,
|
|
50
|
+
$sourceType: String!,
|
|
51
|
+
$signType: String,
|
|
52
|
+
$buyerName: String,
|
|
53
|
+
$buyerTaxCode: String,
|
|
54
|
+
$buyerCompany: String,
|
|
55
|
+
$buyerAddress: String,
|
|
56
|
+
$sendMail: Boolean,
|
|
57
|
+
$receiverName: String,
|
|
58
|
+
$receiverEmail: String,
|
|
59
|
+
$byUser: String!
|
|
60
|
+
) {
|
|
61
|
+
requestUnpublishVatInvoice(
|
|
62
|
+
vatInvoiceRequest: {
|
|
63
|
+
partnerId: $partnerId
|
|
64
|
+
sourceId: $sourceId
|
|
65
|
+
sourceType: $sourceType
|
|
66
|
+
signType: $signType
|
|
67
|
+
buyerName: $buyerName
|
|
68
|
+
buyerTaxCode: $buyerTaxCode
|
|
69
|
+
buyerCompany: $buyerCompany
|
|
70
|
+
buyerAddress: $buyerAddress
|
|
71
|
+
sendMail: $sendMail
|
|
72
|
+
receiverName: $receiverName
|
|
73
|
+
receiverEmail: $receiverEmail
|
|
74
|
+
}
|
|
75
|
+
byUser: $byUser
|
|
76
|
+
) {
|
|
77
|
+
code
|
|
78
|
+
message
|
|
79
|
+
invoiceId
|
|
80
|
+
sourceId
|
|
81
|
+
sourceType
|
|
82
|
+
previewLink
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
`;
|
|
@@ -17,7 +17,7 @@ class ComhubService extends serviceSDK_1.Service {
|
|
|
17
17
|
}
|
|
18
18
|
sendZns(dataTemplate, appId, messageType) {
|
|
19
19
|
return __awaiter(this, void 0, void 0, function* () {
|
|
20
|
-
const endpoint = `/web-hook/message/send/social/ZNS/app/${appId}/message-type/${messageType}`;
|
|
20
|
+
const endpoint = `/web-hook/message/v2/send/social/ZNS/app/${appId}/message-type/${messageType}`;
|
|
21
21
|
const method = "POST";
|
|
22
22
|
try {
|
|
23
23
|
const response = yield this.restApiCallWithNoHeader(endpoint, method, dataTemplate);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Service } from "../serviceSDK";
|
|
2
|
+
import { VatInvoiceRequestDTO } from "../../types/invoice";
|
|
2
3
|
export declare class PaymentService extends Service {
|
|
3
4
|
constructor(endpoint: string, orgId: string, storeId: string);
|
|
4
5
|
getPaymentMethod(): Promise<any>;
|
|
@@ -6,4 +7,5 @@ export declare class PaymentService extends Service {
|
|
|
6
7
|
genQRPayment(orderId: any, totalAmount: any): Promise<any>;
|
|
7
8
|
getPaymentMethodOfStoreChannel(): Promise<any>;
|
|
8
9
|
getInvoiceDetail(invoiceId: string): Promise<any>;
|
|
10
|
+
requestUnpublishVatInvoice(VatInvoiceRequest: VatInvoiceRequestDTO, byUser: string): Promise<any>;
|
|
9
11
|
}
|
|
@@ -96,5 +96,32 @@ class PaymentService extends serviceSDK_1.Service {
|
|
|
96
96
|
}
|
|
97
97
|
});
|
|
98
98
|
}
|
|
99
|
+
requestUnpublishVatInvoice(VatInvoiceRequest, byUser) {
|
|
100
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
101
|
+
const mutation = mutations_1.REQUEST_UNPUBLISH_VAT_INVOICE;
|
|
102
|
+
const { sourceId, sourceType, signType, buyerName, buyerTaxCode, buyerCompany, buyerAddress, sendMail, receiverName, receiverEmail, } = VatInvoiceRequest;
|
|
103
|
+
const variables = {
|
|
104
|
+
partnerId: this.orgId,
|
|
105
|
+
sourceId,
|
|
106
|
+
sourceType,
|
|
107
|
+
signType,
|
|
108
|
+
buyerName,
|
|
109
|
+
buyerTaxCode,
|
|
110
|
+
buyerCompany,
|
|
111
|
+
buyerAddress,
|
|
112
|
+
sendMail,
|
|
113
|
+
receiverName,
|
|
114
|
+
receiverEmail,
|
|
115
|
+
byUser,
|
|
116
|
+
};
|
|
117
|
+
try {
|
|
118
|
+
const response = yield this.graphqlMutationV3(mutation, variables);
|
|
119
|
+
return response.requestUnpublishVatInvoice;
|
|
120
|
+
}
|
|
121
|
+
catch (error) {
|
|
122
|
+
throw error;
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
}
|
|
99
126
|
}
|
|
100
127
|
exports.PaymentService = PaymentService;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface VatInvoiceRequestDTO {
|
|
2
|
+
sourceId: String;
|
|
3
|
+
sourceType: String;
|
|
4
|
+
signType: String;
|
|
5
|
+
buyerName: String;
|
|
6
|
+
buyerTaxCode: String;
|
|
7
|
+
buyerCompany: String;
|
|
8
|
+
buyerAddress: String;
|
|
9
|
+
sendMail: Boolean;
|
|
10
|
+
receiverName: String;
|
|
11
|
+
receiverEmail: String;
|
|
12
|
+
}
|