def app(): """Return a session-wide application configured in TEST mode.""" # _app = create_app('testing') _app = Flask(__name__) _app.config.from_object(get_named_config('testing')) _db.init_app(_app) return _app
from pay_api.models import Invoice as InvoiceModel from pay_api.models import InvoiceReference as InvoiceReferenceModel from pay_api.models import Payment as PaymentModel from pay_api.models import PaymentLineItem as PaymentLineItemModel from pay_api.models import Receipt as ReceiptModel from pay_api.models import db from pay_api.services.queue_publisher import publish from pay_api.utils.enums import (DisbursementStatus, InvoiceReferenceStatus, InvoiceStatus, PaymentMethod, PaymentStatus, PaymentSystem) from sentry_sdk import capture_message from reconciliations import config from reconciliations.minio import get_object APP_CONFIG = config.get_named_config(os.getenv('DEPLOYMENT_ENV', 'production')) async def reconcile_distributions(msg: Dict[str, any], is_feedback: bool = False): """Read the file and update distribution details. 1: Lookup the invoice details based on the file content. 2: Update the statuses """ if is_feedback: await _update_feedback(msg) else: _update_acknowledgement()