Moved credit_amount calculation from SQL to Python
Using MessageCost.calculate_credit_cost instead of repeating calculation