Skip to content

vSivarajah/AirlineReservation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Airline

Create a reservation

There should exist a sourceairport and targetairport in the flight list

curl localhost:8081/reservations | jq 
{
  "reservation": [
    {
      "id": 2,
      "paymentsuccessful": false,
      "passenger": {
        "firstname": "tony",
        "lastname": "rådyr",
        "passportnumber": 12345,
        "dateofbirth": "201292",
        "email": "",
        "creditcardnumber": 0
      },
      "flightinfo": {
        "flightnumber": "BOEING777",
        "operatingairlines": "Emirates",
        "sourceairport": "Oslo",
        "targetairport": "Cancun"
      }
    }
  ]
}

Create a payment for an existing reservation. paymentid is the same as id in reservation

curl -X POST localhost:8081/payment/pay -d '{"paymentid": 2}'

Update the reservation in order to set payment to true

curl -X PUT localhost:8081/reservation/2 -d '{"id": 2}'

List the reservations made

curl -X GET localhost:8081/reservations | jq

Get the available flights

curl -X GET localhost:8081/test | jq

Cobra CLI

Init application

cobra init --pkg-name=gitHub.com/vSivarajah/AirlineReservation

Start CLI

go install github.com/vSivarajah/AirlineReservation

Run commands

AirlineReservation erik
AirlineReservation get flights

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages