public static string[] MappingDtoResponseToEchoMessage(ConsultaSaldoResponseDTO consultaSaldoResponse) { string[] arguments = { consultaSaldoResponse.Data.Balance[0].Amount.amount.ToString("C2", CultureInfo.CurrentCulture), consultaSaldoResponse.Data.Balance[0].Amount.amount >= 0? "positivo": "negativo" }; return(arguments); }
public async System.Threading.Tasks.Task <SkillResponse> ExecuteIntentAsync() { SkillResponse response = await PermissionValidator.ValidatorAsync(_input, _locale); if (response != null) { return(response); } string result = await HttpSenderApi.Call("open-banking/v1/accounts/" + _acc + "/balances", _token); ConsultaSaldoResponseDTO consultaSaldoResponse = JsonConvert.DeserializeObject <ConsultaSaldoResponseDTO>(result); string[] arguments = MappingDtoResponseToEchoMessage(consultaSaldoResponse); var consultaSaldo = await _locale.Get(LanguageKeys.ConsultaSaldo, arguments); return(ResponseBuilder.Ask(consultaSaldo, null, _input.Session));; }
public static string[] MappingDtoResponseToEchoMessage(ConsultaExtratoResponseDTO consultaExtratoResponse, ConsultaSaldoResponseDTO consultaSaldoResponse) { string[] arguments = { consultaExtratoResponse.Data.Transaction[0].TransactionInformation, consultaExtratoResponse.Data.Transaction[0].ValueDateTime.Day.ToString(), consultaExtratoResponse.Data.Transaction[0].ValueDateTime.Month.ToString(), consultaExtratoResponse.Data.Transaction[0].Balance.Amount.amount.ToString("C2", CultureInfo.CurrentCulture), consultaExtratoResponse.Data.Transaction[0].Amount.amount >= 0? "positivo": "negativo", consultaExtratoResponse.Data.Transaction[0].Amount.amount.ToString("C2", CultureInfo.CurrentCulture), }; return(arguments); }