Tickets

APIDescription
GET api/tickets/FlightId/{flightId}

Returns the tickets of a flight

GET api/Tickets/passenger/{passengerId}

Returns the tickets of a passenger

GET api/Tickets

Returns a list of all tickets

GET api/Tickets/{id}

Returns a specific ticket by its ID

POST api/Tickets

Buys a ticket for a passenger on a specific seat, marking it as unavailable

PUT api/Tickets/{id}

Changes a ticket's seat, freeing the old one and taking the new one

DELETE api/Tickets/{id}

Cancels a ticket and frees its seat

Airports

APIDescription
GET api/Airports/IATACode/{iataCode}

Finds an airport by its IATA code

GET api/Airports

Returns a list of all airports

GET api/Airports/{id}

Returns a specific airport by its ID

POST api/Airports

Creates a new airport

PUT api/Airports/{id}

Updates an existing airport

DELETE api/Airports/{id}

Deletes an airport

Passengers

APIDescription
GET api/Passengers/passport/{passport}

Finds a passenger by passport number

GET api/Passengers

Returns a list of all passengers

GET api/Passengers/{id}

Returns a passenger by ID

POST api/Passengers

Creates a new passenger

PUT api/Passengers/{id}

Updates an existing passenger

DELETE api/Passengers/{id}

Deletes a passenger by ID

Flights

APIDescription
GET api/Flights/FlightNumber/{flightNumber}

Finds flights by their flight number

GET api/Flights/{id}/Seats

Returns the seats of a flight

GET api/Flights

Returns a list of all flights

GET api/Flights/{id}

Returns a specific flight by its ID

POST api/Flights

Creates a new flight and generates its seats automatically

PUT api/Flights/{id}

Updates a flight; regenerates seats if the airplane changes

DELETE api/Flights/{id}

Deletes a flight and its seats and tickets

Airplanes

APIDescription
GET api/Airplanes

Returns a list of all airplanes

GET api/Airplanes/{id}

Returns a specific airplane by its ID

POST api/Airplanes

Creates a new airplane

PUT api/Airplanes/{id}

Update an existing airplane

DELETE api/Airplanes/{id}

Deletes an existing airplane