from enum import StrEnum NO_PAYMENT_GROUP_PAYMENT_FOUND = 'No payment_group_payment found with id {}' NO_ELIGIBLE_ACCOUNTS = 'No accounts for payment_group_payment {}' ACCOUNT_MSG = 'Getting eligible accounts for payment_group {}' PAYMENT_GROUP_MSG = 'Getting payment group payment by id {}' ACCOUNTS_BATCHES_MSG = 'Generated {} accounts batches' CLOSE_BALANCE_MSG = 'Getting contract close balance entries for {} accounts' POST_BALANCE_ENTRIES_AFTER_TAX = 'Sending {} contract balance entries after tax' PAYMENT_MINIMUMS_MSG = 'Getting payment minimums list' GET_STATE_MSG = 'Getting abacus states from table {} using id {}' UPDATE_STATE_MSG = 'Updating abacus states by id {}' NO_STATES_MSG = 'No states found' NO_STATE_MSG = 'No state found with name {}' CREATE_PAYMENT_ACCOUNT_MSG = 'Creating {} payment accounts' SUCCESS_MSG = 'Success: generating payments finished' DELETE_BALANCE_ENTRIES_AFTER_TAX = 'Deleting balance entries after tax for event {}' ERROR_MSG = 'Failed to generate payments' POST_STATE_MSG = 'Posting state for {} with id {}' NO_STATE_FOUND = 'No state found for {} with id {}' PAYMENT_NAME_TO_COUNTRY_OF_TAX_POLICY_MAPPING = { 'AWAL-UK': 'GBR', 'AWAL-US': 'USA', 'KNR-UK': 'GBR', 'KNR-NL': 'NLD', } ACCOUNT_BATCH_SIZE = 300 EXTENDED_TIMEOUT_SECONDS = 15 CALCULATE_PAYMENTS_ACTION_NAME = 'calculate_payments' GENERATE_PAYMENTS_ACTION_NAME = 'generate_payments' ACTION_STATUS_COMPLETE = 'complete' ACTION_STATUS_RUNNING = 'running' ACTION_STATUS_ERROR = 'error' # feature flags TAP_GENERATE_PAYMENTS_LAMBDA_REFACTORING = 'tap_generate_payments_lambda_refactoring' FLOWTHROUGH_PAYABLE_DETAIL_TYPE_ID = 6 class PaymentAllocationStatuses(StrEnum): """Payment allocation statuses.""" INIT = 'init' ATTACHED_TO_PAYMENT = 'attached_to_payment' PAID = 'paid' RETURNED = 'returned' class PaymentAllocationLedgerStatuses(StrEnum): """Payment allocation ledger statuses.""" DEBITED = 'debited' RETURNED = 'returned' INIT = 'init' ATTACHED_TO_PAYMENT = 'attached_to_payment'