bitsy-bitcoin 0.8.4 → 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c26cf7efb987d8ef064760813c6970d732bc78dc
4
- data.tar.gz: fc16a22ed352160268df3ebd94dae09fe0505bf9
3
+ metadata.gz: adab618db67cc442d07bd8aae043d23f49de69fd
4
+ data.tar.gz: e2feaaffeec1dc22b19d3b7129aa6b8fa01199b6
5
5
  SHA512:
6
- metadata.gz: bd4d28f79c15c3e001d00094f19110c3a021d3795df9a8c3cb1d8337a24d546a91f8156353c9f3bb1b9fad1fddcbebc600e75e92b6742aae6d0d0e24ce7e39ab
7
- data.tar.gz: 0ce171b4d1880437cb0c924060f612fceccebb48ce6768e9dffcbb6ed8e76de5f4cce4d0e1f73e6b37184f2dab5b85428db128169107eea022317c6f8cb1f37f
6
+ metadata.gz: ceb557ffffe7345b4843d315c341191626327806a5660d907bac3e1ee32e6b3a9b0afb3c038977964552deed2c4533788e940639dc1f8db2d08eecd30d170c77
7
+ data.tar.gz: 6dd64ca2c5075c0b479e32165d7a0c6911cad75efed752ac2ad5b89d39d479d5da35b992ec9b6c34920278d3016dd9a87317927dac5c3b5234069f967866c637
@@ -0,0 +1,13 @@
1
+ module Bitsy
2
+ class PaymentDepotFilterer < Filterer::Base
3
+
4
+ def starting_query
5
+ PaymentDepot.all
6
+ end
7
+
8
+ def param_id(x)
9
+ @results.where(id: x)
10
+ end
11
+
12
+ end
13
+ end
@@ -104,14 +104,18 @@ module Bitsy
104
104
  self.uuid
105
105
  end
106
106
 
107
+ def forwarding_transaction_fee
108
+ total_received_amount - total_tax_sent - total_owner_sent
109
+ end
110
+
107
111
  private
108
112
 
109
113
  def tax_transactions
110
- self.transactions.debit.tax
114
+ self.transactions.debits.tax
111
115
  end
112
116
 
113
117
  def owner_transactions
114
- self.transactions.debit.non_tax
118
+ self.transactions.debits.non_tax
115
119
  end
116
120
 
117
121
  def set_uuid
@@ -20,6 +20,10 @@ module Bitsy
20
20
  scope :non_tax, lambda { where('payment_type != ?', 'tax') }
21
21
  scope :for_forwarding, -> { safely_confirmed.not_forwarded.received }
22
22
  scope :credits, -> { received }
23
+ scope :debits, -> {
24
+ forwarding_transaction_id = arel_table[:forwarding_transaction_id]
25
+ where(forwarding_transaction_id.not_eq(nil))
26
+ }
23
27
 
24
28
  delegate :min_payment, to: :payment_depot, prefix: true
25
29
  delegate :balance, to: :payment_depot, prefix: true
@@ -6,6 +6,10 @@ module Bitsy
6
6
  :min_payment_received,
7
7
  :total_received_amount,
8
8
  :address,
9
+ :min_payment,
10
+ :total_tax_sent,
11
+ :total_owner_sent,
12
+ :forwarding_transaction_fee,
9
13
  )
10
14
 
11
15
  def min_payment_received
@@ -7,6 +7,7 @@ require "daemons"
7
7
  require "light-service"
8
8
  require "uuidtools"
9
9
  require "blockchain"
10
+ require "filterer"
10
11
  require "bitsy/engine"
11
12
  require "bitsy/config"
12
13
 
@@ -1,3 +1,3 @@
1
1
  module Bitsy
2
- VERSION = "0.8.4"
2
+ VERSION = "0.9.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bitsy-bitcoin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.4
4
+ version: 0.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ramon Tayag
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-11 00:00:00.000000000 Z
11
+ date: 2015-04-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -150,6 +150,20 @@ dependencies:
150
150
  - - "~>"
151
151
  - !ruby/object:Gem::Version
152
152
  version: '1.0'
153
+ - !ruby/object:Gem::Dependency
154
+ name: filterer
155
+ requirement: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - '='
158
+ - !ruby/object:Gem::Version
159
+ version: 0.4.1
160
+ type: :runtime
161
+ prerelease: false
162
+ version_requirements: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - '='
165
+ - !ruby/object:Gem::Version
166
+ version: 0.4.1
153
167
  - !ruby/object:Gem::Dependency
154
168
  name: sqlite3
155
169
  requirement: !ruby/object:Gem::Requirement
@@ -313,6 +327,7 @@ files:
313
327
  - app/controllers/bitsy/v1/payment_depots_controller.rb
314
328
  - app/controllers/bitsy/v1/syncs_controller.rb
315
329
  - app/controllers/bitsy/v1/truncations_controller.rb
330
+ - app/filterers/bitsy/payment_depot_filterer.rb
316
331
  - app/helpers/bitsy/application_helper.rb
317
332
  - app/jobs/bitsy/blockchain_notification_job.rb
318
333
  - app/jobs/bitsy/check_payments_job.rb