public CalculationResponse GetCurrentAndFutureTransactions([FromServices] ISavingGoalDataAccess savingGoalDataAccess, [FromQuery] int idSavingGoal, [FromQuery] decimal estimatedAmount, [FromQuery] decimal savingPerMonth) { CalculationResponse calculationResponse = new CalculationResponse(); Response response; SavingGoalFlow savingGoalFlow = new SavingGoalFlow(savingGoalDataAccess); response = savingGoalFlow.GetSavingGoal(idSavingGoal); if (response.ErrorFound.IsThereAnyError) { calculationResponse.ErrorFound = response.ErrorFound; return(calculationResponse); } SavingCalculationFlow savingCalculationFlow = new SavingCalculationFlow(); calculationResponse = savingCalculationFlow.GetCurrentAndFutureTransactions(response.SavingGoal, estimatedAmount, savingPerMonth); return(calculationResponse); }
public Response UpdateSavingGoal([FromServices] ISavingGoalDataAccess savingGoalDataAccess, [FromQuery] SavingGoal savingGoal) { Response response; SavingGoalFlow savingGoalFlow = new SavingGoalFlow(savingGoalDataAccess); response = savingGoalFlow.UpdateSavingGoal(savingGoal); return(response); }
public Response DeleteSavingGoal([FromServices] ISavingGoalDataAccess savingGoalDataAccess, [FromQuery] int idSavingGoal) { Response response; SavingGoalFlow savingGoalFlow = new SavingGoalFlow(savingGoalDataAccess); response = savingGoalFlow.DeleteSavingGoal(idSavingGoal); return(response); }
public List <SavingGoal> GetAllSavingGoals([FromServices] ISavingGoalDataAccess savingGoalDataAccess) { List <SavingGoal> savingGoals; SavingGoalFlow savingGoalFlow = new SavingGoalFlow(savingGoalDataAccess); savingGoals = savingGoalFlow.GetSavingGoals(); return(savingGoals); }