~singpolyma/sgx-jmp

ref: da30c371e56b8bb577897f1151b59c24e209127f sgx-jmp/lib/financial_info.rb -rw-r--r-- 628 bytes
da30c371Stephen Paul Weber Allow finishing admin 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