# Docs of Finder Finds people, living spaces, companies from AccountRecords start_time = perf_counter() end_time = perf_counter() elapsed = end_time - start_time print(f'{elapsed:.3f} : seconds') print('shallow_copy_list', len(shallow_copy_list)) """ """ 1. Stage (Incoming Money) # BuildDecisionBookPayments are reverse records of AccountRecords AccountRecords.approved_record == True AccountRecords.living_space_id is not None # AccountRecords.receive_debit = Credit Receiver (Incoming money from client) / Debit Sender (Debt to be paid by system) 1.1 AccountRecords.currency_value > 0 Received Money Transaction + AccountRecords.currency_value > AccountRecords.remainder_balance () You have extra money in system account Money consumed => AccountRecords.currency_value != abs(AccountRecords.remainder_balance) singluar iban Some payment done but money not yet all money is consumed => AccountRecords.currency_value + AccountRecords.remainder_balance != 0 AccountRecords.currency_value = AccountRecords.remainder_balance (There is no money that individual has in system) AccountRecords.bank_date (Date money arrived) AccountRecords.process_type (Type of bank transaction) 1.2 AccountRecords.currency_value < 0 Sent Money Transaction - 2. Stage (Payment Match Process) Parse : BuildDecisionBookPayments.process_date (Year / Month / Day / Time) BuildDecisionBookPayments.account_records_id == None ( Payment is not assigned to any account record) BuildDecisionBookPayments.payment_types_id == debit_enum.id (Payment type is debit) 2.1 Check current month has any payment to due Payment Month == Money Arrived Month 2.2 Check previous months has any payment to due Payment Month < Money Arrived Month 3. Stage (Payment Assignment Process) Do payment set left money to account record as AccountRecords.remainder_balance