package backend;

public class BackendRentalTerminal {
	Database db = new Database();
	Backend be = new Backend();
	
	public BackendRentalTerminal(){
		
	}
	
	private boolean MutualAuthenticationRTS(){
		boolean states = false;
		//TODO:
		//Check Mutual Authentication between Rental Terminal and SmartCards
		//if succeed then states = true
		return states;
		
	}
	
	public void RegisterNewCustomer(String name, short km){
		//add to database customer
		db.insertCustomer(name);
		//get the customer ID that just inserted
		int id = db.getLastID();		
		
		//add new smartcard
		InitData init = be.registerNewCard(id, km);
	}

}

@@ -409,18 +409,8 @@
 name
-, short km
 )%7B%0A%09
@@ -439,16 +439,37 @@
 tomer%0A%09%09
+Integer customerId = 
 db.inser
@@ -528,16 +528,18 @@
 nserted%0A
+//
 %09%09int id
@@ -625,14 +625,18 @@
 ard(
-id, km
+customerId
 );%0A%09

Change registercustomer