Commit Graph

53 Commits

Author SHA1 Message Date
7197af3933 feat(audit): Add previous vs current AI analysis comparison
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
Store previous analysis before regeneration and show comparison table
with priority breakdown, new/removed actions diff.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-07 18:05:17 +01:00
7383ec74a5 feat(audit): Add AI-powered audit analysis and action generation
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
Add Gemini AI integration to SEO, GBP, and Social Media audits that
generates contextual analysis summaries and prioritized action items
with ready-to-use content (Schema.org, meta descriptions, social posts,
GBP descriptions, review responses, content calendars).

New files:
- audit_ai_service.py: Central AI service with caching (7-day TTL)
- blueprints/api/routes_audit_actions.py: 4 API endpoints
- database/migrations/056_audit_actions.sql: 3 new tables
- templates/partials/audit_ai_actions.html: Reusable UI component

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-07 12:41:26 +01:00
387bd2f616 chore(db): Add migration files 051-055 for enhanced audits
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
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-07 11:58:24 +01:00
2e6eca55e7 feat(multi-company): Allow users to be associated with multiple companies
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
Adds user_companies table with BEFORE/AFTER triggers to sync primary
company to users.company_id. Dashboard shows all user's companies with
edit buttons. Company edit routes accept optional company_id parameter.
Admin API endpoints for managing user-company associations.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-06 19:13:10 +01:00
d742b6676c feat: Add meeting agenda/protocol form system for Board Council
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
- Add BoardMeeting model with JSON fields for flexible data storage
- Add migration 049_board_meetings.sql
- Add routes for creating, editing, viewing meetings
- Add publish workflows for agenda and protocol
- Add templates: meetings_list, meeting_form (with tabs), meeting_view
- Support for: agenda items, attendance tracking, proceedings
- Pre-filled defaults for chairperson, secretary, location
- Quorum calculation (9/16 for majority)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 20:10:50 +01:00
650c0d5760 feat: Add Strefa RADA - closed section for Board Council members
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
- Add @rada_member_required decorator for access control
- Add BoardDocument model for storing protocols and documents
- Create document upload service (PDF, DOCX, DOC up to 50MB)
- Add /rada/ blueprint with list, upload, download endpoints
- Add "Rada" link in navigation (visible only for board members)
- Add "Rada" badge and toggle button in admin user management
- Create SQL migration to set up board_documents table and assign
  is_rada_member=True to 16 board members by email

Storage: /data/board-docs/ (outside webroot for security)
Access: is_rada_member=True OR role >= OFFICE_MANAGER

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 18:41:12 +01:00
61345fa260 feat: Add event access control for Rada Izby meetings
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
- Add access_level field to norda_events (public, members_only, rada_only)
- Add is_rada_member field to users table
- Add can_user_view() and can_user_attend() methods to NordaEvent model
- Update calendar routes to filter events by user permissions
- Add access_level dropdown to admin event form
- Rada Izby events only visible to designated board members
- Regular member meetings visible to all NORDA members

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 12:41:42 +01:00
5fd5140763 feat: Add member benefits module with WisprFlow affiliate
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
- Add Benefit and BenefitClick models for tracking affiliate offers
- Create /korzysci blueprint with admin-only access (test mode)
- Add admin panel at /admin/benefits for managing offers
- Include WisprFlow as first benefit with branded link ref.wisprflow.ai/norda
- Add QR code support for printed materials
- Track clicks with user attribution and analytics

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 22:26:44 +01:00
4181a2e760 refactor: Migrate access control from is_admin to role-based system
Replace ~170 manual `if not current_user.is_admin` checks with:
- @role_required(SystemRole.ADMIN) for user management, security, ZOPK
- @role_required(SystemRole.OFFICE_MANAGER) for content management
- current_user.can_access_admin_panel() for admin UI access
- current_user.can_moderate_forum() for forum moderation
- current_user.can_edit_company(id) for company permissions

Add @office_manager_required decorator shortcut.
Add SQL migration to sync existing users' role field.

Role hierarchy: UNAFFILIATED(10) < MEMBER(20) < EMPLOYEE(30) < MANAGER(40) < OFFICE_MANAGER(50) < ADMIN(100)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 21:05:22 +01:00
03c429dcf9 feat: Add workflow history tracking for membership applications 2026-02-01 16:59:11 +01:00
193d5ad8e3 chore: Increase status column to VARCHAR(50) for flexibility
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 15:55:57 +01:00
0f2a0409a0 fix: Increase status column length to VARCHAR(30)
The status 'pending_user_approval' is 21 characters, exceeding VARCHAR(20).

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 15:53:57 +01:00
e733d26e36 feat: Add user approval workflow for registry data changes
When admin proposes changes from KRS/CEIDG registry, the application
now goes to 'pending_user_approval' status. User must review and
accept/reject proposed changes before final approval.

Changes:
- New status: pending_user_approval
- New fields: proposed_changes, proposed_changes_at, proposed_changes_by_id
- Admin endpoint: POST /admin/membership/<id>/propose-changes
- User endpoints: GET/POST /membership/review-changes/<id>/accept|reject
- New template: templates/membership/review_changes.html
- Migration: 043_membership_proposed_changes.sql

Workflow: submitted → under_review → pending_user_approval → under_review → approved

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 14:56:16 +01:00
0f8aca1435 feat: Add membership application system
Implement full online membership application workflow:
- 3-step wizard form with KRS/CEIDG auto-fill
- Admin panel for application review (approve/reject/request changes)
- Company data update requests for existing members
- Dashboard CTA for users without company
- API endpoints for NIP lookup and draft management

New files:
- database/migrations/042_membership_applications.sql
- blueprints/membership/ (routes, templates)
- blueprints/admin/routes_membership.py
- blueprints/api/routes_membership.py
- templates/membership/ and templates/admin/membership*.html

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 12:38:31 +01:00
f166668f22 feat: Add AI enrichment approval workflow
- Remove confusing "Zweryfikowano 2x | Jakość: 100%" badge
- Create AiEnrichmentProposal model for pending AI suggestions
- Modify AI enrichment to create proposals instead of direct saves
- Add approve/reject API endpoints for proposals
- Update frontend to show approval buttons after AI analysis
- Proposals expire after 30 days if not reviewed

The workflow now requires owner/admin approval before AI-generated
data is applied to company profiles. This prevents unwanted data
from being automatically added.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 11:03:53 +01:00
52061fa949 feat: Display ALL KRS data in company profile
- Add krs_raw_data, krs_fetched_at, krs_registration_date,
  krs_representation, krs_activities columns to Company model
- Save complete KRS API response for full data access
- Display in company profile:
  - Board members (zarząd) with functions and avatars
  - Shareholders (wspólnicy) with share amounts
  - Representation method (sposób reprezentacji)
  - Business activities (PKD codes)
  - Registration date with years active
  - KRS address with region info
  - OPP (public benefit) status
  - Metadata (stan_z_dnia, data_odpisu)
- Add migration 037_krs_extended_data.sql

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 07:44:33 +01:00
448937dabd fix: Rename pkd_codes column to ceidg_pkd_list to avoid backref conflict
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 07:22:32 +01:00
9f2b261df2 feat: Extend CEIDG data storage and enrichment
- Add new Company fields: ceidg_id, ceidg_status, pkd_codes (JSONB),
  correspondence address, owner_citizenships, ceidg_raw_data
- Add enrich_companies_from_ceidg() to fetch full CEIDG details
- Add fetch_full_ceidg_details() for detailed API calls
- Add update_company_from_ceidg() to save all CEIDG fields
- Add --enrich and --apply flags for batch enrichment
- Add migration 036_ceidg_extended_data.sql

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 07:21:21 +01:00
ae70ad326e feat: Add hierarchical role system with delegated permissions
Implements 6-tier role hierarchy:
- ADMIN (100): Full system access
- OFFICE_MANAGER (50): Admin panel without user management
- MANAGER (40): Full company control + user management
- EMPLOYEE (30): Edit company data (with delegated permissions)
- MEMBER (20): Full content access (forum, contacts, chat)
- UNAFFILIATED (10): Public profiles only

Features:
- SystemRole and CompanyRole enums in database.py
- UserCompanyPermissions model for delegation
- New decorators: @role_required(), @company_permission()
- Auto-detection of MANAGER role from KRS data
- Backward compatible with is_admin flag

Migration: 035_add_role_system.sql

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 06:42:39 +01:00
830ef0ea1e feat: Add B2B classifieds interactions (interest, Q&A, context messages)
- Add ClassifiedInterest model for tracking user interest in listings
- Add ClassifiedQuestion model for public Q&A on listings
- Add context_type/context_id to PrivateMessage for B2B linking
- Add interest toggle button and interests list modal
- Add Q&A section with ask/answer/hide functionality
- Update messages to show B2B context badge
- Create migration 034_classified_interactions.sql

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 21:15:30 +01:00
e87ba8ee09 feat: Add read tracking for Forum topics/replies and B2B classifieds
- Add ForumTopicRead, ForumReplyRead, ClassifiedRead models
- Add SQL migration for new tables
- Record reads when user views forum topic (topic + all visible replies)
- Record reads when user views B2B classified
- Display "Seen by" avatars in forum topic and B2B detail pages

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 20:50:27 +01:00
f22342ea37 feat: Add forum modernization with reactions, subscriptions, and moderation
- Add edit tracking (24h limit), soft delete, and JSONB reactions to ForumTopic/ForumReply
- Create ForumTopicSubscription, ForumReport, ForumEditHistory models
- Add 15 new API endpoints for user actions and admin moderation
- Implement reactions (👍❤️🎉), topic subscriptions, content reporting
- Add solution marking, restore deleted content, edit history for admins
- Create forum_reports.html and forum_deleted.html admin templates
- Integrate notifications for replies, reactions, solutions, and reports
- Add SQL migration 024_forum_modernization.sql

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 18:55:40 +01:00
0055857df4 feat: Rozbudowa systemu analityki użytkowników
Nowe funkcjonalności:
- GeoIP enrichment (kraj, miasto, region)
- UTM parameters tracking (source, medium, campaign, term, content)
- Bounce rate calculation
- Search queries logging
- Conversion tracking (register, login, contact_click, rsvp)
- Scroll depth tracking (25%, 50%, 75%, 100%)
- JS error tracking (window.onerror)
- Performance metrics (Web Vitals)
- CSV export (sessions, pageviews, searches, conversions)

Nowe tabele SQL:
- search_queries
- conversion_events
- js_errors
- popular_searches_daily
- hourly_activity

Dashboard rozszerzony o nowe sekcje i metryki.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 15:52:18 +01:00
f5050b92cc feat(announcements): Obsługa wielu kategorii dla aktualności
- Dodanie kolumny categories (ARRAY) do tabeli announcements
- Nowe metody: categories_labels, has_category()
- Migracja 029: dodanie kolumny i mapowanie danych
- Zachowanie kompatybilności wstecznej z polem category

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 15:14:15 +01:00
cebe52f303 refactor: Rebranding i aktualizacja modelu AI
- Zmiana nazwy: "Norda Biznes Hub" → "Norda Biznes Partner"
- Aktualizacja modelu AI: Gemini 2.0 Flash → Gemini 3 Flash
- Zachowano historyczne odniesienia w timeline i dokumentacji

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 14:08:39 +01:00
b19dfa7227 feat(insights): Baza wiedzy i insights dla rozwoju portalu
System zbierania feedbacku z interakcji użytkowników:
1. Źródła wiedzy:
   - Forum (tematy, odpowiedzi)
   - Chat AI (tylko odpowiedzi asystenta - fakty publiczne)
   - Analiza wzorców pytań (zanonimizowana)

2. Kategorie insights:
   - feature_request (propozycje funkcji)
   - bug_report (zgłoszenia błędów)
   - company_search (wyszukiwania firm)
   - question (częste pytania)

3. Panel admina: /admin/insights
   - Przeglądanie insights
   - Zmiana statusów (new → planned → implemented)
   - Synchronizacja z forum/chat

PRIVACY: Pytania użytkowników są analizowane wzorcowo (anonimizacja),
treść pytań NIE trafia do bazy wiedzy.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 22:09:05 +01:00
e2ceba4310 feat(privacy): Dodanie preferencji kanałów kontaktu
Użytkownicy mogą teraz wskazać preferowane kanały komunikacji:
- Email, telefon, wiadomości w portalu (toggle)
- Dodatkowa notatka (np. najlepsze godziny kontaktu)

Migracja: 031_add_contact_preferences.sql

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 21:06:15 +01:00
4b38f8953c feat(categories): Hierarchiczna struktura kategorii
- Dodanie parent_id do tabeli categories
- Model Category z relacją parent/subcategories
- 4 główne grupy: Usługi, Budownictwo, Handel, Produkcja
- Skrypt assign_category_parents.py do przypisania podkategorii
- Migracja 030_add_category_hierarchy.sql

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 20:51:15 +01:00
1fb938feb3 feat(blocks): System blokowania użytkowników
- Nowa tabela user_blocks do przechowywania blokad
- Model UserBlock w database.py
- Sprawdzanie blokad przed wysłaniem wiadomości (messages_send, messages_reply)
- UI zarządzania blokadami w /settings/blocks
- Nawigacja między ustawieniami (prywatność, blokady, 2FA)
- Blokada działa w obie strony

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 20:44:38 +01:00
66f6c1d60e feat(privacy): Ustawienia prywatności użytkownika
- Nowe pola: privacy_show_phone, privacy_show_email w tabeli users
- Nowy route /settings/privacy z UI do zarządzania prywatnością
- Link "Ustawienia" w menu użytkownika
- Toggle switches do włączania/wyłączania widoczności danych
- Migracja SQL: 028_add_user_privacy_settings.sql

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 20:35:50 +01:00
9a36d1fb08 fix(contacts): Zmiana FTS 'polish' na 'simple' dla kompatybilności
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-27 08:35:46 +01:00
21a78befad feat(contacts): Baza kontaktów zewnętrznych dla członków Norda
- Nowy model ExternalContact z pełnymi danymi kontaktowymi, social media, related_links (JSONB)
- Migracja SQL 020_external_contacts.sql z full-text search
- Routes: /kontakty (lista), /kontakty/dodaj, /kontakty/<id>, /kontakty/<id>/edytuj
- Szablony: lista z filtrami, karta szczegółów, formularz CRUD
- Nawigacja: link "Kontakty zewnętrzne" w dropdown Społeczność
- Poprawka: aktualizacja liczby firm z 80 na 111

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-27 08:35:06 +01:00
a172f7af49 feat(announcements): Śledzenie odczytów ogłoszeń (seen by)
- Nowa tabela announcement_reads do śledzenia kto przeczytał
- Avatary użytkowników z inicjałami (tooltip z nazwiskiem)
- Statystyki: liczba i procent użytkowników którzy przeczytali
- Progress bar wizualizujący zasięg ogłoszenia
- Automatyczny zapis odczytu przy otwarciu ogłoszenia

Autor: Maciej Pienczyn
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-27 08:19:39 +01:00
e14d95394d feat(announcements): System ogłoszeń i aktualności dla członków
- Model Announcement z kategoriami, statusami, slugami URL
- Panel admina /admin/announcements (CRUD, filtry, AJAX)
- Strona /ogloszenia tylko dla zalogowanych członków
- Szczegóły ogłoszenia /ogloszenia/<slug>
- Migracja SQL rozszerzająca istniejącą tabelę
- Testowe ogłoszenia: ARP baza noclegowa, Tytani Przedsiębiorczości
- Pliki PDF regulaminu i harmonogramu konkursu Tytani

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 22:10:54 +01:00
96fa0058c2 feat(zopk): Rozbudowa bazy wiedzy ZOPK
- Dodano skrypt cron do automatycznej ekstrakcji wiedzy (scripts/cron_extract_knowledge.py)
- Dodano panel deduplikacji faktów (/admin/zopk/knowledge/fact-duplicates)
- Dodano API i funkcje auto-weryfikacji encji i faktów
- Dodano panel Timeline ZOPK (/admin/zopk/timeline) z CRUD
- Rozszerzono dashboard bazy wiedzy o statystyki weryfikacji i przyciski auto-weryfikacji
- Dodano migrację 016_zopk_milestones.sql dla tabeli kamieni milowych
- Naprawiono duplikat modelu ZOPKMilestone w database.py

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-17 10:57:11 +01:00
d0dda10bd7 feat(zopk): Panel admina bazy wiedzy, poprawa odpowiedzi AI, timeline
Priorytet 1 - Panel admina bazy wiedzy ZOPK:
- /admin/zopk/knowledge - dashboard ze statystykami
- /admin/zopk/knowledge/chunks - lista chunks z filtrowaniem
- /admin/zopk/knowledge/facts - lista faktów z typami
- /admin/zopk/knowledge/entities - lista encji z mentions
- CRUD operacje: weryfikacja, usuwanie

Priorytet 2 - Poprawa jakości odpowiedzi NordaGPT:
- Linki markdown do źródeł w kontekście ZOPK
- Ulepszone formatowanie (bold, listy, nagłówki)
- Sekcja "Źródła" na końcu odpowiedzi
- Instrukcje w system prompt dla lepszej prezentacji

Priorytet 3 - Timeline ZOPK:
- Model ZOPKMilestone w database.py
- Migracja 016_zopk_milestones.sql z sample data
- Sekcja "Roadmapa ZOPK" na stronie /zopk
- Pionowa oś czasu z markerami lat
- Statusy: completed, in_progress, planned, delayed

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-17 08:56:55 +01:00
1b4cd31c41 feat(zopk): Knowledge Base + NordaGPT integration (FAZY 0-3)
FAZA 0 - Web Scraping:
- Migracja 015: pola full_content, scrape_status w zopk_news
- zopk_content_scraper.py: scraper z rate limiting i selektorami

FAZA 1 - Knowledge Extraction:
- zopk_knowledge_service.py: chunking, facts, entities extraction
- Endpointy /admin/zopk/knowledge/extract

FAZA 2 - Embeddings:
- gemini_service.py: generate_embedding(), generate_embeddings_batch()
- Model text-embedding-004 (768 dimensions)

FAZA 3 - NordaGPT Integration:
- nordabiz_chat.py: _is_zopk_query(), _get_zopk_knowledge_context()
- System prompt z bazą wiedzy ZOPK
- Semantic search w kontekście chatu

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 20:15:30 +01:00
a148d464af feat: Add user analytics panel (/admin/analytics)
- Track user sessions, page views, clicks
- Measure engagement score and session duration
- Device breakdown (desktop/mobile/tablet)
- User rankings by activity
- Popular pages statistics
- Recent sessions feed
- SQL migration for analytics tables
- JavaScript tracker for frontend events

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-13 19:40:37 +01:00
de52e6991c feat: Add KRS Audit panel with full PDF parsing
- New admin panel /admin/krs-audit for KRS data extraction
- Full PDF parser extracting: company data, capital, shares, PKD codes,
  management board, shareholders, procurators, financial reports
- API endpoints for single/batch audits and PDF download
- Company profile shows "Odpis PDF" button and last audit date
- Database migration for krs_audits, company_pkd, company_financial_reports

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-13 16:46:54 +01:00
abe1cd38a1 feat: Add PKD codes and CEIDG owner data to company profiles
- Add pkd_code, pkd_description columns for business activity classification
- Add business_start_date column from CEIDG
- Add owner_first_name, owner_last_name for JDG companies
- Create import script scripts/import_ceidg_to_db.py
- Add PKD card display in company profile template
- Add owner section for JDG companies without KRS
- Track SQL migrations in git (database/migrations/*.sql)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-13 16:07:03 +01:00
340e39515f feat: Add AI usage tracking migration
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-11 08:17:06 +01:00
e399022223 feat: Add 1-5 star rating to ZOPK news AI evaluation
- Add ai_relevance_score column (1-5) to zopk_news table
- Update AI prompt to return score with detailed criteria:
  * 1 star = very weak (loose connection to region/industry)
  * 2 stars = weak (general industry news)
  * 3 stars = medium (relates to ZOPK industry but not directly)
  * 4 stars = strong (directly about ZOPK investments/companies)
  * 5 stars = perfect (main topic is ZOPK, Kongsberg, offshore Baltic)
- Display star ratings in admin dashboard with color-coded badges
- Score >= 3 marks news as relevant, < 3 as not relevant

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-11 07:34:36 +01:00
a0db0af6c8 feat: AI-based news relevance evaluation using Gemini
- Add ai_relevant, ai_evaluation_reason, ai_evaluated_at columns to zopk_news
- Add evaluate_news_relevance() and evaluate_pending_news() functions
- Add /admin/zopk/news/evaluate-ai endpoint
- Add AI filter tiles (Pasuje wg AI, Nie pasuje wg AI)
- Add "Oceń przez AI" button with progress feedback
- Show AI evaluation badge on news items
- Add new sources: Norda FM, Twoja Telewizja Morska, Nadmorski24.pl, Facebook (Samsonowicz)

AI evaluates news against ZOPK topics: offshore wind, nuclear plant,
Kongsberg investment, data centers, hydrogen labs, key people.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-11 07:13:08 +01:00
46ef40950f feat: Add multi-source news search with cross-verification for ZOPK
- Add ZOPKNewsService with multiple RSS sources (12 feeds)
- Implement cross-verification logic (3+ sources = auto_approved)
- Add title hash normalization for fuzzy deduplication
- Include government sources: MON, Ministerstwo Rozwoju
- Include Google News searches for key topics and people
- Add confidence scoring (1-5 based on source count)
- Update SQL migration with cross-verification columns

Sources: Brave API, trojmiasto.pl, Dziennik Bałtycki, Google News,
gov.pl/obrona-narodowa, gov.pl/rozwoj-technologia

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-11 06:41:31 +01:00
d51637a226 feat: Add ZOPK (Zielony Okręg Przemysłowy Kaszubia) knowledge base
- Add database models for ZOPK projects, stakeholders, news, resources
- Add migration with initial data (5 projects, 7 stakeholders)
- Implement admin dashboard with news moderation workflow
- Add Brave Search API integration for automated news discovery
- Create public knowledge base pages (index, project detail, news list)
- Add navigation links in main menu and admin bar

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-11 06:32:27 +01:00
61e70ad67c feat: Forum categories, statuses, and multi-file attachments
- Add category selection (feature_request, bug, question, announcement)
- Add status tracking (new, in_progress, resolved, rejected) with admin controls
- Add file attachments support (JPG, PNG, GIF up to 5MB)
- Multi-file upload (up to 10 files per reply) with drag & drop and paste
- New FileUploadService with EXIF stripping for privacy
- Admin panel with status statistics and change modal
- Grid display for multiple attachments

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-10 21:26:20 +01:00
23b6425861 auto-claude: subtask-1-4 - Run migration for IT audit tables in DEV database
- Executed it_audit_migration.sql against DEV PostgreSQL (localhost:5433)
- Created it_audits and it_collaboration_matches tables
- Created 12 indexes for performance optimization
- Created 4 views: v_company_it_overview, v_it_audit_history,
  v_it_collaboration_overview, v_it_technology_stats
- Added missing document_management column to match SQLAlchemy model
- Applied grants for nordabiz_app user

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-09 08:23:40 +01:00
8edcda52e3 auto-claude: subtask-1-1 - Create SQL migration for IT audit tables
Add migration script for it_audits and it_collaboration_matches tables:

- it_audits: 9-section form storage (IT Contact, Cloud & Identity,
  Server Infrastructure, Endpoints, Security, Backup & DR, Monitoring,
  Business Apps, Collaboration flags)
- it_collaboration_matches: Cross-company matching with 6 types
  (shared licensing, backup replication, Teams federation,
  shared monitoring, collective purchasing, knowledge sharing)
- Indexes for company_id, audit_date, scores, maturity level
- Update triggers for updated_at timestamps
- Views: company overview, audit history, collaboration overview,
  technology statistics
- Grants for nordabiz_app user

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-09 08:14:51 +01:00
5f18a228b1 auto-claude: subtask-4-1 - Create SQL migration script for new columns
Add database migration script to add google_opening_hours (JSONB) and
google_photos_count (INTEGER) columns to company_website_analysis table.

These columns are needed for storing GBP data from Google Places API:
- google_opening_hours: stores weekday_text, open_now, and periods data
- google_photos_count: stores count of photos from Google Business profile

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-08 23:04:25 +01:00
ecf811f168 auto-claude: subtask-2-3 - Create database migration script for GBP audit tab
- Create gbp_audits table with all required fields:
  - completeness_score (0-100)
  - fields_status and recommendations (JSONB)
  - Individual field flags (has_name, has_phone, etc.)
  - Photo and review metrics
  - Google Place integration fields
  - Audit metadata (source, version, errors)
- Add indexes for company_id, audit_date, and score
- Add update trigger for updated_at timestamp
- Create views: v_company_gbp_overview, v_gbp_audit_history
- Include GRANT statements for nordabiz_app user

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-08 19:08:05 +01:00