@longvansoftware/storefront-js-client 2.1.0 → 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
  };
@@ -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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@longvansoftware/storefront-js-client",
3
- "version": "2.1.0",
3
+ "version": "2.1.1",
4
4
  "main": "dist/src/index.js",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "files": [