@longvansoftware/service-js-client 1.10.7 → 1.10.9
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.
- package/dist/config/config.d.ts +2 -0
- package/dist/config/config.js +2 -0
- package/dist/src/graphql/accounting_service/mutations.d.ts +2 -0
- package/dist/src/graphql/accounting_service/mutations.js +100 -0
- package/dist/src/graphql/accounting_service/queries.d.ts +1 -0
- package/dist/src/graphql/accounting_service/queries.js +62 -0
- package/dist/src/lib/SDK.d.ts +3 -0
- package/dist/src/lib/SDK.js +4 -0
- package/dist/src/lib/accounting_service/index.d.ts +9 -0
- package/dist/src/lib/accounting_service/index.js +69 -0
- package/package.json +1 -1
package/dist/config/config.d.ts
CHANGED
@@ -17,6 +17,7 @@ export declare const environmentEndpoints: {
|
|
17
17
|
paymentLV: string;
|
18
18
|
resource_permission: string;
|
19
19
|
cloud_rest: string;
|
20
|
+
accounting_service: string;
|
20
21
|
};
|
21
22
|
live: {
|
22
23
|
product: string;
|
@@ -36,5 +37,6 @@ export declare const environmentEndpoints: {
|
|
36
37
|
paymentLV: string;
|
37
38
|
resource_permission: string;
|
38
39
|
cloud_rest: string;
|
40
|
+
accounting_service: string;
|
39
41
|
};
|
40
42
|
};
|
package/dist/config/config.js
CHANGED
@@ -20,6 +20,7 @@ exports.environmentEndpoints = {
|
|
20
20
|
paymentLV: "https://payment.dev.longvan.vn/graphql",
|
21
21
|
resource_permission: "https://api-gateway.dev.longvan.vn/resource-permission-api/graphql",
|
22
22
|
cloud_rest: "https://api-gateway.dev.longvan.vn/cloud-service-api/v1",
|
23
|
+
accounting_service: "https://api-gateway.dev.longvan.vn/accounting-service/graphql/",
|
23
24
|
},
|
24
25
|
live: {
|
25
26
|
product: "https://product-service.longvan.vn/product-service/graphql",
|
@@ -39,5 +40,6 @@ exports.environmentEndpoints = {
|
|
39
40
|
paymentLV: "https://payment.longvan.vn/graphql",
|
40
41
|
resource_permission: "https://api-gateway.longvan.vn/resource-permission-api/graphql",
|
41
42
|
cloud_rest: "https://api-gateway.longvan.vn/cloud-service-api/v1",
|
43
|
+
accounting_service: "https://api-gateway.longvan.vn/accounting-service/graphql/",
|
42
44
|
},
|
43
45
|
};
|
@@ -0,0 +1,100 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.CONFIRM_DEPOSIT_WALLET = exports.DEPOSIT_WALLET = void 0;
|
4
|
+
const graphql_tag_1 = require("graphql-tag");
|
5
|
+
exports.DEPOSIT_WALLET = (0, graphql_tag_1.gql) `
|
6
|
+
mutation DepositWallet(
|
7
|
+
$partnerId: String!
|
8
|
+
$storeId: String!
|
9
|
+
$partyId: String!
|
10
|
+
$storeName: String
|
11
|
+
$amountDeposit: BigDecimal!
|
12
|
+
$amountPromotion: BigDecimal
|
13
|
+
$orderNote: String
|
14
|
+
$paymentMethodCode: String
|
15
|
+
$sourcePayment: String
|
16
|
+
$paymentType: String
|
17
|
+
$createBy: String
|
18
|
+
) {
|
19
|
+
depositWallet(
|
20
|
+
partnerId: $partnerId
|
21
|
+
partyId: $partyId
|
22
|
+
storeId: $storeId
|
23
|
+
storeName: $storeName
|
24
|
+
amountDeposit: $amountDeposit
|
25
|
+
amountPromotion: $amountPromotion
|
26
|
+
orderNote: $orderNote
|
27
|
+
paymentMethodCode: $paymentMethodCode
|
28
|
+
sourcePayment: $sourcePayment
|
29
|
+
paymentType: $paymentType
|
30
|
+
createBy: $createBy
|
31
|
+
) {
|
32
|
+
order {
|
33
|
+
orderId
|
34
|
+
}
|
35
|
+
payment {
|
36
|
+
code
|
37
|
+
message
|
38
|
+
data
|
39
|
+
qrCodeUrl
|
40
|
+
deeplink
|
41
|
+
deeplinkMiniApp
|
42
|
+
invoiceId
|
43
|
+
orderId
|
44
|
+
paymentId
|
45
|
+
}
|
46
|
+
financialOrder {
|
47
|
+
partnerId
|
48
|
+
name
|
49
|
+
userId
|
50
|
+
totalAmount
|
51
|
+
type
|
52
|
+
transactionId
|
53
|
+
status
|
54
|
+
accountNumber
|
55
|
+
method
|
56
|
+
gateway
|
57
|
+
extOrderId
|
58
|
+
extTransactionId
|
59
|
+
transactionTime
|
60
|
+
description
|
61
|
+
source
|
62
|
+
level
|
63
|
+
}
|
64
|
+
}
|
65
|
+
}
|
66
|
+
`;
|
67
|
+
exports.CONFIRM_DEPOSIT_WALLET = (0, graphql_tag_1.gql) `
|
68
|
+
mutation ConfirmDepositWallet(
|
69
|
+
$partnerId: String!
|
70
|
+
$orderId: String!
|
71
|
+
$transactionId: String
|
72
|
+
$transactionTime: Long!
|
73
|
+
$createBy: String
|
74
|
+
) {
|
75
|
+
confirmDepositWallet(
|
76
|
+
partnerId: $partnerId
|
77
|
+
orderId: $orderId
|
78
|
+
transactionId: $transactionId
|
79
|
+
transactionTime: $transactionTime
|
80
|
+
createBy: $createBy
|
81
|
+
) {
|
82
|
+
partnerId
|
83
|
+
name
|
84
|
+
userId
|
85
|
+
totalAmount
|
86
|
+
type
|
87
|
+
transactionId
|
88
|
+
status
|
89
|
+
accountNumber
|
90
|
+
method
|
91
|
+
gateway
|
92
|
+
extOrderId
|
93
|
+
extTransactionId
|
94
|
+
transactionTime
|
95
|
+
description
|
96
|
+
source
|
97
|
+
level
|
98
|
+
}
|
99
|
+
}
|
100
|
+
`;
|
@@ -0,0 +1 @@
|
|
1
|
+
export declare const FINANCIAL_ACCOUNT_WALLET_INFO: import("graphql").DocumentNode;
|
@@ -0,0 +1,62 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.FINANCIAL_ACCOUNT_WALLET_INFO = void 0;
|
4
|
+
const graphql_tag_1 = require("graphql-tag");
|
5
|
+
exports.FINANCIAL_ACCOUNT_WALLET_INFO = (0, graphql_tag_1.gql) `
|
6
|
+
query FinancialAccountWalletInfo(
|
7
|
+
$partnerId: String!
|
8
|
+
$partyId: String
|
9
|
+
$showTransaction: Boolean!
|
10
|
+
) {
|
11
|
+
financialAccountWalletInfo(
|
12
|
+
partnerId: $partnerId
|
13
|
+
partyId: $partyId
|
14
|
+
showTransaction: $showTransaction
|
15
|
+
) {
|
16
|
+
financialAccount {
|
17
|
+
id
|
18
|
+
partyId
|
19
|
+
partnerId
|
20
|
+
type
|
21
|
+
description
|
22
|
+
glAccountNumber
|
23
|
+
created
|
24
|
+
updated
|
25
|
+
}
|
26
|
+
glAccount {
|
27
|
+
partnerId
|
28
|
+
accountNumber
|
29
|
+
owner
|
30
|
+
debit
|
31
|
+
credit
|
32
|
+
balance
|
33
|
+
type
|
34
|
+
parent
|
35
|
+
level
|
36
|
+
description
|
37
|
+
created
|
38
|
+
updated
|
39
|
+
deleteAble
|
40
|
+
}
|
41
|
+
transactions {
|
42
|
+
partnerId
|
43
|
+
name
|
44
|
+
userId
|
45
|
+
totalAmount
|
46
|
+
type
|
47
|
+
transactionId
|
48
|
+
status
|
49
|
+
accountNumber
|
50
|
+
method
|
51
|
+
gateway
|
52
|
+
extOrderId
|
53
|
+
extTransactionId
|
54
|
+
transactionTime
|
55
|
+
description
|
56
|
+
source
|
57
|
+
level
|
58
|
+
createdStamp
|
59
|
+
}
|
60
|
+
}
|
61
|
+
}
|
62
|
+
`;
|
package/dist/src/lib/SDK.d.ts
CHANGED
@@ -15,6 +15,7 @@ import { PaymentLVService } from "./paymentLV";
|
|
15
15
|
import { ResourcePermissionService } from "./resource_permission";
|
16
16
|
import { CloudRestService } from "./cloud_rest";
|
17
17
|
import { OrderCloudRestService } from "./order_cloud_rest";
|
18
|
+
import { AccountingService } from "./accounting_service";
|
18
19
|
export interface Endpoints {
|
19
20
|
product: string;
|
20
21
|
crm: string;
|
@@ -33,6 +34,7 @@ export interface Endpoints {
|
|
33
34
|
resource_permission: string;
|
34
35
|
cloud_rest: string;
|
35
36
|
order_cloud_rest: string;
|
37
|
+
accounting_service: string;
|
36
38
|
}
|
37
39
|
export declare class SDK {
|
38
40
|
orgId: string;
|
@@ -56,6 +58,7 @@ export declare class SDK {
|
|
56
58
|
resource_permission: ResourcePermissionService;
|
57
59
|
cloud_rest: CloudRestService;
|
58
60
|
order_cloud_rest: OrderCloudRestService;
|
61
|
+
accounting_service: AccountingService;
|
59
62
|
token: string | null;
|
60
63
|
private endpoints;
|
61
64
|
constructor(orgId: string, storeId: string, storefrontAccessToken: string, environment: string);
|
package/dist/src/lib/SDK.js
CHANGED
@@ -21,6 +21,7 @@ const paymentLV_1 = require("./paymentLV");
|
|
21
21
|
const resource_permission_1 = require("./resource_permission");
|
22
22
|
const cloud_rest_1 = require("./cloud_rest");
|
23
23
|
const order_cloud_rest_1 = require("./order_cloud_rest");
|
24
|
+
const accounting_service_1 = require("./accounting_service");
|
24
25
|
class SDK {
|
25
26
|
constructor(orgId, storeId, storefrontAccessToken, environment) {
|
26
27
|
this.orgId = orgId;
|
@@ -52,6 +53,7 @@ class SDK {
|
|
52
53
|
this.resource_permission = new resource_permission_1.ResourcePermissionService(this.endpoints.resource_permission, orgId, storeId);
|
53
54
|
this.cloud_rest = new cloud_rest_1.CloudRestService(this.endpoints.cloud_rest, orgId, storeId);
|
54
55
|
this.order_cloud_rest = new order_cloud_rest_1.OrderCloudRestService(this.endpoints.order_cloud_rest, orgId, storeId);
|
56
|
+
this.accounting_service = new accounting_service_1.AccountingService(this.endpoints.accounting_service, orgId, storeId);
|
55
57
|
// Initialize other services here
|
56
58
|
}
|
57
59
|
setToken(token) {
|
@@ -74,6 +76,7 @@ class SDK {
|
|
74
76
|
this.resource_permission.setToken(token);
|
75
77
|
this.cloud_rest.setToken(token);
|
76
78
|
this.order_cloud_rest.setToken(token);
|
79
|
+
this.accounting_service.setToken(token);
|
77
80
|
// Set token for other services here
|
78
81
|
}
|
79
82
|
// các module export từ serviceSDK.ts set storeId vào serviceSDK.ts
|
@@ -98,6 +101,7 @@ class SDK {
|
|
98
101
|
this.resource_permission = new resource_permission_1.ResourcePermissionService(this.endpoints.resource_permission, this.orgId, storeId);
|
99
102
|
this.cloud_rest = new cloud_rest_1.CloudRestService(this.endpoints.cloud_rest, this.orgId, storeId);
|
100
103
|
this.order_cloud_rest = new order_cloud_rest_1.OrderCloudRestService(this.endpoints.order_cloud_rest, this.orgId, storeId);
|
104
|
+
this.accounting_service = new accounting_service_1.AccountingService(this.endpoints.accounting_service, this.orgId, storeId);
|
101
105
|
}
|
102
106
|
}
|
103
107
|
exports.SDK = SDK;
|
@@ -0,0 +1,9 @@
|
|
1
|
+
import { Service } from "../serviceSDK";
|
2
|
+
export declare class AccountingService extends Service {
|
3
|
+
constructor(endpoint: string, orgId: string, storeId: string);
|
4
|
+
setToken(token: string): void;
|
5
|
+
setStoreId(storeId: string): void;
|
6
|
+
depositWallet(data: any): Promise<any>;
|
7
|
+
confirmDepositWallet(data: any): Promise<any>;
|
8
|
+
financialAccountWalletInfo(data: any): Promise<any>;
|
9
|
+
}
|
@@ -0,0 +1,69 @@
|
|
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 mutations_1 = require("../../graphql/accounting_service/mutations");
|
14
|
+
const queries_1 = require("../../graphql/accounting_service/queries");
|
15
|
+
const serviceSDK_1 = require("../serviceSDK");
|
16
|
+
class AccountingService extends serviceSDK_1.Service {
|
17
|
+
constructor(endpoint, orgId, storeId) {
|
18
|
+
super(endpoint, orgId, storeId);
|
19
|
+
}
|
20
|
+
setToken(token) {
|
21
|
+
this.token = token;
|
22
|
+
}
|
23
|
+
setStoreId(storeId) {
|
24
|
+
this.storeId = storeId;
|
25
|
+
}
|
26
|
+
depositWallet(data) {
|
27
|
+
return __awaiter(this, void 0, void 0, function* () {
|
28
|
+
const mutation = mutations_1.DEPOSIT_WALLET;
|
29
|
+
const variables = Object.assign({ partnerId: this.orgId, storeId: this.storeId }, data);
|
30
|
+
try {
|
31
|
+
const response = yield this.graphqlMutationCustomHeader(mutation, variables);
|
32
|
+
return response.depositWallet;
|
33
|
+
}
|
34
|
+
catch (error) {
|
35
|
+
console.log(`Error in depositWallet: ${error}`);
|
36
|
+
throw error;
|
37
|
+
}
|
38
|
+
});
|
39
|
+
}
|
40
|
+
confirmDepositWallet(data) {
|
41
|
+
return __awaiter(this, void 0, void 0, function* () {
|
42
|
+
const mutation = mutations_1.CONFIRM_DEPOSIT_WALLET;
|
43
|
+
const variables = Object.assign({ partnerId: this.orgId }, data);
|
44
|
+
try {
|
45
|
+
const response = yield this.graphqlMutationCustomHeader(mutation, variables);
|
46
|
+
return response.confirmDepositWallet;
|
47
|
+
}
|
48
|
+
catch (error) {
|
49
|
+
console.log(`Error in confirmDepositWallet: ${error}`);
|
50
|
+
throw error;
|
51
|
+
}
|
52
|
+
});
|
53
|
+
}
|
54
|
+
financialAccountWalletInfo(data) {
|
55
|
+
return __awaiter(this, void 0, void 0, function* () {
|
56
|
+
const query = queries_1.FINANCIAL_ACCOUNT_WALLET_INFO;
|
57
|
+
const variables = Object.assign({ partnerId: this.orgId }, data);
|
58
|
+
try {
|
59
|
+
const response = yield this.graphqlQueryCustomHeader(query, variables);
|
60
|
+
return response.financialAccountWalletInfo;
|
61
|
+
}
|
62
|
+
catch (error) {
|
63
|
+
console.log(`Error in financialAccountWalletInfo: ${error}`);
|
64
|
+
throw error;
|
65
|
+
}
|
66
|
+
});
|
67
|
+
}
|
68
|
+
}
|
69
|
+
exports.AccountingService = AccountingService;
|