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>
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>
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>
- Add @role_required to 2 missing routes (krs_api PDF download, zopk milestones)
- Add role-based menu visibility in admin bar (hide Users, Security, Benefits,
Model Comparison, Debug from OFFICE_MANAGER users)
- Inject SystemRole into Jinja2 context processor for template role checks
- Replace is_admin checkbox with role select dropdown in user creation form
- Migrate routes.py and routes_users_api.py from is_admin to SystemRole-based
role assignment via set_role()
- Add deprecation notice to is_admin database column
- Add 23 RBAC unit tests (hierarchy, has_role, set_role, permissions)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace ~20 remaining is_admin references across backend, templates and scripts
with proper SystemRole checks. Column is_admin stays as deprecated (synced by
set_role()) until DB migration removes it.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- 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>
- 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>
- Members can VIEW Rada Izby events (title, date, location)
- Only Rada members can RSVP and see attendee list
- Add can_user_see_attendees() method to NordaEvent
- Update event template to conditionally show RSVP and attendees
- Add info banner for non-Rada members viewing restricted events
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- 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>
- 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>
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>
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>
- 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>
- 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>
- 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>
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>
- 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>
- 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>
- 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>
- Zmiana 'general'/'member_news' na 'internal'/'external'
- Kategorie: Wewnętrzne, Zewnętrzne, Wydarzenie, Okazja biznesowa, Partnerstwo
- Polskie znaki w tytułach i meta description
- "Aktualności Norda Biznes Partner"
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- zopk_knowledge_service.py: model dla kategoryzacji milestone'ów
- database.py: przykłady modeli w komentarzach kolumn
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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>
- 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>
- 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>
- 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>
- 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>
- 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>
- Dodano funkcje automatycznego uzupełniania Timeline z bazy wiedzy:
- get_timeline_suggestions() - pobiera milestone facts jako sugestie
- create_milestone_from_suggestion() - tworzy milestone z faktu
- categorize_milestones_with_ai() - kategoryzacja AI (nuclear/offshore/etc)
- Auto-detekcja kategorii, dat i statusu z tekstu polskiego
- API endpoints:
- GET /api/zopk/timeline/suggestions - lista sugestii z bazy wiedzy
- POST /api/zopk/timeline/suggestions/approve - zatwierdź sugestię
- Fix: /zopk zwracał 500 (nieistniejąca kolumna is_verified)
- Dodano kolumnę is_verified do modelu ZOPKMilestone
- Usunięto filtr is_verified z query (do migracji)
- Health check rozszerzony z 15 do 55+ endpointów:
- Public pages, Raporty, ZOPK, Chat, IT Audit
- API publiczne, Admin Core, Admin Audits, Admin ZOPK
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- 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>
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>
Changes:
- Lower auto-approve threshold from 4★ to 3★ (verified 2026-01-15)
- Add detailed progress bar for ZOPK search process
- Add auto-approved articles list with star ratings
- Document ZOPK topics (ZOP Kaszubia) in CLAUDE.md
- Add 8-second countdown before auto-refresh
Technical:
- zopk_news_service.py: Changed score threshold from >=4 to >=3
- Templates: New CSS for progress phases and results display
- CLAUDE.md: Added "ZOP Kaszubia News" section with topic guidelines
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add EmailLog model to database.py for tracking sent emails
- Modify email_service.py to log all sent emails to database
- Track email type (welcome, password_reset, notification)
- Record sender, recipient, subject, status, timestamps
- Supports monitoring email delivery success/failure
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Nowa kolumna member_since w tabeli companies
- Karta "Członek Izby NORDA od" na profilu firmy (niebieski kolor #3b82f6)
- Wyświetlanie liczby lat w Izbie
- Import 57 dat przystąpienia z pliku Excel od Artura
- Skrypt import_member_since.py do importu dat
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- 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>