@longvansoftware/storefront-js-client 2.8.0 → 2.8.2

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.
@@ -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,7 @@ 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
67
69
  buyerName: $buyerName
68
70
  buyerTaxCode: $buyerTaxCode
69
71
  buyerCompany: $buyerCompany
@@ -85,17 +87,18 @@ exports.REQUEST_UNPUBLISH_VAT_INVOICE = (0, graphql_tag_1.gql) `
85
87
  `;
86
88
  exports.REQUEST_PUBLISH_VAT_INVOICE = (0, graphql_tag_1.gql) `
87
89
  mutation RequestPublishVatInvoice(
88
- $partnerId: String!,
89
- $sourceId: String!,
90
- $sourceType: String!,
91
- $signType: String,
92
- $buyerName: String,
93
- $buyerTaxCode: String,
94
- $buyerCompany: String,
95
- $buyerAddress: String,
96
- $sendMail: Boolean,
97
- $receiverName: String,
98
- $receiverEmail: String,
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
99
102
  $byUser: String!
100
103
  ) {
101
104
  requestPublishVatInvoice(
@@ -104,6 +107,7 @@ exports.REQUEST_PUBLISH_VAT_INVOICE = (0, graphql_tag_1.gql) `
104
107
  sourceId: $sourceId
105
108
  sourceType: $sourceType
106
109
  signType: $signType
110
+ includeBuyerTaxCode: $includeBuyerTaxCode
107
111
  buyerName: $buyerName
108
112
  buyerTaxCode: $buyerTaxCode
109
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
+ `;
@@ -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,
@@ -126,12 +127,13 @@ class PaymentService extends serviceSDK_1.Service {
126
127
  requestPublishVatInvoice(VatInvoiceRequest, byUser) {
127
128
  return __awaiter(this, void 0, void 0, function* () {
128
129
  const mutation = mutations_1.REQUEST_PUBLISH_VAT_INVOICE;
129
- const { sourceId, sourceType, signType, buyerName, buyerTaxCode, buyerCompany, buyerAddress, sendMail, receiverName, receiverEmail, } = VatInvoiceRequest;
130
+ const { sourceId, sourceType, signType, includeBuyerTaxCode, buyerName, buyerTaxCode, buyerCompany, buyerAddress, sendMail, receiverName, receiverEmail, } = VatInvoiceRequest;
130
131
  const variables = {
131
132
  partnerId: this.orgId,
132
133
  sourceId,
133
134
  sourceType,
134
135
  signType,
136
+ includeBuyerTaxCode,
135
137
  buyerName,
136
138
  buyerTaxCode,
137
139
  buyerCompany,
@@ -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<any>;
24
26
  }
@@ -356,5 +356,40 @@ 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
+ try {
386
+ const response = yield this.graphqlMutation(mutation, variables);
387
+ return response.createVatInfo;
388
+ }
389
+ catch (error) {
390
+ throw error;
391
+ }
392
+ });
393
+ }
359
394
  }
360
395
  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.8.0",
3
+ "version": "2.8.2",
4
4
  "main": "dist/src/index.js",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "files": [