@longvansoftware/storefront-js-client 4.3.2 → 4.3.3

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.
@@ -3,3 +3,5 @@ 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
5
  export declare const CREATE_VAT_INFO: import("graphql").DocumentNode;
6
+ export declare const CREATE_RELATED_PARTY: import("graphql").DocumentNode;
7
+ export declare const UPDATE_RELATED_PARTY: import("graphql").DocumentNode;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CREATE_VAT_INFO = exports.CREATE_CUSTOMER_V2 = exports.UPDATE_CUSTOMER_V2 = exports.UPDATE_COMPANY_INFOR = exports.CREATE_COMPANY = void 0;
3
+ exports.UPDATE_RELATED_PARTY = exports.CREATE_RELATED_PARTY = 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(
@@ -82,6 +82,7 @@ exports.UPDATE_CUSTOMER_V2 = (0, graphql_tag_1.gql) `
82
82
  createdStamp
83
83
  createdBy
84
84
  memberLevel
85
+ sourceCustomer
85
86
  }
86
87
  }
87
88
  `;
@@ -93,7 +94,7 @@ exports.CREATE_CUSTOMER_V2 = (0, graphql_tag_1.gql) `
93
94
  $birthDate: DateCustom
94
95
  $tenantId: String!
95
96
  $createdBy: String
96
- $source: String
97
+ $sourceCustomer: String
97
98
  ) {
98
99
  createCustomerV2(
99
100
  name: $name
@@ -102,7 +103,7 @@ exports.CREATE_CUSTOMER_V2 = (0, graphql_tag_1.gql) `
102
103
  birthDate: $birthDate
103
104
  tenantId: $tenantId
104
105
  createdBy: $createdBy
105
- source: $source
106
+ sourceCustomer: $sourceCustomer
106
107
  ) {
107
108
  id
108
109
  name
@@ -115,6 +116,7 @@ exports.CREATE_CUSTOMER_V2 = (0, graphql_tag_1.gql) `
115
116
  createdStamp
116
117
  createdBy
117
118
  memberLevel
119
+ sourceCustomer
118
120
  }
119
121
  }
120
122
  `;
@@ -151,3 +153,60 @@ exports.CREATE_VAT_INFO = (0, graphql_tag_1.gql) `
151
153
  }
152
154
  }
153
155
  `;
156
+ exports.CREATE_RELATED_PARTY = (0, graphql_tag_1.gql) `
157
+ mutation CreateRelatedParty(
158
+ $orgId: String!
159
+ $name: String
160
+ $phone: String
161
+ $relationshipName: String
162
+ $email: String
163
+ $birthDate: DateCustom
164
+ $createdBy: String!
165
+ $partyId: String
166
+ ) {
167
+ createRelatedParty(
168
+ orgId: $orgId
169
+ name: $name
170
+ phone: $phone
171
+ relationshipName: $relationshipName
172
+ email: $email
173
+ birthDate: $birthDate
174
+ createdBy: $createdBy
175
+ partyId: $partyId
176
+ ) {
177
+ id
178
+ name
179
+ address
180
+ gender
181
+ identityNumber
182
+ birthDate
183
+ email
184
+ phone
185
+ createdStamp
186
+ createdBy
187
+ memberLevel
188
+ imageUrl
189
+ customAttribute
190
+ relationshipName
191
+ source
192
+ sourceCustomer
193
+ }
194
+ }
195
+ `;
196
+ exports.UPDATE_RELATED_PARTY = (0, graphql_tag_1.gql) `
197
+ mutation UpdateRelatedParty(
198
+ $relatedPartyId: String!
199
+ $partyId: String!
200
+ $updateRelatedPartyRequest: UpdateRelatedPartyRequest!
201
+ $orgId: String!
202
+ $updatedBy: String!
203
+ ) {
204
+ updateRelatedParty(
205
+ relatedPartyId: $relatedPartyId
206
+ partyId: $partyId
207
+ updateRelatedPartyRequest: $updateRelatedPartyRequest
208
+ orgId: $orgId
209
+ updatedBy: $updatedBy
210
+ )
211
+ }
212
+ `;
@@ -14,3 +14,4 @@ export declare const GET_DISTRICTS: import("graphql").DocumentNode;
14
14
  export declare const GET_WARDS: import("graphql").DocumentNode;
15
15
  export declare const GET_PERSON_BY_PARTY_ID: import("graphql").DocumentNode;
16
16
  export declare const GET_VAT_INFO_BY_OWNER_PARTYID: import("graphql").DocumentNode;
17
+ export declare const GET_RELATED_PARTIES: import("graphql").DocumentNode;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.GET_VAT_INFO_BY_OWNER_PARTYID = exports.GET_PERSON_BY_PARTY_ID = exports.GET_WARDS = exports.GET_DISTRICTS = exports.GET_WARDS_BY_PROVINCEID = 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_RELATED_PARTIES = exports.GET_VAT_INFO_BY_OWNER_PARTYID = exports.GET_PERSON_BY_PARTY_ID = exports.GET_WARDS = exports.GET_DISTRICTS = exports.GET_WARDS_BY_PROVINCEID = 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!]!) {
@@ -62,6 +62,7 @@ exports.GET_CUSTOMER_BY_ID = (0, graphql_tag_1.gql) `
62
62
  createdStamp
63
63
  createdBy
64
64
  memberLevel
65
+ sourceCustomer
65
66
  }
66
67
  }
67
68
  `;
@@ -335,3 +336,25 @@ exports.GET_VAT_INFO_BY_OWNER_PARTYID = (0, graphql_tag_1.gql) `
335
336
  }
336
337
  }
337
338
  `;
339
+ exports.GET_RELATED_PARTIES = (0, graphql_tag_1.gql) `
340
+ query GetRelatedParties($partyId: String, $orgId: String) {
341
+ getRelatedParties(partyId: $partyId, orgId: $orgId) {
342
+ id
343
+ name
344
+ address
345
+ gender
346
+ identityNumber
347
+ birthDate
348
+ email
349
+ phone
350
+ createdStamp
351
+ createdBy
352
+ memberLevel
353
+ imageUrl
354
+ customAttribute
355
+ relationshipName
356
+ source
357
+ sourceCustomer
358
+ }
359
+ }
360
+ `;
@@ -24,4 +24,7 @@ export declare class UserService extends Service {
24
24
  getPersonByPartyId(partyId: string): Promise<any>;
25
25
  getVatInfoByOwnerPartyId(ownerPartyId: string): Promise<any>;
26
26
  createVatInfo(company: string, taxCode: string, invoiceReceiveEmail1: string, ownerPartyId: string, address: string, createdBy: string): Promise<any>;
27
+ getRelatedParties(partyId: string): Promise<any>;
28
+ createRelatedParty(user: Record<string, any>): Promise<any>;
29
+ updateRelatedParty(relatedPartyId: string, partyId: string, updateRelatedPartyRequest: any, updatedBy: string): Promise<any>;
27
30
  }
@@ -131,7 +131,7 @@ class UserService extends serviceSDK_1.Service {
131
131
  phone: (createCustomerRequest === null || createCustomerRequest === void 0 ? void 0 : createCustomerRequest.phone) || "",
132
132
  email: (createCustomerRequest === null || createCustomerRequest === void 0 ? void 0 : createCustomerRequest.email) || "",
133
133
  birthDate: (createCustomerRequest === null || createCustomerRequest === void 0 ? void 0 : createCustomerRequest.birthDate) || null,
134
- source: (createCustomerRequest === null || createCustomerRequest === void 0 ? void 0 : createCustomerRequest.source) || "",
134
+ sourceCustomer: (createCustomerRequest === null || createCustomerRequest === void 0 ? void 0 : createCustomerRequest.sourceCustomer) || "",
135
135
  tenantId: this.orgId,
136
136
  createdBy: createdBy,
137
137
  };
@@ -410,5 +410,53 @@ class UserService extends serviceSDK_1.Service {
410
410
  }
411
411
  });
412
412
  }
413
+ getRelatedParties(partyId) {
414
+ return __awaiter(this, void 0, void 0, function* () {
415
+ const query = queries_1.GET_RELATED_PARTIES;
416
+ const variables = {
417
+ orgId: this.orgId,
418
+ partyId,
419
+ };
420
+ try {
421
+ const response = yield this.graphqlQueryV2(query, variables);
422
+ return response.getRelatedParties;
423
+ }
424
+ catch (error) {
425
+ throw error;
426
+ }
427
+ });
428
+ }
429
+ createRelatedParty(user) {
430
+ return __awaiter(this, void 0, void 0, function* () {
431
+ const mutation = mutations_1.CREATE_RELATED_PARTY;
432
+ const data = Object.assign({ orgId: this.orgId }, user);
433
+ try {
434
+ const response = yield this.graphqlMutationV2(mutation, data);
435
+ return response.createRelatedParty;
436
+ }
437
+ catch (error) {
438
+ throw error;
439
+ }
440
+ });
441
+ }
442
+ updateRelatedParty(relatedPartyId, partyId, updateRelatedPartyRequest, updatedBy) {
443
+ return __awaiter(this, void 0, void 0, function* () {
444
+ const mutation = mutations_1.UPDATE_RELATED_PARTY;
445
+ const data = {
446
+ relatedPartyId,
447
+ partyId,
448
+ updateRelatedPartyRequest,
449
+ orgId: this.orgId,
450
+ updatedBy,
451
+ };
452
+ try {
453
+ const response = yield this.graphqlMutationV2(mutation, data);
454
+ return response.updateRelatedParty;
455
+ }
456
+ catch (error) {
457
+ throw error;
458
+ }
459
+ });
460
+ }
413
461
  }
414
462
  exports.UserService = UserService;
@@ -24,6 +24,7 @@ export interface updateCustomerRequest {
24
24
  birthDate: Date;
25
25
  email: string;
26
26
  gender: string;
27
+ sourceCustomer: string;
27
28
  }
28
29
  export interface GetPersonByPartyIds {
29
30
  status: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@longvansoftware/storefront-js-client",
3
- "version": "4.3.2",
3
+ "version": "4.3.3",
4
4
  "main": "dist/src/index.js",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "files": [