@longvansoftware/storefront-js-client 4.5.2 → 4.5.4
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/src/graphql/cloudCloud/mutations.d.ts +1 -0
- package/dist/src/graphql/cloudCloud/mutations.js +6 -1
- package/dist/src/graphql/cloudCloud/queries.d.ts +1 -0
- package/dist/src/graphql/cloudCloud/queries.js +6 -1
- package/dist/src/graphql/product/queries.js +9 -0
- package/dist/src/lib/cloudCloud/index.d.ts +2 -0
- package/dist/src/lib/cloudCloud/index.js +31 -0
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.UPDATE_SERVICE_RESOURCE = exports.UPDATE_DESCRIPTION = void 0;
|
|
3
|
+
exports.RECOUNT_USED_BOOKING = exports.UPDATE_SERVICE_RESOURCE = exports.UPDATE_DESCRIPTION = void 0;
|
|
4
4
|
const graphql_tag_1 = require("graphql-tag");
|
|
5
5
|
exports.UPDATE_DESCRIPTION = (0, graphql_tag_1.gql) `
|
|
6
6
|
mutation UpdateDescription(
|
|
@@ -34,3 +34,8 @@ exports.UPDATE_SERVICE_RESOURCE = (0, graphql_tag_1.gql) `
|
|
|
34
34
|
)
|
|
35
35
|
}
|
|
36
36
|
`;
|
|
37
|
+
exports.RECOUNT_USED_BOOKING = (0, graphql_tag_1.gql) `
|
|
38
|
+
mutation RecountUsedBookings($serviceId: String!, $actorId: String!) {
|
|
39
|
+
recountUsedBookings(serviceId: $serviceId, actorId: $actorId)
|
|
40
|
+
}
|
|
41
|
+
`;
|
|
@@ -2,3 +2,4 @@ export declare const SEARCH_SERVICE: import("graphql").DocumentNode;
|
|
|
2
2
|
export declare const SERVICE_DETAIL: import("graphql").DocumentNode;
|
|
3
3
|
export declare const SEARCH_SERVICE_BY_PHONE: import("graphql").DocumentNode;
|
|
4
4
|
export declare const GET_LIST_LAB_SERVICE: import("graphql").DocumentNode;
|
|
5
|
+
export declare const COUNT_AVAILABLE_BOOKING: import("graphql").DocumentNode;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.GET_LIST_LAB_SERVICE = exports.SEARCH_SERVICE_BY_PHONE = exports.SERVICE_DETAIL = exports.SEARCH_SERVICE = void 0;
|
|
3
|
+
exports.COUNT_AVAILABLE_BOOKING = exports.GET_LIST_LAB_SERVICE = exports.SEARCH_SERVICE_BY_PHONE = exports.SERVICE_DETAIL = exports.SEARCH_SERVICE = void 0;
|
|
4
4
|
const graphql_tag_1 = require("graphql-tag");
|
|
5
5
|
exports.SEARCH_SERVICE = (0, graphql_tag_1.gql) `
|
|
6
6
|
query SearchService($filter: CloudServiceFilterInput) {
|
|
@@ -178,3 +178,8 @@ exports.GET_LIST_LAB_SERVICE = (0, graphql_tag_1.gql) `
|
|
|
178
178
|
}
|
|
179
179
|
}
|
|
180
180
|
`;
|
|
181
|
+
exports.COUNT_AVAILABLE_BOOKING = (0, graphql_tag_1.gql) `
|
|
182
|
+
query countAvailableBookings($serviceId: String!) {
|
|
183
|
+
countAvailableBookings(serviceId: $serviceId)
|
|
184
|
+
}
|
|
185
|
+
`;
|
|
@@ -7,4 +7,6 @@ export declare class CloudCloudService extends Service {
|
|
|
7
7
|
searchServiceByPhone(phone: string, serviceScope: string): Promise<any>;
|
|
8
8
|
getListLabService(productId: string): Promise<any>;
|
|
9
9
|
updateServiceResource(data: Record<string, any>): Promise<any>;
|
|
10
|
+
countAvailableBookings(serviceId: string): Promise<any>;
|
|
11
|
+
recountUsedBookings(serviceId: string, actorId: string): Promise<any>;
|
|
10
12
|
}
|
|
@@ -107,5 +107,36 @@ class CloudCloudService extends serviceSDK_1.Service {
|
|
|
107
107
|
}
|
|
108
108
|
});
|
|
109
109
|
}
|
|
110
|
+
countAvailableBookings(serviceId) {
|
|
111
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
112
|
+
const queries = queries_1.COUNT_AVAILABLE_BOOKING;
|
|
113
|
+
const variables = {
|
|
114
|
+
serviceId,
|
|
115
|
+
};
|
|
116
|
+
try {
|
|
117
|
+
const response = yield this.graphqlQueryV4(queries, variables);
|
|
118
|
+
return response.countAvailableBookings;
|
|
119
|
+
}
|
|
120
|
+
catch (error) {
|
|
121
|
+
throw error;
|
|
122
|
+
}
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
recountUsedBookings(serviceId, actorId) {
|
|
126
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
127
|
+
const mutation = mutations_1.RECOUNT_USED_BOOKING;
|
|
128
|
+
const variables = {
|
|
129
|
+
serviceId,
|
|
130
|
+
actorId,
|
|
131
|
+
};
|
|
132
|
+
try {
|
|
133
|
+
const response = yield this.graphqlMutationV2(mutation, variables);
|
|
134
|
+
return response.recountUsedBookings;
|
|
135
|
+
}
|
|
136
|
+
catch (error) {
|
|
137
|
+
throw error;
|
|
138
|
+
}
|
|
139
|
+
});
|
|
140
|
+
}
|
|
110
141
|
}
|
|
111
142
|
exports.CloudCloudService = CloudCloudService;
|