Vai al contenuto

ACMESky

Torna a Servizi web.

Panoramica

Dentro la rete Docker acmesky-network, tutti gli URI sono relativi a http://acmesky_backend:8080.
Da fuori Docker, la porta per raggiungere il servizio è 9000.

Risorsa Descrizione Risorsa per
POST /offers/buy Richiede l'avvio di un processo di acquisto dell'offerta con il codice offerta passato come argomento. Utente finale
POST /offers/lastminute Permette alle compagnie aeree di notificare ACMESky della presenza di nuove offerte last minute. Flight Company
POST /interests Registra l'interesse di un utente per la ricezione di offerte di volo A/R. Utente finale
POST /payments Invia le informazioni di pagamento ricevute dall'utente a fini di verifica. Payment Provider

Richieste

POST /offers/buy

Richiede l'avvio di un processo di acquisto dell'offerta con il codice offerta passato come argomento.

Parametri

Nome Tipo
OfferPurchaseData OfferPurchaseData

Tipo ritornato

Header della richiesta

  • Content-Type: application/json
  • Accept: application/json

POST /offers/lastminute

Permette alle compagnie aeree di notificare ACMESky della presenza di nuove offerte last minute.

Parametri

Nome Tipo
company_name String
Flight List

Tipo ritornato

  • 200: -
  • 400: -

Header della richiesta

  • Content-Type: application/json
  • Accept: application/json

POST /interests

Registra l'interesse di un utente per la ricezione di offerte di volo A/R.

Parametri

Nome Tipo
Interest Interest

Tipo ritornato

Header della richiesta

  • Content-Type: application/json
  • Accept: application/json

POST /payments

Invia le informazioni di pagamento ricevute dall'utente a fini di verifica.

Parametri

Nome Tipo
PaymentInformation PaymentInformation

Tipo ritornato

  • 200: -
  • 400: -

Header della richiesta

  • Content-Type: application/json
  • Accept: application/json

Modelli

Address

Nome Tipo
street String
number String
city String
zip_code String
country String

BuyOfferResponse

Nome Tipo
communication_code String

Error

Nome Tipo
Descrizione String

Flight

Nome Tipo
flight_id String
departure_airport_code String
arrival_airport_code String
cost Double
departure_datetime DateTime
arrival_datetime DateTime

Interest

Nome Tipo
departure_airport_code String
arrival_airport_code String
min_departure_date Date
max_comeback_date Date
max_price Double
prontogram_username String

OfferPurchaseData

Nome Tipo
offer_code String
address Address
name String
surname String

PaymentInformation

Nome Tipo
transaction_id UUID
status Boolean

Interfaccia OpenAPI

Nel seguente blocco (cliccare sulla barra con su scritto "OpenAPI" in basso per aprirlo) è possibile visualizzare l'interfaccia OpenAPI che descrive il funzionamento delle API fornite da ACMESky.

OpenAPI
openapi: 3.0.0
info:
  title: ACMESky
  version: '1.0'
  description: Interface that models the operations for ACMESky.
servers:
  - url: 'http://acmesky_backend:8080'
    description: Inside the docker network
  - url: 'http://chosen_url:9000'
    description: Outside the Docker network (chosen_url is a placeholder)
paths:
  /offers/lastminute:
    post:
      summary: publishLastMinuteOffer
      operationId: publishLastMinuteOffer
      responses:
        '200':
          description: OK
        '400':
          description: Bad Request
      description: |-
        Allows flight companies to notify ACMESky of the presence of new last minute offers.
        API for: Flight Company
      requestBody:
        content:
          application/json:
            schema:
              type: array
              items:
                $ref: '#/components/schemas/Flight'
      parameters:
        - schema:
            type: string
          in: query
          name: company_name
          description: Name of the flight company
          required: true
    parameters: []
  /offers/buy:
    post:
      summary: buyOffer
      operationId: buyOffer
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BuyOfferResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      description: |-
        Requires to start the buying process of the offer with the given offer code.
        API for: User
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OfferPurchaseData'
        description: ''
  /payments:
    post:
      summary: sendPaymentInformation
      operationId: sendPaymentInformation
      responses:
        '200':
          description: OK
        '400':
          description: Bad Request
      description: |-
        Sends the information received by the user for verification purposes.
        API for: Payment Provider
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PaymentInformation'
        description: ''
  /interests:
    post:
      summary: registerInterest
      operationId: registerInterest
      responses:
        '200':
          description: OK
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Interest'
      description: |-
        Register the user interest for roundtrip flights.
        API for: User
components:
  schemas:
    Flight:
      title: Flight
      type: object
      properties:
        flight_id:
          type: string
        departure_airport_code:
          type: string
          pattern: '[A-Z]{3,3}'
        arrival_airport_code:
          type: string
          pattern: '[A-Z]{3,3}'
        cost:
          type: number
          format: double
          minimum: 0
        departure_datetime:
          type: string
          format: date-time
        arrival_datetime:
          type: string
          format: date-time
      required:
        - flight_id
        - departure_airport_code
        - arrival_airport_code
        - cost
        - departure_datetime
        - arrival_datetime
    OfferPurchaseData:
      title: OfferPurchaseData
      type: object
      properties:
        offer_code:
          type: string
          minLength: 1
        address:
          $ref: '#/components/schemas/Address'
        name:
          type: string
          minLength: 1
        surname:
          type: string
          minLength: 1
      required:
        - offer_code
        - address
        - name
        - surname
    Address:
      title: Address
      type: object
      properties:
        street:
          type: string
        number:
          type: string
        city:
          type: string
        zip_code:
          type: string
        country:
          type: string
      required:
        - street
        - number
        - city
        - zip_code
        - country
    PaymentInformation:
      title: PaymentInformation
      type: object
      properties:
        transaction_id:
          type: string
          format: uuid
        status:
          type: boolean
      required:
        - transaction_id
        - status
    Interest:
      title: Interest
      type: object
      properties:
        departure_airport_code:
          type: string
          pattern: '[A-Z]{3,3}'
        arrival_airport_code:
          type: string
          pattern: '[A-Z]{3,3}'
        min_departure_date:
          type: string
          format: date
        max_comeback_date:
          type: string
          format: date
        max_price:
          type: number
          format: double
          minimum: 0
        prontogram_username:
          type: string
          minLength: 1
      required:
        - departure_airport_code
        - arrival_airport_code
        - min_departure_date
        - max_comeback_date
        - max_price
        - prontogram_username
    Error:
      title: Error
      type: object
      properties:
        description:
          type: string
          minLength: 1
      required:
        - description
    BuyOfferResponse:
      title: BuyOfferResponse
      type: object
      properties:
        communication_code:
          type: string
          minLength: 1
      required:
        - communication_code

Torna a Servizi web.