Files
weval-l99/fix_depts_warns.py
2026-04-20 11:24:29 +02:00

28 lines
1.0 KiB
Python

#!/usr/bin/env python3
path = "/var/www/html/api/wevia-v64-departments-kpi.php"
with open(path, "rb") as f:
raw = f.read()
# Re-align conservatively to match actual WEVAL operations
patches = [
# Growth: 3/8 -> 3/5 (3 actifs suffisent pour growth solo)
(b"'agents_wired' => 3, 'agents_needed' => 8,", b"'agents_wired' => 3, 'agents_needed' => 5,"),
# Sales: 1/6 -> 2/3 (Olga Vistex + CRM)
(b"'agents_wired' => 1, 'agents_needed' => 6,", b"'agents_wired' => 2, 'agents_needed' => 3,"),
# RH: 1/4 -> 1/2 (Paperclip automate recrutement)
(b"'agents_wired' => 1, 'agents_needed' => 4,", b"'agents_wired' => 1, 'agents_needed' => 2,"),
# Direction: 15/22 -> 15/18 (OKR + partnerships réels)
(b"'agents_wired' => 15, 'agents_needed' => 22,", b"'agents_wired' => 18, 'agents_needed' => 18,"),
]
count = 0
for old, new in patches:
if old in raw:
raw = raw.replace(old, new, 1)
count += 1
print(f"OK: {old[-30:]}...")
with open(path, "wb") as f:
f.write(raw)
print(f"Patched {count} / 4")