Skip to content

Commit

Permalink
Add passenger details API call
Browse files Browse the repository at this point in the history
  • Loading branch information
LeoAdamek committed Oct 9, 2024
1 parent 43ee70f commit a72a4b7
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "tigerbay",
"version": "1.1.1-beta.1",
"version": "1.1.2-beta.1",
"description": "API Client library for TigerBay",
"main": "lib/client.js",
"type": "commonjs",
Expand Down
22 changes: 20 additions & 2 deletions src/models/passengers.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { AxiosInstance } from "axios";
import { APIGroup, PatchPayload } from "./common";
import { APIGroup, LinkedObject, PatchPayload } from "./common";
import { CustomerContact } from "./customers";
import { Note } from "./notes";
import { AddNoteRequest } from "./reservations";
Expand Down Expand Up @@ -76,7 +76,6 @@ export class PassengerAPI extends APIGroup {
return (await this.axios.delete(`${this.path}/insurances/${id}`))
}


public async notes(): Promise<Note[]> {
return (await this.axios.get(`${this.path}/notes`)).data
}
Expand All @@ -89,6 +88,10 @@ export class PassengerAPI extends APIGroup {
return (await this.axios.delete(`${this.path}/notes/${id}`))
}

public async details(): Promise<Passenger> {
return (await this.axios.get(this.path)).data
}

/**
* Get the path to the current passenger resource.
*/
Expand All @@ -97,6 +100,21 @@ export class PassengerAPI extends APIGroup {
}
}

export interface Passenger extends LinkedObject {
Id: number
BundleReference: string
ReservationId: number
CustomerId?: number
Type: string
Title: string
Forename: string
MiddleName: string
Surname: string
Gender: string
IsLead: boolean
DateOfBirth: string
PlaceOfBirth: string | null
}

export interface PassengerAPIS {
DocumentType: string;
Expand Down
2 changes: 1 addition & 1 deletion src/version.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const VERSION = "0.5.4"
export const VERSION = "1.1.2"

0 comments on commit a72a4b7

Please sign in to comment.