lib/finapps/rest/cashflows.rb in finapps-0.17.1.pre vs lib/finapps/rest/cashflows.rb in finapps-0.18.0.pre

- old
+ new

@@ -63,28 +63,28 @@ array_container.present? ? array_container[array_identifier] : nil end def result_category_to_cashflow_detail(category) raise 'Unable to locate category id for current category record.' unless category.key?('cat') - raise 'Unable to locate inflow amount for current category record.' unless category.key?('inflow') - raise 'Unable to locate outflow amount for current category record.' unless category.key?('outflow') - raise 'Unable to locate left over amount for current category record.' unless category.key?('diff') + raise 'Unable to locate credits amount for current category record.' unless category.key?('inflow') + raise 'Unable to locate debits amount for current category record.' unless category.key?('outflow') + raise 'Unable to locate balance amount for current category record.' unless category.key?('diff') CashflowDetail.new({:category_id => category['cat'], - :income_amount => category['inflow'], - :expenses_amount => category['outflow'], - :leftover_amount => category['diff']}) + :credits => category['inflow'], + :debits => category['outflow'], + :balance => category['diff']}) end end class Cashflow < FinApps::REST::Resource attr_accessor :start_date, :end_date, :total_income_amount, :total_expenses_amount, :total_leftover_amount, :details end class CashflowDetail < FinApps::REST::Resource - attr_accessor :category_id, :income_amount, :expenses_amount, :leftover_amount + attr_accessor :category_id, :credits, :debits, :balance end end end \ No newline at end of file