Delayed Flights Payment

Under Review

DOCUMENTSTOOLSESCROW

Contract purpose

Smart Contract that enables insurance companies to directly transfer payment compensation to clients in case their flights are delayed or canceled.

Contract parameters

manager : address of the system manager

Exposed methods and variables

addFlight : allows the manager to introduce a new flight for which there are reservations made

parameter nametypedetails
_flightNrstringthe unique alpha-numeric identifier of the flight

addReservation : the manager can introduce a reservation linked to a specific flight and he also needs to send to the contract the amount of ether equivalent to the maximum of cancellation and delay compensations for the client and emits reservationAdded event

parameter nametypedetails
_clientethereum addressthe address of the client
_restNrstringthe unique alpha-numeric identifier of the reservation
_flightNrstringthe unique alpha-numeric identifier of the flight
_delayCompensationintegerthe sum the company will pay the client if the flight is delayed
_cancelCompensationintegerthe sum the company will pay the client if the flight is cancelled

flightIsDelayed : the manager marks the flight as delayed and the money will automatically be sent to the clients and what remains is sent back to the manager and emits delayedFlight event

parameter nametypedetails
_flightNrstringthe unique alpha-numeric identifier of the flight

flightIsCancelled : the manager marks the flight as cancelled and the money will automatically be sent to the clients and what remains is sent back to the manager and emits cancelledFlight event

parameter nametypedetails
_flightNrstringthe unique alpha-numeric identifier of the flight

flightLandedOk : if the flight has no problem, the money goes back to the manager

parameter nametypedetails
_flightNrstringthe unique alpha-numeric identifier of the flight

getResCount : returns the number of reservations for a certain flight

parameter nametypedetails
_flightNrstringthe unique alpha-numeric identifier of the flight

Events

reservationAdded

parameter nametypedetails
resNrstringthe unique alpha-numeric identifier of the reservation

cancelledFlight

parameter nametypedetails
flightNumberstringthe unique alpha-numeric identifier of the flight

delayedFlight

parameter nametypedetails
flightNumberstringthe unique alpha-numeric identifier of the flight
Reviewed by Modex
Buy

Copyright © Modex Marketplace