@longvansoftware/storefront-js-client 2.8.2 → 2.8.4

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.
@@ -2,3 +2,5 @@ export declare const GET_PAYMENT_METHOD: import("graphql").DocumentNode;
2
2
  export declare const GEN_QR_PAYMENT: import("graphql").DocumentNode;
3
3
  export declare const GET_PAYMENT_METHOD_OF_STORE_CHANNEL: import("graphql").DocumentNode;
4
4
  export declare const GET_INVOICE_DETAIL: import("graphql").DocumentNode;
5
+ export declare const GET_INVOICES_OF_ORDER: import("graphql").DocumentNode;
6
+ export declare const VIEW_PUBLISHED_INVOICE: import("graphql").DocumentNode;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.GET_INVOICE_DETAIL = exports.GET_PAYMENT_METHOD_OF_STORE_CHANNEL = exports.GEN_QR_PAYMENT = exports.GET_PAYMENT_METHOD = void 0;
3
+ exports.VIEW_PUBLISHED_INVOICE = exports.GET_INVOICES_OF_ORDER = exports.GET_INVOICE_DETAIL = exports.GET_PAYMENT_METHOD_OF_STORE_CHANNEL = exports.GEN_QR_PAYMENT = exports.GET_PAYMENT_METHOD = void 0;
4
4
  const graphql_tag_1 = require("graphql-tag");
5
5
  exports.GET_PAYMENT_METHOD = (0, graphql_tag_1.gql) `
6
6
  query GetPaymentMethod($orgId: String!, $storeChannelId: String) {
@@ -63,3 +63,35 @@ exports.GET_INVOICE_DETAIL = (0, graphql_tag_1.gql) `
63
63
  }
64
64
  }
65
65
  `;
66
+ exports.GET_INVOICES_OF_ORDER = (0, graphql_tag_1.gql) `
67
+ query GetInvoicesOfOrder($orderId: String!) {
68
+ getInvoicesOfOrder(orderId: $orderId) {
69
+ id
70
+ orderId
71
+ type
72
+ partyIdFrom
73
+ partyIdTo
74
+ status
75
+ invoiceDate
76
+ invoiceDueDate
77
+ createdBy
78
+ createdStamp
79
+ paymentId
80
+ originalTotalPrice
81
+ totalVAT
82
+ appliedAmount
83
+ }
84
+ }
85
+ `;
86
+ exports.VIEW_PUBLISHED_INVOICE = (0, graphql_tag_1.gql) `
87
+ query ViewPublishedInvoice($partnerId: String!, $invoiceId: String!) {
88
+ viewPublishedInvoice(partnerId: $partnerId, invoiceId: $invoiceId) {
89
+ code
90
+ message
91
+ invoiceId
92
+ sourceId
93
+ sourceType
94
+ previewLink
95
+ }
96
+ }
97
+ `;
@@ -509,4 +509,5 @@ export declare class OrderService extends Service {
509
509
  updateExchangeOrder(exchangeOrder: string, returnOrder: string, sellOrder: string): Promise<any>;
510
510
  removeShippingAddress(orderId: string, updateBy: string): Promise<any>;
511
511
  removeShippingInfo(orderId: string, updateBy: string): Promise<any>;
512
+ updateVatInorder(orderId: string, orderItemId: string, vatRate: string): Promise<any>;
512
513
  }
@@ -1497,5 +1497,18 @@ class OrderService extends serviceSDK_1.Service {
1497
1497
  }
1498
1498
  });
1499
1499
  }
1500
+ updateVatInorder(orderId, orderItemId, vatRate) {
1501
+ return __awaiter(this, void 0, void 0, function* () {
1502
+ const endpoint = `/orders/${this.orgId}/${this.storeId}/${orderId}/${orderItemId}/${vatRate}/vatProduct`;
1503
+ const method = 'PUT';
1504
+ try {
1505
+ const response = yield this.restApiCallWithToken(endpoint, method);
1506
+ return response;
1507
+ }
1508
+ catch (error) {
1509
+ throw error;
1510
+ }
1511
+ });
1512
+ }
1500
1513
  }
1501
1514
  exports.OrderService = OrderService;
@@ -9,4 +9,6 @@ export declare class PaymentService extends Service {
9
9
  getInvoiceDetail(invoiceId: string): Promise<any>;
10
10
  requestUnpublishVatInvoice(VatInvoiceRequest: VatInvoiceRequestDTO, byUser: string): Promise<any>;
11
11
  requestPublishVatInvoice(VatInvoiceRequest: VatInvoiceRequestDTO, byUser: string): Promise<any>;
12
+ getInvoicesOfOrder(orderId: string): Promise<any>;
13
+ viewPublishedInvoice(invoiceId: string): Promise<any>;
12
14
  }
@@ -152,5 +152,36 @@ class PaymentService extends serviceSDK_1.Service {
152
152
  }
153
153
  });
154
154
  }
155
+ getInvoicesOfOrder(orderId) {
156
+ return __awaiter(this, void 0, void 0, function* () {
157
+ const query = queries_1.GET_INVOICES_OF_ORDER;
158
+ const variables = {
159
+ orderId,
160
+ };
161
+ try {
162
+ const response = yield this.graphqlQueryV3(query, variables);
163
+ return response.getInvoicesOfOrder;
164
+ }
165
+ catch (error) {
166
+ throw error;
167
+ }
168
+ });
169
+ }
170
+ viewPublishedInvoice(invoiceId) {
171
+ return __awaiter(this, void 0, void 0, function* () {
172
+ const query = queries_1.VIEW_PUBLISHED_INVOICE;
173
+ const variables = {
174
+ partnerId: this.orgId,
175
+ invoiceId,
176
+ };
177
+ try {
178
+ const response = yield this.graphqlQueryV3(query, variables);
179
+ return response.viewPublishedInvoice;
180
+ }
181
+ catch (error) {
182
+ throw error;
183
+ }
184
+ });
185
+ }
155
186
  }
156
187
  exports.PaymentService = PaymentService;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@longvansoftware/storefront-js-client",
3
- "version": "2.8.2",
3
+ "version": "2.8.4",
4
4
  "main": "dist/src/index.js",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "files": [