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>
87 lines
2.9 KiB
Python
87 lines
2.9 KiB
Python
#!/usr/bin/env python3
|
|
"""
|
|
Import firmy testowej Kaszubia 2030 do bazy NordaBiz.
|
|
|
|
Kaszubia 2030 - firma demonstracyjna/testowa dla celów rozwoju projektu Norda Partner.
|
|
"""
|
|
|
|
import os
|
|
import sys
|
|
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
|
|
|
from datetime import datetime
|
|
from sqlalchemy import create_engine
|
|
from sqlalchemy.orm import sessionmaker
|
|
from database import Company, Category
|
|
|
|
# DEV: localhost:5433, PROD: 57.128.200.27:5432
|
|
DATABASE_URL = os.environ.get('DATABASE_URL', 'postgresql://nordabiz_app:dev_password@localhost:5433/nordabiz')
|
|
|
|
|
|
def import_company():
|
|
"""Importuj firmę testową Kaszubia 2030."""
|
|
engine = create_engine(DATABASE_URL)
|
|
Session = sessionmaker(bind=engine)
|
|
session = Session()
|
|
|
|
try:
|
|
# Sprawdź czy firma już istnieje
|
|
existing = session.query(Company).filter_by(slug='kaszubia-2030').first()
|
|
if existing:
|
|
print(f"Firma Kaszubia 2030 już istnieje (ID: {existing.id})")
|
|
return existing.id
|
|
|
|
# Znajdź kategorię "Services" (Usługi)
|
|
category = session.query(Category).filter_by(name='Services').first()
|
|
if not category:
|
|
# Fallback do "Usługi"
|
|
category = session.query(Category).filter_by(name='Usługi').first()
|
|
|
|
company = Company(
|
|
slug='kaszubia-2030',
|
|
name='Kaszubia 2030',
|
|
legal_name='Kaszubia 2030 - Firma Demonstracyjna',
|
|
nip=None, # Firma testowa - bez NIP
|
|
regon=None,
|
|
krs=None,
|
|
email='test@kaszubia2030.pl',
|
|
phone='+48 000 000 000',
|
|
website='https://kaszubia2030.pl',
|
|
address_street='ul. Testowa 1',
|
|
address_city='Wejherowo',
|
|
address_postal='84-200',
|
|
category_id=category.id if category else None,
|
|
description_short='Firma demonstracyjna projektu Norda Partner - Kaszubia 2030',
|
|
description_full='''Kaszubia 2030 to przykładowa firma stworzona na potrzeby testowania
|
|
i demonstracji funkcjonalności platformy Norda Biznes Partner (Norda Partner).
|
|
|
|
Firma reprezentuje wizję rozwoju regionu Kaszub do roku 2030, łącząc:
|
|
- Innowacje technologiczne
|
|
- Zrównoważony rozwój
|
|
- Współpracę regionalną
|
|
- Networking biznesowy
|
|
|
|
Jest powiązana z kontem testowym użytkownika "Testuser Kaszubia 2030"
|
|
do celów prezentacyjnych i testowych funkcji platformy.''',
|
|
data_quality='enhanced',
|
|
status='active'
|
|
)
|
|
|
|
session.add(company)
|
|
session.commit()
|
|
print(f"✅ Firma Kaszubia 2030 dodana pomyślnie! ID: {company.id}")
|
|
print(f" Slug: {company.slug}")
|
|
print(f" Kategoria: {category.name if category else 'brak'}")
|
|
return company.id
|
|
|
|
except Exception as e:
|
|
session.rollback()
|
|
print(f"❌ Błąd podczas importu: {e}")
|
|
raise
|
|
finally:
|
|
session.close()
|
|
|
|
|
|
if __name__ == '__main__':
|
|
import_company()
|