Walking Tour Reservations

UTILITYDOCUMENTSTOOLS

Contract purpose

This Smart Contract enables people to make reservations for walking tours from an entity who offers this kind of service.

Exposed methods and variables

guide the ethereum address of the tour guide, given as parameter at contract creation

tours returns the details of a tour when called with the tourID

addTour allows the guide to add a new walking tour for which people can make reservations, It emits the NewTour event that gives the tourID by which the tour can be further identified

parameter nametypedetails
_tourDateintegerthe date of the tour (unix time)
_ticketPriceintegerthe price of the tour for one person
_meetingPlacestringthe location from where the tour begins
_tourDetailsstringthe list of landmarks the tour covers

makeReservations allows a tourist to make a reservation for a specific walking tour. It emits the NewReservation event and returns the ReservationID

parameter nametypedetails
_tourIDintegerthe unique identifier of the tour
_nrOfPeopleintegerthe number of people the reservation is made for
_emailstringthe email of the buyer

endTourReservationsTime by calling this function, the tour guide can end the period during which the reservations can be made

parameter nametypedetails
_tourIDintegerthe unique identifier of the tour

getReservationDetails returns the details of a reservation when called by the guide or by the buyer

parameter nametypedetails
_customerethereum addressthe address of the buyer

transferMoney allows the guide to transfer money from the contract's balance to his own account

parameter nametypedetails
amountintegerthe sum the guide wants to transfer

getBalance returns the balance of the contract when called by the guide

Events

NewTour

parameter nametypedetails
TourIDintegerthe ID of the new added walking tour

NewReservation

parameter nametypedetails
ReservationNumberintegerthe unique identifier of the new reservation
Buy
Reviewed by Modex
Buy Contract Test Contract

Create an account or login to purchase this smart contract