modelswrkpi 9.0.1__py3-none-any.whl → 9.1.0__py3-none-any.whl
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.
Potentially problematic release.
This version of modelswrkpi might be problematic. Click here for more details.
- models/bro_clicks/load_balancer/v1.cpython-310-x86_64-linux-gnu.so +0 -0
- models/bro_clicks/load_balancer/v1.py +11 -3
- models/bro_clicks/load_balancer/v7.cpython-310-x86_64-linux-gnu.so +0 -0
- models/bro_clicks/load_balancer/v7.py +13 -10
- {modelswrkpi-9.0.1.dist-info → modelswrkpi-9.1.0.dist-info}/METADATA +1 -1
- {modelswrkpi-9.0.1.dist-info → modelswrkpi-9.1.0.dist-info}/RECORD +8 -8
- {modelswrkpi-9.0.1.dist-info → modelswrkpi-9.1.0.dist-info}/WHEEL +0 -0
- {modelswrkpi-9.0.1.dist-info → modelswrkpi-9.1.0.dist-info}/top_level.txt +0 -0
|
Binary file
|
|
@@ -217,8 +217,16 @@ class LoadBalancer(Db):
|
|
|
217
217
|
{"set visa_soft_cap_alerted=true" if cc_type.lower()=='visa' else "set soft_cap_alerted=true"}
|
|
218
218
|
where crm_id= '{crm_id}'""")
|
|
219
219
|
|
|
220
|
-
def disable(self, crm_id, gateway_id):
|
|
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 = 'visa_enabled = false'
|
|
225
|
+
elif cc_type:
|
|
226
|
+
set_clause = 'mc_enabled = false'
|
|
227
|
+
|
|
221
228
|
self.engine.execute(
|
|
222
|
-
f"""Update {self.schema}.{self.table}
|
|
223
|
-
|
|
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(
|
|
224
232
|
f"update ui_54407332_clients.gateway_settings set enable_initials=false where crm_id='{crm_id}' and gateway_id='{gateway_id}'")
|
|
Binary file
|
|
@@ -39,7 +39,9 @@ class LoadBalancerV7(LoadBalancerV6):
|
|
|
39
39
|
d.soft_cap_alerted,
|
|
40
40
|
d.visa_soft_cap_alerted,
|
|
41
41
|
d.initial_count_mtd as prev_mtd,
|
|
42
|
-
d.visa_count_mtd as prev_visa_mtd
|
|
42
|
+
d.visa_count_mtd as prev_visa_mtd,
|
|
43
|
+
TRUE as visa_enabled,
|
|
44
|
+
TRUE as mc_enabled
|
|
43
45
|
|
|
44
46
|
FROM {sk}.mids a
|
|
45
47
|
LEFT JOIN {sk}.steps b on b.mid_id = a.mid_id
|
|
@@ -105,7 +107,8 @@ class LoadBalancerV7(LoadBalancerV6):
|
|
|
105
107
|
up.visa_dly_cap = pd.np.floor((up.visa_monthly_cap - up.visa_count_mtd) / drim)
|
|
106
108
|
up.loc[up.dly_initial_cap < 0, 'dly_initial_cap'] = 0
|
|
107
109
|
up.loc[up.visa_dly_cap < 0, 'visa_dly_cap'] = 0
|
|
108
|
-
|
|
110
|
+
up.visa_enabled = up.visa_count_mtd.fillna(0) < up.visa_monthly_cap.fillna(0)
|
|
111
|
+
up.mc_enabled = up.initial_count_mtd.fillna(0) < up.monthly_initial_cap.fillna(0)
|
|
109
112
|
up.dly_initial_cap = up.dly_initial_cap.fillna(11)
|
|
110
113
|
up.visa_dly_cap = up.visa_dly_cap.fillna(11)
|
|
111
114
|
up.dly_min_approval_rate = up.dly_min_approval_rate.fillna(30)
|
|
@@ -113,7 +116,7 @@ class LoadBalancerV7(LoadBalancerV6):
|
|
|
113
116
|
up.approval_rate = up.approval_rate.fillna(0)
|
|
114
117
|
up.soft_cap_alerted = up.soft_cap_alerted.fillna(False)
|
|
115
118
|
up.visa_soft_cap_alerted = up.visa_soft_cap_alerted.fillna(False)
|
|
116
|
-
up.drop('prev_mtd', axis=1, errors='ignore', inplace=True)
|
|
119
|
+
up.drop(['prev_mtd', 'prev_visa_mtd'], axis=1, errors='ignore', inplace=True)
|
|
117
120
|
up = up.drop_duplicates(['gateway_id', 'router_id'])
|
|
118
121
|
# self.engine.execute(f'truncate {self.schema}.{self.table}')
|
|
119
122
|
self.upsert(up.dropna())
|
|
@@ -121,14 +124,16 @@ class LoadBalancerV7(LoadBalancerV6):
|
|
|
121
124
|
def gty_qry(self, crm_id, date, step, processor, cc_type=False, decs='', proc_excl=[], is_tds=None,
|
|
122
125
|
is_prepaid=False, is_decline_salvage=False, **kw):
|
|
123
126
|
p_ex = ''
|
|
127
|
+
cc_enable_clause = ''
|
|
124
128
|
if proc_excl and len(proc_excl) and not processor:
|
|
125
129
|
p_ex = f"and a.processor not ilike all(ARRAY{[f'%%{p}%%' for p in proc_excl]}::text[])"
|
|
126
130
|
|
|
127
131
|
if str(cc_type).lower() == 'visa':
|
|
128
132
|
dyna_cap_cols = "a.visa_fill_pct fill_pct, a.visa_dly_cap dly_initial_cap, a.visa_monthly_cap monthly_initial_cap, a.visa_soft_cap_alerted soft_cap_alerted, a.visa_count_mtd initial_count_mtd, a.visa_count initial_count, a.soft_cap_alerted sca2"
|
|
133
|
+
cc_enable_clause = 'and a.visa_enabled'
|
|
129
134
|
else:
|
|
130
135
|
dyna_cap_cols = "a.fill_pct, a.dly_initial_cap, a.monthly_initial_cap, a.soft_cap_alerted, initial_count_mtd, initial_count, a.visa_soft_cap_alerted sca2"
|
|
131
|
-
|
|
136
|
+
cc_enable_clause = 'and a.mc_enabled'
|
|
132
137
|
|
|
133
138
|
return f""" --LEFT HERE NEED TO GET MCC!
|
|
134
139
|
select a.gateway_id::int, priority, a.approval_rate, a.date_added, a.processor, a.mid_id, b.mcc,
|
|
@@ -150,6 +155,7 @@ class LoadBalancerV7(LoadBalancerV6):
|
|
|
150
155
|
{f"and (tds_exclude_cc_types is null or tds_exclude_cc_types not ilike '%%{cc_type}%%')" if cc_type and is_tds else ""}
|
|
151
156
|
{f"and allow_prepaid" if is_prepaid else ""}
|
|
152
157
|
{f"and allow_non_prepaid" if not is_prepaid else ""}
|
|
158
|
+
{cc_enable_clause}
|
|
153
159
|
--and fill_pct < 1
|
|
154
160
|
|
|
155
161
|
--order by date_added desc, approval_rate desc, fill_pct asc limit 1
|
|
@@ -276,12 +282,9 @@ class LoadBalancerV7(LoadBalancerV6):
|
|
|
276
282
|
return 'out of processing'
|
|
277
283
|
r2 = res.to_dict(orient='records')[0]
|
|
278
284
|
if r2['initial_count_mtd'] >= r2['monthly_initial_cap']:
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
res = res.loc[res.gateway_id != r2['gateway_id']]
|
|
283
|
-
else:
|
|
284
|
-
self.alert_cb('hard_cap_alert', crm_id=crm_id, gateway_id=r2['gateway_id'], cc_type='Non-Visa')
|
|
285
|
+
self.alert_cb('hard_cap_alert', crm_id=crm_id, gateway_id=r2['gateway_id'], cc_type=cc_type)
|
|
286
|
+
self.disable(crm_id=crm_id, gateway_id=r2['gateway_id'], cc_type=cc_type)
|
|
287
|
+
res = res.loc[res.gateway_id != r2['gateway_id']]
|
|
285
288
|
return _get_aft_sc()
|
|
286
289
|
self.set_iin(**r2)
|
|
287
290
|
r2['is_tds'] = is_tds
|
|
@@ -67,8 +67,8 @@ models/bro_clicks/scrub_settings.cpython-310-x86_64-linux-gnu.so,sha256=gKo6LHc-
|
|
|
67
67
|
models/bro_clicks/splitter.cpython-310-x86_64-linux-gnu.so,sha256=27kzt-JDllwAXMFq8Xe2Av0RIDpwFK4h_t6BvytGsak,57712
|
|
68
68
|
models/bro_clicks/load_balancer/__init__.py,sha256=TMIh-RpmoCaEMTLU7geYtcDpygX5KFM8B4RRsHcKutA,432
|
|
69
69
|
models/bro_clicks/load_balancer/compile.py,sha256=0mD0LCkkR2aasWk8AdxVA6ylHN28l4bV6vwkA2TUQF4,661
|
|
70
|
-
models/bro_clicks/load_balancer/v1.cpython-310-x86_64-linux-gnu.so,sha256=
|
|
71
|
-
models/bro_clicks/load_balancer/v1.py,sha256
|
|
70
|
+
models/bro_clicks/load_balancer/v1.cpython-310-x86_64-linux-gnu.so,sha256=Eqst8z6bGCUZ6DM8s1cPDA4LEhWVrQa82d97YlPJirc,177072
|
|
71
|
+
models/bro_clicks/load_balancer/v1.py,sha256=-vCW9oGwMi4jkcVyR6yi6UA5O0xP1Q7EfhKcpTvQUc4,11115
|
|
72
72
|
models/bro_clicks/load_balancer/v2.cpython-310-x86_64-linux-gnu.so,sha256=VCGHr8KSipO2E0IfJ0zSpdte-xw_xsSK5vRWujtumnU,140368
|
|
73
73
|
models/bro_clicks/load_balancer/v2.py,sha256=WSM6lKtyLrzx1xdhL3ncuH4QH-FBnS5Gm0uDFAtNHXo,7303
|
|
74
74
|
models/bro_clicks/load_balancer/v3.cpython-310-x86_64-linux-gnu.so,sha256=f03MbM9KyuKpctvJ-6g6pnhMbnsasPtTkFVeQlRXUeA,256496
|
|
@@ -79,8 +79,8 @@ models/bro_clicks/load_balancer/v5.cpython-310-x86_64-linux-gnu.so,sha256=gHA2J0
|
|
|
79
79
|
models/bro_clicks/load_balancer/v5.py,sha256=jA1KPoJLcm8szMGhaGuMSH-dZ6d0dwNv1PgGm0UHsJ0,8036
|
|
80
80
|
models/bro_clicks/load_balancer/v6.cpython-310-x86_64-linux-gnu.so,sha256=1X_3SFmkafbH3Ejj8q7aHUHHxNzpP6zlJXNTKehks2s,165360
|
|
81
81
|
models/bro_clicks/load_balancer/v6.py,sha256=oD_VYJ_Yvm5YJAGBx4IYxQHvIbKTeRq-Y00O38adOyQ,9587
|
|
82
|
-
models/bro_clicks/load_balancer/v7.cpython-310-x86_64-linux-gnu.so,sha256=
|
|
83
|
-
models/bro_clicks/load_balancer/v7.py,sha256=
|
|
82
|
+
models/bro_clicks/load_balancer/v7.cpython-310-x86_64-linux-gnu.so,sha256=82CbiqQvJZjYBYSGwc45fEX8Pfpnkb6Br8ipRet0-5I,214160
|
|
83
|
+
models/bro_clicks/load_balancer/v7.py,sha256=cEQQmLPBlKoSau9V-PAXhq0cHsfU661MiyNHNbE49dk,18457
|
|
84
84
|
models/bro_clicks/load_balancer/v8.py,sha256=tkk6FpLgQvKCaFf2kmKsHhW_Pj4gJq4PcSe-DKcIUC4,264
|
|
85
85
|
models/cb911/__init__.py,sha256=Y3tX5WQYFUswdMMUpWqa9U_fNObUAhXcVrix3eXYP4k,64
|
|
86
86
|
models/cb911/alerts.cpython-310-x86_64-linux-gnu.so,sha256=LCsUfaTzdQKS6ZaKQbfLCNTZbpZqaJmEsWDTUOdHUrI,61808
|
|
@@ -136,7 +136,7 @@ models/reports/table_reports/inactive_report.cpython-310-x86_64-linux-gnu.so,sha
|
|
|
136
136
|
models/reports/table_reports/mtd_report.cpython-310-x86_64-linux-gnu.so,sha256=dHko7wWia9y9d-gIPC8uxycUnobII6hQgairSPRU168,74096
|
|
137
137
|
models/vaultx/__init__.py,sha256=PwYMmWXQMojeyFnQuQW3wNlv9dLUmX_uiDfCOHJN7XI,46
|
|
138
138
|
models/vaultx/ssc_cont.cpython-310-x86_64-linux-gnu.so,sha256=69kGuEko6oJEqxopS_4BxoX5S-Twq94eFwYJFEu_4B8,94992
|
|
139
|
-
modelswrkpi-9.0.
|
|
140
|
-
modelswrkpi-9.0.
|
|
141
|
-
modelswrkpi-9.0.
|
|
142
|
-
modelswrkpi-9.0.
|
|
139
|
+
modelswrkpi-9.1.0.dist-info/METADATA,sha256=Q06H4MrzsFOGRBgFbNnGjoPoL3qU3Gj6J4fgMXTLwOA,346
|
|
140
|
+
modelswrkpi-9.1.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
141
|
+
modelswrkpi-9.1.0.dist-info/top_level.txt,sha256=fOgLNy4xnMfp0ihe_kFhY_yH71kNkdEQG68z8FoLR4g,19
|
|
142
|
+
modelswrkpi-9.1.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|