destinations: [
{
id: 1,
destination: "Lima, Peru",
estimatedLodgingCostPerDay: 70,
estimatedFlightCostPerPerson: 400,
image: "https://images.unsplash.com/photo-1489171084589-9b5031ebcf9b?ixlib=rb-
1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=2089&q=80",
alt: "overview of city buildings with a clear sky"
},
{
id: 2,
destination: "Stockholm, Sweden",
estimatedLodgingCostPerDay: 100,
estimatedFlightCostPerPerson: 780,
image: "https://images.unsplash.com/photo-1560089168-6516081f5bf1?ixlib=rb
1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=1950&q=80",
alt: "city with boats on the water during the day time"
},
]
Destinations Class
Create mock trips data for testing suite:
mockDestinartionsData.js
filehttp://localhost:3001/api/v1/destinations
API endpointCreate new Destinations
let destinations = new Destinations(destinationsData);
Destinations.js
fileexport default Trips
Properties
Methods
calculateAYearTripsExpense(travelerTrips, year)
calculateTripEstimate(trip)
getDestination(destinationID);
~- [ ]estimatedFlightCostPerPerson(destinationID);
~ ~- [ ]getDestinationImg(destinationID);
~ ~- [ ]getDestinationImgAlt(destinationID);
~Sample Data: