nordabiz/scripts/add_grill_event.py
Maciej Pienczyn 5030b71beb
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
chore: update Author to Maciej Pienczyn, InPi sp. z o.o. across all files
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-10 08:20:47 +02:00

83 lines
2.7 KiB
Python
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/usr/bin/env python3
"""Add Grill Integracyjny event to NordaBiz calendar."""
import os
import sys
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from dotenv import load_dotenv
load_dotenv(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), '.env'))
from datetime import date, time
from database import SessionLocal, NordaEvent
DESCRIPTION = """<p>Szanowni Państwo,<br>
z przyjemnością zapraszamy do udziału w <strong>Grillu Integracyjnym Izby Norda</strong>.</p>
<p>Podczas wydarzenia zapewniamy przestrzeń do swobodnych rozmów, integracji oraz budowania relacji biznesowych w mniej formalnej atmosferze.</p>
<h3>Na uczestników czekać będzie:</h3>
<ul>
<li><strong>Strefa gastronomiczna</strong> grill oraz food truck</li>
<li><strong>Obsługa cateringowa</strong> Restauracja Nadolanka</li>
<li><strong>Strzelnica</strong> opcjonalnie, dodatkowo płatne (250 zł/os.)</li>
</ul>
<h3>Koszt udziału:</h3>
<ul>
<li><strong>Członkowie Izby</strong> 140 zł/os. (Izba pokrywa 50% kosztów!)</li>
<li><strong>Goście spoza Izby</strong> 240 zł/os.</li>
</ul>
<p>Serdecznie zapraszamy do udziału wraz z osobami towarzyszącymi oraz gośćmi.</p>
<h3>Wpłaty:</h3>
<p>Przelew na konto Izby: <strong>KBS 69 8350 0004 0000 0111 2000 0010</strong> (tytuł: <em>grill</em>)<br>
lub gotówka w biurze Norda (godz. 8:0014:00).</p>
<p>Kontakt: Magdalena Klóska, tel: 729-716-400</p>"""
def main():
db = SessionLocal()
try:
# Check if event already exists
existing = db.query(NordaEvent).filter(
NordaEvent.title.ilike('%grill%integracyjny%'),
NordaEvent.event_date == date(2026, 5, 16)
).first()
if existing:
print(f"Event already exists: ID={existing.id}, title='{existing.title}'")
return
event = NordaEvent(
title='Grill Integracyjny Izby Norda',
description=DESCRIPTION,
event_date=date(2026, 5, 16),
time_start=time(14, 0),
event_type='networking',
access_level='public',
location='Kurkowe Bractwo Strzeleckie, ul. Strzelecka 9, Wejherowo',
location_url='https://maps.app.goo.gl/QFbNxBpDfnYvxZYx7',
is_featured=True,
created_by=1, # admin
source='manual',
organizer_name='Norda Biznes',
organizer_email='biuro@norda-biznes.info',
)
db.add(event)
db.commit()
print(f"Event created: ID={event.id}, title='{event.title}', date={event.event_date}")
except Exception as e:
db.rollback()
print(f"Error: {e}")
sys.exit(1)
finally:
db.close()
if __name__ == '__main__':
main()