@longvansoftware/service-js-client 1.20.6 → 1.20.7
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.
|
@@ -5,3 +5,4 @@ export declare const GET_QUANTITY_ORDER_LINEITEMS: DocumentNode;
|
|
|
5
5
|
export declare const GET_ORDER_LINE_ITEM_BY_SERVICE_ID: DocumentNode;
|
|
6
6
|
export declare const GET_ORDER_BY_SERVICE_ID: DocumentNode;
|
|
7
7
|
export declare const FIND_ORDER_BY_OWNER_PARTYID: DocumentNode;
|
|
8
|
+
export declare const CALC_EXCHANGE_PRICE_EXTEND_RESOURCE_DETAIL_DYNAMIC: (fields?: string[]) => DocumentNode;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.FIND_ORDER_BY_OWNER_PARTYID = exports.GET_ORDER_BY_SERVICE_ID = exports.GET_ORDER_LINE_ITEM_BY_SERVICE_ID = exports.GET_QUANTITY_ORDER_LINEITEMS = exports.GET_ORDER_DETAIL_DYNAMIC = exports.GET_ORDER_DETAIL = void 0;
|
|
3
|
+
exports.CALC_EXCHANGE_PRICE_EXTEND_RESOURCE_DETAIL_DYNAMIC = exports.FIND_ORDER_BY_OWNER_PARTYID = exports.GET_ORDER_BY_SERVICE_ID = exports.GET_ORDER_LINE_ITEM_BY_SERVICE_ID = exports.GET_QUANTITY_ORDER_LINEITEMS = exports.GET_ORDER_DETAIL_DYNAMIC = exports.GET_ORDER_DETAIL = void 0;
|
|
4
4
|
const graphql_tag_1 = require("graphql-tag");
|
|
5
5
|
exports.GET_ORDER_DETAIL = (0, graphql_tag_1.gql) `
|
|
6
6
|
query getOrderDetail($orderId: String!) {
|
|
@@ -138,46 +138,46 @@ exports.GET_ORDER_DETAIL = (0, graphql_tag_1.gql) `
|
|
|
138
138
|
title
|
|
139
139
|
}
|
|
140
140
|
resourceConfigs {
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
141
|
+
name
|
|
142
|
+
quantity
|
|
143
|
+
unit
|
|
144
|
+
productId
|
|
145
|
+
giftProductId
|
|
146
|
+
gift
|
|
147
|
+
giftQuantity
|
|
148
|
+
campaignId
|
|
149
|
+
campaignActionId
|
|
150
|
+
qualify
|
|
151
|
+
idParent
|
|
152
|
+
addQuantity
|
|
153
|
+
defaultQuantity
|
|
154
|
+
title
|
|
155
|
+
price
|
|
156
|
+
unitPrice
|
|
157
|
+
totalResource
|
|
158
|
+
}
|
|
159
|
+
resourceItems {
|
|
160
|
+
name
|
|
161
|
+
quantity
|
|
162
|
+
unit
|
|
163
|
+
productId
|
|
164
|
+
giftProductId
|
|
165
|
+
gift
|
|
166
|
+
giftQuantity
|
|
167
|
+
campaignId
|
|
168
|
+
campaignActionId
|
|
169
|
+
qualify
|
|
170
|
+
idParent
|
|
171
|
+
addQuantity
|
|
172
|
+
defaultQuantity
|
|
173
|
+
title
|
|
174
|
+
price
|
|
175
|
+
unitPrice
|
|
176
|
+
totalResource
|
|
177
|
+
unitGift
|
|
178
|
+
giftDuration
|
|
179
|
+
giftDurationUnit
|
|
180
|
+
}
|
|
181
181
|
itemType
|
|
182
182
|
}
|
|
183
183
|
serviceId
|
|
@@ -434,3 +434,27 @@ exports.FIND_ORDER_BY_OWNER_PARTYID = (0, graphql_tag_1.gql) `
|
|
|
434
434
|
findOrderByOwnerPartyId(partnerId: $partnerId, ownerPartyId: $ownerPartyId)
|
|
435
435
|
}
|
|
436
436
|
`;
|
|
437
|
+
const CALC_EXCHANGE_PRICE_EXTEND_RESOURCE_DETAIL_DYNAMIC = (fields = []) => {
|
|
438
|
+
const fieldStr = fields.join("\n ");
|
|
439
|
+
const hasFields = fields.length > 0;
|
|
440
|
+
return (0, graphql_tag_1.gql) `
|
|
441
|
+
query CalcExchangePriceExtendResourceDetail(
|
|
442
|
+
$partnerId: String!
|
|
443
|
+
$storeId: String!
|
|
444
|
+
$serviceId: String!
|
|
445
|
+
$productBaseIdNew: String!
|
|
446
|
+
$durationQuantity: BigDecimal!
|
|
447
|
+
$durationUnit: String!
|
|
448
|
+
) {
|
|
449
|
+
calcExchangePriceExtendResourceDetail(
|
|
450
|
+
partnerId: $partnerId
|
|
451
|
+
storeId: $storeId
|
|
452
|
+
serviceId: $serviceId
|
|
453
|
+
productBaseIdNew: $productBaseIdNew
|
|
454
|
+
durationQuantity: $durationQuantity
|
|
455
|
+
durationUnit: $durationUnit
|
|
456
|
+
) ${hasFields ? `{ ${fieldStr} }` : ""}
|
|
457
|
+
}
|
|
458
|
+
`;
|
|
459
|
+
};
|
|
460
|
+
exports.CALC_EXCHANGE_PRICE_EXTEND_RESOURCE_DETAIL_DYNAMIC = CALC_EXCHANGE_PRICE_EXTEND_RESOURCE_DETAIL_DYNAMIC;
|
|
@@ -13,4 +13,5 @@ export declare class OrderGraphQLService extends Service {
|
|
|
13
13
|
addToCart(serviceId: string, actorId: string, cartId: string): Promise<any>;
|
|
14
14
|
removeProductOptionOrderLineItem(orderLineItemId: string, optionId: string, updateBy: string): Promise<any>;
|
|
15
15
|
findOrderByOwnerPartyId(ownerPartyId: string): Promise<any>;
|
|
16
|
+
calcExchangePriceExtendResourceDetail(serviceId: string, productBaseIdNew: string, durationQuantity: string, durationUnit: string, fields: string[]): Promise<any>;
|
|
16
17
|
}
|
|
@@ -188,5 +188,26 @@ class OrderGraphQLService extends serviceSDK_1.Service {
|
|
|
188
188
|
}
|
|
189
189
|
});
|
|
190
190
|
}
|
|
191
|
+
calcExchangePriceExtendResourceDetail(serviceId, productBaseIdNew, durationQuantity, durationUnit, fields) {
|
|
192
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
193
|
+
const query = (0, queries_1.CALC_EXCHANGE_PRICE_EXTEND_RESOURCE_DETAIL_DYNAMIC)(fields);
|
|
194
|
+
const variables = {
|
|
195
|
+
partnerId: this.orgId,
|
|
196
|
+
storeId: this.storeId,
|
|
197
|
+
serviceId,
|
|
198
|
+
productBaseIdNew,
|
|
199
|
+
durationQuantity,
|
|
200
|
+
durationUnit,
|
|
201
|
+
};
|
|
202
|
+
try {
|
|
203
|
+
const response = yield this.graphqlQueryV2(query, variables);
|
|
204
|
+
return response.calcExchangePriceExtendResourceDetail;
|
|
205
|
+
}
|
|
206
|
+
catch (error) {
|
|
207
|
+
console.log(`Error in calcExchangePriceExtendResourceDetail: ${error}`);
|
|
208
|
+
throw error;
|
|
209
|
+
}
|
|
210
|
+
});
|
|
211
|
+
}
|
|
191
212
|
}
|
|
192
213
|
exports.OrderGraphQLService = OrderGraphQLService;
|