@vulog/aima-booking 1.2.36 → 1.2.37
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/index.cjs +5 -1
- package/dist/index.mjs +5 -1
- package/package.json +3 -3
- package/src/getSlaves.test.ts +14 -0
- package/src/getSlaves.ts +1 -1
package/dist/index.cjs
CHANGED
|
@@ -470,7 +470,11 @@ const getAdditionalDrivers = async (client, parentId) => {
|
|
|
470
470
|
//#region src/getSlaves.ts
|
|
471
471
|
const schema$2 = zod.z.object({
|
|
472
472
|
parentId: zod.z.string().trim().min(1),
|
|
473
|
-
status: zod.z.enum([
|
|
473
|
+
status: zod.z.enum([
|
|
474
|
+
"ONGOING",
|
|
475
|
+
"COMPLETED",
|
|
476
|
+
"UPCOMING"
|
|
477
|
+
])
|
|
474
478
|
});
|
|
475
479
|
const getSlaves = async (client, parentId, status) => {
|
|
476
480
|
const result = schema$2.safeParse({
|
package/dist/index.mjs
CHANGED
|
@@ -446,7 +446,11 @@ const getAdditionalDrivers = async (client, parentId) => {
|
|
|
446
446
|
//#region src/getSlaves.ts
|
|
447
447
|
const schema$2 = z.object({
|
|
448
448
|
parentId: z.string().trim().min(1),
|
|
449
|
-
status: z.enum([
|
|
449
|
+
status: z.enum([
|
|
450
|
+
"ONGOING",
|
|
451
|
+
"COMPLETED",
|
|
452
|
+
"UPCOMING"
|
|
453
|
+
])
|
|
450
454
|
});
|
|
451
455
|
const getSlaves = async (client, parentId, status) => {
|
|
452
456
|
const result = schema$2.safeParse({
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vulog/aima-booking",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.2.
|
|
4
|
+
"version": "1.2.37",
|
|
5
5
|
"main": "dist/index.cjs",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
7
7
|
"types": "dist/index.d.cts",
|
|
@@ -32,8 +32,8 @@
|
|
|
32
32
|
"author": "Vulog",
|
|
33
33
|
"license": "MIT",
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@vulog/aima-client": "1.2.
|
|
36
|
-
"@vulog/aima-core": "1.2.
|
|
35
|
+
"@vulog/aima-client": "1.2.37",
|
|
36
|
+
"@vulog/aima-core": "1.2.37"
|
|
37
37
|
},
|
|
38
38
|
"peerDependencies": {
|
|
39
39
|
"es-toolkit": "^1.39.9",
|
package/src/getSlaves.test.ts
CHANGED
|
@@ -57,4 +57,18 @@ describe('getSlaves', () => {
|
|
|
57
57
|
expect(result).toEqual(slaves);
|
|
58
58
|
expect(result).toHaveLength(1);
|
|
59
59
|
});
|
|
60
|
+
|
|
61
|
+
test('accepts COMPLETED status and calls GET with correct URL', async () => {
|
|
62
|
+
const parentId = '87438128-2e44-4255-8a37-660af7d66de5';
|
|
63
|
+
const slaves: BookingRequestSlave[] = [];
|
|
64
|
+
getMock.mockResolvedValueOnce({ data: slaves });
|
|
65
|
+
|
|
66
|
+
const result = await getSlaves(client, parentId, 'COMPLETED');
|
|
67
|
+
|
|
68
|
+
expect(getMock).toHaveBeenCalledTimes(1);
|
|
69
|
+
expect(getMock).toHaveBeenCalledWith(
|
|
70
|
+
`/boapi/proxy/user/scheduledBooking/fleets/FLEET_ID/subscription/bookingRequests/${parentId}/bookingRequestsSlave?bookingStatus=COMPLETED`
|
|
71
|
+
);
|
|
72
|
+
expect(result).toEqual([]);
|
|
73
|
+
});
|
|
60
74
|
});
|
package/src/getSlaves.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { BookingRequestSlave } from './types';
|
|
|
5
5
|
|
|
6
6
|
const schema = z.object({
|
|
7
7
|
parentId: z.string().trim().min(1),
|
|
8
|
-
status: z.enum(['ONGOING, COMPLETED', 'UPCOMING']),
|
|
8
|
+
status: z.enum(['ONGOING', 'COMPLETED', 'UPCOMING']),
|
|
9
9
|
});
|
|
10
10
|
|
|
11
11
|
export const getSlaves = async (client: Client, parentId: string, status: string): Promise<BookingRequestSlave[]> => {
|