package de.fau.amos.virtualledger.android.api;

import java.util.List;

import de.fau.amos.virtualledger.dtos.Contact;
import de.fau.amos.virtualledger.android.model.SavingsAccount;
import de.fau.amos.virtualledger.dtos.BankAccess;
import de.fau.amos.virtualledger.dtos.BankAccessCredential;
import de.fau.amos.virtualledger.dtos.BankAccountSync;
import de.fau.amos.virtualledger.dtos.BankAccountSyncResult;
import de.fau.amos.virtualledger.dtos.SessionData;
import de.fau.amos.virtualledger.android.model.UserCredential;
import de.fau.amos.virtualledger.dtos.LoginData;
import de.fau.amos.virtualledger.dtos.StringApiModel;
import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.DELETE;
import retrofit2.http.GET;
import retrofit2.http.Header;
import retrofit2.http.POST;
import retrofit2.http.PUT;
import retrofit2.http.Path;

public interface Restapi {

    @POST("/api/auth/register")
    Call<StringApiModel> register(@Body UserCredential credential);

    @POST("/api/auth/login")
    Call<SessionData> login(@Body LoginData loginData);

    @POST("/api/auth/logout")
    Call<StringApiModel> logout(@Header("Authorization") String token);

    @GET("/api/banking")
    Call<List<BankAccess>> getBankAccesses(@Header("Authorization") String token);

    @POST("/api/banking")
    Call<BankAccess> addBankAccess(@Header("Authorization") String token, @Body BankAccessCredential bankAccessCredential);

    @DELETE("/api/banking/{accessId}")
    Call<Void> deleteBankAccess(@Header("Authorization") String token, @Path("accessId") String accessId);

    @DELETE("/api/banking/{accessId}/{accountId}")
    Call<Void> deleteBankAccount(@Header("Authorization") String token, @Path("accessId") String accessId, @Path("accountId") String accountId);

    @PUT("/api/banking/sync")
    Call<BankAccountSyncResult> getBookings(@Header("Authorization") String token, @Body List<BankAccountSync> bankAccountSyncList);

    @GET("/api/savings")
    Call<List<SavingsAccount>> getSavingAccounts(@Header("Authorization") String token);

    @POST("/api/savings")
    Call<Void> addSavingAccounts(@Header("Authorization") String token, @Body SavingsAccount savingsAccounts);

    @GET("/api/contacts")
    Call<List<Contact>> getContacts(@Header("Authorization") String token);

    @POST("/api/contacts")
    Call<Void> addContacts(@Header("Authorization") String token, @Body Contact contacts);
}

@@ -69,55 +69,8 @@
 t;%0A%0A
-import de.fau.amos.virtualledger.dtos.Contact;%0A
 impo
@@ -128,16 +128,16 @@
 ccount;%0A
+
 import d
@@ -396,185 +396,15 @@
 tos.
-SessionData;%0Aimport de.fau.amos.virtualledger.android.model.UserCredential;%0Aimport de.fau.amos.virtualledger.dtos.LoginData;%0Aimport de.fau.amos.virtualledger.dtos.StringApiModel
+Contact
 ;%0Aim
@@ -623,16 +623,16 @@
 .Path;%0A%0A
+
 public i
@@ -655,298 +655,8 @@
  %7B%0A%0A
-    @POST(%22/api/auth/register%22)%0A    Call%3CStringApiModel%3E register(@Body UserCredential credential);%0A%0A    @POST(%22/api/auth/login%22)%0A    Call%3CSessionData%3E login(@Body LoginData loginData);%0A%0A    @POST(%22/api/auth/logout%22)%0A    Call%3CStringApiModel%3E logout(@Header(%22Authorization%22) String token);%0A%0A
     

Remove obsolete auth methods in Restapi.java