Skip to content

HalitGrpnr/flight-ticket

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

flight-ticket application

rest api for flight-ticket

  • AIRPORT
  1. get all airports

GET /airports

  1. get airport by name

GET /airports/name/{name}

  1. get airport by id

GET /airports/{id}

  1. add airport

POST /airports

Airport JSON body: { "name": "airportName" }

  1. delete airport

DELETE /airports/{id}

  1. update airport

PUT /airports

Airport JSON body: { "id": "airportId", "name": "airportName" }


  • COMPANY
  1. get all companies

GET /companies

  1. get company by name

GET /companies/name/{name}

  1. get company by id

GET /companies/{id}

  1. add company

POST /companies

Company JSON body: { "name": "companyName" }

  1. delete company

DELETE /companies/{id}

  1. update company

PUT /companies

Company JSON body: { "id": "companyId", "name": "companyName", "flights": "companyFlights" }


  • ROUTE
  1. get all routes

GET /routes

  1. get route by id

GET /routes/{id}

  1. get route by departure

GET /routes/departure/{name}

  1. get route by destination

GET /routes/destination/{name}

  1. add route

POST /routes

Route JSON body: { "departure": { "name": "departureName" }, "destination": { "name": "destinationName" } }

  1. delete route

DELETE /routes/{id}

  1. update route

PUT /routes

Route JSON body: { "id": "routeId", "departure": { "id": "departureId", "name": "departureName" }, "destination": { "id": "destinationId", "name": "destinationName" } }


  • FLIGHT
  1. get all flights

GET /flights

  1. get flights by company name

GET /flights/company/{name}

  1. get flight by id

GET /flights/{id}

  1. add flight

POST /flights

Flight JSON body: { "route": { "id": "routeId" }, "company": { "name": "companyName" }, "price": "flightPrice", "seatNumber": "seatNumber" }

  1. delete flight

DELETE /flights/{id}

  1. update flight

PUT /flights

Flight JSON body: { "id": "flightId", "route": { "id": "routeId", "departure": { "id": "departureId", "name": "departureName" }, "destination": { "id": "destinationId", "name": "destinationName" } }, "date": "flightDate", "price": "flightPrice", "seatNumber": "seatNumber" }


  • TICKET
  1. get all tickets

GET /tickets

  1. get ticket by id

GET /tickets/{id}

  1. add ticket

POST /tickets

Ticket JSON body: { "flight": { "id": "flightId" }, "creditCardNumber": "creditCardNumber", "status": "ticketStatus" }

  1. delete ticket

DELETE /tickets/{id}

  1. update ticket

PUT /tickets

Ticket JSON body: { "id": "ticketId", "flight": { "id": "flightId", "route": { "id": "routeId", "departure": { "id": "departureId", "name": "departureName" }, "destination": { "id": "destinationId", "name": "destinationName" } }, "date": "flightDate", "price": "flightPrice", "seatNumber": "seatNumber" }, "creditCardNumber": "creditCardNumber", "status": "ticketStatus" }

About

flight ticket application

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages