@longvansoftware/storefront-js-client 2.0.9 → 2.1.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.
@@ -18,6 +18,7 @@ export declare const environmentEndpoints: {
18
18
  portal: string;
19
19
  upload: string;
20
20
  getImage: string;
21
+ accounting: string;
21
22
  };
22
23
  live: {
23
24
  product: string;
@@ -38,5 +39,6 @@ export declare const environmentEndpoints: {
38
39
  portal: string;
39
40
  upload: string;
40
41
  getImage: string;
42
+ accounting: string;
41
43
  };
42
44
  };
@@ -21,6 +21,7 @@ exports.environmentEndpoints = {
21
21
  portal: " https://portal.dev.longvan.vn",
22
22
  upload: "https://fileservice.dev.longvan.vn/omnichannel/files/upload",
23
23
  getImage: "https://s3-img-gw.longvan.net/img/omnichannel",
24
+ accounting: "https://api-gateway.dev.longvan.vn/accounting-service",
24
25
  },
25
26
  live: {
26
27
  product: "https://product-service.longvan.vn/product-service/graphql",
@@ -41,5 +42,6 @@ exports.environmentEndpoints = {
41
42
  portal: " https://portal.longvan.vn",
42
43
  upload: "https://fileservice.dev.longvan.vn/omnichannel/files/upload",
43
44
  getImage: "https://s3-img-gw.longvan.net/img/omnichannel",
45
+ accounting: "https://api-gateway.dev.longvan.vn/accounting-service",
44
46
  },
45
47
  };
@@ -406,7 +406,7 @@ exports.CREATE_WORK_EFFORT = (0, graphql_tag_1.gql) `
406
406
  $source: String!
407
407
  $attributes: JSON
408
408
  $addAttachmentRequest: [AddAttachmentRequest]
409
- $parentId: String!
409
+ $parentId: String
410
410
  ) {
411
411
  createWorkEffort(
412
412
  partnerId: $partnerId
@@ -593,21 +593,6 @@ exports.CREATE_WORK_EFFORT = (0, graphql_tag_1.gql) `
593
593
  id
594
594
  name
595
595
  }
596
- actionLink {
597
- name
598
- uri
599
- type
600
- partyId
601
- fromCollection
602
- toCollection
603
- group
604
- params
605
- id
606
- createdStamp
607
- updatedStamp
608
- updatedBy
609
- createdBy
610
- }
611
596
  }
612
597
  }
613
598
  `;
@@ -397,21 +397,6 @@ exports.GET_WORK_EFFORTS = (0, graphql_tag_1.gql) `
397
397
  processResult
398
398
  processStatus
399
399
  }
400
- actionLink {
401
- name
402
- uri
403
- type
404
- partyId
405
- fromCollection
406
- toCollection
407
- group
408
- params
409
- id
410
- createdStamp
411
- updatedStamp
412
- updatedBy
413
- createdBy
414
- }
415
400
  }
416
401
  }
417
402
  }
@@ -16,6 +16,7 @@ import { ComhubService } from "./comhub";
16
16
  import { PortalService } from "./portal";
17
17
  import { UploadService } from "./upload";
18
18
  import { GetImageService } from "./getImage";
19
+ import { AccountingService } from "./accounting";
19
20
  export interface Endpoints {
20
21
  product: string;
21
22
  crm: string;
@@ -35,6 +36,7 @@ export interface Endpoints {
35
36
  portal: string;
36
37
  upload: string;
37
38
  getImage: string;
39
+ accounting: string;
38
40
  }
39
41
  export declare class SDK {
40
42
  orgId: string;
@@ -58,6 +60,7 @@ export declare class SDK {
58
60
  portal: PortalService;
59
61
  upload: UploadService;
60
62
  getImage: GetImageService;
63
+ accounting: AccountingService;
61
64
  token: string | null;
62
65
  constructor(orgId: string, storeId: string, environment: "dev" | "live");
63
66
  setToken(token: string): void;
@@ -21,6 +21,7 @@ const comhub_1 = require("./comhub");
21
21
  const portal_1 = require("./portal");
22
22
  const upload_1 = require("./upload");
23
23
  const getImage_1 = require("./getImage");
24
+ const accounting_1 = require("./accounting");
24
25
  class SDK {
25
26
  constructor(orgId, storeId, environment) {
26
27
  this.orgId = orgId;
@@ -46,6 +47,7 @@ class SDK {
46
47
  this.portal = new portal_1.PortalService(endpoints.portal, orgId, storeId);
47
48
  this.upload = new upload_1.UploadService(endpoints.upload, orgId, storeId);
48
49
  this.getImage = new getImage_1.GetImageService(endpoints.getImage, orgId, storeId);
50
+ this.accounting = new accounting_1.AccountingService(endpoints.accounting, orgId, storeId);
49
51
  // Initialize other services here
50
52
  }
51
53
  setToken(token) {
@@ -70,6 +72,7 @@ class SDK {
70
72
  this.getImage.setToken(token);
71
73
  // this.shareZalo.setToken(token)
72
74
  // Set token for other services here
75
+ this.accounting.setToken(token);
73
76
  }
74
77
  // các module export từ serviceSDK.ts set storeId vào serviceSDK.ts
75
78
  // src/service.ts
@@ -91,6 +94,7 @@ class SDK {
91
94
  this.portal.setStoreId(storeId);
92
95
  this.upload.setStoreId(storeId);
93
96
  this.getImage.setStoreId(storeId);
97
+ this.accounting.setStoreId(storeId);
94
98
  // Set storeId for other services here
95
99
  }
96
100
  setOrgId(orgId) {
@@ -111,6 +115,7 @@ class SDK {
111
115
  this.portal.setOrgId(orgId);
112
116
  this.upload.setOrgId(orgId);
113
117
  this.getImage.setOrgId(orgId);
118
+ this.accounting.setOrgId(orgId);
114
119
  }
115
120
  }
116
121
  exports.SDK = SDK;
@@ -0,0 +1,5 @@
1
+ import { Service } from "../serviceSDK";
2
+ export declare class AccountingService extends Service {
3
+ constructor(endpoint: string, orgId: string, storeId: string);
4
+ getCustomerWallet(customerId: string, type: string): Promise<any>;
5
+ }
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.AccountingService = void 0;
13
+ const serviceSDK_1 = require("../serviceSDK");
14
+ class AccountingService extends serviceSDK_1.Service {
15
+ constructor(endpoint, orgId, storeId) {
16
+ super(endpoint, orgId, storeId);
17
+ }
18
+ getCustomerWallet(customerId, type) {
19
+ return __awaiter(this, void 0, void 0, function* () {
20
+ const endpoint = `/${this.orgId}/get_gl_account?partyId=${customerId}&type=${type}`;
21
+ const method = "GET";
22
+ try {
23
+ const response = yield this.restApiCallWithNoHeader(endpoint, method);
24
+ return response;
25
+ }
26
+ catch (error) {
27
+ throw error;
28
+ }
29
+ });
30
+ }
31
+ }
32
+ exports.AccountingService = AccountingService;
@@ -18,7 +18,7 @@ export declare class CrmService extends Service {
18
18
  getAttachmentByWorkEffortId(workEffortIds: [string]): Promise<any>;
19
19
  getListComment(getCommentRequest: GetCommentRequest): Promise<any>;
20
20
  addComment(params: any): Promise<any>;
21
- createWorkEffort(createdBy: string, name: String, decription: string, workEffortTypeId: string, source: string, attributes: object, addAttachmentRequest: AddAttachmentRequest, parentId: string): Promise<any>;
21
+ createWorkEffort(createdBy: string, name: String, decription: string, workEffortTypeId: string, source: string, attributes: object, addAttachmentRequest: AddAttachmentRequest, parentId?: string): Promise<any>;
22
22
  getWorkEfforts(performerId: string, workEffortTypeId: string, source: string, pageNumber: number, pageSize: number, sorts: BaseSort, attributes: object): Promise<any>;
23
23
  getWorkEffortById(id: string): Promise<any>;
24
24
  updateWorkEffortProcessStatus(workEffortId: string, processStatus: string, performerId: string): Promise<any>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@longvansoftware/storefront-js-client",
3
- "version": "2.0.9",
3
+ "version": "2.1.1",
4
4
  "main": "dist/src/index.js",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "files": [