modelswrkpi 8.0.4__tar.gz → 10.6.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {modelswrkpi-8.0.4 → modelswrkpi-10.6.0}/MANIFEST.in +17 -1
- {modelswrkpi-8.0.4/modelswrkpi.egg-info → modelswrkpi-10.6.0}/PKG-INFO +1 -1
- {modelswrkpi-8.0.4 → modelswrkpi-10.6.0}/models/bins.cpython-310-x86_64-linux-gnu.so +0 -0
- modelswrkpi-10.6.0/models/bro_clicks/alerts.cpython-310-x86_64-linux-gnu.so +0 -0
- {modelswrkpi-8.0.4 → modelswrkpi-10.6.0}/models/bro_clicks/conversions.cpython-310-x86_64-linux-gnu.so +0 -0
- modelswrkpi-10.6.0/models/bro_clicks/initial_routes.cpython-310-x86_64-linux-gnu.so +0 -0
- modelswrkpi-10.6.0/models/bro_clicks/load_balancer/__init__.py +7 -0
- modelswrkpi-10.6.0/models/bro_clicks/load_balancer/compile.py +17 -0
- modelswrkpi-10.6.0/models/bro_clicks/load_balancer/v1.cpython-310-x86_64-linux-gnu.so +0 -0
- modelswrkpi-10.6.0/models/bro_clicks/load_balancer/v1.py +232 -0
- modelswrkpi-10.6.0/models/bro_clicks/load_balancer/v2.cpython-310-x86_64-linux-gnu.so +0 -0
- modelswrkpi-10.6.0/models/bro_clicks/load_balancer/v2.py +135 -0
- modelswrkpi-10.6.0/models/bro_clicks/load_balancer/v3.cpython-310-x86_64-linux-gnu.so +0 -0
- modelswrkpi-10.6.0/models/bro_clicks/load_balancer/v3.py +402 -0
- modelswrkpi-10.6.0/models/bro_clicks/load_balancer/v4.cpython-310-x86_64-linux-gnu.so +0 -0
- modelswrkpi-10.6.0/models/bro_clicks/load_balancer/v4.py +151 -0
- modelswrkpi-10.6.0/models/bro_clicks/load_balancer/v5.cpython-310-x86_64-linux-gnu.so +0 -0
- modelswrkpi-10.6.0/models/bro_clicks/load_balancer/v5.py +139 -0
- modelswrkpi-10.6.0/models/bro_clicks/load_balancer/v6.cpython-310-x86_64-linux-gnu.so +0 -0
- modelswrkpi-10.6.0/models/bro_clicks/load_balancer/v6.py +195 -0
- modelswrkpi-10.6.0/models/bro_clicks/load_balancer/v7.cpython-310-x86_64-linux-gnu.so +0 -0
- modelswrkpi-10.6.0/models/bro_clicks/load_balancer/v7.py +313 -0
- modelswrkpi-10.6.0/models/bro_clicks/load_balancer/v8.py +8 -0
- {modelswrkpi-8.0.4 → modelswrkpi-10.6.0}/models/discounter.cpython-310-x86_64-linux-gnu.so +0 -0
- {modelswrkpi-8.0.4 → modelswrkpi-10.6.0}/models/reporting_update/affid_report_update.cpython-310-x86_64-linux-gnu.so +0 -0
- modelswrkpi-10.6.0/models/reporting_update/assigned_cpa_table_update.cpython-310-x86_64-linux-gnu.so +0 -0
- {modelswrkpi-8.0.4 → modelswrkpi-10.6.0}/models/reporting_update/continuity_update.cpython-310-x86_64-linux-gnu.so +0 -0
- {modelswrkpi-8.0.4 → modelswrkpi-10.6.0}/models/reporting_update/filter_box_updates.cpython-310-x86_64-linux-gnu.so +0 -0
- modelswrkpi-10.6.0/models/reporting_update/refund_parser.cpython-310-x86_64-linux-gnu.so +0 -0
- modelswrkpi-10.6.0/models/reporting_update/revenue_update.cpython-310-x86_64-linux-gnu.so +0 -0
- modelswrkpi-10.6.0/models/reports/dependencies.cpython-310-x86_64-linux-gnu.so +0 -0
- {modelswrkpi-8.0.4 → modelswrkpi-10.6.0}/models/reports/table_reports/__init__.py +1 -1
- modelswrkpi-10.6.0/models/reports/table_reports/approval_report.cpython-310-x86_64-linux-gnu.so +0 -0
- {modelswrkpi-8.0.4 → modelswrkpi-10.6.0}/models/reports/table_reports/bin_report.cpython-310-x86_64-linux-gnu.so +0 -0
- {modelswrkpi-8.0.4 → modelswrkpi-10.6.0}/models/reports/table_reports/continuity_report.cpython-310-x86_64-linux-gnu.so +0 -0
- modelswrkpi-10.6.0/models/reports/table_reports/impact_reports.cpython-310-x86_64-linux-gnu.so +0 -0
- {modelswrkpi-8.0.4 → modelswrkpi-10.6.0}/models/reports/table_reports/inactive_report.cpython-310-x86_64-linux-gnu.so +0 -0
- {modelswrkpi-8.0.4 → modelswrkpi-10.6.0}/models/reports/widgets.cpython-310-x86_64-linux-gnu.so +0 -0
- {modelswrkpi-8.0.4 → modelswrkpi-10.6.0/modelswrkpi.egg-info}/PKG-INFO +1 -1
- {modelswrkpi-8.0.4 → modelswrkpi-10.6.0}/modelswrkpi.egg-info/SOURCES.txt +17 -1
- modelswrkpi-10.6.0/pyproject.toml +0 -0
- {modelswrkpi-8.0.4 → modelswrkpi-10.6.0}/setup.cfg +1 -1
- modelswrkpi-8.0.4/models/bro_clicks/alerts.cpython-310-x86_64-linux-gnu.so +0 -0
- modelswrkpi-8.0.4/models/bro_clicks/initial_routes.cpython-310-x86_64-linux-gnu.so +0 -0
- modelswrkpi-8.0.4/models/bro_clicks/load_balancer.cpython-310-x86_64-linux-gnu.so +0 -0
- modelswrkpi-8.0.4/models/reporting_update/assigned_cpa_table_update.cpython-310-x86_64-linux-gnu.so +0 -0
- modelswrkpi-8.0.4/models/reporting_update/refund_parser.cpython-310-x86_64-linux-gnu.so +0 -0
- modelswrkpi-8.0.4/models/reporting_update/revenue_update.cpython-310-x86_64-linux-gnu.so +0 -0
- modelswrkpi-8.0.4/models/reports/dependencies.cpython-310-x86_64-linux-gnu.so +0 -0
- modelswrkpi-8.0.4/models/reports/table_reports/approval_report.cpython-310-x86_64-linux-gnu.so +0 -0
- modelswrkpi-8.0.4/models/reports/table_reports/impact_reports.cpython-310-x86_64-linux-gnu.so +0 -0
- modelswrkpi-8.0.4/pyproject.toml +0 -6
- {modelswrkpi-8.0.4 → modelswrkpi-10.6.0}/DataFactory/__init__.py +0 -0
- {modelswrkpi-8.0.4 → modelswrkpi-10.6.0}/DataFactory/sqlinterface.cpython-310-x86_64-linux-gnu.so +0 -0
- {modelswrkpi-8.0.4 → modelswrkpi-10.6.0}/models/__init__.py +0 -0
- {modelswrkpi-8.0.4 → modelswrkpi-10.6.0}/models/alert_providers.cpython-310-x86_64-linux-gnu.so +0 -0
- {modelswrkpi-8.0.4 → modelswrkpi-10.6.0}/models/api.py +0 -0
- {modelswrkpi-8.0.4 → modelswrkpi-10.6.0}/models/approval_rate.cpython-310-x86_64-linux-gnu.so +0 -0
- {modelswrkpi-8.0.4 → modelswrkpi-10.6.0}/models/banks.cpython-310-x86_64-linux-gnu.so +0 -0
- {modelswrkpi-8.0.4 → modelswrkpi-10.6.0}/models/billing_models.cpython-310-x86_64-linux-gnu.so +0 -0
- {modelswrkpi-8.0.4 → modelswrkpi-10.6.0}/models/bro_clicks/__init__.py +0 -0
- {modelswrkpi-8.0.4 → modelswrkpi-10.6.0}/models/bro_clicks/aff_stats.cpython-310-x86_64-linux-gnu.so +0 -0
- {modelswrkpi-8.0.4 → modelswrkpi-10.6.0}/models/bro_clicks/binrouter.cpython-310-x86_64-linux-gnu.so +0 -0
- {modelswrkpi-8.0.4 → modelswrkpi-10.6.0}/models/bro_clicks/clicks.cpython-310-x86_64-linux-gnu.so +0 -0
- {modelswrkpi-8.0.4 → modelswrkpi-10.6.0}/models/bro_clicks/error_log.cpython-310-x86_64-linux-gnu.so +0 -0
- {modelswrkpi-8.0.4 → modelswrkpi-10.6.0}/models/bro_clicks/scrub_settings.cpython-310-x86_64-linux-gnu.so +0 -0
- {modelswrkpi-8.0.4 → modelswrkpi-10.6.0}/models/bro_clicks/splitter.cpython-310-x86_64-linux-gnu.so +0 -0
- {modelswrkpi-8.0.4 → modelswrkpi-10.6.0}/models/campaign_balancer.cpython-310-x86_64-linux-gnu.so +0 -0
- {modelswrkpi-8.0.4 → modelswrkpi-10.6.0}/models/campaigns.cpython-310-x86_64-linux-gnu.so +0 -0
- {modelswrkpi-8.0.4 → modelswrkpi-10.6.0}/models/capfill.cpython-310-x86_64-linux-gnu.so +0 -0
- {modelswrkpi-8.0.4 → modelswrkpi-10.6.0}/models/cb911/__init__.py +0 -0
- {modelswrkpi-8.0.4 → modelswrkpi-10.6.0}/models/cb911/alerts.cpython-310-x86_64-linux-gnu.so +0 -0
- {modelswrkpi-8.0.4 → modelswrkpi-10.6.0}/models/cb911/cb_struc.cpython-310-x86_64-linux-gnu.so +0 -0
- {modelswrkpi-8.0.4 → modelswrkpi-10.6.0}/models/cb911/chargebacks.cpython-310-x86_64-linux-gnu.so +0 -0
- {modelswrkpi-8.0.4 → modelswrkpi-10.6.0}/models/clients.cpython-310-x86_64-linux-gnu.so +0 -0
- {modelswrkpi-8.0.4 → modelswrkpi-10.6.0}/models/color_index.cpython-310-x86_64-linux-gnu.so +0 -0
- {modelswrkpi-8.0.4 → modelswrkpi-10.6.0}/models/config.py +0 -0
- {modelswrkpi-8.0.4 → modelswrkpi-10.6.0}/models/corp_cascade.cpython-310-x86_64-linux-gnu.so +0 -0
- {modelswrkpi-8.0.4 → modelswrkpi-10.6.0}/models/corps.cpython-310-x86_64-linux-gnu.so +0 -0
- {modelswrkpi-8.0.4 → modelswrkpi-10.6.0}/models/crm_errors.cpython-310-x86_64-linux-gnu.so +0 -0
- {modelswrkpi-8.0.4 → modelswrkpi-10.6.0}/models/custom_shipping.cpython-310-x86_64-linux-gnu.so +0 -0
- {modelswrkpi-8.0.4 → modelswrkpi-10.6.0}/models/db.cpython-310-x86_64-linux-gnu.so +0 -0
- {modelswrkpi-8.0.4 → modelswrkpi-10.6.0}/models/discount_stats.cpython-310-x86_64-linux-gnu.so +0 -0
- {modelswrkpi-8.0.4 → modelswrkpi-10.6.0}/models/email_reconfs.cpython-310-x86_64-linux-gnu.so +0 -0
- {modelswrkpi-8.0.4 → modelswrkpi-10.6.0}/models/exception_log.cpython-310-x86_64-linux-gnu.so +0 -0
- {modelswrkpi-8.0.4 → modelswrkpi-10.6.0}/models/filter_index.cpython-310-x86_64-linux-gnu.so +0 -0
- {modelswrkpi-8.0.4 → modelswrkpi-10.6.0}/models/gateway_providers.cpython-310-x86_64-linux-gnu.so +0 -0
- {modelswrkpi-8.0.4 → modelswrkpi-10.6.0}/models/gateways.cpython-310-x86_64-linux-gnu.so +0 -0
- {modelswrkpi-8.0.4 → modelswrkpi-10.6.0}/models/hard_declines.cpython-310-x86_64-linux-gnu.so +0 -0
- {modelswrkpi-8.0.4 → modelswrkpi-10.6.0}/models/initials.cpython-310-x86_64-linux-gnu.so +0 -0
- {modelswrkpi-8.0.4 → modelswrkpi-10.6.0}/models/instance_data.cpython-310-x86_64-linux-gnu.so +0 -0
- {modelswrkpi-8.0.4 → modelswrkpi-10.6.0}/models/invoices.cpython-310-x86_64-linux-gnu.so +0 -0
- {modelswrkpi-8.0.4 → modelswrkpi-10.6.0}/models/iso.cpython-310-x86_64-linux-gnu.so +0 -0
- {modelswrkpi-8.0.4 → modelswrkpi-10.6.0}/models/konn/__init__.py +0 -0
- {modelswrkpi-8.0.4 → modelswrkpi-10.6.0}/models/konn/campaigns.cpython-310-x86_64-linux-gnu.so +0 -0
- {modelswrkpi-8.0.4 → modelswrkpi-10.6.0}/models/konn/composite.cpython-310-x86_64-linux-gnu.so +0 -0
- {modelswrkpi-8.0.4 → modelswrkpi-10.6.0}/models/konn/config.cpython-310-x86_64-linux-gnu.so +0 -0
- {modelswrkpi-8.0.4 → modelswrkpi-10.6.0}/models/konn/customers.cpython-310-x86_64-linux-gnu.so +0 -0
- {modelswrkpi-8.0.4 → modelswrkpi-10.6.0}/models/konn/fullfillment_items.cpython-310-x86_64-linux-gnu.so +0 -0
- {modelswrkpi-8.0.4 → modelswrkpi-10.6.0}/models/konn/gateways.cpython-310-x86_64-linux-gnu.so +0 -0
- {modelswrkpi-8.0.4 → modelswrkpi-10.6.0}/models/konn/hybrid.cpython-310-x86_64-linux-gnu.so +0 -0
- {modelswrkpi-8.0.4 → modelswrkpi-10.6.0}/models/konn/hybrid_campaigns.cpython-310-x86_64-linux-gnu.so +0 -0
- {modelswrkpi-8.0.4 → modelswrkpi-10.6.0}/models/konn/hybrid_merchants.cpython-310-x86_64-linux-gnu.so +0 -0
- {modelswrkpi-8.0.4 → modelswrkpi-10.6.0}/models/konn/hybrid_notes.cpython-310-x86_64-linux-gnu.so +0 -0
- {modelswrkpi-8.0.4 → modelswrkpi-10.6.0}/models/konn/kk_struc.cpython-310-x86_64-linux-gnu.so +0 -0
- {modelswrkpi-8.0.4 → modelswrkpi-10.6.0}/models/konn/notes.cpython-310-x86_64-linux-gnu.so +0 -0
- {modelswrkpi-8.0.4 → modelswrkpi-10.6.0}/models/konn/order_items.cpython-310-x86_64-linux-gnu.so +0 -0
- {modelswrkpi-8.0.4 → modelswrkpi-10.6.0}/models/konn/orders.cpython-310-x86_64-linux-gnu.so +0 -0
- {modelswrkpi-8.0.4 → modelswrkpi-10.6.0}/models/konn/paysources.cpython-310-x86_64-linux-gnu.so +0 -0
- {modelswrkpi-8.0.4 → modelswrkpi-10.6.0}/models/konn/products.cpython-310-x86_64-linux-gnu.so +0 -0
- {modelswrkpi-8.0.4 → modelswrkpi-10.6.0}/models/konn/purchases.cpython-310-x86_64-linux-gnu.so +0 -0
- {modelswrkpi-8.0.4 → modelswrkpi-10.6.0}/models/konn/transaction_items.cpython-310-x86_64-linux-gnu.so +0 -0
- {modelswrkpi-8.0.4 → modelswrkpi-10.6.0}/models/konn/transactions.cpython-310-x86_64-linux-gnu.so +0 -0
- {modelswrkpi-8.0.4 → modelswrkpi-10.6.0}/models/lime/__init__.py +0 -0
- {modelswrkpi-8.0.4 → modelswrkpi-10.6.0}/models/lime/compile.py +0 -0
- {modelswrkpi-8.0.4 → modelswrkpi-10.6.0}/models/lime/hybrid.py +0 -0
- {modelswrkpi-8.0.4 → modelswrkpi-10.6.0}/models/lime/orders.py +0 -0
- {modelswrkpi-8.0.4 → modelswrkpi-10.6.0}/models/logga.cpython-310-x86_64-linux-gnu.so +0 -0
- {modelswrkpi-8.0.4 → modelswrkpi-10.6.0}/models/master_campaigns.cpython-310-x86_64-linux-gnu.so +0 -0
- {modelswrkpi-8.0.4 → modelswrkpi-10.6.0}/models/mc_promo.cpython-310-x86_64-linux-gnu.so +0 -0
- {modelswrkpi-8.0.4 → modelswrkpi-10.6.0}/models/mids.cpython-310-x86_64-linux-gnu.so +0 -0
- {modelswrkpi-8.0.4 → modelswrkpi-10.6.0}/models/offer_globals.cpython-310-x86_64-linux-gnu.so +0 -0
- {modelswrkpi-8.0.4 → modelswrkpi-10.6.0}/models/offers.cpython-310-x86_64-linux-gnu.so +0 -0
- {modelswrkpi-8.0.4 → modelswrkpi-10.6.0}/models/order_actions.cpython-310-x86_64-linux-gnu.so +0 -0
- {modelswrkpi-8.0.4 → modelswrkpi-10.6.0}/models/order_cycles.cpython-310-x86_64-linux-gnu.so +0 -0
- {modelswrkpi-8.0.4 → modelswrkpi-10.6.0}/models/order_processing.cpython-310-x86_64-linux-gnu.so +0 -0
- {modelswrkpi-8.0.4 → modelswrkpi-10.6.0}/models/orders.cpython-310-x86_64-linux-gnu.so +0 -0
- {modelswrkpi-8.0.4 → modelswrkpi-10.6.0}/models/partitioner.cpython-310-x86_64-linux-gnu.so +0 -0
- {modelswrkpi-8.0.4 → modelswrkpi-10.6.0}/models/pixels.cpython-310-x86_64-linux-gnu.so +0 -0
- {modelswrkpi-8.0.4 → modelswrkpi-10.6.0}/models/prices.cpython-310-x86_64-linux-gnu.so +0 -0
- {modelswrkpi-8.0.4 → modelswrkpi-10.6.0}/models/processing_error_log.cpython-310-x86_64-linux-gnu.so +0 -0
- {modelswrkpi-8.0.4 → modelswrkpi-10.6.0}/models/processor.cpython-310-x86_64-linux-gnu.so +0 -0
- {modelswrkpi-8.0.4 → modelswrkpi-10.6.0}/models/processor_settings.cpython-310-x86_64-linux-gnu.so +0 -0
- {modelswrkpi-8.0.4 → modelswrkpi-10.6.0}/models/processors.cpython-310-x86_64-linux-gnu.so +0 -0
- {modelswrkpi-8.0.4 → modelswrkpi-10.6.0}/models/products.cpython-310-x86_64-linux-gnu.so +0 -0
- {modelswrkpi-8.0.4 → modelswrkpi-10.6.0}/models/prospects.cpython-310-x86_64-linux-gnu.so +0 -0
- {modelswrkpi-8.0.4 → modelswrkpi-10.6.0}/models/providers.cpython-310-x86_64-linux-gnu.so +0 -0
- {modelswrkpi-8.0.4 → modelswrkpi-10.6.0}/models/rb_set.cpython-310-x86_64-linux-gnu.so +0 -0
- {modelswrkpi-8.0.4 → modelswrkpi-10.6.0}/models/reporting_update/__init__.py +0 -0
- {modelswrkpi-8.0.4 → modelswrkpi-10.6.0}/models/reporting_update/delete_duplicate.cpython-310-x86_64-linux-gnu.so +0 -0
- {modelswrkpi-8.0.4 → modelswrkpi-10.6.0}/models/reporting_update/revenue_orders_update.cpython-310-x86_64-linux-gnu.so +0 -0
- {modelswrkpi-8.0.4 → modelswrkpi-10.6.0}/models/reports/__init__.py +0 -0
- {modelswrkpi-8.0.4 → modelswrkpi-10.6.0}/models/reports/cap.cpython-310-x86_64-linux-gnu.so +0 -0
- {modelswrkpi-8.0.4 → modelswrkpi-10.6.0}/models/reports/reporting_alerts.cpython-310-x86_64-linux-gnu.so +0 -0
- {modelswrkpi-8.0.4 → modelswrkpi-10.6.0}/models/reports/table_reports/affid_report.cpython-310-x86_64-linux-gnu.so +0 -0
- {modelswrkpi-8.0.4 → modelswrkpi-10.6.0}/models/reports/table_reports/mtd_report.cpython-310-x86_64-linux-gnu.so +0 -0
- {modelswrkpi-8.0.4 → modelswrkpi-10.6.0}/models/reports/traffic.cpython-310-x86_64-linux-gnu.so +0 -0
- {modelswrkpi-8.0.4 → modelswrkpi-10.6.0}/models/reports/traffic_reporting.cpython-310-x86_64-linux-gnu.so +0 -0
- {modelswrkpi-8.0.4 → modelswrkpi-10.6.0}/models/revenue.cpython-310-x86_64-linux-gnu.so +0 -0
- {modelswrkpi-8.0.4 → modelswrkpi-10.6.0}/models/test_customers.cpython-310-x86_64-linux-gnu.so +0 -0
- {modelswrkpi-8.0.4 → modelswrkpi-10.6.0}/models/transactions.cpython-310-x86_64-linux-gnu.so +0 -0
- {modelswrkpi-8.0.4 → modelswrkpi-10.6.0}/models/users.cpython-310-x86_64-linux-gnu.so +0 -0
- {modelswrkpi-8.0.4 → modelswrkpi-10.6.0}/models/vaultx/__init__.py +0 -0
- {modelswrkpi-8.0.4 → modelswrkpi-10.6.0}/models/vaultx/ssc_cont.cpython-310-x86_64-linux-gnu.so +0 -0
- {modelswrkpi-8.0.4 → modelswrkpi-10.6.0}/modelswrkpi.egg-info/dependency_links.txt +0 -0
- {modelswrkpi-8.0.4 → modelswrkpi-10.6.0}/modelswrkpi.egg-info/requires.txt +0 -0
- {modelswrkpi-8.0.4 → modelswrkpi-10.6.0}/modelswrkpi.egg-info/top_level.txt +0 -0
|
@@ -96,12 +96,28 @@ include models/offers.cpython-310-x86_64-linux-gnu.so
|
|
|
96
96
|
include models/db.cpython-310-x86_64-linux-gnu.so
|
|
97
97
|
include models/bro_clicks/aff_stats.cpython-310-x86_64-linux-gnu.so
|
|
98
98
|
include models/bro_clicks/__init__.py
|
|
99
|
-
include models/bro_clicks/load_balancer.cpython-310-x86_64-linux-gnu.so
|
|
100
99
|
include models/bro_clicks/scrub_settings.cpython-310-x86_64-linux-gnu.so
|
|
101
100
|
include models/bro_clicks/splitter.cpython-310-x86_64-linux-gnu.so
|
|
102
101
|
include models/bro_clicks/alerts.cpython-310-x86_64-linux-gnu.so
|
|
103
102
|
include models/bro_clicks/initial_routes.cpython-310-x86_64-linux-gnu.so
|
|
104
103
|
include models/bro_clicks/binrouter.cpython-310-x86_64-linux-gnu.so
|
|
104
|
+
include models/bro_clicks/load_balancer/v3.cpython-310-x86_64-linux-gnu.so
|
|
105
|
+
include models/bro_clicks/load_balancer/v7.cpython-310-x86_64-linux-gnu.so
|
|
106
|
+
include models/bro_clicks/load_balancer/v5.cpython-310-x86_64-linux-gnu.so
|
|
107
|
+
include models/bro_clicks/load_balancer/__init__.py
|
|
108
|
+
include models/bro_clicks/load_balancer/v3.py
|
|
109
|
+
include models/bro_clicks/load_balancer/v7.py
|
|
110
|
+
include models/bro_clicks/load_balancer/v2.py
|
|
111
|
+
include models/bro_clicks/load_balancer/v6.py
|
|
112
|
+
include models/bro_clicks/load_balancer/v8.py
|
|
113
|
+
include models/bro_clicks/load_balancer/v2.cpython-310-x86_64-linux-gnu.so
|
|
114
|
+
include models/bro_clicks/load_balancer/v5.py
|
|
115
|
+
include models/bro_clicks/load_balancer/compile.py
|
|
116
|
+
include models/bro_clicks/load_balancer/v1.py
|
|
117
|
+
include models/bro_clicks/load_balancer/v4.py
|
|
118
|
+
include models/bro_clicks/load_balancer/v4.cpython-310-x86_64-linux-gnu.so
|
|
119
|
+
include models/bro_clicks/load_balancer/v6.cpython-310-x86_64-linux-gnu.so
|
|
120
|
+
include models/bro_clicks/load_balancer/v1.cpython-310-x86_64-linux-gnu.so
|
|
105
121
|
include models/bro_clicks/conversions.cpython-310-x86_64-linux-gnu.so
|
|
106
122
|
include models/bro_clicks/clicks.cpython-310-x86_64-linux-gnu.so
|
|
107
123
|
include models/bro_clicks/error_log.cpython-310-x86_64-linux-gnu.so
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
from models.bro_clicks.load_balancer.v1 import LoadBalancer
|
|
2
|
+
from models.bro_clicks.load_balancer.v2 import LoadBalancerV2
|
|
3
|
+
from models.bro_clicks.load_balancer.v3 import LoadBalancerV3
|
|
4
|
+
from models.bro_clicks.load_balancer.v4 import LoadBalancerV4
|
|
5
|
+
from models.bro_clicks.load_balancer.v5 import LoadBalancerV5
|
|
6
|
+
from models.bro_clicks.load_balancer.v6 import LoadBalancerV6
|
|
7
|
+
from models.bro_clicks.load_balancer.v7 import LoadBalancerV7
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
from distutils.core import setup
|
|
2
|
+
from distutils.extension import Extension
|
|
3
|
+
from Cython.Distutils import build_ext
|
|
4
|
+
ext_modules = [
|
|
5
|
+
Extension("v1", ["v1.py"], extra_compile_args=["-g0"]),
|
|
6
|
+
Extension("v2", ["v2.py"], extra_compile_args=["-g0"]),
|
|
7
|
+
Extension("v3", ["v3.py"], extra_compile_args=["-g0"]),
|
|
8
|
+
Extension("v4", ["v4.py"], extra_compile_args=["-g0"]),
|
|
9
|
+
Extension("v5", ["v5.py"], extra_compile_args=["-g0"]),
|
|
10
|
+
Extension("v6", ["v6.py"], extra_compile_args=["-g0"]),
|
|
11
|
+
Extension("v7", ["v7.py"], extra_compile_args=["-g0"]),
|
|
12
|
+
]
|
|
13
|
+
setup(
|
|
14
|
+
name='load_balancer',
|
|
15
|
+
cmdclass={'build_ext': build_ext},
|
|
16
|
+
ext_modules=ext_modules
|
|
17
|
+
)
|
|
Binary file
|
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
import random
|
|
2
|
+
from models.db import Db, pd
|
|
3
|
+
from calendar import monthrange
|
|
4
|
+
import datetime as dt
|
|
5
|
+
from models import config
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class LoadBalancer(Db):
|
|
9
|
+
_max_decline_attempts = 5
|
|
10
|
+
def __init__(self, db, db_p, account_id='54407332', **kw):
|
|
11
|
+
Db.__init__(self, db, f"bro_clicks", 'load_balancer_2')
|
|
12
|
+
self.set_constraint('load_balancer_2_pk', ['date', 'crm_id', 'gateway_id', 'router_id'])
|
|
13
|
+
self.db_p = db_p
|
|
14
|
+
self._account_id = account_id
|
|
15
|
+
self.is_cc_type_cap_split = False
|
|
16
|
+
|
|
17
|
+
@staticmethod
|
|
18
|
+
def set_max_decline_attempts(attempts):
|
|
19
|
+
LoadBalancer._max_decline_attempts = int(attempts)
|
|
20
|
+
print(f'max decline attempts set to {attempts}', flush=True)
|
|
21
|
+
|
|
22
|
+
@staticmethod
|
|
23
|
+
def now():
|
|
24
|
+
return dt.datetime.now() - dt.timedelta(hours=config.timeOffset)
|
|
25
|
+
|
|
26
|
+
@staticmethod
|
|
27
|
+
def today():
|
|
28
|
+
return LoadBalancer.now().date()
|
|
29
|
+
|
|
30
|
+
@staticmethod
|
|
31
|
+
def get_first_om():
|
|
32
|
+
now = LoadBalancer.now()
|
|
33
|
+
return dt.datetime(year=now.year, month=now.month, day=1)
|
|
34
|
+
|
|
35
|
+
@staticmethod
|
|
36
|
+
def get_last_dom(now=False):
|
|
37
|
+
now = now if now else LoadBalancer.now()
|
|
38
|
+
weekday_of, last_day = monthrange(now.year, now.month)
|
|
39
|
+
return last_day
|
|
40
|
+
|
|
41
|
+
@staticmethod
|
|
42
|
+
def get_drim():
|
|
43
|
+
now = LoadBalancer.now()
|
|
44
|
+
return LoadBalancer.get_last_dom() - now.day + 1
|
|
45
|
+
|
|
46
|
+
def get_processing_for_month(self, crm_id):
|
|
47
|
+
qry = f"""
|
|
48
|
+
select b.gateway_id,
|
|
49
|
+
count(a.order_id)::int initial_count_mtd
|
|
50
|
+
from augmented_data.order_cycles a
|
|
51
|
+
inner join crm_global.orders b on a.order_id = b.order_id and a.crm_id = b.crm_id and a.crm_id = '{crm_id}'
|
|
52
|
+
where a.time_stamp > '{self.get_first_om()}' and a.time_stamp < '{self.today()}'::timestamp
|
|
53
|
+
and a.bc_inferred = 0
|
|
54
|
+
and a.decline_reason is null
|
|
55
|
+
and b.is_test_cc::int <> '1'
|
|
56
|
+
group by b.gateway_id
|
|
57
|
+
"""
|
|
58
|
+
|
|
59
|
+
# print(qry)
|
|
60
|
+
return pd.read_sql(qry, self.db_p.engine).fillna(0)
|
|
61
|
+
|
|
62
|
+
def get_processing_for_month_cc_type(self, crm_id):
|
|
63
|
+
qry = f"""
|
|
64
|
+
select
|
|
65
|
+
gateway_id,
|
|
66
|
+
(initial_count_mtd - visa_count_mtd)::int as initial_count_mtd,
|
|
67
|
+
visa_count_mtd
|
|
68
|
+
from
|
|
69
|
+
(select b.gateway_id,
|
|
70
|
+
count(a.order_id)::int initial_count_mtd,
|
|
71
|
+
(count(a.order_id) filter(where lower(cc_type) = 'visa'))::int visa_count_mtd
|
|
72
|
+
from augmented_data.order_cycles a
|
|
73
|
+
inner join crm_global.orders b on a.order_id = b.order_id and a.crm_id = b.crm_id and a.crm_id = '{crm_id}'
|
|
74
|
+
where a.time_stamp > '{self.get_first_om()}' and a.time_stamp < '{self.today()}'::timestamp
|
|
75
|
+
and a.bc_inferred = 0
|
|
76
|
+
and a.decline_reason is null
|
|
77
|
+
and b.is_test_cc::int <> '1'
|
|
78
|
+
group by b.gateway_id) a
|
|
79
|
+
"""
|
|
80
|
+
|
|
81
|
+
# print(qry)
|
|
82
|
+
return pd.read_sql(qry, self.db_p.engine).fillna(0)
|
|
83
|
+
|
|
84
|
+
def init_date(self, date, crm_id, reset_cap_count=True):
|
|
85
|
+
sk = f'ui_{self._account_id}_clients'
|
|
86
|
+
real_cap_space = self.get_processing_for_month(crm_id) if reset_cap_count else None
|
|
87
|
+
|
|
88
|
+
qry = f"""
|
|
89
|
+
SELECT '{date}'::date as date, b.crm_id, a.mid_id, b.gateway_id, b.step, a.processor,
|
|
90
|
+
coalesce(e.approved, 0) approved,
|
|
91
|
+
coalesce(e.approved,0) initial_count,
|
|
92
|
+
c.dly_initial_cap, b.minimum_price,
|
|
93
|
+
coalesce(e.declined, 0) declined,
|
|
94
|
+
d.approval_rate,
|
|
95
|
+
c.dly_min_approval_rate,
|
|
96
|
+
array_to_string(c.pr_exclude_cc_types, ',') exclude_cc_types ,
|
|
97
|
+
c.date_added,
|
|
98
|
+
c.enable_tds,
|
|
99
|
+
array_to_string(c.tds_exclude_cc_types, ',') tds_exclude_cc_types,
|
|
100
|
+
c.enabled,
|
|
101
|
+
c.enable_initials,
|
|
102
|
+
c.monthly_initial_cap,
|
|
103
|
+
c.priority,
|
|
104
|
+
c.router_id,
|
|
105
|
+
d.router_id as cur_router_id,
|
|
106
|
+
d.soft_cap_alerted,
|
|
107
|
+
d.initial_count_mtd as prev_mtd
|
|
108
|
+
|
|
109
|
+
FROM {sk}.mids a
|
|
110
|
+
LEFT JOIN {sk}.steps b on b.mid_id = a.mid_id
|
|
111
|
+
LEFT JOIN {sk}.gateway_settings c on c.gateway_id = b.gateway_id and c.crm_id = b.crm_id
|
|
112
|
+
LEFT JOIN {self.schema}.{self.table} d on c.gateway_id =d.gateway_id and c.crm_id = d.crm_id and b.step = d.step and '{date}'::date =d.date
|
|
113
|
+
LEFT JOIN (select crm_id, gateway_id, coalesce(sum(declined), 0) declined, coalesce(sum(approved), 0) approved
|
|
114
|
+
from {self.schema}.conversions where coalesce(test, 0) <> 1 and time_stamp::date = '{date}'::date group by crm_id, gateway_id
|
|
115
|
+
) e on e.gateway_id =c.gateway_id and e.crm_id=c.crm_id
|
|
116
|
+
where (b.close_date is null or b.close_date >'{self.today()}')
|
|
117
|
+
and b.crm_id = '{crm_id}'
|
|
118
|
+
and b.gateway_id is not null
|
|
119
|
+
and a.processor not ilike '%%virtual%%'
|
|
120
|
+
and b.gateway_id::int <> 1
|
|
121
|
+
and a.processor != 'FlexCharge'
|
|
122
|
+
|
|
123
|
+
"""
|
|
124
|
+
|
|
125
|
+
try:
|
|
126
|
+
|
|
127
|
+
# if crm_id != 'crm_ll_2':
|
|
128
|
+
#
|
|
129
|
+
|
|
130
|
+
# print(qry)
|
|
131
|
+
# print('break')
|
|
132
|
+
up = pd.read_sql(qry, self.engine)
|
|
133
|
+
|
|
134
|
+
up = up.sort_values('step').drop_duplicates(['gateway_id', 'cur_router_id'], keep='first')
|
|
135
|
+
up = up.loc[~up.router_id.isna()]
|
|
136
|
+
up = up.explode('router_id')
|
|
137
|
+
|
|
138
|
+
# delete changes to routers
|
|
139
|
+
del_gt_msk = (up.router_id != up.cur_router_id) & (
|
|
140
|
+
up.gateway_id.isin(up.loc[~up.cur_router_id.isna()].gateway_id.unique()))
|
|
141
|
+
del_gtys = up.loc[del_gt_msk].gateway_id.tolist()
|
|
142
|
+
|
|
143
|
+
up = up.loc[(~up.gateway_id.isin(del_gtys)) | (~up.cur_router_id.isna())]
|
|
144
|
+
|
|
145
|
+
# delete changes to routers
|
|
146
|
+
del_gt_msk = (up.router_id != up.cur_router_id)
|
|
147
|
+
del_gtys = up.loc[del_gt_msk].gateway_id.tolist()
|
|
148
|
+
self.engine.execute(
|
|
149
|
+
f"delete from {self.schema}.{self.table} where gateway_id::int = ANY(ARRAY{del_gtys}::int[]) and crm_id='{crm_id}'")
|
|
150
|
+
up = up.drop(columns='cur_router_id')
|
|
151
|
+
except Exception as e:
|
|
152
|
+
raise e
|
|
153
|
+
if reset_cap_count:
|
|
154
|
+
try:
|
|
155
|
+
up = up.merge(real_cap_space, on=['gateway_id'], how='left')
|
|
156
|
+
up.initial_count_mtd = up.initial_count_mtd.fillna(0)
|
|
157
|
+
up.initial_count_mtd += up.initial_count
|
|
158
|
+
|
|
159
|
+
except:
|
|
160
|
+
up['initial_count_mtd'] = up.prev_mtd.fillna(0)
|
|
161
|
+
up.initial_count_mtd = up.initial_count_mtd.fillna(0)
|
|
162
|
+
|
|
163
|
+
drim = float(self.get_drim())
|
|
164
|
+
up.dly_initial_cap = pd.np.floor((up.monthly_initial_cap - up.initial_count_mtd) / drim)
|
|
165
|
+
up.loc[up.dly_initial_cap < 0, 'dly_initial_cap'] = 0
|
|
166
|
+
|
|
167
|
+
up.dly_initial_cap = up.dly_initial_cap.fillna(11)
|
|
168
|
+
up.dly_min_approval_rate = up.dly_min_approval_rate.fillna(30)
|
|
169
|
+
up.declined = up.declined.fillna(0)
|
|
170
|
+
up.approval_rate = up.approval_rate.fillna(0)
|
|
171
|
+
up.soft_cap_alerted = up.soft_cap_alerted.fillna(False)
|
|
172
|
+
up.drop('prev_mtd', axis=1, errors='ignore', inplace=True)
|
|
173
|
+
up = up.drop_duplicates(['gateway_id', 'router_id'])
|
|
174
|
+
# self.engine.execute(f'truncate {self.schema}.{self.table}')
|
|
175
|
+
self.upsert(up.dropna())
|
|
176
|
+
|
|
177
|
+
def _increment_conversion(self, date, gateway_id, crm_id, approved, recurs_attempt=0, cc_type=None, **kwargs):
|
|
178
|
+
if cc_type.lower() == 'visa':
|
|
179
|
+
inc_p = '(visa_count +1)'
|
|
180
|
+
m_inc_p = '(visa_count_mtd +1)'
|
|
181
|
+
inc = 'visa_count'
|
|
182
|
+
m_inc = 'visa_count_mtd'
|
|
183
|
+
|
|
184
|
+
else:
|
|
185
|
+
inc_p = '(initial_count +1)'
|
|
186
|
+
m_inc_p = '(initial_count_mtd +1)'
|
|
187
|
+
inc = 'initial_count'
|
|
188
|
+
m_inc = 'initial_count_mtd'
|
|
189
|
+
dnc = 'declined'
|
|
190
|
+
dnc_p = '(declined + 1)'
|
|
191
|
+
try:
|
|
192
|
+
qry = f"""
|
|
193
|
+
UPDATE {self.schema}.{self.table}
|
|
194
|
+
set {f"{inc} ={inc_p}, approval_rate = ((initial_count+visa_count+1)::numeric / ({dnc}+(initial_count+visa_count+1)::numeric))*100, {m_inc} = {m_inc_p}" if approved
|
|
195
|
+
else f"{dnc} ={dnc_p}, approval_rate = case when visa_count+initial_count>0 then ((visa_count+initial_count)::numeric / ({dnc_p}+visa_count+initial_count)::numeric * 100) else 0 end "
|
|
196
|
+
}
|
|
197
|
+
where crm_id = '{crm_id}' and date = '{date}'::date and gateway_id='{gateway_id}'
|
|
198
|
+
returning gateway_id
|
|
199
|
+
"""
|
|
200
|
+
|
|
201
|
+
if self.engine.execute(qry).scalar() is None and not recurs_attempt:
|
|
202
|
+
self.init_date(date, crm_id)
|
|
203
|
+
if not recurs_attempt:
|
|
204
|
+
return self._increment_conversion(date, gateway_id, crm_id, approved, recurs_attempt + 1)
|
|
205
|
+
|
|
206
|
+
except Exception as e:
|
|
207
|
+
print(e)
|
|
208
|
+
return False
|
|
209
|
+
return True
|
|
210
|
+
|
|
211
|
+
def increment_conversion(self, date, gateway_id, crm_id, approved, **kwargs):
|
|
212
|
+
return self._increment_conversion(date, gateway_id, crm_id, approved, recurs_attempt=0, **kwargs)
|
|
213
|
+
|
|
214
|
+
def set_soft_cap_alerted(self, crm_id, cc_type=None, **kw):
|
|
215
|
+
self.engine.execute(
|
|
216
|
+
f"""Update {self.schema}.{self.table}
|
|
217
|
+
{"set visa_soft_cap_alerted=true" if cc_type.lower()=='visa' else "set soft_cap_alerted=true"}
|
|
218
|
+
where crm_id= '{crm_id}'""")
|
|
219
|
+
|
|
220
|
+
def disable(self, crm_id, gateway_id, cc_type=None, **kw):
|
|
221
|
+
set_clause = 'set enable_initials=false'
|
|
222
|
+
if cc_type:
|
|
223
|
+
if cc_type.lower() == 'visa':
|
|
224
|
+
set_clause = ' set visa_enabled=false '
|
|
225
|
+
elif cc_type:
|
|
226
|
+
set_clause = ' set mc_enabled=false '
|
|
227
|
+
|
|
228
|
+
self.engine.execute(
|
|
229
|
+
f"""Update {self.schema}.{self.table} {set_clause} where crm_id= '{crm_id}' and gateway_id = '{int(gateway_id)}'""")
|
|
230
|
+
if not cc_type:
|
|
231
|
+
self.db_p.engine.execute(
|
|
232
|
+
f"update ui_54407332_clients.gateway_settings set enable_initials=false where crm_id='{crm_id}' and gateway_id='{gateway_id}'")
|
|
Binary file
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
from models.bro_clicks.load_balancer.v1 import LoadBalancer
|
|
2
|
+
import pandas as pd
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class LoadBalancerV2(LoadBalancer):
|
|
6
|
+
def __init__(self, db, db_p, account_id='54407332', alert_call_back=False, **kwargs):
|
|
7
|
+
LoadBalancer.__init__(self, db, db_p, account_id=account_id)
|
|
8
|
+
self.alert_cb = alert_call_back
|
|
9
|
+
|
|
10
|
+
self.sort_map = {
|
|
11
|
+
# No optimization
|
|
12
|
+
4: {'by': ['priority', 'date_added', 'fill_pct', 'approval_rate', 'initial_count'],
|
|
13
|
+
'ascending': [False, False, True, False, True]}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
def gty_qry(self, crm_id, date, step, processor, cc_type=False, decs='', proc_excl=[], is_tds=None, is_decline_salvage=False, **kw):
|
|
17
|
+
p_ex = ''
|
|
18
|
+
if proc_excl and len(proc_excl) and not processor:
|
|
19
|
+
p_ex = f"and a.processor not ilike all(ARRAY{[f'%%{p}%%' for p in proc_excl]}::text[])"
|
|
20
|
+
|
|
21
|
+
return f""" --LEFT HERE NEED TO GET MCC!
|
|
22
|
+
select a.gateway_id::int, a.fill_pct,a.dly_initial_cap,priority,initial_count, a.approval_rate, a.date_added, a.processor, a.mid_id, a.monthly_initial_cap, a.soft_cap_alerted, initial_count_mtd,b.mcc from {self.schema}.{self.table} a
|
|
23
|
+
inner join (select crm_id, gateway_id, mcc from ui_54407332_clients.steps ) b on b.crm_id = a.crm_id and b.gateway_id=a.gateway_id
|
|
24
|
+
{"inner join (select crm_id, gateway_id where enable_decline_salvage) ds on ds.crm_id = a.crm_id and ds.gateway_id::int = a.gateway_id::int" if is_decline_salvage else "" }
|
|
25
|
+
inner join processing.cap c on a.mid_id = c.mid_id and a.step=c.step and a.processor=c.processor and c.monthly_available > 200
|
|
26
|
+
{f"left join processing.cap_cc_type d on a.mid_id = d.mid_id and a.step= d.step and a.processor = d.processor and d.cc_type = '{cc_type}' " if cc_type else ''}
|
|
27
|
+
|
|
28
|
+
where date = '{date}'::date and a.crm_id = '{crm_id}' and router_id = '{step if step in [1, 11] else 2}' and enabled and enable_initials
|
|
29
|
+
{f"and a.processor = '{processor}'" if processor else ""}
|
|
30
|
+
{f"and (exclude_cc_types is null or exclude_cc_types::text not ilike '%%{cc_type.lower()}%%')" if cc_type else ''}
|
|
31
|
+
and (approval_rate > dly_min_approval_rate or(declined+initial_count<110))
|
|
32
|
+
{'and (d.available_tc is null or d.available_tc >50)' if cc_type else ''}
|
|
33
|
+
{decs}
|
|
34
|
+
{p_ex}
|
|
35
|
+
{f"and enable_tds = {bool(is_tds)}" if is_tds else ""}
|
|
36
|
+
{f"and (tds_exclude_cc_types is null or tds_exclude_cc_types not ilike '%%{cc_type}%%')" if cc_type and is_tds else ""}
|
|
37
|
+
--and fill_pct < 1
|
|
38
|
+
--order by date_added desc, approval_rate desc, fill_pct asc limit 1
|
|
39
|
+
order by priority desc, date_added desc, fill_pct, approval_rate desc, initial_count
|
|
40
|
+
|
|
41
|
+
"""
|
|
42
|
+
|
|
43
|
+
def exclude_list(self, crm_id, step, click_id, alias='', c_token=''):
|
|
44
|
+
if not c_token:
|
|
45
|
+
c = 'absce'
|
|
46
|
+
else:
|
|
47
|
+
c = c_token
|
|
48
|
+
decs = pd.read_sql(f"""SELECT gateway_id, processor, approved from {self.schema}.conversions
|
|
49
|
+
where crm_id = '{crm_id}'
|
|
50
|
+
and time_stamp > (now() - INTERVAL '48 hours')::timestamp
|
|
51
|
+
and {f" c_token='{c}' " if c_token else f" click_id = '{click_id}' " } and coalesce(decline_reason, '') not ilike 'prepaid%%' """,
|
|
52
|
+
|
|
53
|
+
self.engine)
|
|
54
|
+
|
|
55
|
+
whd = ""
|
|
56
|
+
if len(decs):
|
|
57
|
+
decs.gateway_id = decs.gateway_id.fillna(-1)
|
|
58
|
+
decs.processor = decs.processor.fillna('')
|
|
59
|
+
processors = decs.loc[decs.approved == 0].processor.astype(str).tolist()
|
|
60
|
+
if len(decs) >= self._max_decline_attempts:
|
|
61
|
+
raise Exception('declined due to too many attempts')
|
|
62
|
+
p_break = []
|
|
63
|
+
for p in processors:
|
|
64
|
+
p_break.extend(p.split(' '))
|
|
65
|
+
|
|
66
|
+
whd = f"""and {alias}gateway_id != all(ARRAY{decs.gateway_id.astype(int).tolist()})
|
|
67
|
+
{f"and {alias}processor not ilike all(ARRAY{[f'%%{p}%%' for p in p_break]})" if len(p_break) else ""}"""
|
|
68
|
+
|
|
69
|
+
return whd
|
|
70
|
+
|
|
71
|
+
def next_gateway(self, crm_id, date, step, click_id='', processor=False, cc_type=None, recurse=0, decs=False,
|
|
72
|
+
proc_excl=[], is_tds=None,
|
|
73
|
+
**kwargs):
|
|
74
|
+
try:
|
|
75
|
+
decs = self.exclude_list(crm_id, step, click_id, alias='a.') if not decs else decs
|
|
76
|
+
except Exception as e:
|
|
77
|
+
return str(e)
|
|
78
|
+
|
|
79
|
+
qry = self.gty_qry(crm_id, date, step, processor, cc_type, decs, proc_excl, is_tds=is_tds, **kwargs)
|
|
80
|
+
# print(qry)
|
|
81
|
+
res = None
|
|
82
|
+
try:
|
|
83
|
+
res = pd.read_sql(qry, self.engine)
|
|
84
|
+
except Exception as e:
|
|
85
|
+
print(str(e))
|
|
86
|
+
if res is None or not len(res):
|
|
87
|
+
if not decs:
|
|
88
|
+
if not recurse and is_tds is not None:
|
|
89
|
+
return self.next_gateway(crm_id, date, step, click_id, processor, cc_type, recurse=recurse + 1,
|
|
90
|
+
is_tds=not is_tds)
|
|
91
|
+
elif recurse == 1:
|
|
92
|
+
self.init_date(date, crm_id)
|
|
93
|
+
return self.next_gateway(crm_id, date, step, click_id, processor, cc_type, recurse=recurse + 1,
|
|
94
|
+
is_tds=is_tds)
|
|
95
|
+
elif recurse == 2 and is_tds is not None:
|
|
96
|
+
return self.next_gateway(crm_id, date, step, click_id, processor, cc_type, recurse=recurse + 1,
|
|
97
|
+
is_tds=None)
|
|
98
|
+
|
|
99
|
+
return 'out of processing'
|
|
100
|
+
else:
|
|
101
|
+
return 'declined due to too many attempts'
|
|
102
|
+
r = res.loc[res.fill_pct < 1]
|
|
103
|
+
|
|
104
|
+
# HARD CAP
|
|
105
|
+
if not len(r):
|
|
106
|
+
res = res.sort_values(['dly_initial_cap'], ascending=False).sort_values(['fill_pct'])
|
|
107
|
+
|
|
108
|
+
def _get_aft_sc():
|
|
109
|
+
nonlocal res
|
|
110
|
+
if not len(res):
|
|
111
|
+
return 'out of processing'
|
|
112
|
+
r2 = res.to_dict(orient='records')[0]
|
|
113
|
+
if r2['initial_count_mtd'] >= r2['monthly_initial_cap']:
|
|
114
|
+
self.alert_cb('hard_cap_alert', crm_id=crm_id, gateway_id=r2['gateway_id'])
|
|
115
|
+
self.disable(crm_id=crm_id, gateway_id=r2['gateway_id'])
|
|
116
|
+
res = res.loc[res.gateway_id != r2['gateway_id']]
|
|
117
|
+
return _get_aft_sc()
|
|
118
|
+
r2['is_tds'] = is_tds
|
|
119
|
+
return r2
|
|
120
|
+
|
|
121
|
+
if ~res.soft_cap_alerted.any():
|
|
122
|
+
cnt = self.engine.execute(
|
|
123
|
+
f"""select count(*) from {self.schema}.{self.table} where date = '{date}'::date and crm_id = '{crm_id}' and router_id = '{step if step == 1 else 2}' and enabled and enable_initials and fill_pct<1""").scalar()
|
|
124
|
+
if cnt == 0 or cnt is None:
|
|
125
|
+
self.alert_cb('soft_cap_alert', crm_id=crm_id)
|
|
126
|
+
self.set_soft_cap_alerted(crm_id)
|
|
127
|
+
return _get_aft_sc()
|
|
128
|
+
r = r.to_dict(orient='records')[0]
|
|
129
|
+
r['is_tds'] = is_tds
|
|
130
|
+
return r
|
|
131
|
+
|
|
132
|
+
def increment_conversion(self, date, gateway_id, crm_id, approved, **kwargs):
|
|
133
|
+
|
|
134
|
+
return self._increment_conversion(date, gateway_id, crm_id, approved, recurs_attempt=0, **kwargs)
|
|
135
|
+
|