@longvansoftware/service-js-client 1.3.7 → 1.3.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/computing/queries.js +2 -2
- package/dist/src/graphql/payment/mutations.d.ts +1 -0
- package/dist/src/graphql/payment/mutations.js +12 -1
- package/dist/src/graphql/payment/queries.d.ts +1 -0
- package/dist/src/graphql/payment/queries.js +38 -1
- package/dist/src/graphql/resource_permission/mutations.d.ts +1 -0
- package/dist/src/graphql/resource_permission/mutations.js +29 -0
- package/dist/src/graphql/user/mutations.d.ts +3 -0
- package/dist/src/graphql/user/mutations.js +54 -1
- package/dist/src/graphql/user/queries.d.ts +1 -0
- package/dist/src/graphql/user/queries.js +39 -6
- package/dist/src/lib/SDK.d.ts +3 -0
- package/dist/src/lib/SDK.js +4 -1
- package/dist/src/lib/computing/index.d.ts +1 -1
- package/dist/src/lib/computing/index.js +2 -1
- package/dist/src/lib/payment/index.d.ts +2 -0
- package/dist/src/lib/payment/index.js +34 -0
- package/dist/src/lib/resource_permission/index.d.ts +6 -0
- package/dist/src/lib/resource_permission/index.js +40 -0
- package/dist/src/lib/user/index.d.ts +4 -0
- package/dist/src/lib/user/index.js +68 -0
- package/package.json +1 -1
package/dist/config/config.d.ts
CHANGED
@@ -14,6 +14,7 @@ export declare const environmentEndpoints: {
|
|
14
14
|
crm_camping: string;
|
15
15
|
order_graphQL: string;
|
16
16
|
paymentLV: string;
|
17
|
+
resource_permission: string;
|
17
18
|
};
|
18
19
|
live: {
|
19
20
|
product: string;
|
@@ -30,5 +31,6 @@ export declare const environmentEndpoints: {
|
|
30
31
|
crm_camping: string;
|
31
32
|
order_graphQL: string;
|
32
33
|
paymentLV: string;
|
34
|
+
resource_permission: string;
|
33
35
|
};
|
34
36
|
};
|
package/dist/config/config.js
CHANGED
@@ -17,6 +17,7 @@ exports.environmentEndpoints = {
|
|
17
17
|
crm_camping: "https://crm.dev.longvan.vn/campaign-gateway/graphql",
|
18
18
|
order_graphQL: "https://api-gateway.dev.longvan.vn/order-cloud-service/graphql",
|
19
19
|
paymentLV: "https://payment.dev.longvan.vn/graphql",
|
20
|
+
resource_permission: "https://api-gateway.dev.longvan.vn/resource-permission-api/graphql"
|
20
21
|
},
|
21
22
|
live: {
|
22
23
|
product: "https://product-service.longvan.vn/product-service/graphql",
|
@@ -33,5 +34,6 @@ exports.environmentEndpoints = {
|
|
33
34
|
crm_camping: "https://crm.longvan.vn/campaign-gateway/graphql",
|
34
35
|
order_graphQL: "https://api-gateway.longvan.vn/order-cloud-service/graphql",
|
35
36
|
paymentLV: "https://payment-staging.longvan.vn/graphql",
|
37
|
+
resource_permission: "https://api-gateway.longvan.vn/resource-permission-api/graphql"
|
36
38
|
},
|
37
39
|
};
|
@@ -211,8 +211,8 @@ exports.GET_COMPUTINGS = (0, graphql_tag_1.gql) `
|
|
211
211
|
}
|
212
212
|
`;
|
213
213
|
exports.GET_LAB_INSTANCE = (0, graphql_tag_1.gql) `
|
214
|
-
query GetLabInstance($articleId: String!, $userId: String!) {
|
215
|
-
getLabInstance(articleId: $articleId, userId: $userId) {
|
214
|
+
query GetLabInstance($articleId: String!, $labId: String!, $userId: String!) {
|
215
|
+
getLabInstance(articleId: $articleId, labId: $labId, userId: $userId) {
|
216
216
|
id
|
217
217
|
name
|
218
218
|
username
|
@@ -1,6 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.CREATE_PAYMENT_ORDER_MUTATION = void 0;
|
3
|
+
exports.CREATE_VAT_INVOICE_REQUEST = exports.CREATE_PAYMENT_ORDER_MUTATION = void 0;
|
4
4
|
const graphql_tag_1 = require("graphql-tag");
|
5
5
|
exports.CREATE_PAYMENT_ORDER_MUTATION = (0, graphql_tag_1.gql) `
|
6
6
|
mutation CreatePaymentOrder(
|
@@ -38,3 +38,14 @@ exports.CREATE_PAYMENT_ORDER_MUTATION = (0, graphql_tag_1.gql) `
|
|
38
38
|
}
|
39
39
|
}
|
40
40
|
`;
|
41
|
+
exports.CREATE_VAT_INVOICE_REQUEST = (0, graphql_tag_1.gql) `
|
42
|
+
mutation CreateVatInvoiceRequest(
|
43
|
+
$vatInvoiceRequest: VatInvoiceRequest!
|
44
|
+
$createBy: String!
|
45
|
+
) {
|
46
|
+
createVatInvoiceRequest(
|
47
|
+
vatInvoiceRequest: $vatInvoiceRequest
|
48
|
+
createBy: $createBy
|
49
|
+
)
|
50
|
+
}
|
51
|
+
`;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.GEN_QR_PAYMENT = exports.GET_PAYMENT_METHOD = void 0;
|
3
|
+
exports.GET_VAT_INVOICE_REQUEST_BY_ORDER = exports.GEN_QR_PAYMENT = exports.GET_PAYMENT_METHOD = void 0;
|
4
4
|
const graphql_tag_1 = require("graphql-tag");
|
5
5
|
exports.GET_PAYMENT_METHOD = (0, graphql_tag_1.gql) `
|
6
6
|
query GetPaymentMethod($orgId: String!, $storeChannelId: String) {
|
@@ -28,3 +28,40 @@ exports.GEN_QR_PAYMENT = (0, graphql_tag_1.gql) `
|
|
28
28
|
)
|
29
29
|
}
|
30
30
|
`;
|
31
|
+
exports.GET_VAT_INVOICE_REQUEST_BY_ORDER = (0, graphql_tag_1.gql) `
|
32
|
+
query GetVatInvoiceRequestByOrder(
|
33
|
+
$orgId: String!
|
34
|
+
$orderId: String!
|
35
|
+
$offset: Int
|
36
|
+
$pageSize: Int
|
37
|
+
) {
|
38
|
+
getVatInvoiceRequestByOrder(
|
39
|
+
orgId: $orgId
|
40
|
+
orderId: $orderId
|
41
|
+
offset: $offset
|
42
|
+
pageSize: $pageSize
|
43
|
+
) {
|
44
|
+
content {
|
45
|
+
id
|
46
|
+
partyId
|
47
|
+
orderIds
|
48
|
+
vatInfoId
|
49
|
+
taxCode
|
50
|
+
represent
|
51
|
+
company
|
52
|
+
address
|
53
|
+
receiverName
|
54
|
+
receiverEmail
|
55
|
+
note
|
56
|
+
createdBy
|
57
|
+
createdStamp
|
58
|
+
updatedBy
|
59
|
+
updatedStamp
|
60
|
+
}
|
61
|
+
totalElements
|
62
|
+
totalPages
|
63
|
+
number
|
64
|
+
size
|
65
|
+
}
|
66
|
+
}
|
67
|
+
`;
|
@@ -0,0 +1 @@
|
|
1
|
+
export declare const SHARE_RESOURCE: import("graphql").DocumentNode;
|
@@ -0,0 +1,29 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.SHARE_RESOURCE = void 0;
|
4
|
+
const graphql_tag_1 = require("graphql-tag");
|
5
|
+
exports.SHARE_RESOURCE = (0, graphql_tag_1.gql) `
|
6
|
+
mutation ShareResource(
|
7
|
+
$partnerId: String!
|
8
|
+
$createModel: ShareResourceRequest!
|
9
|
+
) {
|
10
|
+
shareResource(partnerId: $partnerId, createModel: $createModel) {
|
11
|
+
id
|
12
|
+
name
|
13
|
+
resourceId
|
14
|
+
org
|
15
|
+
resourceType
|
16
|
+
oauthSharePermissions {
|
17
|
+
role
|
18
|
+
partyId
|
19
|
+
partyName
|
20
|
+
permission
|
21
|
+
}
|
22
|
+
description
|
23
|
+
createdStamp
|
24
|
+
updatedStamp
|
25
|
+
updatedBy
|
26
|
+
createdBy
|
27
|
+
}
|
28
|
+
}
|
29
|
+
`;
|
@@ -2,3 +2,6 @@ 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;
|
6
|
+
export declare const UPDATE_VAT_INFO: import("graphql").DocumentNode;
|
7
|
+
export declare const DELETE_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.DELETE_VAT_INFO = exports.UPDATE_VAT_INFO = 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,56 @@ 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
|
+
$createVatInfoRequest: CreateVatInfoRequest!
|
122
|
+
$createdBy: String!
|
123
|
+
) {
|
124
|
+
createVatInfo(
|
125
|
+
createVatInfoRequest: $createVatInfoRequest
|
126
|
+
createdBy: $createdBy
|
127
|
+
) {
|
128
|
+
id
|
129
|
+
company
|
130
|
+
taxCode
|
131
|
+
address
|
132
|
+
invoiceReceiveEmail1
|
133
|
+
invoiceReceiveEmail2
|
134
|
+
ownerPartyId
|
135
|
+
createdStamp
|
136
|
+
updatedStamp
|
137
|
+
updatedBy
|
138
|
+
createdBy
|
139
|
+
}
|
140
|
+
}
|
141
|
+
`;
|
142
|
+
exports.UPDATE_VAT_INFO = (0, graphql_tag_1.gql) `
|
143
|
+
mutation UpdateVatInfo(
|
144
|
+
$id: String!
|
145
|
+
$updateVatInfoRequest: UpdateVatInfoRequest!
|
146
|
+
$updateBy: String!
|
147
|
+
) {
|
148
|
+
updateVatInfo(
|
149
|
+
id: $id
|
150
|
+
updateVatInfoRequest: $updateVatInfoRequest
|
151
|
+
updateBy: $updateBy
|
152
|
+
) {
|
153
|
+
id
|
154
|
+
company
|
155
|
+
taxCode
|
156
|
+
address
|
157
|
+
invoiceReceiveEmail1
|
158
|
+
invoiceReceiveEmail2
|
159
|
+
ownerPartyId
|
160
|
+
createdStamp
|
161
|
+
updatedStamp
|
162
|
+
updatedBy
|
163
|
+
createdBy
|
164
|
+
}
|
165
|
+
}
|
166
|
+
`;
|
167
|
+
exports.DELETE_VAT_INFO = (0, graphql_tag_1.gql) `
|
168
|
+
mutation DeleteVatInfo($id: String!, $updatedBy: String!) {
|
169
|
+
deleteVatInfo(id: $id, updatedBy: $updatedBy)
|
170
|
+
}
|
171
|
+
`;
|
@@ -11,3 +11,4 @@ export declare const GET_CONTACT_INFOS_BY_COMPANY_ID: import("graphql").Document
|
|
11
11
|
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
|
+
export declare const GET_VAT_INFOR_BY_OWNER_PARTY_ID: import("graphql").DocumentNode;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
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_INFOR_BY_OWNER_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!]!) {
|
@@ -106,7 +106,11 @@ exports.SEARCH_CUSTOMER = (0, graphql_tag_1.gql) `
|
|
106
106
|
}
|
107
107
|
`;
|
108
108
|
exports.SEARCH_EMPLOYEES = (0, graphql_tag_1.gql) `
|
109
|
-
query SearchEmployees(
|
109
|
+
query SearchEmployees(
|
110
|
+
$keyword: String
|
111
|
+
$positionShortName: String
|
112
|
+
$partnerId: String
|
113
|
+
) {
|
110
114
|
searchEmployees(
|
111
115
|
keyword: $keyword
|
112
116
|
positionShortName: $positionShortName
|
@@ -132,13 +136,25 @@ exports.GET_POSTIONS_BY_EMPLOYEES_ID = (0, graphql_tag_1.gql) `
|
|
132
136
|
}
|
133
137
|
`;
|
134
138
|
exports.GET_STORE_CHANEL_IDS_BY_EMPLOYESS_ID = (0, graphql_tag_1.gql) `
|
135
|
-
query GetStoreChannelIdsByEmployeeId(
|
136
|
-
|
139
|
+
query GetStoreChannelIdsByEmployeeId(
|
140
|
+
$employeeId: String!
|
141
|
+
$partnerId: String!
|
142
|
+
) {
|
143
|
+
getStoreChannelIdsByEmployeeId(
|
144
|
+
employeeId: $employeeId
|
145
|
+
partnerId: $partnerId
|
146
|
+
)
|
137
147
|
}
|
138
148
|
`;
|
139
149
|
exports.GET_EMPLOYEES_BY_STORE_CHANEL_ID = (0, graphql_tag_1.gql) `
|
140
|
-
query GetEmployeesByStoreChannelId(
|
141
|
-
|
150
|
+
query GetEmployeesByStoreChannelId(
|
151
|
+
$storeChannelId: String!
|
152
|
+
$partnerId: String!
|
153
|
+
) {
|
154
|
+
getEmployeesByStoreChannelId(
|
155
|
+
storeChannelId: $storeChannelId
|
156
|
+
partnerId: $partnerId
|
157
|
+
) {
|
142
158
|
id
|
143
159
|
name
|
144
160
|
address
|
@@ -250,3 +266,20 @@ exports.GET_WARDS = (0, graphql_tag_1.gql) `
|
|
250
266
|
}
|
251
267
|
}
|
252
268
|
`;
|
269
|
+
exports.GET_VAT_INFOR_BY_OWNER_PARTY_ID = (0, graphql_tag_1.gql) `
|
270
|
+
query GetVatInfoByOwnerPartyId($ownerPartyId: String!) {
|
271
|
+
getVatInfoByOwnerPartyId(ownerPartyId: $ownerPartyId) {
|
272
|
+
id
|
273
|
+
company
|
274
|
+
taxCode
|
275
|
+
address
|
276
|
+
invoiceReceiveEmail1
|
277
|
+
invoiceReceiveEmail2
|
278
|
+
ownerPartyId
|
279
|
+
createdStamp
|
280
|
+
updatedStamp
|
281
|
+
updatedBy
|
282
|
+
createdBy
|
283
|
+
}
|
284
|
+
}
|
285
|
+
`;
|
package/dist/src/lib/SDK.d.ts
CHANGED
@@ -12,6 +12,7 @@ import { DnsService } from "../lib/dns/index";
|
|
12
12
|
import { CrmCampingService } from "./crm_camping";
|
13
13
|
import { OrderGraphQLService } from "./orderGraphQL";
|
14
14
|
import { PaymentLVService } from "./paymentLV";
|
15
|
+
import { ResourcePermissionService } from "./resource_permission";
|
15
16
|
export interface Endpoints {
|
16
17
|
product: string;
|
17
18
|
crm: string;
|
@@ -27,6 +28,7 @@ export interface Endpoints {
|
|
27
28
|
crm_camping: string;
|
28
29
|
order_graphQL: string;
|
29
30
|
paymentLV: string;
|
31
|
+
resource_permission: string;
|
30
32
|
}
|
31
33
|
export declare class SDK {
|
32
34
|
orgId: string;
|
@@ -47,6 +49,7 @@ export declare class SDK {
|
|
47
49
|
crm_camping: CrmCampingService;
|
48
50
|
order_graphQL: OrderGraphQLService;
|
49
51
|
paymentLV: PaymentLVService;
|
52
|
+
resource_permission: ResourcePermissionService;
|
50
53
|
token: string | null;
|
51
54
|
constructor(orgId: string, storeId: string, storefrontAccessToken: string, environment: string);
|
52
55
|
setToken(token: string): void;
|
package/dist/src/lib/SDK.js
CHANGED
@@ -18,6 +18,7 @@ const index_10 = require("../lib/dns/index");
|
|
18
18
|
const crm_camping_1 = require("./crm_camping");
|
19
19
|
const orderGraphQL_1 = require("./orderGraphQL");
|
20
20
|
const paymentLV_1 = require("./paymentLV");
|
21
|
+
const resource_permission_1 = require("./resource_permission");
|
21
22
|
class SDK {
|
22
23
|
constructor(orgId, storeId, storefrontAccessToken, environment) {
|
23
24
|
this.orgId = orgId;
|
@@ -25,7 +26,7 @@ class SDK {
|
|
25
26
|
this.storefrontAccessToken = storefrontAccessToken;
|
26
27
|
this.environment = environment;
|
27
28
|
this.token = null;
|
28
|
-
console.log("🚀 ~ SDK ~ environment:", environment);
|
29
|
+
//console.log("🚀 ~ SDK ~ environment:", environment);
|
29
30
|
(0, helpers_1.validateStorefrontAccessToken)(storefrontAccessToken);
|
30
31
|
const endpoints = environment == "live"
|
31
32
|
? config_1.environmentEndpoints.live
|
@@ -45,6 +46,7 @@ class SDK {
|
|
45
46
|
this.crm_camping = new crm_camping_1.CrmCampingService(endpoints.crm_camping, orgId, storeId);
|
46
47
|
this.order_graphQL = new orderGraphQL_1.OrderGraphQLService(endpoints.order_graphQL, orgId, storeId);
|
47
48
|
this.paymentLV = new paymentLV_1.PaymentLVService(endpoints.paymentLV, orgId, storeId);
|
49
|
+
this.resource_permission = new resource_permission_1.ResourcePermissionService(endpoints.resource_permission, orgId, storeId);
|
48
50
|
// Initialize other services here
|
49
51
|
}
|
50
52
|
setToken(token) {
|
@@ -64,6 +66,7 @@ class SDK {
|
|
64
66
|
this.crm_camping.setToken(token);
|
65
67
|
this.order_graphQL.setToken(token);
|
66
68
|
this.paymentLV.setToken(token);
|
69
|
+
this.resource_permission.setToken(token);
|
67
70
|
// Set token for other services here
|
68
71
|
}
|
69
72
|
// các module export từ serviceSDK.ts set storeId vào serviceSDK.ts
|
@@ -32,7 +32,7 @@ export declare class ComputingService extends Service {
|
|
32
32
|
networkUsageStartTime(computingId: string, type: string, startTime: string): Promise<any>;
|
33
33
|
diskUsageStartTime(computingId: string, type: string, startTime: string): Promise<any>;
|
34
34
|
getComputings(userId: string): Promise<any>;
|
35
|
-
getLabInstance(articleId: string, userId: string): Promise<any>;
|
35
|
+
getLabInstance(articleId: string, labId: string, userId: string): Promise<any>;
|
36
36
|
createCluster(ownerId: string, name: string): Promise<any>;
|
37
37
|
addComputingInCluster(clusterId: string, computingId: string, userId: string): Promise<any>;
|
38
38
|
removeComputingInCluster(clusterId: string, computingId: string, userId: string): Promise<any>;
|
@@ -426,11 +426,12 @@ class ComputingService extends serviceSDK_1.Service {
|
|
426
426
|
}
|
427
427
|
});
|
428
428
|
}
|
429
|
-
getLabInstance(articleId, userId) {
|
429
|
+
getLabInstance(articleId, labId, userId) {
|
430
430
|
return __awaiter(this, void 0, void 0, function* () {
|
431
431
|
const query = queries_1.GET_LAB_INSTANCE;
|
432
432
|
const variables = {
|
433
433
|
articleId,
|
434
|
+
labId,
|
434
435
|
userId,
|
435
436
|
};
|
436
437
|
try {
|
@@ -4,4 +4,6 @@ export declare class PaymentService extends Service {
|
|
4
4
|
getPaymentMethod(): Promise<any>;
|
5
5
|
createPaymentOrder(paymentOrderData: any): Promise<any>;
|
6
6
|
genQRPayment(orderId: any, totalAmount: any): Promise<any>;
|
7
|
+
createVatInvoiceRequest(vatInvoiceRequest: any, createBy: string): Promise<any>;
|
8
|
+
getVatInvoiceRequestByOrder(orderId: string, offset: number, pageSize: number): Promise<any>;
|
7
9
|
}
|
@@ -66,5 +66,39 @@ class PaymentService extends serviceSDK_1.Service {
|
|
66
66
|
}
|
67
67
|
});
|
68
68
|
}
|
69
|
+
createVatInvoiceRequest(vatInvoiceRequest, createBy) {
|
70
|
+
return __awaiter(this, void 0, void 0, function* () {
|
71
|
+
const data = {
|
72
|
+
vatInvoiceRequest,
|
73
|
+
createBy,
|
74
|
+
};
|
75
|
+
try {
|
76
|
+
const response = yield this.graphqlMutation(mutations_1.CREATE_VAT_INVOICE_REQUEST, data);
|
77
|
+
return response.createVatInvoiceRequest;
|
78
|
+
}
|
79
|
+
catch (error) {
|
80
|
+
console.log(`Error in createVatInvoiceRequest: ${error}`);
|
81
|
+
throw error;
|
82
|
+
}
|
83
|
+
});
|
84
|
+
}
|
85
|
+
getVatInvoiceRequestByOrder(orderId, offset, pageSize) {
|
86
|
+
return __awaiter(this, void 0, void 0, function* () {
|
87
|
+
const data = {
|
88
|
+
orgId: this.orgId,
|
89
|
+
orderId,
|
90
|
+
offset,
|
91
|
+
pageSize,
|
92
|
+
};
|
93
|
+
try {
|
94
|
+
const response = yield this.graphqlQuery(queries_1.GET_VAT_INVOICE_REQUEST_BY_ORDER, data);
|
95
|
+
return response.getVatInvoiceRequestByOrder;
|
96
|
+
}
|
97
|
+
catch (error) {
|
98
|
+
console.log(`Error in getVatInvoiceRequestByOrder: ${error}`);
|
99
|
+
throw error;
|
100
|
+
}
|
101
|
+
});
|
102
|
+
}
|
69
103
|
}
|
70
104
|
exports.PaymentService = PaymentService;
|
@@ -0,0 +1,40 @@
|
|
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.ResourcePermissionService = void 0;
|
13
|
+
const mutations_1 = require("../../graphql/resource_permission/mutations");
|
14
|
+
const serviceSDK_1 = require("../serviceSDK");
|
15
|
+
class ResourcePermissionService extends serviceSDK_1.Service {
|
16
|
+
constructor(endpoint, orgId, storeId) {
|
17
|
+
super(endpoint, orgId, storeId);
|
18
|
+
}
|
19
|
+
setToken(token) {
|
20
|
+
this.token = token;
|
21
|
+
}
|
22
|
+
shareResource(createModel) {
|
23
|
+
return __awaiter(this, void 0, void 0, function* () {
|
24
|
+
const mutation = mutations_1.SHARE_RESOURCE;
|
25
|
+
const variables = {
|
26
|
+
partnerId: this.orgId,
|
27
|
+
createModel,
|
28
|
+
};
|
29
|
+
try {
|
30
|
+
const response = yield this.graphqlMutationV2(mutation, variables);
|
31
|
+
return response.shareResource;
|
32
|
+
}
|
33
|
+
catch (error) {
|
34
|
+
console.log(`Error in shareResource: ${error}`);
|
35
|
+
throw error;
|
36
|
+
}
|
37
|
+
});
|
38
|
+
}
|
39
|
+
}
|
40
|
+
exports.ResourcePermissionService = ResourcePermissionService;
|
@@ -20,4 +20,8 @@ export declare class UserService extends Service {
|
|
20
20
|
getProvinces(): Promise<any>;
|
21
21
|
getDistricts(provinceId: string): Promise<any>;
|
22
22
|
getWards(districtId: string): Promise<any>;
|
23
|
+
getVatInfoByOwnerPartyId(ownerPartyId: string): Promise<any>;
|
24
|
+
createVatInfo(createVatInfoRequest: any, createdBy: string): Promise<any>;
|
25
|
+
updateVatInfo(id: string, updateVatInfoRequest: any, updateBy: string): Promise<any>;
|
26
|
+
deleteVatInfo(id: string, updatedBy: string): Promise<any>;
|
23
27
|
}
|
@@ -341,5 +341,73 @@ class UserService extends serviceSDK_1.Service {
|
|
341
341
|
}
|
342
342
|
});
|
343
343
|
}
|
344
|
+
getVatInfoByOwnerPartyId(ownerPartyId) {
|
345
|
+
return __awaiter(this, void 0, void 0, function* () {
|
346
|
+
const query = queries_1.GET_VAT_INFOR_BY_OWNER_PARTY_ID;
|
347
|
+
const variables = {
|
348
|
+
ownerPartyId,
|
349
|
+
};
|
350
|
+
try {
|
351
|
+
const response = yield this.graphqlQuery(query, variables);
|
352
|
+
return response.getVatInfoByOwnerPartyId;
|
353
|
+
}
|
354
|
+
catch (error) {
|
355
|
+
console.log(`Error in getVatInfoByOwnerPartyId: ${error}`);
|
356
|
+
throw error;
|
357
|
+
}
|
358
|
+
});
|
359
|
+
}
|
360
|
+
createVatInfo(createVatInfoRequest, createdBy) {
|
361
|
+
return __awaiter(this, void 0, void 0, function* () {
|
362
|
+
const mutation = mutations_1.CREATE_VAT_INFO;
|
363
|
+
const variables = {
|
364
|
+
createVatInfoRequest,
|
365
|
+
createdBy,
|
366
|
+
};
|
367
|
+
try {
|
368
|
+
const response = yield this.graphqlMutation(mutation, variables);
|
369
|
+
return response.createVatInfo;
|
370
|
+
}
|
371
|
+
catch (error) {
|
372
|
+
console.log(`Error in createVatInfo: ${error}`);
|
373
|
+
throw error;
|
374
|
+
}
|
375
|
+
});
|
376
|
+
}
|
377
|
+
updateVatInfo(id, updateVatInfoRequest, updateBy) {
|
378
|
+
return __awaiter(this, void 0, void 0, function* () {
|
379
|
+
const mutation = mutations_1.UPDATE_VAT_INFO;
|
380
|
+
const variables = {
|
381
|
+
id,
|
382
|
+
updateVatInfoRequest,
|
383
|
+
updateBy,
|
384
|
+
};
|
385
|
+
try {
|
386
|
+
const response = yield this.graphqlMutation(mutation, variables);
|
387
|
+
return response.updateVatInfo;
|
388
|
+
}
|
389
|
+
catch (error) {
|
390
|
+
console.log(`Error in updateVatInfo: ${error}`);
|
391
|
+
throw error;
|
392
|
+
}
|
393
|
+
});
|
394
|
+
}
|
395
|
+
deleteVatInfo(id, updatedBy) {
|
396
|
+
return __awaiter(this, void 0, void 0, function* () {
|
397
|
+
const mutation = mutations_1.DELETE_VAT_INFO;
|
398
|
+
const variables = {
|
399
|
+
id,
|
400
|
+
updatedBy,
|
401
|
+
};
|
402
|
+
try {
|
403
|
+
const response = yield this.graphqlMutation(mutation, variables);
|
404
|
+
return response.deleteVatInfo;
|
405
|
+
}
|
406
|
+
catch (error) {
|
407
|
+
console.log(`Error in deleteVatInfo: ${error}`);
|
408
|
+
throw error;
|
409
|
+
}
|
410
|
+
});
|
411
|
+
}
|
344
412
|
}
|
345
413
|
exports.UserService = UserService;
|