interface ItineraryInventoryItemsService {
    create(
        input: CreateItineraryInventoryItemInput,
    ): Promise<SavedItineraryInventoryItem>;
    findById(id: string): Promise<null | SavedItineraryInventoryItem>;
    hasAvailableInventoryItems(
        itineraryId: string,
        enabledPackages: PackageLevel[],
        minStartDate?: Date,
    ): Promise<boolean>;
    listByItineraryId(
        itineraryId: string,
    ): Promise<SavedItineraryInventoryItem[]>;
    listByItineraryIdWithTrips(
        itineraryId: string,
    ): Promise<SavedItineraryInventoryItemWithTrips[]>;
    update(
        id: string,
        input: Partial<
            Omit<ItineraryInventoryItem, "startDate" | SystemGeneratedFields>,
        >,
    ): Promise<SavedItineraryInventoryItem>;
}

Methods

  • Checks if there are available inventory items for a specific itinerary and package levels. If minStartDate is provided, it will also check if the inventory items have a start date greater than or equal to the minStartDate, otherwise it will check based on the current date.

    Parameters

    • itineraryId: string
    • enabledPackages: PackageLevel[]
    • OptionalminStartDate: Date

    Returns Promise<boolean>