@bookinglab/booking-journey-api 1.4.1 → 1.4.2

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.
Files changed (2) hide show
  1. package/README.md +98 -0
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -354,6 +354,104 @@ import type {
354
354
  } from '@bookinglab/booking-journey-api';
355
355
  ```
356
356
 
357
+ ### Example Response: ServicesResponse
358
+
359
+ When calling `useServices(companyId)` or `client.getServices(companyId)`, you'll receive a `ServicesResponse`:
360
+
361
+ ```typescript
362
+ {
363
+ total_entries: 2,
364
+ _embedded: {
365
+ services: [
366
+ {
367
+ id: 48320,
368
+ category_id: 1,
369
+ name: "Football 3G Astroturf Pitch Hire",
370
+ description: "Book a 3G Astroturf pitch",
371
+ durations: [60, 90, 120, 150, 180],
372
+ prices: [0, 0, 0, 0, 0],
373
+ detail_group_id: 18528,
374
+ listed_durations: [],
375
+ extra: {},
376
+ booking_time_step: 30,
377
+ can_refund_automatically: false,
378
+ is_event_group: false,
379
+ type: "service",
380
+ group_id: 1,
381
+ deleted: false,
382
+ queuing_disabled: true,
383
+ company_id: 37001,
384
+ min_advance_period: 172800, // seconds (2 days)
385
+ max_advance_period: 7776000, // seconds (90 days)
386
+ min_cancel_period: 172800, // seconds (2 days)
387
+ booking_type_public: "booking",
388
+ booking_type: 3,
389
+ mbooking_type: 5,
390
+ min_bookings: 1,
391
+ max_bookings: 1,
392
+ method_of_appointment: "In-person",
393
+ groups: [],
394
+ order: 48320,
395
+ child_level_service: false,
396
+ global_id: 48320,
397
+ availability: 0,
398
+ prices_in_major_units: [0.0, 0.0, 0.0, 0.0, 0.0],
399
+ combine_resource_and_staff: false,
400
+ disabled: false,
401
+ _links: {
402
+ self: { href: "https://api.jrni.com/api/v5/37001/services/48320" },
403
+ items: { href: "https://api.jrni.com/api/v5/37001/services/48320/items" }
404
+ }
405
+ }
406
+ ]
407
+ },
408
+ _links: {
409
+ self: { href: "https://api.jrni.com/api/v5/37001/services" }
410
+ }
411
+ }
412
+ ```
413
+
414
+ ### JrniService Type Definition
415
+
416
+ ```typescript
417
+ interface JrniService {
418
+ id: number; // Unique service identifier
419
+ name: string; // Display name
420
+ description: string; // Service description
421
+ durations: number[]; // Available durations in minutes
422
+ prices: number[]; // Prices corresponding to durations (in minor units)
423
+ detail_group_id: number; // Associated detail group ID
424
+ listed_durations: any[]; // Publicly listed durations
425
+ extra: Record<string, any>; // Custom extra fields
426
+ booking_time_step: number; // Booking time interval in minutes
427
+ can_refund_automatically: boolean; // Auto-refund capability
428
+ is_event_group: boolean; // Whether this is an event group
429
+ type: string; // Service type (e.g., "service")
430
+ group_id: number | null; // Parent group ID
431
+ deleted: boolean; // Soft delete flag
432
+ queuing_disabled: boolean; // Queue functionality flag
433
+ company_id: number; // Owning company ID
434
+ min_advance_period: number; // Minimum advance booking time (seconds)
435
+ max_advance_period: number; // Maximum advance booking time (seconds)
436
+ min_cancel_period: number; // Minimum cancellation notice (seconds)
437
+ booking_type_public: string; // Public booking type label
438
+ booking_type: number; // Internal booking type code
439
+ mbooking_type: number; // Mobile booking type code
440
+ min_bookings: number; // Minimum bookings required
441
+ max_bookings: number; // Maximum bookings allowed
442
+ method_of_appointment: string; // Appointment method (e.g., "In-person")
443
+ groups: any[]; // Associated groups
444
+ order: number; // Display order
445
+ child_level_service: boolean; // Child company service flag
446
+ global_id: number; // Global service identifier
447
+ availability: number; // Availability status
448
+ prices_in_major_units: number[]; // Prices in major currency units
449
+ combine_resource_and_staff: boolean; // Resource/staff combination flag
450
+ disabled: boolean; // Service disabled flag
451
+ _links: Record<string, any>; // HAL links
452
+ }
453
+ ```
454
+
357
455
  ## License
358
456
 
359
457
  MIT
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bookinglab/booking-journey-api",
3
- "version": "1.4.1",
3
+ "version": "1.4.2",
4
4
  "type": "module",
5
5
  "description": "TypeScript library for BookingLab and JRNI APIs with React hooks support",
6
6
  "main": "./dist/index.js",