From aee00293ee66be9e6c3827f898c6e1624e3cb00e Mon Sep 17 00:00:00 2001 From: Francesco Rinaldi Date: Wed, 11 Jan 2017 19:32:50 +0100 Subject: [PATCH] End of section 3 --- 2.Design Document/DD.lyx | 32 +- 3.Integration Test Plan Document/ITPD.lyx | 1486 +++++++++++---------- 2 files changed, 785 insertions(+), 733 deletions(-) diff --git a/2.Design Document/DD.lyx b/2.Design Document/DD.lyx index 6cbf300..e22add0 100644 --- a/2.Design Document/DD.lyx +++ b/2.Design Document/DD.lyx @@ -3934,7 +3934,7 @@ In this way we would achieve our goal to distribute cars in the smartest \end_layout \begin_layout Subsection -How to calculate the Reservation fees +How to apply the Reservation fees \end_layout \begin_layout Standard @@ -3943,7 +3943,7 @@ In this section we will analyze the structure of the code that will handle \end_layout \begin_layout Subparagraph* -calculateReservationFees(Reservation) +applyReservationFees(Reservation) \end_layout \begin_layout Standard @@ -3969,16 +3969,16 @@ begin{lstlisting} \begin_layout Plain Layout -/* This function will calculate the fees for each reservation entity. - Actually, the user can terminate a reservation for free, but in the future +/* This function will apply the fees for each Reservation entity. + Actually, the user can terminate a reservation for free, but in the future if PowerEnjoy would decide to apply a fee for the termination of a reservation, - it would be very easy to modify this function. - If the user pick up the car, his reservation terminates and the system - will create another object 'rent': no fees will be applied to transform - a reservation into a rent. - On the other hand, if the reservation expires before the user pick up the - car, the system will apply to him a fee of one euro. - As said before, it would not be difficult in the future also to change + it would be very easy to modify this value. + If the user picks up the car, his reservation terminates and the system + will create another object Rent: no fees will be applied to transform a + reservation into a rent. + On the other hand, if the reservation expires before the user picks up + the car, the system will apply to him a fee of one euro. + As said before, it would not be difficult in the future also to change this amount of money. \end_layout @@ -3993,7 +3993,7 @@ begin{lstlisting} \begin_layout Plain Layout -function calculateReservationFees (Reservation res){ +function applyReservationFees (Reservation res){ \end_layout \begin_layout Plain Layout @@ -4304,7 +4304,7 @@ end{lstlisting} \end_layout \begin_layout Subparagraph* -calculateAdditionalFee(Rent) +calculateAdditionalFees(Rent) \end_layout \begin_layout Standard @@ -4340,7 +4340,7 @@ begin{lstlisting} \begin_layout Plain Layout -void function calculateAdditionalFee(Rent ren){ +void function calculateAdditionalFees(Rent ren){ \end_layout \begin_layout Plain Layout @@ -4427,7 +4427,7 @@ begin{lstlisting} \begin_layout Plain Layout -/* This function will calculate the fees for each rent entity. +/* This function will calculate the fees for each Rent entity. In this case we have to consider eventual discounts and other additional fees before sending the payment request to the external payment service. It would not be difficult in the future to change some parameters according @@ -4481,7 +4481,7 @@ function calculateRentFees (Rent ren){ \begin_layout Plain Layout - calculateAdditionalFee(ren); + calculateAdditionalFees(ren); \end_layout \begin_layout Plain Layout diff --git a/3.Integration Test Plan Document/ITPD.lyx b/3.Integration Test Plan Document/ITPD.lyx index 153e9c2..4780130 100644 --- a/3.Integration Test Plan Document/ITPD.lyx +++ b/3.Integration Test Plan Document/ITPD.lyx @@ -4847,7 +4847,7 @@ A response from the Car is received. \begin_layout Plain Layout \family typewriter -carsInRadius(User) +carsInRadius(Location) \end_layout \end_inset @@ -4879,7 +4879,7 @@ Description \begin_inset Text \begin_layout Plain Layout -This function retrieves all the cars near the User location. +This function retrieves all the cars near the Location passed as argument. \end_layout \end_inset @@ -4954,7 +4954,7 @@ An InvalidArgumentException is raised. \begin_inset Text \begin_layout Plain Layout -A valid User object +A valid Location object \end_layout \end_inset @@ -4963,7 +4963,7 @@ A valid User object \begin_inset Text \begin_layout Plain Layout -A list of cars near the User. +Returns a list of cars around the Location. \end_layout \end_inset @@ -5139,7 +5139,7 @@ A valid User object \begin_inset Text \begin_layout Plain Layout -The current position of the user is returned. +A Location object is returned representing the current position of the user. \end_layout \end_inset @@ -5182,7 +5182,7 @@ The current position of the user is returned. \begin_layout Plain Layout \family typewriter -isAvailable(Car) +getAvailableCars(Location) \end_layout \end_inset @@ -5214,7 +5214,7 @@ Description \begin_inset Text \begin_layout Plain Layout -This function check whether the Car is available. +This function return a list of available cars near the user's Location. \end_layout \end_inset @@ -5289,7 +5289,7 @@ An InvalidArgumentException is raised. \begin_inset Text \begin_layout Plain Layout -A valid Car object +A valid Location object \end_layout \end_inset @@ -5298,7 +5298,7 @@ A valid Car object \begin_inset Text \begin_layout Plain Layout -Returns true if the Car is available, false otherwise. +Returns a list of available cars near the Location. \end_layout \end_inset @@ -5341,7 +5341,7 @@ Main functions implemented by the \align center \begin_inset Tabular - + @@ -5350,7 +5350,7 @@ Main functions implemented by the \begin_layout Plain Layout \family typewriter -checkUserPosition(User) +getUserPosition(User) \end_layout \end_inset @@ -5362,12 +5362,12 @@ checkUserPosition(User) \begin_layout Plain Layout \begin_inset Tabular - + - - + + - + \begin_inset Text \begin_layout Plain Layout @@ -5378,11 +5378,12 @@ Description \end_inset - + \begin_inset Text \begin_layout Plain Layout -This is a cool description +This function will retrieve the information about the user’s position through + the Google Maps API. \end_layout \end_inset @@ -5395,7 +5396,7 @@ This is a cool description \begin_layout Plain Layout \shape slanted -Input +Input Specification \end_layout \end_inset @@ -5413,7 +5414,7 @@ Effect - + \begin_inset Text \begin_layout Plain Layout @@ -5422,13 +5423,33 @@ A null parameter \end_inset - + \begin_inset Text \begin_layout Plain Layout A NullArgumentException is raised. \end_layout +\end_inset + + + + +\begin_inset Text + +\begin_layout Plain Layout +An invalid object +\end_layout + +\end_inset + + +\begin_inset Text + +\begin_layout Plain Layout +An InvalidArgumentException is raised. +\end_layout + \end_inset @@ -5437,7 +5458,7 @@ A NullArgumentException is raised. \begin_inset Text \begin_layout Plain Layout -A non-null user +A valid User object \end_layout \end_inset @@ -5446,7 +5467,7 @@ A non-null user \begin_inset Text \begin_layout Plain Layout -The user data are correctly inserted in the database. +A Location object is returned representing the current position of the user. \end_layout \end_inset @@ -5480,7 +5501,7 @@ The user data are correctly inserted in the database. \align center \begin_inset Tabular - + @@ -5489,7 +5510,7 @@ The user data are correctly inserted in the database. \begin_layout Plain Layout \family typewriter -isReservable(Car, User) +getReservableCars(Location) \end_layout \end_inset @@ -5501,12 +5522,12 @@ isReservable(Car, User) \begin_layout Plain Layout \begin_inset Tabular - + - - + + - + \begin_inset Text \begin_layout Plain Layout @@ -5517,11 +5538,11 @@ Description \end_inset - + \begin_inset Text \begin_layout Plain Layout -This is a cool description +This function return a list of reservable cars near the user's Location. \end_layout \end_inset @@ -5534,7 +5555,7 @@ This is a cool description \begin_layout Plain Layout \shape slanted -Input +Input Specification \end_layout \end_inset @@ -5552,7 +5573,7 @@ Effect - + \begin_inset Text \begin_layout Plain Layout @@ -5561,13 +5582,33 @@ A null parameter \end_inset - + \begin_inset Text \begin_layout Plain Layout A NullArgumentException is raised. \end_layout +\end_inset + + + + +\begin_inset Text + +\begin_layout Plain Layout +An invalid object +\end_layout + +\end_inset + + +\begin_inset Text + +\begin_layout Plain Layout +An InvalidArgumentException is raised. +\end_layout + \end_inset @@ -5576,7 +5617,7 @@ A NullArgumentException is raised. \begin_inset Text \begin_layout Plain Layout -A non-null user +A valid Location object \end_layout \end_inset @@ -5585,7 +5626,7 @@ A non-null user \begin_inset Text \begin_layout Plain Layout -The user data are correctly inserted in the database. +Returns a list of reservable cars near the Location. \end_layout \end_inset @@ -5619,7 +5660,7 @@ The user data are correctly inserted in the database. \align center \begin_inset Tabular - + @@ -5628,7 +5669,7 @@ The user data are correctly inserted in the database. \begin_layout Plain Layout \family typewriter -isTerminable(Car, User) +isTerminable(Reservation) \end_layout \end_inset @@ -5640,12 +5681,12 @@ isTerminable(Car, User) \begin_layout Plain Layout \begin_inset Tabular - + - - + + - + \begin_inset Text \begin_layout Plain Layout @@ -5656,11 +5697,12 @@ Description \end_inset - + \begin_inset Text \begin_layout Plain Layout -This is a cool description +This function will check if all the conditions to end the reservation are + respected. \end_layout \end_inset @@ -5673,7 +5715,7 @@ This is a cool description \begin_layout Plain Layout \shape slanted -Input +Input Specification \end_layout \end_inset @@ -5691,7 +5733,7 @@ Effect - + \begin_inset Text \begin_layout Plain Layout @@ -5700,13 +5742,33 @@ A null parameter \end_inset - + \begin_inset Text \begin_layout Plain Layout A NullArgumentException is raised. \end_layout +\end_inset + + + + +\begin_inset Text + +\begin_layout Plain Layout +An invalid object +\end_layout + +\end_inset + + +\begin_inset Text + +\begin_layout Plain Layout +An InvalidArgumentException is raised. +\end_layout + \end_inset @@ -5715,7 +5777,7 @@ A NullArgumentException is raised. \begin_inset Text \begin_layout Plain Layout -A non-null user +A valid Reservation object \end_layout \end_inset @@ -5724,7 +5786,7 @@ A non-null user \begin_inset Text \begin_layout Plain Layout -The user data are correctly inserted in the database. +Returns true if the reservation is terminable, false otherwise. \end_layout \end_inset @@ -5758,7 +5820,7 @@ The user data are correctly inserted in the database. \align center \begin_inset Tabular - + @@ -5767,7 +5829,7 @@ The user data are correctly inserted in the database. \begin_layout Plain Layout \family typewriter -startReservation(Car) +isTerminable(Rent) \end_layout \end_inset @@ -5779,12 +5841,12 @@ startReservation(Car) \begin_layout Plain Layout \begin_inset Tabular - + - - + + - + \begin_inset Text \begin_layout Plain Layout @@ -5795,11 +5857,12 @@ Description \end_inset - + \begin_inset Text \begin_layout Plain Layout -This is a cool description +This function will check if all the conditions to end the rent are respected + (for example if nobody is still in the car, and so on..).. \end_layout \end_inset @@ -5812,7 +5875,7 @@ This is a cool description \begin_layout Plain Layout \shape slanted -Input +Input Specification \end_layout \end_inset @@ -5830,7 +5893,7 @@ Effect - + \begin_inset Text \begin_layout Plain Layout @@ -5839,13 +5902,33 @@ A null parameter \end_inset - + \begin_inset Text \begin_layout Plain Layout A NullArgumentException is raised. \end_layout +\end_inset + + + + +\begin_inset Text + +\begin_layout Plain Layout +An invalid object +\end_layout + +\end_inset + + +\begin_inset Text + +\begin_layout Plain Layout +An InvalidArgumentException is raised. +\end_layout + \end_inset @@ -5854,7 +5937,7 @@ A NullArgumentException is raised. \begin_inset Text \begin_layout Plain Layout -A non-null user +A valid Rent object \end_layout \end_inset @@ -5863,7 +5946,7 @@ A non-null user \begin_inset Text \begin_layout Plain Layout -The user data are correctly inserted in the database. +Returns true if the rent is terminable, false otherwise. \end_layout \end_inset @@ -5897,7 +5980,7 @@ The user data are correctly inserted in the database. \align center \begin_inset Tabular - + @@ -5906,7 +5989,7 @@ The user data are correctly inserted in the database. \begin_layout Plain Layout \family typewriter -updateReservation(Reservation) +startReservation(Car, User) \end_layout \end_inset @@ -5918,12 +6001,12 @@ updateReservation(Reservation) \begin_layout Plain Layout \begin_inset Tabular - + - - + + - + \begin_inset Text \begin_layout Plain Layout @@ -5934,11 +6017,12 @@ Description \end_inset - + \begin_inset Text \begin_layout Plain Layout -This is a cool description +This function creates a new instance of Reservation, tying together the + Car and User object passed as argument. \end_layout \end_inset @@ -5951,7 +6035,7 @@ This is a cool description \begin_layout Plain Layout \shape slanted -Input +Input Specification \end_layout \end_inset @@ -5969,7 +6053,7 @@ Effect - + \begin_inset Text \begin_layout Plain Layout @@ -5978,13 +6062,33 @@ A null parameter \end_inset - + \begin_inset Text \begin_layout Plain Layout A NullArgumentException is raised. \end_layout +\end_inset + + + + +\begin_inset Text + +\begin_layout Plain Layout +An invalid object +\end_layout + +\end_inset + + +\begin_inset Text + +\begin_layout Plain Layout +An InvalidArgumentException is raised. +\end_layout + \end_inset @@ -5993,7 +6097,7 @@ A NullArgumentException is raised. \begin_inset Text \begin_layout Plain Layout -A non-null user +Valid User and Car objects \end_layout \end_inset @@ -6002,7 +6106,7 @@ A non-null user \begin_inset Text \begin_layout Plain Layout -The user data are correctly inserted in the database. +A new instance of Reservation is correctly created. \end_layout \end_inset @@ -6036,7 +6140,7 @@ The user data are correctly inserted in the database. \align center \begin_inset Tabular - + @@ -6057,12 +6161,12 @@ endReservation(Reservation) \begin_layout Plain Layout \begin_inset Tabular - + - - + + - + \begin_inset Text \begin_layout Plain Layout @@ -6073,11 +6177,11 @@ Description \end_inset - + \begin_inset Text \begin_layout Plain Layout -This is a cool description +This function terminates the current Reservation. \end_layout \end_inset @@ -6090,7 +6194,7 @@ This is a cool description \begin_layout Plain Layout \shape slanted -Input +Input Specification \end_layout \end_inset @@ -6108,7 +6212,7 @@ Effect - + \begin_inset Text \begin_layout Plain Layout @@ -6117,13 +6221,33 @@ A null parameter \end_inset - + \begin_inset Text \begin_layout Plain Layout A NullArgumentException is raised. \end_layout +\end_inset + + + + +\begin_inset Text + +\begin_layout Plain Layout +An invalid object +\end_layout + +\end_inset + + +\begin_inset Text + +\begin_layout Plain Layout +An InvalidArgumentException is raised. +\end_layout + \end_inset @@ -6132,7 +6256,7 @@ A NullArgumentException is raised. \begin_inset Text \begin_layout Plain Layout -A non-null user +A valid Reservation object \end_layout \end_inset @@ -6141,7 +6265,11 @@ A non-null user \begin_inset Text \begin_layout Plain Layout -The user data are correctly inserted in the database. +The state of the Reservation object is changed into +\shape italic +terminated +\shape default +, and the reservation is no more active. \end_layout \end_inset @@ -6175,424 +6303,7 @@ The user data are correctly inserted in the database. \align center \begin_inset Tabular - - - - -\begin_inset Text - -\begin_layout Plain Layout - -\family typewriter -startRent(Rent) -\end_layout - -\end_inset - - - - -\begin_inset Text - -\begin_layout Plain Layout -\begin_inset Tabular - - - - - - -\begin_inset Text - -\begin_layout Plain Layout - -\series bold -Description -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -This is a cool description -\end_layout - -\end_inset - - - - -\begin_inset Text - -\begin_layout Plain Layout - -\shape slanted -Input -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout - -\shape slanted -Effect -\end_layout - -\end_inset - - - - -\begin_inset Text - -\begin_layout Plain Layout -A null parameter -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -A NullArgumentException is raised. -\end_layout - -\end_inset - - - - -\begin_inset Text - -\begin_layout Plain Layout -A non-null user -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -The user data are correctly inserted in the database. -\end_layout - -\end_inset - - - - -\end_inset - - -\end_layout - -\end_inset - - - - -\end_inset - - -\end_layout - -\begin_layout Standard -\begin_inset VSpace smallskip -\end_inset - - -\end_layout - -\begin_layout Standard -\align center -\begin_inset Tabular - - - - - -\begin_inset Text - -\begin_layout Plain Layout - -\family typewriter -updateRent(Rent) -\end_layout - -\end_inset - - - - -\begin_inset Text - -\begin_layout Plain Layout -\begin_inset Tabular - - - - - - -\begin_inset Text - -\begin_layout Plain Layout - -\series bold -Description -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -This is a cool description -\end_layout - -\end_inset - - - - -\begin_inset Text - -\begin_layout Plain Layout - -\shape slanted -Input -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout - -\shape slanted -Effect -\end_layout - -\end_inset - - - - -\begin_inset Text - -\begin_layout Plain Layout -A null parameter -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -A NullArgumentException is raised. -\end_layout - -\end_inset - - - - -\begin_inset Text - -\begin_layout Plain Layout -A non-null user -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -The user data are correctly inserted in the database. -\end_layout - -\end_inset - - - - -\end_inset - - -\end_layout - -\end_inset - - - - -\end_inset - - -\end_layout - -\begin_layout Standard -\begin_inset VSpace smallskip -\end_inset - - -\end_layout - -\begin_layout Standard -\align center -\begin_inset Tabular - - - - - -\begin_inset Text - -\begin_layout Plain Layout - -\family typewriter -endRent(Rent) -\end_layout - -\end_inset - - - - -\begin_inset Text - -\begin_layout Plain Layout -\begin_inset Tabular - - - - - - -\begin_inset Text - -\begin_layout Plain Layout - -\series bold -Description -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -This is a cool description -\end_layout - -\end_inset - - - - -\begin_inset Text - -\begin_layout Plain Layout - -\shape slanted -Input -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout - -\shape slanted -Effect -\end_layout - -\end_inset - - - - -\begin_inset Text - -\begin_layout Plain Layout -A null parameter -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -A NullArgumentException is raised. -\end_layout - -\end_inset - - - - -\begin_inset Text - -\begin_layout Plain Layout -A non-null user -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -The user data are correctly inserted in the database. -\end_layout - -\end_inset - - - - -\end_inset - - -\end_layout - -\end_inset - - - - -\end_inset - - -\end_layout - -\begin_layout Standard -\begin_inset VSpace smallskip -\end_inset - - -\end_layout - -\begin_layout Standard -\align center -\begin_inset Tabular - - + @@ -6613,12 +6324,12 @@ checkReservationStatus(Reservation) \begin_layout Plain Layout \begin_inset Tabular - + - - + + - + \begin_inset Text \begin_layout Plain Layout @@ -6629,11 +6340,12 @@ Description \end_inset - + \begin_inset Text \begin_layout Plain Layout -This is a cool description +This function retrieves all the information about the Reservation object + passed as argument. \end_layout \end_inset @@ -6646,7 +6358,7 @@ This is a cool description \begin_layout Plain Layout \shape slanted -Input +Input Specification \end_layout \end_inset @@ -6664,7 +6376,7 @@ Effect - + \begin_inset Text \begin_layout Plain Layout @@ -6673,13 +6385,33 @@ A null parameter \end_inset - + \begin_inset Text \begin_layout Plain Layout A NullArgumentException is raised. \end_layout +\end_inset + + + + +\begin_inset Text + +\begin_layout Plain Layout +An invalid object +\end_layout + +\end_inset + + +\begin_inset Text + +\begin_layout Plain Layout +An InvalidArgumentException is raised. +\end_layout + \end_inset @@ -6688,7 +6420,7 @@ A NullArgumentException is raised. \begin_inset Text \begin_layout Plain Layout -A non-null user +A valid Reservation object \end_layout \end_inset @@ -6697,7 +6429,7 @@ A non-null user \begin_inset Text \begin_layout Plain Layout -The user data are correctly inserted in the database. +Returns the current status of the Reservation. \end_layout \end_inset @@ -6731,7 +6463,330 @@ The user data are correctly inserted in the database. \align center \begin_inset Tabular - + + + + +\begin_inset Text + +\begin_layout Plain Layout + +\family typewriter +startRent(Reservation) +\end_layout + +\end_inset + + + + +\begin_inset Text + +\begin_layout Plain Layout +\begin_inset Tabular + + + + + + +\begin_inset Text + +\begin_layout Plain Layout + +\series bold +Description +\end_layout + +\end_inset + + +\begin_inset Text + +\begin_layout Plain Layout +This function creates a new instance of Rent, updating the Reservation object + passed as argument. +\end_layout + +\end_inset + + + + +\begin_inset Text + +\begin_layout Plain Layout + +\shape slanted +Input Specification +\end_layout + +\end_inset + + +\begin_inset Text + +\begin_layout Plain Layout + +\shape slanted +Effect +\end_layout + +\end_inset + + + + +\begin_inset Text + +\begin_layout Plain Layout +A null parameter +\end_layout + +\end_inset + + +\begin_inset Text + +\begin_layout Plain Layout +A NullArgumentException is raised. +\end_layout + +\end_inset + + + + +\begin_inset Text + +\begin_layout Plain Layout +An invalid object +\end_layout + +\end_inset + + +\begin_inset Text + +\begin_layout Plain Layout +An InvalidArgumentException is raised. +\end_layout + +\end_inset + + + + +\begin_inset Text + +\begin_layout Plain Layout +A valid Reservation object +\end_layout + +\end_inset + + +\begin_inset Text + +\begin_layout Plain Layout +A new instance of Rent is correctly created. +\end_layout + +\end_inset + + + + +\end_inset + + +\end_layout + +\end_inset + + + + +\end_inset + + +\end_layout + +\begin_layout Standard +\begin_inset VSpace smallskip +\end_inset + + +\end_layout + +\begin_layout Standard +\align center +\begin_inset Tabular + + + + + +\begin_inset Text + +\begin_layout Plain Layout + +\family typewriter +endRent(Rent) +\end_layout + +\end_inset + + + + +\begin_inset Text + +\begin_layout Plain Layout +\begin_inset Tabular + + + + + + +\begin_inset Text + +\begin_layout Plain Layout + +\series bold +Description +\end_layout + +\end_inset + + +\begin_inset Text + +\begin_layout Plain Layout +This function terminates the current Rent. +\end_layout + +\end_inset + + + + +\begin_inset Text + +\begin_layout Plain Layout + +\shape slanted +Input Specification +\end_layout + +\end_inset + + +\begin_inset Text + +\begin_layout Plain Layout + +\shape slanted +Effect +\end_layout + +\end_inset + + + + +\begin_inset Text + +\begin_layout Plain Layout +A null parameter +\end_layout + +\end_inset + + +\begin_inset Text + +\begin_layout Plain Layout +A NullArgumentException is raised. +\end_layout + +\end_inset + + + + +\begin_inset Text + +\begin_layout Plain Layout +An invalid object +\end_layout + +\end_inset + + +\begin_inset Text + +\begin_layout Plain Layout +An InvalidArgumentException is raised. +\end_layout + +\end_inset + + + + +\begin_inset Text + +\begin_layout Plain Layout +A valid Rent object +\end_layout + +\end_inset + + +\begin_inset Text + +\begin_layout Plain Layout +The state of the Rent object is changed into +\shape italic +terminated +\shape default +, and the rent is no more active. +\end_layout + +\end_inset + + + + +\end_inset + + +\end_layout + +\end_inset + + + + +\end_inset + + +\end_layout + +\begin_layout Standard +\begin_inset VSpace smallskip +\end_inset + + +\end_layout + +\begin_layout Standard +\align center +\begin_inset Tabular + + @@ -6752,12 +6807,12 @@ checkRentStatus(Rent) \begin_layout Plain Layout \begin_inset Tabular - + - - + + - + \begin_inset Text \begin_layout Plain Layout @@ -6768,11 +6823,12 @@ Description \end_inset - + \begin_inset Text \begin_layout Plain Layout -This is a cool description +This function retrieves all the information about the Rent object passed + as argument. \end_layout \end_inset @@ -6785,7 +6841,7 @@ This is a cool description \begin_layout Plain Layout \shape slanted -Input +Input Specification \end_layout \end_inset @@ -6803,7 +6859,7 @@ Effect - + \begin_inset Text \begin_layout Plain Layout @@ -6812,13 +6868,33 @@ A null parameter \end_inset - + \begin_inset Text \begin_layout Plain Layout A NullArgumentException is raised. \end_layout +\end_inset + + + + +\begin_inset Text + +\begin_layout Plain Layout +An invalid object +\end_layout + +\end_inset + + +\begin_inset Text + +\begin_layout Plain Layout +An InvalidArgumentException is raised. +\end_layout + \end_inset @@ -6827,7 +6903,7 @@ A NullArgumentException is raised. \begin_inset Text \begin_layout Plain Layout -A non-null user +A valid Rent object \end_layout \end_inset @@ -6836,7 +6912,7 @@ A non-null user \begin_inset Text \begin_layout Plain Layout -The user data are correctly inserted in the database. +Returns the current status of the Rent. \end_layout \end_inset @@ -6883,7 +6959,7 @@ Main functions implemented by the \align center \begin_inset Tabular - + @@ -6904,12 +6980,12 @@ notify(User, Notification) \begin_layout Plain Layout \begin_inset Tabular - + - - + + - + \begin_inset Text \begin_layout Plain Layout @@ -6920,11 +6996,11 @@ Description \end_inset - + \begin_inset Text \begin_layout Plain Layout -This is a cool description +This function notifies a message to the user. \end_layout \end_inset @@ -6937,7 +7013,7 @@ This is a cool description \begin_layout Plain Layout \shape slanted -Input +Input Specification \end_layout \end_inset @@ -6955,7 +7031,7 @@ Effect - + \begin_inset Text \begin_layout Plain Layout @@ -6964,13 +7040,33 @@ A null parameter \end_inset - + \begin_inset Text \begin_layout Plain Layout A NullArgumentException is raised. \end_layout +\end_inset + + + + +\begin_inset Text + +\begin_layout Plain Layout +An invalid object +\end_layout + +\end_inset + + +\begin_inset Text + +\begin_layout Plain Layout +An InvalidArgumentException is raised. +\end_layout + \end_inset @@ -6979,7 +7075,7 @@ A NullArgumentException is raised. \begin_inset Text \begin_layout Plain Layout -A non-null user +Valid User and Notification objects \end_layout \end_inset @@ -6988,7 +7084,7 @@ A non-null user \begin_inset Text \begin_layout Plain Layout -The user data are correctly inserted in the database. +The Notification is correctly displayed to the User. \end_layout \end_inset @@ -7021,9 +7117,6 @@ Main functions implemented by the Payment Manager \series default : -\end_layout - -\begin_layout Standard \begin_inset VSpace smallskip \end_inset @@ -7034,7 +7127,7 @@ Main functions implemented by the \align center \begin_inset Tabular - + @@ -7043,7 +7136,7 @@ Main functions implemented by the \begin_layout Plain Layout \family typewriter -calculateReservationFees(Reservation) +applyReservationFees(Reservation) \end_layout \end_inset @@ -7055,12 +7148,12 @@ calculateReservationFees(Reservation) \begin_layout Plain Layout \begin_inset Tabular - + - - + + - + \begin_inset Text \begin_layout Plain Layout @@ -7071,11 +7164,20 @@ Description \end_inset - + \begin_inset Text \begin_layout Plain Layout -This is a cool description +This function will apply the fees for each Reservation entity. + Actually, the user can terminate a reservation for free, but in the future + if PowerEnjoy would decide to apply a fee for the termination of a reservation, + it would be very easy to modify this value. + If the user picks up the car, his reservation terminates and the system + will create another object Rent: no fees will be applied to transform a + reservation into a rent. + On the other hand, if the reservation expires before the user picks up + the car, the system will apply to him a fee of one euro. + \end_layout \end_inset @@ -7088,7 +7190,7 @@ This is a cool description \begin_layout Plain Layout \shape slanted -Input +Input Specification \end_layout \end_inset @@ -7106,7 +7208,7 @@ Effect - + \begin_inset Text \begin_layout Plain Layout @@ -7115,13 +7217,33 @@ A null parameter \end_inset - + \begin_inset Text \begin_layout Plain Layout A NullArgumentException is raised. \end_layout +\end_inset + + + + +\begin_inset Text + +\begin_layout Plain Layout +An invalid object +\end_layout + +\end_inset + + +\begin_inset Text + +\begin_layout Plain Layout +An InvalidArgumentException is raised. +\end_layout + \end_inset @@ -7130,7 +7252,7 @@ A NullArgumentException is raised. \begin_inset Text \begin_layout Plain Layout -A non-null user +A valid Reservation object \end_layout \end_inset @@ -7139,7 +7261,8 @@ A non-null user \begin_inset Text \begin_layout Plain Layout -The user data are correctly inserted in the database. +A payment request to an external service is successfully sent for the User + related to the current Reservation. \end_layout \end_inset @@ -7173,7 +7296,7 @@ The user data are correctly inserted in the database. \align center \begin_inset Tabular - + @@ -7182,7 +7305,7 @@ The user data are correctly inserted in the database. \begin_layout Plain Layout \family typewriter -calculateRentFees(Rent) +calculateRentFees(Rent) \end_layout \end_inset @@ -7194,12 +7317,12 @@ calculateRentFees(Rent) \begin_layout Plain Layout \begin_inset Tabular - + - - + + - + \begin_inset Text \begin_layout Plain Layout @@ -7210,11 +7333,15 @@ Description \end_inset - + \begin_inset Text \begin_layout Plain Layout -This is a cool description +This function will calculate the fees for each Rent entity. + In this case we have to consider eventual discounts and other additional + fees before sending the payment request to the external payment service. + It would not be difficult in the future to change some parameters according + to the PowerEnjoy policy. \end_layout \end_inset @@ -7227,7 +7354,7 @@ This is a cool description \begin_layout Plain Layout \shape slanted -Input +Input Specification \end_layout \end_inset @@ -7245,7 +7372,7 @@ Effect - + \begin_inset Text \begin_layout Plain Layout @@ -7254,13 +7381,33 @@ A null parameter \end_inset - + \begin_inset Text \begin_layout Plain Layout A NullArgumentException is raised. \end_layout +\end_inset + + + + +\begin_inset Text + +\begin_layout Plain Layout +An invalid object +\end_layout + +\end_inset + + +\begin_inset Text + +\begin_layout Plain Layout +An InvalidArgumentException is raised. +\end_layout + \end_inset @@ -7269,7 +7416,7 @@ A NullArgumentException is raised. \begin_inset Text \begin_layout Plain Layout -A non-null user +A valid Rent object \end_layout \end_inset @@ -7278,7 +7425,8 @@ A non-null user \begin_inset Text \begin_layout Plain Layout -The user data are correctly inserted in the database. +This function first update the total cost of the Rent and then send a payment + request to an external service for the User related to the current Rent. \end_layout \end_inset @@ -7312,7 +7460,7 @@ The user data are correctly inserted in the database. \align center \begin_inset Tabular - + @@ -7321,7 +7469,7 @@ The user data are correctly inserted in the database. \begin_layout Plain Layout \family typewriter -calculateRentDiscount(Rent) +calculateRentDiscount(Rent) \end_layout \end_inset @@ -7333,12 +7481,12 @@ calculateRentDiscount(Rent) \begin_layout Plain Layout \begin_inset Tabular - + - - + + - + \begin_inset Text \begin_layout Plain Layout @@ -7349,11 +7497,11 @@ Description \end_inset - + \begin_inset Text \begin_layout Plain Layout -This is a cool description +This function will calculate the eventual discount for each rent entity. \end_layout \end_inset @@ -7366,7 +7514,7 @@ This is a cool description \begin_layout Plain Layout \shape slanted -Input +Input Specification \end_layout \end_inset @@ -7384,7 +7532,7 @@ Effect - + \begin_inset Text \begin_layout Plain Layout @@ -7393,13 +7541,33 @@ A null parameter \end_inset - + \begin_inset Text \begin_layout Plain Layout A NullArgumentException is raised. \end_layout +\end_inset + + + + +\begin_inset Text + +\begin_layout Plain Layout +An invalid object +\end_layout + +\end_inset + + +\begin_inset Text + +\begin_layout Plain Layout +An InvalidArgumentException is raised. +\end_layout + \end_inset @@ -7408,7 +7576,7 @@ A NullArgumentException is raised. \begin_inset Text \begin_layout Plain Layout -A non-null user +A valid Rent object \end_layout \end_inset @@ -7417,7 +7585,8 @@ A non-null user \begin_inset Text \begin_layout Plain Layout -The user data are correctly inserted in the database. +The total cost of the Rent will be successfully updated according to the + eventual discounts. \end_layout \end_inset @@ -7451,7 +7620,7 @@ The user data are correctly inserted in the database. \align center \begin_inset Tabular - + @@ -7460,7 +7629,7 @@ The user data are correctly inserted in the database. \begin_layout Plain Layout \family typewriter -calculateAdditionalFee(Rent) +calculateAdditionalFees(Rent) \end_layout \end_inset @@ -7472,12 +7641,12 @@ calculateAdditionalFee(Rent) \begin_layout Plain Layout \begin_inset Tabular - + - - + + - + \begin_inset Text \begin_layout Plain Layout @@ -7488,11 +7657,12 @@ Description \end_inset - + \begin_inset Text \begin_layout Plain Layout -This is a cool description +This function will calculate the eventual additional fees for each rent + entity. \end_layout \end_inset @@ -7505,7 +7675,7 @@ This is a cool description \begin_layout Plain Layout \shape slanted -Input +Input Specification \end_layout \end_inset @@ -7523,7 +7693,7 @@ Effect - + \begin_inset Text \begin_layout Plain Layout @@ -7532,7 +7702,7 @@ A null parameter \end_inset - + \begin_inset Text \begin_layout Plain Layout @@ -7543,119 +7713,20 @@ A NullArgumentException is raised. - + \begin_inset Text \begin_layout Plain Layout -A non-null user +An invalid object \end_layout \end_inset - + \begin_inset Text \begin_layout Plain Layout -The user data are correctly inserted in the database. -\end_layout - -\end_inset - - - - -\end_inset - - -\end_layout - -\end_inset - - - - -\end_inset - - -\end_layout - -\begin_layout Standard -\begin_inset VSpace smallskip -\end_inset - - -\end_layout - -\begin_layout Standard -\align center -\begin_inset Tabular - - - - - -\begin_inset Text - -\begin_layout Plain Layout - -\family typewriter -contactPaymentService() -\end_layout - -\end_inset - - - - -\begin_inset Text - -\begin_layout Plain Layout -\begin_inset Tabular - - - - - - -\begin_inset Text - -\begin_layout Plain Layout - -\series bold -Description -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -This is a cool description -\end_layout - -\end_inset - - - - -\begin_inset Text - -\begin_layout Plain Layout - -\shape slanted -Input -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout - -\shape slanted -Effect +An InvalidArgumentException is raised. \end_layout \end_inset @@ -7666,27 +7737,7 @@ Effect \begin_inset Text \begin_layout Plain Layout -A null parameter -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -A NullArgumentException is raised. -\end_layout - -\end_inset - - - - -\begin_inset Text - -\begin_layout Plain Layout -A non-null user +A valid Rent object \end_layout \end_inset @@ -7695,7 +7746,8 @@ A non-null user \begin_inset Text \begin_layout Plain Layout -The user data are correctly inserted in the database. +The total cost of the Rent will be successfully updated according to the + eventual additional fees. \end_layout \end_inset -- 2.47.2