Commit Graph

563 Commits

Author SHA1 Message Date
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
1dbe3d2dfa docs(release-notes): Rewrite all release notes v1.0-v1.25 in plain language
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
Simplify all 18 historical release notes for non-technical readers.
Replace jargon with clear Polish descriptions explaining changes
from the user's perspective. Merge duplicate entries describing
the same feature (PWA 3→1, email polling 2→1, blocking 2→1).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-06 18:37:53 +01:00
b24787ad82 docs(release-notes): Rewrite v1.26.0 and v1.27.0 in plain language
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
Simplify release notes for non-technical readers. Remove jargon
(RBAC, regex, CSRF, SQL injection), use clear Polish descriptions
that explain what changed from the user's perspective.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-06 18:24:24 +01:00
7c1a381ce1 docs(release-notes): Add v1.26.0 (Feb 5) and v1.27.0 (Feb 6) release notes
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
v1.26.0: Complete RBAC migration (154/154 routes), is_admin deprecation,
permanent company deletion, 23 RBAC unit tests.

v1.27.0: 9 security fixes (SQL injection, XSS, CSRF), forum email
notifications, NordaGPT knowledge base, dashboard widgets, company
profile editing, registry enrichment button, social audit recommendations,
SEO/GBP audit import fixes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-06 18:22:48 +01:00
8ef537c624 fix(gbp-audit): Fix GBPAuditResult import name mismatch
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
The class is named AuditResult in gbp_audit_service.py but was imported
as GBPAuditResult. Using alias to maintain compatibility.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-06 18:15:43 +01:00
7205279434 fix(seo-audit): Fix SEOAuditor import path after migration to scripts/
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
The import was looking for 'seo_audit_service' module which no longer
exists. The SEOAuditor class lives in scripts/seo_audit.py. Fixed to
use sys.path like routes_social_audit.py does.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-06 18:12:14 +01:00
51b9176c10 feat(admin): Add recommendations column to social audit dashboard
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
Shows per-company recommendations: missing platforms, Facebook numeric
ID warning, etc. Color-coded by severity in a new "Zalecenia" column.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-06 18:09:36 +01:00
6d436bb0ae feat(company): Add registry data enrichment button for admins
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 "Pobierz dane urzędowe" button on company detail page (admin-only)
that fetches data from KRS, Biała Lista VAT, or CEIDG registries.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-06 17:54:56 +01:00
1dc7f20e9b feat(company): Add company profile editing for owners and employees
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
Allow company owners/employees to edit marketing fields (descriptions,
services, contacts, social media) directly without admin intervention.
Legal fields (NIP, KRS, name) remain admin-only. Per-tab permission
checks with delegated permissions support.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-06 06:58:21 +01:00
99e4e05f72 feat(dashboard): Add "Co nowego w Izbie?" widgets to member dashboard
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
Replace static stats (recommendations=0, forum=total) with live data
(unread notifications, upcoming events). Add 5 content widgets:
events with RSVP badges, announcements, forum topics, B2B classifieds,
and new member companies. 2-column responsive grid layout.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-06 06:00:07 +01:00
e718d96a7d fix(security): Resolve 1 HIGH and 7 MEDIUM vulnerabilities from code review
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
- HIGH: Fix SQL injection in ZOPK knowledge service (3 functions) — replace f-strings with parameterized queries
- MEDIUM: Sanitize tsquery/LIKE input in SearchService to prevent injection
- MEDIUM: Add @login_required + @role_required(ADMIN) to /health/full endpoint
- MEDIUM: Add @role_required(ADMIN) to ZOPK knowledge search API
- MEDIUM: Add bleach HTML sanitization on write for announcements, events, board proceedings (stored XSS via |safe)
- MEDIUM: Remove partial API key from Gemini service logs
- MEDIUM: Remove @csrf.exempt from chat endpoints, add X-CSRFToken headers in JS
- MEDIUM: Add missing CSRF tokens to 3 POST forms (data_request, benefits_form, benefits_list)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-06 05:25:18 +01:00
5e77ede9fa feat(forum): Add email notifications for replies + custom tooltips
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
- Email notifications sent to topic subscribers when new reply posted
- Auto-subscribe users when they reply to a topic
- Custom CSS tooltip on "seen by" avatars (replaces native title)
- GET /forum/<id>/unsubscribe endpoint for email unsubscribe links
- Clean up ROADMAP.md (remove unimplemented priorities, add RBAC/Slack)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-06 04:10:47 +01:00
f2fc1b89ec refactor(rbac): Complete RBAC migration - 154/154 admin routes protected
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 @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>
2026-02-05 21:36:14 +01:00
c0d60481f0 refactor(rbac): Migrate legacy is_admin checks to role-based has_role()/set_role()
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
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>
2026-02-05 21:06:22 +01:00
85e14bb4bf feat(admin): Add permanent delete for archived companies + update release notes
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
Workflow: Active → Archive → Permanent Delete (hard delete from DB).
Only ADMIN role can permanently delete, and only archived companies.
FK cleanup across 35+ tables before deletion.

Also adds 4 missing items to v1.25.0 release notes:
- Strefa RADA simplified (removed documents section)
- Korzyści commission column visibility
- Company hard-delete feature
- User delete FK cascade fix

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-05 08:00:30 +01:00
932ee9c2b0 fix(admin): Use raw SQL DELETE to bypass ORM backref cascades
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
Expunge user from ORM session and use raw SQL DELETE to prevent
SQLAlchemy from trying to SET NULL on backref relationships.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 15:41:06 +01:00
11ee9d8493 fix(admin): Handle dependent records when deleting users
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
Clean up FK references with NO ACTION before user deletion:
- SET NULL for nullable FK columns (30+ tables)
- DELETE records for NOT NULL FK columns without CASCADE
Prevents IntegrityError on user_notifications and other tables.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 15:39:37 +01:00
b8ee364dbe docs: Add release notes v1.25.0 - Strefa RADA, Korzysci, Registration UX
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.5 <noreply@anthropic.com>
2026-02-04 15:33:42 +01:00
61e4bec5b3 fix(board): Handle OSError when weasyprint system libs missing
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
WeasyPrint raises OSError (not ImportError) when pango/cairo system
libraries are not installed. Catch both to allow graceful fallback.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 15:14:13 +01:00
a5196bc1e2 feat(board): Add PDF download for meetings, remove documents section
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
Replace redundant documents tab with PDF generation from meeting data
using weasyprint. Meetings become the main /rada/ view with board
members section. Remove upload/view/download document routes and
templates.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 15:12:39 +01:00
69c7141185 feat(board): Improve meeting management with enhanced UI and PDF printing
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
Changes:
- Add staff users dropdown for secretary selection (Magdalena Klóska)
- Implement 3-status attendance (present/absent/unknown) with colors
- Add automatic quorum calculation with visual indicator
- Add print buttons for agenda and protocol (opens formatted print view)
- Add quick edit action button in meetings list
- Fix Polish diacritics across all board templates

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 20:49:38 +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
e41187478b feat: Use LibreOffice for DOCX to PDF conversion in board document preview
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
- Converts DOCX/DOC to PDF using soffice --headless
- Caches converted PDFs alongside originals
- Falls back to mammoth HTML if LibreOffice fails
- Preserves full document formatting and graphics

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 19:05:32 +01:00
4c20e17855 feat: Add document preview and board members list to Strefa RADA
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/<id>/view endpoint for document preview
- PDF files displayed inline in browser
- DOCX files converted to HTML using mammoth library
- Add board members section showing all is_rada_member users
- Add "Podgląd" button next to "Pobierz" in document list

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 18:53:54 +01:00
86d10c8d70 fix: Use SessionLocal instead of db_session in board routes
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.5 <noreply@anthropic.com>
2026-02-03 18:43:20 +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
4eadcd9a8d feat: Show application status banner instead of join CTA for pending applications
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
- Check for pending membership application on homepage
- Show blue "Deklaracja w toku" banner with status info
- Different messages for: draft, submitted, under_review, pending_user_approval, changes_requested
- Link to membership status page instead of application form

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 13:20:03 +01:00
de281e5bda feat: Add notifications for admins when membership application is submitted
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
- Notify ADMIN and OFFICE_MANAGER users when new membership application is submitted
- Include applicant name, company name, and link to application detail
- Use notification_type='alert' for visibility

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 13:14:14 +01:00
5423f14c72 fix: Correct membership endpoint name (membership.apply not membership_apply)
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
2026-02-03 13:07:37 +01:00
8c9597d3e9 feat: Restrict company details to NORDA members only
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
- Block company detail access for non-members (redirect to membership form)
- Show membership CTA header instead of catalog header for non-members
- Add info banner explaining access restriction
- Non-members can still see company list on homepage

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 13:01:43 +01:00
4c7573a2b9 fix: Fix RSVP button for restricted events and add membership banner
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
- Filter next_event by user's view permissions
- Check user_can_attend before showing "Zapisz się" button
- Show "🔒 Rada Izby" badge for restricted events
- Add "Złóż deklarację" banner for non-NORDA members on homepage

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 12:53:18 +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
d656f75f35 fix: Use correct field name is_verified instead of email_verified
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
2026-02-02 13:19:54 +01:00
0df896cbb1 feat: Auto-redirect after email verification via polling
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 /auth/check-verification-status API endpoint
- Add JS polling every 3s on registration success page
- When email is verified elsewhere, redirect to dashboard automatically
- No need for user to manually navigate back

This improves UX by detecting verification in the original tab
2026-02-02 13:16:00 +01:00
c234443e6c feat: Improve registration UX with dedicated success page and auto-login
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
Registration flow improvements:
- New dedicated success page (/registration-success) with clear instructions
- Shows email address where verification link was sent
- Step-by-step guide what to do next
- Link validity reminder (24 hours)
- Easy access to resend verification

Verification flow improvements:
- Auto-login after email verification (no need to enter password)
- Redirect to dashboard instead of login page
- If already verified, auto-login and redirect to dashboard
- Audit logging for verification and auto-login events

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 13:03:17 +01:00
36575e0442 feat: Add pre-commit hooks, CI badge, and release notes v1.24.0
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
Best practices additions:
- .pre-commit-config.yaml with ruff, bandit, and quick tests
- pyproject.toml with modern Python tooling config
- CI/CD badge in README.md
- Release notes v1.24.0 documenting testing infrastructure

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 10:48:29 +01:00
629d4088c4 docs: Expand release notes v1.23.0 with all today's changes
Added comprehensive changelog including:
- Membership application system with registry lookup
- KRS/CEIDG integration and data display
- Website content updater
- Company profile cleanup
- All bug fixes

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 21:48:15 +01:00
66070c8bf9 docs: Add release notes v1.23.0 - Role-based access control
Summary of changes:
- Migration from is_admin to 6-tier role hierarchy
- NordaGPT, Messages, B2B, Contacts restricted to MEMBER role
- New decorators: @office_manager_required, @member_required
- Promotional landing page for non-members on /chat

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 21:46:00 +01:00
6bf243d1cb security: Restrict member-only features to MEMBER role
Modules now requiring MEMBER role or higher:
- NordaGPT (/chat) - with dedicated landing page for non-members
- Wiadomości (/wiadomosci) - private messaging
- Tablica B2B (/tablica) - business classifieds
- Kontakty (/kontakty) - member contact information

Non-members see a promotional page explaining the benefits
of NordaGPT membership instead of being simply redirected.

This provides clear value proposition for NORDA membership
while protecting member-exclusive features.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 21:33:27 +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
4e3d6aa9cc feat: Auto-fetch KRS data when approving membership application
- Add _enrich_company_from_krs() helper function
- Import board members (zarząd) to CompanyPerson table
- Import PKD codes to CompanyPKD table
- Set data_source='KRS API' for proper template rendering
- Show status message to admin about KRS data fetch

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 20:02:49 +01:00
fc2d4e0175 feat: Improve company data formatting on membership approval
- Build address_full from components
- Auto-detect legal_form from company name
- Format address with title case
- Remove dashes from NIP

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 19:52:28 +01:00
ade4933e75 fix: Correct all Company field mappings in membership approval
- founded_date → business_start_date + year_established
- employee_count → employees_count
- Remove show_employee_count (not in Company model)
- is_norda_member → member_since (date field)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 19:38:45 +01:00
0e955274ee fix: Correct field mapping for Company model in membership approval
- Change address_postal_code to address_postal (correct Company field name)
- Combine address_street + address_number into address_street (Company has no address_number field)
- Fix template reference to company.address_postal

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 19:35:40 +01:00
f71b12eeba fix: Add flag_modified for JSONB workflow_history persistence
SQLAlchemy doesn't detect in-place changes to JSONB columns.
Using flag_modified() and creating new list ensures changes are saved.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 17:06:08 +01:00
03c429dcf9 feat: Add workflow history tracking for membership applications 2026-02-01 16:59:11 +01:00
899cb42aee feat: Add reviewer info and sub-workflow progress bar for proposed changes 2026-02-01 16:43:38 +01:00
8a8d39632f feat: Add admin notifications when user accepts/rejects changes
- Create notification for all admins when user accepts proposed changes
- Create notification for all admins when user rejects proposed changes
- Clear proposed_changes fields after user decision
- Include rejection reason in admin notification

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 16:09:30 +01:00
6370abb24f feat: Replace alert() with flash notifications and add bell notification
- Replace all alert() calls with showNotification() for consistent UX
- Add UserNotification creation when admin proposes changes
- User sees notification in bell icon with link to review changes

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 16:00:58 +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
c73e90bc70 feat: Add Biała Lista VAT integration for NIP→KRS lookup
- Use official Ministry of Finance API (wl-api.mf.gov.pl) to get KRS from NIP
- Add KRS field to membership application form
- Workflow: NIP → Biała Lista → KRS Open API → full company data
- Fallback to CEIDG for JDG (sole proprietorship)
- Remove rejestr.io dependency - only official government APIs

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 14:32:36 +01:00
ebc3dd63d3 fix: Redirect loop in membership apply + add registry lookup for admin + action legends 2026-02-01 14:05:41 +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
cc83186486 fix: Move sources_used definition before usage in AI enrichment 2026-02-01 11:13:30 +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
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
a325e1b2e4 feat: Add role management UI in admin panel
- Add role dropdown column in users table
- Add /admin/users-api/change-role endpoint
- Sync is_admin flag when role changes
- Auto-create UserCompanyPermissions for EMPLOYEE
- Prevent self-demotion from admin

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 06:48:26 +01:00
1bf56148f5 docs: Merge v1.22.0 and v1.23.0 release notes into single v1.22.0
Combined all January 31st changes into one release.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 21:19:35 +01:00
2c5e2dc4af docs: Add v1.23.0 release notes
- B2B classifieds interactions (interest, Q&A, context messages)
- Forum and B2B read tracking with seen-by avatars
- Admin modules for Companies and People management
- Status dashboard with SSL, deploy, security metrics
- Audit logging for login/logout events

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 21:17:42 +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
1d62934b57 feat: Add audit logging for login/logout events
- Log successful logins (password and 2FA) to audit_logs
- Log failed login attempts to audit_logs
- Log logout events to audit_logs
- Enables tracking of login activity in admin status dashboard

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 20:42:42 +01:00
0530d096b0 fix: Add db.rollback() after SQL exceptions in status dashboard
Prevents "transaction is aborted" cascade errors when
pg_stat_statements extension is not installed or other
SQL queries fail.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 20:30:52 +01:00
fca0e9d51e feat: Enhance status dashboard with SSL, deploy, security and API metrics
- Add load average display (1/5/15 min)
- Add SSL certificate monitoring (expiry, issuer, days left)
- Add Git/deploy info (branch, commit, date)
- Add extended DB metrics (cache hit ratio, slow queries, deadlocks)
- Add security metrics (failed logins, GeoIP blocks, rate limits, locked accounts)
- Add external APIs status with latency (Google, Gemini, Gravatar)
- Add servers ping monitoring (R11-REVPROXY-01, NORDABIZ-01, R11-DNS-01)
- Fix pgrep path for Gunicorn worker detection

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 20:28:26 +01:00
edcb755588 fix: Use full path for pgrep in gunicorn detection 2026-01-31 20:21:41 +01:00
4cdc5214f6 debug: Add logging for gunicorn status detection 2026-01-31 20:20:51 +01:00
d5273a8e6a feat: Add admin modules for Companies and People management
- Add /admin/companies with CRUD operations, filters, CSV export
- Add /admin/people with person-company relationship management
- Companies: add, edit, toggle status, archive, view linked people
- People: add, edit, delete, link/unlink companies by role
- Both panels follow existing admin UI patterns (stats, filters, modals)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 20:13:51 +01:00
9d422ceb64 docs: Expand v1.22.0 release notes with full changelog
Added:
- Forum reactions, subscriptions, editing, reporting
- Solution marking, user stats, markdown, mentions
- Bulk actions, soft-delete, restore
- Architecture refactoring to blueprints

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 19:51:17 +01:00
eb45504f1b docs: Add v1.22.0 release notes (31 Jan 2026)
- Forum admin analytics dashboard
- CSV export, topic move/merge, admin search
- User activity log
- Admin menu links (Forum, Announcements, Insights)
- NordaGPT input area fix

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 19:48:23 +01:00
36d988aee3 chore: Remove party emoji from forum reactions
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 19:31:00 +01:00
e8586b3e4e feat: Add forum admin tools (analytics, search, move, merge)
New admin features:
- Analytics dashboard with stats, charts (Chart.js), user rankings
- CSV export of forum activity with date range
- Topic category move functionality
- Merge multiple topics into one
- Admin search across all posts (including deleted)
- User activity log with stats

New endpoints:
- GET /admin/forum/analytics
- GET /admin/forum/export-activity
- POST /admin/forum/topic/<id>/move
- POST /admin/forum/merge-topics
- GET /admin/forum/search
- GET /admin/forum/user/<id>/activity

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 19:29:02 +01:00
c5f724f954 feat: Add forum search, markdown, user stats, and admin bulk actions
New features implemented:
- Forum search with title/content filtering
- Solution filter (topics with marked solutions)
- Quote reply functionality with @mention
- @mentions parsing and notifications
- Simple markdown formatting (bold, italic, code, quotes, lists)
- User forum statistics tooltip (topics, replies, solutions, reactions)
- Admin bulk actions (pin/unpin, lock/unlock, status change, delete)

Files changed:
- blueprints/forum/routes.py: user_forum_stats, admin_forum_bulk_action endpoints
- templates/forum/topic.html: user stats tooltips, markdown CSS
- templates/forum/index.html: search box, solution filter
- templates/admin/forum.html: bulk selection checkboxes and action bar
- utils/markdown.py: simple forum markdown parser
- utils/notifications.py: @mention notification parsing

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 19:11:29 +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
ff59872529 refactor: Move company/validation/enrichment API routes to blueprints
- Create blueprints/api/routes_company.py with 9 routes:
  - /api/companies, /api/connections
  - /api/check-email, /api/verify-nip, /api/verify-krs
  - /api/company/<id>/refresh-krs, /api/company/<id>/enrich-ai
  - /api/model-info, /api/admin/test-sanitization
- app.py: 5520 → 4756 lines (-764)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 18:08:36 +01:00
94dd5327bc refactor: Move audit dashboard routes to blueprints/audit
- Create new audit blueprint for user-facing audit dashboards
- Move /audit/seo/<slug>, /audit/social/<slug>, /audit/gbp/<slug>, /audit/it/<slug>
- Add endpoint aliases for backward compatibility
- app.py: 5860 → 5520 lines (-340)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 18:03:02 +01:00
8e3346178d refactor: Move GBP and Social Audit API routes to blueprints
- Create blueprints/api/routes_gbp_audit.py (4 routes)
- Create blueprints/api/routes_social_audit.py (1 route)
- app.py: 6354 → 5860 lines (-494 total this batch)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 17:54:54 +01:00
60c19ec188 refactor: Migrate SEO audit API routes to api blueprint
- Created blueprints/api/routes_seo_audit.py with 3 routes:
  - /api/seo/audit (GET)
  - /api/seo/audit/<slug> (GET)
  - /api/seo/audit (POST - trigger)
- Includes helper functions for building audit responses
- Removed ~420 lines from app.py (6770 -> 6348)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 17:48:43 +01:00
52e5395a04 refactor: Migrate contacts API routes to api blueprint
- Created blueprints/api/routes_contacts.py with 2 routes:
  - /api/contacts/ai-parse (POST)
  - /api/contacts/bulk-create (POST)
- Includes AI prompts for contact parsing
- Removed ~300 lines from app.py (7063 -> 6764)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 17:42:18 +01:00
eaadef0bc1 refactor: Migrate recommendations API routes to api blueprint
- Created blueprints/api/routes_recommendations.py with 4 routes:
  - /api/recommendations/<company_id> (GET)
  - /api/recommendations/create (POST)
  - /api/recommendations/<rec_id>/edit (POST)
  - /api/recommendations/<rec_id>/delete (POST)
- Removed ~320 lines from app.py (7378 -> 7057)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 17:39:48 +01:00
3c5795ee4a refactor: Migrate announcements routes to public blueprint
- Created blueprints/public/routes_announcements.py with 2 routes:
  - /ogloszenia (announcements_list)
  - /ogloszenia/<slug> (announcement_detail)
- Added endpoint aliases for backward compatibility
- Removed ~130 lines from app.py (7506 -> 7378)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 17:37:08 +01:00
0337d1a0bb refactor: Migrate analytics API routes to api blueprint
- Created blueprints/api/ with 6 routes:
  - /api/analytics/track
  - /api/analytics/heartbeat
  - /api/analytics/scroll
  - /api/analytics/error
  - /api/analytics/performance
  - /api/analytics/conversion
- Added CSRF exemption for analytics routes
- Removed ~230 lines from app.py (7729 -> 7506)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 17:35:08 +01:00
e6cca4ec19 refactor: Migrate KRS API routes to admin blueprint
- Created blueprints/admin/routes_krs_api.py with 3 routes:
  - /admin/krs-api/audit (POST)
  - /admin/krs-api/audit/batch (POST)
  - /admin/krs-api/pdf/<company_id>
- Updated templates to use new URL paths
- Added endpoint aliases for backward compatibility
- Removed ~420 lines from app.py (8150 -> 7729)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 17:31:36 +01:00
236e929d10 refactor: Migrate IT Audit routes to it_audit blueprint
- Created blueprints/it_audit/ with 5 routes:
  - /it-audit/form (it_audit_form)
  - /it-audit/save (it_audit_save)
  - /api/it-audit/matches/<company_id>
  - /api/it-audit/history/<company_id>
  - /api/it-audit/export
- Added endpoint aliases for backward compatibility
- Removed ~600 lines from app.py (8750 -> 8150)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 17:25:28 +01:00
ab15cf3cba refactor: Migrate ZOPK public routes to public blueprint
- Created blueprints/public/routes_zopk.py with 3 public routes:
  - /zopk (zopk_index)
  - /zopk/projekty/<slug> (zopk_project_detail)
  - /zopk/aktualnosci (zopk_news_list)
- Added endpoint aliases for backward compatibility
- Removed ZOPK public routes from app.py

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 17:19:53 +01:00
bdae7f5309 fix: Add ZOPK endpoint aliases for backward compatibility
Templates use url_for('admin_zopk') but blueprint endpoints are
'admin.admin_zopk'. Added aliases in blueprints/__init__.py.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 17:12:46 +01:00
f36aa07137 fix: Remove non-existent routes_ai_usage import
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 17:08:15 +01:00
49830855a2 refactor: Migrate ZOPK and Users API routes to admin blueprint
Major refactoring to reduce app.py size by ~22%:
- Move all ZOPK routes (47 endpoints) to 4 blueprint files:
  - routes_zopk_dashboard.py - main dashboard
  - routes_zopk_news.py - news management, scraping, AI evaluation
  - routes_zopk_knowledge.py - knowledge base, embeddings, graph
  - routes_zopk_timeline.py - milestones management
- Move Users API routes to routes_users_api.py:
  - /admin/users-api/ai-parse - AI-powered user parsing
  - /admin/users-api/bulk-create - bulk user creation
- Move notify-release to routes.py

app.py reduced from 11518 to 8916 lines (-22.6%)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 17:05:36 +01:00
351c8fba75 refactor: Move admin_model_comparison routes to admin blueprint
- Created routes_model_comparison.py with model comparison functionality
- Updated base.html to use full blueprint name
- Added aliases for backward compatibility
- Commented old routes in app.py with _old_ prefix

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 10:48:18 +01:00
532d666fa8 refactor: Move admin_ai_usage routes to admin blueprint
- Added admin_ai_usage and admin_ai_usage_user to routes_analytics.py
- Updated templates to use full blueprint names (admin.admin_ai_usage)
- Added aliases for backward compatibility
- Commented old routes in app.py with _old_ prefix

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 10:43:28 +01:00
8909641ff3 refactor: Migrate analytics routes to blueprints
- Create new blueprints/admin/routes_analytics.py (~350 lines)
- Move admin_analytics and admin_analytics_export routes
- Update templates to use full blueprint names
- Add endpoint aliases for backward compatibility

Phase 6.2b - Analytics dashboard

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 10:36:23 +01:00
9b9ae40932 refactor: Add ai-learning-status and chat-stats API to blueprints
- Add api_ai_learning_status and api_chat_stats to routes_insights.py
- Update chat_analytics template to use new API path
- Add endpoint aliases for backward compatibility

Phase 6.2b - AI API routes

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 10:31:29 +01:00
42f04e065f refactor: Migrate insights routes to blueprints
- Create new blueprints/admin/routes_insights.py
- Move 5 insights routes (dashboard + API endpoints)
- Update template to use new /admin/insights-api/* paths
- Add endpoint aliases for backward compatibility

Phase 6.2b - Insights routes

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 10:27:35 +01:00
54c1878d66 refactor: Migrate announcements routes to blueprints
- Create new blueprints/admin/routes_announcements.py
- Move 6 announcements routes to blueprint
- Update templates to use full blueprint names
- Add endpoint aliases for backward compatibility

Phase 6.2d - Announcements routes

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 09:41:49 +01:00
82162874b8 refactor: Migrate security routes to blueprints
- Create new blueprints/admin/routes_security.py
- Move 5 security routes: admin_security, acknowledge_security_alert,
  resolve_security_alert, unlock_account, api_geoip_stats
- Update templates to use full blueprint names
- Add endpoint aliases for backward compatibility

Phase 6.2d - Security routes

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 09:39:12 +01:00
470e2a8bb7 refactor: Migrate admin_it_audit to blueprints
- Move IT audit dashboard route to blueprints/admin/routes_audits.py
- Add ITAudit, ITCollaborationMatch imports
- Update base.html template to use full blueprint name
- Add endpoint alias for backward compatibility

Phase 6.2f continued

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 09:25:31 +01:00
806f9e730e refactor: Migrate digital_maturity_dashboard and admin_krs_audit to blueprints
- Move routes from app.py to blueprints/admin/routes_audits.py
- Add endpoint aliases for backward compatibility
- Update base.html template to use full blueprint names
- Comment old routes in app.py with _old_ prefix

Phase 6.2f of blueprint migration

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 09:19:56 +01:00
9dedab2929 refactor: Faza 6.2e - Social Media do blueprintu admin
Przeniesiono 2 trasy do blueprints/admin/routes_social.py:
- admin_social_media (analytics dashboard)
- admin_social_audit (audit dashboard)

Zaktualizowano szablony:
- base.html, dashboard.html, social_audit_dashboard.html

Dodano aliasy dla kompatybilności wstecznej.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 09:07:51 +01:00
61a32d9bfa refactor: Faza 6.2c - Status, Health, Debug do blueprintu admin
Przeniesiono 9 tras do blueprints/admin/routes_status.py:
- admin_status, api_admin_status
- admin_health, api_admin_health
- debug_panel
- api_get_logs, api_logs_stream, api_clear_logs, api_test_log

Zaktualizowano szablony na pełne nazwy blueprintów:
- base.html: admin.admin_status, admin.admin_health
- health_dashboard.html: admin.admin_status

Dodano aliasy dla kompatybilności wstecznej.
Stare trasy w app.py oznaczone jako _old_* (do usunięcia po weryfikacji).

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 08:59:15 +01:00
dd4eb52521 refactor: Aliasy admin_seo/gbp_audit + poprawka chat.chat_analytics
- Dodano aliasy w blueprints/__init__.py dla admin_seo i admin_gbp_audit
- Poprawiono url_for('chat_analytics') na url_for('chat.chat_analytics')
  (trasa już jest w blueprincie chat)

Minimalne, bezpieczne zmiany zgodne z metodologią.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 08:41:28 +01:00
1384c7f090 refactor: Add SEO & GBP audit routes to admin blueprint (Phase 6.2a)
- Created blueprints/admin/routes_audits.py (2 routes)
- admin_seo, admin_gbp_audit moved from app.py
- Aliases created for backward compatibility

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 08:16:22 +01:00
ba0baf1305 fix: Correct template paths for admin calendar
- calendar/admin.html (not admin/calendar.html)
- calendar/admin_new.html (not admin/calendar_form.html)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 08:12:15 +01:00
44268c5425 refactor: Extract admin blueprint Part 1 (Phase 6)
Moved 19 admin routes to blueprints/admin/:
- Recommendations: 3 routes (list, approve, reject)
- Users: 8 routes (list, add, toggle-admin, toggle-verified, update, assign-company, delete, reset-password)
- Fees: 5 routes (list, generate, mark-paid, bulk-mark-paid, export)
- Calendar admin: 3 routes (list, new, delete)

Note: AI-parse routes (/api/admin/users/ai-parse, ai-create) remain in app.py.

Aliases created for backward compatibility.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 08:05:06 +01:00
55718ed211 refactor: Extract chat blueprint (Phase 5)
- Create blueprints/chat/ with 9 routes:
  - chat, chat_settings, chat_start, chat_send_message
  - chat_get_history, chat_list_conversations, chat_delete_conversation
  - chat_feedback, chat_analytics
- Register chat blueprint with backward-compatible aliases
- Remove dead code from app.py (-458 lines)
- app.py: 13,058 → 12,600 lines (-3.5%)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 07:54:08 +01:00
0f482cc4aa refactor: Extract messages + notifications blueprint (Phase 4)
- Create blueprints/messages/ with 11 routes:
  - messages_inbox, messages_sent, messages_new, messages_send
  - messages_view, messages_reply, api_unread_count
  - api_notifications, api_notification_mark_read
  - api_notifications_mark_all_read, api_notifications_unread_count
- Register messages blueprint with backward-compatible aliases
- Remove dead code from app.py (-340 lines)
- app.py: 13,398 → 13,058 lines (-2.5%)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 07:47:55 +01:00
ad2262388b refactor: Extract forum blueprint (Phase 3)
- Create blueprints/forum/ with 10 routes:
  - forum_index, forum_new_topic, forum_topic, forum_reply
  - admin_forum, admin_forum_pin, admin_forum_lock
  - admin_forum_delete_topic, admin_forum_delete_reply
  - admin_forum_change_status
- Register forum blueprint with backward-compatible aliases
- Remove dead code from app.py (-422 lines)
- app.py: 13,820 → 13,398 lines (-3.1%)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 07:42:18 +01:00
d5adf029aa refactor(phase2a): Extract auth + public blueprints with Alias Bridge
Phase 2a of modular monolith refactoring:

New blueprints:
- blueprints/auth/routes.py (1,040 lines, 20 routes)
  - login, logout, register, verify_2fa, settings_2fa
  - forgot_password, reset_password, verify_email
  - konto_dane, konto_prywatnosc, konto_bezpieczenstwo, konto_blokady
- blueprints/public/routes.py (862 lines, 11 routes)
  - index, company_detail, person_detail, search
  - dashboard, events, new_members, release_notes

Alias Bridge strategy:
- Both url_for('login') and url_for('auth.login') work
- Templates don't require changes (backward compatible)
- Original routes in app.py marked with _old_ prefix (dead code)

Next step: Cleanup dead code from app.py after production verification

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 07:28:18 +01:00
4ac2fd93e4 fix: Usunięto placeholder video "Jak korzystać z NordaGPT" z Akademii
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 20:35:01 +01:00
e6acc2ec6f feat: Dodano moderację tablicy B2B dla administratora
- Przycisk usuwania ogłoszenia z potwierdzeniem
- Przycisk aktywacji/dezaktywacji ogłoszenia
- Endpointy: /delete, /toggle-active
- Badge "Nieaktywne" dla dezaktywowanych ogłoszeń

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 20:31:37 +01:00
52abe33dd1 feat(education): Integracja wideo z Platformą Edukacyjną
- Dodano 2 filmy: zajawka 30s i tutorial 2min
- Modal z odtwarzaczem wideo (klik na kartę)
- Badge "Nowe" dla dostępnych materiałów
- Podgląd pierwszej klatki wideo
- Obsługa klawisza Escape do zamknięcia

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 14:53:15 +01:00
a06cd335d8 fix(blueprints): Poprawka url_for w blueprintach - dodanie prefixu
- classifieds/routes.py: .classifieds_index
- calendar/routes.py: .calendar_index
- contacts/routes.py: .contacts_list, .contact_detail

Błąd powodował 500 przy dodawaniu ogłoszeń B2B.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 14:42:59 +01:00
9f286d1790 feat(education): Dodanie Platformy Edukacyjnej
- Nowy blueprint /edukacja z materiałami szkoleniowymi
- Link "Edukacja" w menu (tylko dla zalogowanych)
- Strona placeholder z listą przyszłych materiałów
- Dostęp wymaga logowania (@login_required)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 20:31:04 +01:00
66856a697d refactor(phase1): Extract blueprints for reports, contacts, classifieds, calendar
Phase 1 of app.py refactoring - reducing from ~14,455 to ~13,699 lines.

New structure:
- blueprints/reports/ - 4 routes (/raporty/*)
- blueprints/community/contacts/ - 6 routes (/kontakty/*)
- blueprints/community/classifieds/ - 4 routes (/tablica/*)
- blueprints/community/calendar/ - 3 routes (/kalendarz/*)
- utils/ - decorators, helpers, notifications, analytics
- extensions.py - Flask extensions (csrf, login_manager, limiter)
- config.py - environment configurations

Updated templates with blueprint-prefixed url_for() calls.

⚠️ DO NOT DEPLOY before presentation on 2026-01-30 19:00

Tested on DEV: all endpoints working correctly.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-27 10:10:45 +01:00