~singpolyma/sgx-jmp

ref: 9827b8b48336d249637f88d6921d613ad12b16f1 sgx-jmp/lib/financial_info.rb -rw-r--r-- 628 bytes
9827b8b4Stephen Paul Weber Allow finishing adming command 11 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# frozen_string_literal: true

require "value_semantics/monkey_patched"

class AdminFinancialInfo
	value_semantics do
		transactions ArrayOf(CustomerFinancials::TransactionInfo)
		declines Integer
		btc_addresses ArrayOf(String)
		payment_methods PaymentMethods
	end

	def self.for(customer)
		EMPromise.all([
			customer.transactions, customer.declines,
			customer.payment_methods, customer.btc_addresses
		]).then do |transactions, declines, payment_methods, btc_addresses|
			new(
				transactions: transactions,
				declines: declines,
				payment_methods: payment_methods, btc_addresses: btc_addresses
			)
		end
	end
end