Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/Stays/Bookings/Bookings.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const mockBookingParams: StaysBookingPayload = {
metadata: {
customer_reference_number: 'ABXYZZ53Z',
},
users: ['icu_00009htyDGjIfajdNBZRlw'],
}

const duffel = new Duffel({ token: 'mockToken' })
Expand Down
11 changes: 11 additions & 0 deletions src/Stays/Bookings/Bookings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,23 @@ export interface StaysBookingPayload {
guests: Array<{
given_name: string
family_name: string
/**
* Creates an association between the guest and a previously created user.
* This is intended to allow guests the ability to manage their own bookings.
* @example ["icu_0000000000000000000000"]
*/
user_id?: string
}>
email: string
phone_number: string
accommodation_special_requests?: string
payment?: { card_id: string } | { three_d_secure_session_id: string }
metadata?: StaysBooking['metadata']
/**
* The ids of users that would be allowed to manage the booking.
* @example ["icu_0000000000000000000000"]
*/
users?: string[]
}

export class Bookings extends Resource {
Expand Down
1 change: 1 addition & 0 deletions src/Stays/mocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ export const MOCK_CREATE_BOOKING_PAYLOAD: StaysBookingPayload = {
email: '[email protected]',
phone_number: '+44 07242242424',
accommodation_special_requests: '',
users: ['icu_00009htyDGjIfajdNBZRlw'],
}

export const MOCK_QUOTE: StaysQuote = {
Expand Down
13 changes: 13 additions & 0 deletions src/booking/Orders/OrdersTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,13 @@ export interface CreateOrderPassenger extends Omit<OrderPassenger, 'type'> {
*/
identity_documents?: OrderPassengerIdentityDocument[]

/**
* Creates an association between the passenger and a previously created user.
* This is intended to allow passengers the ability to manage their own orders.
* @example "icu_0000000000000000000000"
*/
user_id?: string

/**
* The passenger's email address
* @example "[email protected]"
Expand Down Expand Up @@ -630,6 +637,12 @@ export interface CreateOrder {
*/
type: 'instant' | 'pay_later'

/**
* The ids of users that would be allowed to manage the order.
* @example ["icu_0000000000000000000000"]
*/
users?: string[]

/**
* Metadata contains a set of key-value pairs that you can attach to an object. It can be useful for storing additional information about the object, in a structured format. Duffel does not use this information. You should not store sensitive information in this field.
*
Expand Down
2 changes: 2 additions & 0 deletions src/booking/Orders/mockOrders.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,10 @@ export const mockCreateOrderRequest: CreateOrder = {
family_name: 'Earhart',
email: '[email protected]',
born_on: '1987-07-24',
user_id: 'icu_00009htyDGjIfajdNBZRlw',
},
],
users: ['icu_00009htyDGjIfajdNBZRlw'],
}

export const mockOrder: Order = {
Expand Down