For companies with CEIDG data, hide the redundant "Informacje prawne
i biznesowe" and "Dane kontaktowe" sections since this data is already
displayed in the "Dane z rejestrów urzędowych (CEIDG)" section.
This matches the behavior for KRS companies and eliminates duplicate
display of NIP, REGON, PKD, and contact information.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Removed limits on services (was 10) and keywords (was 8)
- Added new extraction categories:
- products: physical/digital products
- brands: partners, certifications (VMware, Veeam, etc.)
- specializations: specific competencies
- target_customers: customer types (SMB, enterprise, etc.)
- regions: geographic coverage
- Merged all data into services_extracted and main_keywords
- Increased content limit to 20000 chars for AI
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- New script: scripts/website_content_updater.py
- Uses Gemini 3 Flash (free tier) for AI extraction
- Extracts: services_extracted, main_keywords, content_summary
- Supports: single company, batch, stale-days filtering, dry-run
- Rate limiting: 2s between API calls
- Documented cron setup in CLAUDE.md
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Wrapped recommendations section in {% if False %} condition
- Added clear comments explaining why and how to re-enable
- No code deleted, just hidden until approved
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Removed USPs (unique_selling_points) and company values
- These were AI guesses from website analysis, not verified data
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Removed "Źródło", "Analiza", "Pewność AI" info card
- This was metadata about website crawling, not useful for users
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Removed "Certyfikaty i uprawnienia" section
- This was AI (Gemini) guessing certifications from website content
- Not verified data, just crawler-based inference
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Removed "Funkcje strony" section (Blog, Portfolio, Contact form, etc.)
- Removed "Ostatnia modyfikacja" timestamp
- These were crawler-based data with low business value
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Move phone number to KRS "Dane kontaktowe" section
- Hide legacy "Dane kontaktowe" section for companies with KRS API data
- Show (KRS) badge next to email/www from official registry
- Phone is unique data not available in KRS API
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Hide "Zarząd i Wspólnicy" section for companies with KRS API data
(data is now in "Dane z rejestrów urzędowych" section)
- Hide "Informacje prawne i biznesowe" section for companies with KRS API data
(NIP, REGON, forma prawna, kapitał - all in KRS section)
- Remove rejestr.io links (we now have official KRS API data)
- Keep PDF download button in legacy section
- Add CRBR and SUDOP registries to TODO for future integration
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Extend KRS data collection and display:
1. NIP - displayed in company profile
2. REGON - displayed in company profile
3. Email from KRS (adresPocztyElektronicznej)
4. WWW from KRS (adresStronyInternetowej)
5. ePUAP address (adresDoDoreczenElektronicznychWpisanyDoBAE)
6. Company agreement date (data zawarcia umowy)
7. Company duration (czas trwania spółki)
8. Share information (informacja o udziałach)
9. Financial statements history (sprawozdania finansowe)
10. Full PKD codes with class/subclass (e.g., 62.03.Z)
11. Court registry data (sygnatura, sąd, rok obrotowy)
Updated krs_api_service.py:
- Extended KRSCompanyData dataclass with new fields
- Updated parse_krs_response() to extract all data
- PKD now returns dict with kod, opis, glowna
Updated templates/company_detail.html:
- Display NIP and REGON from KRS
- Contact section with email, www, ePUAP
- Company agreement section
- Financial statements history grid
- Court registry information
- Improved PKD display with full codes
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Document that `source .env` doesn't work via SSH and
provide correct patterns for running Python scripts
that need database access on production.
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>
- Display all CEIDG data: status, owner, PKD codes, contacts, addresses
- Display all KRS data: legal form, capital, KRS number
- Show data source banner with fetch timestamp and registry link
- Display additional business locations from CEIDG
- Show succession manager (zarządca sukcesyjny) if present
- All PKD codes displayed as tags with main PKD highlighted
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add enrich_companies_from_registries() that tries KRS first for companies
with KRS number, then falls back to CEIDG
- Add update_company_from_krs() to save KRS data to Company model
- Fix CEIDG search to use 'nip' parameter directly
- Keep enrich_companies_from_ceidg() as alias for compatibility
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>
- Add search_ceidg_by_name() for API v3 name-based queries
- Add search_missing_nip_companies() to find NIP for companies without NIP
- Add --missing-nip flag to search for all companies missing NIP
- Add --apply-nip flag to save found NIPs to database
- Fix API endpoint: /api/ceidg/v3/firmy (not /firma)
- Correctly extract NIP from wlasciciel object in response
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Changes:
- Remove position: sticky from konto sidebar (dane, prywatnosc, bezpieczenstwo, blokady)
- Add "Firmy" link to admin dropdown menu (before "Użytkownicy")
- Add scan_websites_for_nip.py script for data quality
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- 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>
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>
- 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>
- 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>
Changed condition from loop.first to checking if reader
matches current_user.id for correct "You" indicator.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- 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>
Prevents text clipping in third column by moving issuer
to a separate centered row below the date stats.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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>
- Added CSS variable --header-height (109px for admin, 73px for regular users)
- Fixed chat container height calculation to account for admin bar
- Fixed mobile sidebar position
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Fixes issue where chat input field was cut off at the bottom of the screen.
Added safe-area-inset-bottom support for iOS devices.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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>
Removed 33 dead functions that were left behind after migration to blueprints.
These were prefixed with _old_ and no longer referenced.
app.py: 4756 → 1523 lines (-3233, -68%)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>