Some checks are pending
NordaBiz Tests / Unit & Integration Tests (push) Waiting to run
NordaBiz Tests / E2E Tests (Playwright) (push) Blocked by required conditions
NordaBiz Tests / Smoke Tests (Production) (push) Blocked by required conditions
NordaBiz Tests / Send Failure Notification (push) Blocked by required conditions
Production moved from on-prem VM 249 (10.22.68.249) to OVH VPS (57.128.200.27, inpi-vps-waw01). Updated ALL documentation, slash commands, memory files, architecture docs, and deploy procedures. Added |local_time Jinja filter (UTC→Europe/Warsaw) and converted 155 .strftime() calls across 71 templates so timestamps display in Polish timezone regardless of server timezone. Also includes: created_by_id tracking, abort import fix, ICS calendar fix for missing end times, Pros Poland data cleanup. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
55 lines
2.0 KiB
Python
55 lines
2.0 KiB
Python
"""Audit active companies for missing KRS/CEIDG data."""
|
|
import os, sys
|
|
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
|
|
|
from sqlalchemy import create_engine, text
|
|
|
|
db_url = os.environ.get('DATABASE_URL', 'postgresql://nordabiz_app:nordabiz_pass@localhost:5433/nordabiz')
|
|
engine = create_engine(db_url)
|
|
|
|
with engine.connect() as conn:
|
|
r = conn.execute(text(
|
|
"SELECT id, name, nip, krs, legal_form, address_street, address_city, "
|
|
"email, phone, website, data_quality, fee_included_in_parent "
|
|
"FROM companies WHERE status = 'active' ORDER BY name"
|
|
))
|
|
|
|
no_nip = []
|
|
no_address = []
|
|
no_contact = []
|
|
no_legal_form = []
|
|
basic_quality = []
|
|
|
|
for row in r:
|
|
cid, name, nip, krs, legal_form, street, city, email, phone, website, quality, fee_in_parent = row
|
|
if not nip and not fee_in_parent:
|
|
no_nip.append((cid, name))
|
|
if not street and not city:
|
|
no_address.append((cid, name))
|
|
if not email and not phone:
|
|
no_contact.append((cid, name))
|
|
if not legal_form:
|
|
no_legal_form.append((cid, name))
|
|
if quality == 'basic':
|
|
basic_quality.append((cid, name, nip))
|
|
|
|
print(f'=== Firmy BEZ NIP (nie-podspolki): {len(no_nip)} ===')
|
|
for cid, name in no_nip:
|
|
print(f' id={cid:4d} {name}')
|
|
|
|
print(f'\n=== Firmy BEZ adresu: {len(no_address)} ===')
|
|
for cid, name in no_address:
|
|
print(f' id={cid:4d} {name}')
|
|
|
|
print(f'\n=== Firmy BEZ kontaktu (email+telefon): {len(no_contact)} ===')
|
|
for cid, name in no_contact:
|
|
print(f' id={cid:4d} {name}')
|
|
|
|
print(f'\n=== Firmy BEZ formy prawnej: {len(no_legal_form)} ===')
|
|
for cid, name in no_legal_form:
|
|
print(f' id={cid:4d} {name}')
|
|
|
|
print(f'\n=== Firmy z data_quality=basic (minimalne dane): {len(basic_quality)} ===')
|
|
for cid, name, nip in basic_quality:
|
|
print(f' id={cid:4d} nip={str(nip or "BRAK"):15s} {name}')
|