Display prominent green alert informing admin that user has accepted
the proposed changes and they can now approve the membership application.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Position "Historia workflow" right after "Akcje" section so it's
visible without scrolling. Previously it was hidden below "Zgłaszający".
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Show same workflow history on admin side as users see, with sub-workflow
arrows (↓ for admin proposals, ↑ for user responses).
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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>
- Show full-screen success overlay with progress steps (like InPost)
- Display clear confirmation that changes were accepted/rejected
- Show workflow progress: Złożono → Weryfikacja → Rozpatrzenie → Decyzja
- Button to navigate to status page
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- 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>
- 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>
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>
- Add info box explaining how NIP→KRS lookup works
- Show real-time status during lookup (Biała Lista → KRS Open API)
- Consistent UI with user-facing membership form
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add expandable info section explaining the lookup workflow
- Explain why NIP→Biała Lista→KRS is needed (KRS API doesn't support NIP)
- Show real-time status during lookup process
- Better UX for understanding multi-step data retrieval
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- 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>
- Add ceidg_api_service.py with fetch_ceidg_by_nip() function
- Add KRSApiService class with search_by_nip() method
- KRS lookup uses rejestr.io API (unofficial) or database fallback
- CEIDG lookup uses official dane.biznes.gov.pl API
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
All AJAX calls in membership_detail.html now include X-CSRFToken header
to prevent 'Błąd połączenia' errors when performing admin actions like
start-review, approve, reject, request-changes, and registry lookup.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add "Złóż deklarację" / "Uzupełnij dane firmy" in user dropdown menu
- Add membership section in account settings sidebar
- Dynamic links based on user's company status
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>
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>