GBP audit:
- Fix review_response_rate bug: check ownerResponse instead of authorAttribution.displayName
- Mark has_posts/has_products/has_qa as OAuth-dependent in AI prompt
- Add review_keywords and description_keywords to AI prompt
SEO audit:
- Replace deprecated FID with INP (Core Web Vital since March 2024)
- Pass 10 additional metrics to AI prompt: FCP, TTFB, TBT, Speed Index,
meta title/desc length, html lang, Schema.org field details
- Update templates with INP thresholds (200ms/500ms)
Social media audit:
- Calculate engagement_rate from industry base rates × activity multiplier
- Calculate posting_frequency_score (0-10 based on posts_count_30d)
- Enrich AI prompt with page_name, freq_score, engagement, last_post_date
- Add avg engagement rate and brand name consistency check to prompt
Completeness: 52% → ~68% (estimated)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Previously the check_status='needs_verification' was only visible in the admin
social media panel (Wszystkie wpisy tab). Now it also shows on:
- Company social audit page (/audit/social/...) as yellow status badge + warning
- Company detail page social media grid as yellow 'Do weryfikacji' badge
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 empty JSON body to fetch POST requests - Flask cannot parse
Content-Type: application/json with no body.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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>
Replace selectattr('value', 'search', ...) with simple 'in' check against
known_phones list that was already being built. Fixes 500 error on /company/102.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add missing sections for services_offered, technologies_used,
operational_area, languages_offered, founding_history, and core_values
to company_detail.html. These fields are editable via /firma/edytuj
but were not visible on the profile page.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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>
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>
- 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>
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>
- 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>
- 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>
- 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>
- 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>
TypeError: 'datetime.datetime' object is not callable
Przyczyna: now jest obiektem datetime, nie funkcją
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Changed card color from blue to green (#10b981)
- Added "Źródło: Izba NORDA" text below years count
- Consistent styling with other legal info cards
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 modal with animated progress bar and percentage
- Step-by-step log showing:
- Initialization
- Data collection
- AI prompt preparation
- Gemini API call
- Response parsing
- Results summary (services, USPs, tags, etc.)
- Cancel button with AbortController support
- Success/error states with appropriate icons
- Footer with "Close" and "Refresh page" buttons
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add "Wzbogac dane AI" button visible to all users
- Button enabled only for admins and company owners
- New API endpoint POST /api/company/<id>/enrich-ai
- Integrates with Gemini AI to generate:
- Business summary
- Services list
- Target market
- Unique selling points
- Company values
- Certifications
- Industry tags
- Rate limited to 5 requests/hour per user
- Results saved to CompanyAIInsights table
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Show all PKD codes from KRS audit (not just main one)
- Primary PKD highlighted with 'GŁÓWNY' badge
- Secondary PKDs listed below with descriptions
- Fallback to CEIDG data if no KRS audit data
- Shows source (eKRS or CEIDG) and total count
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>
Move sections to new order:
1. Zarząd i Wspólnicy (people info first)
2. Właściciel JDG
3. Informacje prawne i biznesowe
4. Dane kontaktowe (contact info last)
5. Social Media
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Changed Social Media audit banner to show percentage score (e.g., 16%)
instead of platform count, matching the detailed audit page
- Fixed SEO score inconsistency by sorting website_analysis query by
seo_audited_at desc (same as seo_audit_dashboard)
- Both audit sections on company profile now show same values as
their detailed pages
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- GBP Audit banner links to /audit/gbp/<slug>
- SEO Audit banner links to /audit/seo/<slug>
- Social Media banner links to /audit/social/<slug>
- IT Audit banner links to /audit/it/<slug>
- Added hover effects and chevron icon for visual feedback
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add normalize_social_url() function to database.py to prevent
www vs non-www duplicates in social media records
- Update update_social_media.py to normalize URLs before insert
- Update social_media_audit.py to normalize URLs before insert
- Add inline GBP Audit section to company profile
- Add inline Social Media Audit section to company profile
- Add inline IT Audit section to company profile
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add company logo display in search results cards
- Make logo clickable (links to company profile)
- Temporarily hide "Aktualności i wydarzenia" section on company profiles
- Add scripts for KRS PDF download/parsing and CEIDG API
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add /admin/ai-usage/user/<id> route for detailed AI usage per user
- Add ai_usage_user.html template with stats, usage breakdown, logs
- Make user names clickable in AI usage dashboard ranking
- Replace all native browser dialogs (alert, confirm) with styled modals/toasts:
- admin/fees.html, forum.html, recommendations.html, announcements.html, debug.html
- calendar/admin.html, event.html
- company_detail.html, company/recommend.html
- forum/new_topic.html, topic.html
- classifieds/view.html
- auth/reset_password.html
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Create /audit/social/<slug> route with platform presence analysis
- Create social_audit.html template with 6 platforms (FB, IG, LinkedIn, YT, X, TikTok)
- Add purple "Audyt Social" button on company profile next to GBP and SEO audits
- Show score based on platforms count, profile details and recommendations
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Create /audit/seo/<slug> route with access control (admin or company owner)
- Create seo_audit.html template with score visualization
- Add green "Audyt SEO" button next to GBP audit button on company profile
- Match styling and UX patterns from GBP audit feature
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Fixes:
- Added GBP audit link to company profile contact bar
- Link visible to admins on all profiles
- Link visible to regular users only on their own company profile
- Styled consistently with contact bar design (Google blue)
Verified:
- Template syntax balanced (blocks, if, for)
- Route gbp_audit_dashboard exists in app.py
QA Fix Session: 1
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Naprawione błędy wprowadzone podczas synchronizacji:
- Przywrócono sekcję company-logo-header z obrazkiem
- Przywrócono style CSS dla logo (240x240px, shadow, border-radius)
- Przywrócono przyciski Social Media (Facebook, Instagram, LinkedIn, YouTube, X, TikTok)
- Przywrócono style kolorów dla platform social media
- Naprawiono pole website_url → website
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Extend templates/company_detail.html to display SEO metrics when
seo_audited_at exists:
- Overall SEO score banner with color-coded gradient (green/yellow/red)
- PageSpeed scores grid (SEO, Performance, Accessibility, Best Practices)
- On-Page SEO card (meta tags, headings, images, links)
- Technical SEO card (canonical, indexing, structured data, OG tags)
- Core Web Vitals section (LCP, FID, CLS) when available
- Structured data types display (Schema.org)
- Score legend with color coding explanation
- Responsive design for mobile/tablet screens
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add MembershipFee and MembershipFeeConfig models
- Add /health endpoint for monitoring
- Add Microsoft Fluent Design CSS
- Update templates with new CSS structure
- Add Announcement model
- Update .gitignore to exclude analysis files
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>