@longvansoftware/storefront-js-client 2.7.9 → 2.8.1

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.
@@ -263,7 +263,11 @@ exports.GET_VOUCHER_AVAILABLE_FOR_CUSTOMER = (0, graphql_tag_1.gql) `
263
263
  }
264
264
  `;
265
265
  exports.SUGGEST_VOUCHER = (0, graphql_tag_1.gql) `
266
- query SuggestVoucher($partyId: String,$customerId:String, $excludeExpired: Boolean) {
266
+ query SuggestVoucher(
267
+ $partyId: String
268
+ $customerId: String
269
+ $excludeExpired: Boolean
270
+ ) {
267
271
  suggestVoucher(
268
272
  searchVoucherRequest: {
269
273
  partyId: $partyId
@@ -300,6 +304,9 @@ exports.SUGGEST_VOUCHER = (0, graphql_tag_1.gql) `
300
304
  isBirthday
301
305
  customerId
302
306
  scope
307
+ affiliateId
308
+ maximumSpend
309
+ minimumSpend
303
310
  }
304
311
  }
305
312
  }
@@ -356,51 +363,50 @@ exports.GET_CAMPAIGN_ACTION_BY_ID = (0, graphql_tag_1.gql) `
356
363
  `;
357
364
  exports.SEARCH_PRODUCT_GIFT_PROMOTION_RESPONSE = (0, graphql_tag_1.gql) `
358
365
  query SearchProductGiftPromotionResponse(
359
- $partyId: String!
360
- $storeId: String
361
- $campaignActionId: String
362
- ){
363
- searchProductGiftPromotionResponse(
364
- parameterSearchProductGift:{
365
- partyId: $partyId
366
- storeId: $storeId
367
- campaignActionId: $campaignActionId
368
- }
369
- ){
370
- total
371
- totalPages
372
- totalElements
373
- last
374
- first
375
- number
376
- numberOfElements
377
- size
378
- empty
379
- content {
380
- id
381
- partyId
382
- campaignId
383
- campaignActionId
384
- productId
385
- quantityLimit
386
- campaignActionName
387
- startDate
388
- endDate
389
- newCustomer
390
- createdStamp
391
- updatedStamp
392
- updatedBy
393
- createdBy
394
- giftPromotions {
395
- fromQuantity
396
- toProductId
397
- toQuantity
398
- productName
399
- sku
400
- featureImage
401
- }
366
+ $partyId: String!
367
+ $storeId: String
368
+ $campaignActionId: String
369
+ ) {
370
+ searchProductGiftPromotionResponse(
371
+ parameterSearchProductGift: {
372
+ partyId: $partyId
373
+ storeId: $storeId
374
+ campaignActionId: $campaignActionId
375
+ }
376
+ ) {
377
+ total
378
+ totalPages
379
+ totalElements
380
+ last
381
+ first
382
+ number
383
+ numberOfElements
384
+ size
385
+ empty
386
+ content {
387
+ id
388
+ partyId
389
+ campaignId
390
+ campaignActionId
391
+ productId
392
+ quantityLimit
393
+ campaignActionName
394
+ startDate
395
+ endDate
396
+ newCustomer
397
+ createdStamp
398
+ updatedStamp
399
+ updatedBy
400
+ createdBy
401
+ giftPromotions {
402
+ fromQuantity
403
+ toProductId
404
+ toQuantity
405
+ productName
406
+ sku
407
+ featureImage
402
408
  }
409
+ }
403
410
  }
404
411
  }
405
-
406
412
  `;
@@ -1,2 +1,3 @@
1
1
  export declare const CREATE_PAYMENT_ORDER_MUTATION: import("graphql").DocumentNode;
2
2
  export declare const REQUEST_UNPUBLISH_VAT_INVOICE: import("graphql").DocumentNode;
3
+ export declare const REQUEST_PUBLISH_VAT_INVOICE: import("graphql").DocumentNode;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.REQUEST_UNPUBLISH_VAT_INVOICE = exports.CREATE_PAYMENT_ORDER_MUTATION = void 0;
3
+ exports.REQUEST_PUBLISH_VAT_INVOICE = 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(
@@ -45,17 +45,18 @@ exports.CREATE_PAYMENT_ORDER_MUTATION = (0, graphql_tag_1.gql) `
45
45
  `;
46
46
  exports.REQUEST_UNPUBLISH_VAT_INVOICE = (0, graphql_tag_1.gql) `
47
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,
48
+ $partnerId: String!
49
+ $sourceId: String!
50
+ $sourceType: String!
51
+ $signType: String
52
+ $includeBuyerTaxCode: Boolean
53
+ $buyerName: String
54
+ $buyerTaxCode: String
55
+ $buyerCompany: String
56
+ $buyerAddress: String
57
+ $sendMail: Boolean
58
+ $receiverName: String
59
+ $receiverEmail: String
59
60
  $byUser: String!
60
61
  ) {
61
62
  requestUnpublishVatInvoice(
@@ -64,6 +65,49 @@ exports.REQUEST_UNPUBLISH_VAT_INVOICE = (0, graphql_tag_1.gql) `
64
65
  sourceId: $sourceId
65
66
  sourceType: $sourceType
66
67
  signType: $signType
68
+ includeBuyerTaxCode: $includeBuyerTaxCode
69
+ buyerName: $buyerName
70
+ buyerTaxCode: $buyerTaxCode
71
+ buyerCompany: $buyerCompany
72
+ buyerAddress: $buyerAddress
73
+ sendMail: $sendMail
74
+ receiverName: $receiverName
75
+ receiverEmail: $receiverEmail
76
+ }
77
+ byUser: $byUser
78
+ ) {
79
+ code
80
+ message
81
+ invoiceId
82
+ sourceId
83
+ sourceType
84
+ previewLink
85
+ }
86
+ }
87
+ `;
88
+ exports.REQUEST_PUBLISH_VAT_INVOICE = (0, graphql_tag_1.gql) `
89
+ mutation RequestPublishVatInvoice(
90
+ $partnerId: String!
91
+ $sourceId: String!
92
+ $sourceType: String!
93
+ $signType: String
94
+ $includeBuyerTaxCode: Boolean
95
+ $buyerName: String
96
+ $buyerTaxCode: String
97
+ $buyerCompany: String
98
+ $buyerAddress: String
99
+ $sendMail: Boolean
100
+ $receiverName: String
101
+ $receiverEmail: String
102
+ $byUser: String!
103
+ ) {
104
+ requestPublishVatInvoice(
105
+ vatInvoiceRequest: {
106
+ partnerId: $partnerId
107
+ sourceId: $sourceId
108
+ sourceType: $sourceType
109
+ signType: $signType
110
+ includeBuyerTaxCode: $includeBuyerTaxCode
67
111
  buyerName: $buyerName
68
112
  buyerTaxCode: $buyerTaxCode
69
113
  buyerCompany: $buyerCompany
@@ -2,3 +2,4 @@ export declare const CREATE_COMPANY: import("graphql").DocumentNode;
2
2
  export declare const UPDATE_COMPANY_INFOR: import("graphql").DocumentNode;
3
3
  export declare const UPDATE_CUSTOMER_V2: import("graphql").DocumentNode;
4
4
  export declare const CREATE_CUSTOMER_V2: import("graphql").DocumentNode;
5
+ export declare const CREATE_VAT_INFO: import("graphql").DocumentNode;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CREATE_CUSTOMER_V2 = exports.UPDATE_CUSTOMER_V2 = exports.UPDATE_COMPANY_INFOR = exports.CREATE_COMPANY = void 0;
3
+ exports.CREATE_VAT_INFO = exports.CREATE_CUSTOMER_V2 = exports.UPDATE_CUSTOMER_V2 = exports.UPDATE_COMPANY_INFOR = exports.CREATE_COMPANY = void 0;
4
4
  const graphql_tag_1 = require("graphql-tag");
5
5
  exports.CREATE_COMPANY = (0, graphql_tag_1.gql) `
6
6
  mutation CreateCompany(
@@ -116,3 +116,36 @@ exports.CREATE_CUSTOMER_V2 = (0, graphql_tag_1.gql) `
116
116
  }
117
117
  }
118
118
  `;
119
+ exports.CREATE_VAT_INFO = (0, graphql_tag_1.gql) `
120
+ mutation CreateVatInfo(
121
+ $company: String!
122
+ $taxCode: String!
123
+ $address: String!
124
+ $invoiceReceiveEmail1: String
125
+ $ownerPartyId: String
126
+ $createdBy: String!
127
+ ) {
128
+ createVatInfo(
129
+ createVatInfoRequest: {
130
+ company: $company
131
+ taxCode: $taxCode
132
+ address: $address
133
+ invoiceReceiveEmail1: $invoiceReceiveEmail1
134
+ ownerPartyId: $ownerPartyId
135
+ }
136
+ createdBy: $createdBy
137
+ ) {
138
+ id
139
+ company
140
+ taxCode
141
+ address
142
+ invoiceReceiveEmail1
143
+ invoiceReceiveEmail2
144
+ ownerPartyId
145
+ createdStamp
146
+ updatedStamp
147
+ updatedBy
148
+ createdBy
149
+ }
150
+ }
151
+ `;
@@ -12,3 +12,4 @@ export declare const GET_PROVINCES: import("graphql").DocumentNode;
12
12
  export declare const GET_DISTRICTS: import("graphql").DocumentNode;
13
13
  export declare const GET_WARDS: import("graphql").DocumentNode;
14
14
  export declare const GET_PERSON_BY_PARTY_ID: import("graphql").DocumentNode;
15
+ export declare const GET_VAT_INFO_BY_OWNER_PARTYID: import("graphql").DocumentNode;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.GET_PERSON_BY_PARTY_ID = exports.GET_WARDS = exports.GET_DISTRICTS = exports.GET_PROVINCES = exports.GET_CONTACT_INFOS_BY_COMPANY_ID = exports.GET_COMPANY_BY_CONTACT_INFO_ID = exports.GET_EMPLOYEES_BY_STORE_CHANEL_ID = exports.GET_STORE_CHANEL_IDS_BY_EMPLOYESS_ID = exports.GET_POSTIONS_BY_EMPLOYEES_ID = exports.SEARCH_EMPLOYEES = exports.SEARCH_CUSTOMER = exports.GET_CUSTOMER_BY_ID = exports.SEARCH_COMPANY = exports.GET_PERSON_BY_IDS_QUERY = void 0;
3
+ exports.GET_VAT_INFO_BY_OWNER_PARTYID = exports.GET_PERSON_BY_PARTY_ID = exports.GET_WARDS = exports.GET_DISTRICTS = exports.GET_PROVINCES = exports.GET_CONTACT_INFOS_BY_COMPANY_ID = exports.GET_COMPANY_BY_CONTACT_INFO_ID = exports.GET_EMPLOYEES_BY_STORE_CHANEL_ID = exports.GET_STORE_CHANEL_IDS_BY_EMPLOYESS_ID = exports.GET_POSTIONS_BY_EMPLOYEES_ID = exports.SEARCH_EMPLOYEES = exports.SEARCH_CUSTOMER = exports.GET_CUSTOMER_BY_ID = exports.SEARCH_COMPANY = exports.GET_PERSON_BY_IDS_QUERY = void 0;
4
4
  const graphql_tag_1 = require("graphql-tag");
5
5
  exports.GET_PERSON_BY_IDS_QUERY = (0, graphql_tag_1.gql) `
6
6
  query GetPersonByIds($partyIds: [String!]!) {
@@ -295,3 +295,23 @@ exports.GET_PERSON_BY_PARTY_ID = (0, graphql_tag_1.gql) `
295
295
  }
296
296
  }
297
297
  `;
298
+ exports.GET_VAT_INFO_BY_OWNER_PARTYID = (0, graphql_tag_1.gql) `
299
+ query GetVatInfoByOwnerPartyId(
300
+ $ownerPartyId:String!
301
+ ){
302
+ getVatInfoByOwnerPartyId(
303
+ ownerPartyId: $ownerPartyId){
304
+ id
305
+ company
306
+ taxCode
307
+ address
308
+ invoiceReceiveEmail1
309
+ invoiceReceiveEmail2
310
+ ownerPartyId
311
+ createdStamp
312
+ updatedStamp
313
+ updatedBy
314
+ createdBy
315
+ }
316
+ }
317
+ `;
@@ -8,4 +8,5 @@ export declare class PaymentService extends Service {
8
8
  getPaymentMethodOfStoreChannel(): Promise<any>;
9
9
  getInvoiceDetail(invoiceId: string): Promise<any>;
10
10
  requestUnpublishVatInvoice(VatInvoiceRequest: VatInvoiceRequestDTO, byUser: string): Promise<any>;
11
+ requestPublishVatInvoice(VatInvoiceRequest: VatInvoiceRequestDTO, byUser: string): Promise<any>;
11
12
  }
@@ -99,12 +99,13 @@ class PaymentService extends serviceSDK_1.Service {
99
99
  requestUnpublishVatInvoice(VatInvoiceRequest, byUser) {
100
100
  return __awaiter(this, void 0, void 0, function* () {
101
101
  const mutation = mutations_1.REQUEST_UNPUBLISH_VAT_INVOICE;
102
- const { sourceId, sourceType, signType, buyerName, buyerTaxCode, buyerCompany, buyerAddress, sendMail, receiverName, receiverEmail, } = VatInvoiceRequest;
102
+ const { sourceId, sourceType, signType, includeBuyerTaxCode, buyerName, buyerTaxCode, buyerCompany, buyerAddress, sendMail, receiverName, receiverEmail, } = VatInvoiceRequest;
103
103
  const variables = {
104
104
  partnerId: this.orgId,
105
105
  sourceId,
106
106
  sourceType,
107
107
  signType,
108
+ includeBuyerTaxCode,
108
109
  buyerName,
109
110
  buyerTaxCode,
110
111
  buyerCompany,
@@ -123,5 +124,33 @@ class PaymentService extends serviceSDK_1.Service {
123
124
  }
124
125
  });
125
126
  }
127
+ requestPublishVatInvoice(VatInvoiceRequest, byUser) {
128
+ return __awaiter(this, void 0, void 0, function* () {
129
+ const mutation = mutations_1.REQUEST_PUBLISH_VAT_INVOICE;
130
+ const { sourceId, sourceType, signType, includeBuyerTaxCode, buyerName, buyerTaxCode, buyerCompany, buyerAddress, sendMail, receiverName, receiverEmail, } = VatInvoiceRequest;
131
+ const variables = {
132
+ partnerId: this.orgId,
133
+ sourceId,
134
+ sourceType,
135
+ signType,
136
+ includeBuyerTaxCode,
137
+ buyerName,
138
+ buyerTaxCode,
139
+ buyerCompany,
140
+ buyerAddress,
141
+ sendMail,
142
+ receiverName,
143
+ receiverEmail,
144
+ byUser,
145
+ };
146
+ try {
147
+ const response = yield this.graphqlMutationV3(mutation, variables);
148
+ return response.requestPublishVatInvoice;
149
+ }
150
+ catch (error) {
151
+ throw error;
152
+ }
153
+ });
154
+ }
126
155
  }
127
156
  exports.PaymentService = PaymentService;
@@ -21,4 +21,6 @@ export declare class UserService extends Service {
21
21
  getDistricts(provinceId: string): Promise<any>;
22
22
  getWards(districtId: string): Promise<any>;
23
23
  getPersonByPartyId(partyId: string): Promise<any>;
24
+ getVatInfoByOwnerPartyId(ownerPartyId: string): Promise<any>;
25
+ createVatInfo(company: string, taxCode: string, invoiceReceiveEmail1: string, ownerPartyId: string, address: string, createdBy: string): Promise<void>;
24
26
  }
@@ -356,5 +356,33 @@ class UserService extends serviceSDK_1.Service {
356
356
  }
357
357
  });
358
358
  }
359
+ getVatInfoByOwnerPartyId(ownerPartyId) {
360
+ return __awaiter(this, void 0, void 0, function* () {
361
+ const query = queries_1.GET_VAT_INFO_BY_OWNER_PARTYID;
362
+ const variables = {
363
+ ownerPartyId,
364
+ };
365
+ try {
366
+ const response = yield this.graphqlQuery(query, variables);
367
+ return response.getVatInfoByOwnerPartyId;
368
+ }
369
+ catch (error) {
370
+ throw error;
371
+ }
372
+ });
373
+ }
374
+ createVatInfo(company, taxCode, invoiceReceiveEmail1, ownerPartyId, address, createdBy) {
375
+ return __awaiter(this, void 0, void 0, function* () {
376
+ const mutation = mutations_1.CREATE_VAT_INFO;
377
+ const variables = {
378
+ company,
379
+ taxCode,
380
+ invoiceReceiveEmail1,
381
+ ownerPartyId,
382
+ address,
383
+ createdBy,
384
+ };
385
+ });
386
+ }
359
387
  }
360
388
  exports.UserService = UserService;
@@ -2,6 +2,7 @@ export interface VatInvoiceRequestDTO {
2
2
  sourceId: String;
3
3
  sourceType: String;
4
4
  signType: String;
5
+ includeBuyerTaxCode: Boolean;
5
6
  buyerName: String;
6
7
  buyerTaxCode: String;
7
8
  buyerCompany: String;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@longvansoftware/storefront-js-client",
3
- "version": "2.7.9",
3
+ "version": "2.8.1",
4
4
  "main": "dist/src/index.js",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "files": [