Commit Graph

8 Commits

Author SHA1 Message Date
3b2dcc279b feat(gbp-audit): Use Google data for all audit fields
- Add new columns to CompanyWebsiteAnalysis: google_name, google_address,
  google_phone, google_website, google_types, google_maps_url
- Update _check_name(), _check_address(), _check_phone(), _check_website(),
  _check_categories() to use Google data instead of NordaBiz database
- All audit fields now show real data from Google Business Profile
- Fallback to NordaBiz data only when Google data unavailable

Migration: database/migrations/add_google_gbp_fields.sql

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-09 04:43:03 +01:00
7aacdd5951 Fix: include details field in fields_status serialization
The details field (with reviews breakdown) was not being passed to template.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-09 04:32:40 +01:00
0c1d03418b GBP Audit: show reviews scoring breakdown
Add details field to FieldStatus for passing breakdown info.
Display scoring breakdown like: "3 pkt (1. opinia) + 1 pkt (ocena) = 4/9"

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-09 04:30:04 +01:00
6758e208d4 GBP Audit: fetch Google data + detailed progress overlay
- Add fetch_google_business_data() to fetch fresh data from Google Places API
- Progress overlay shows all 10 data fields with actual values:
  * Place search, Rating, Reviews, Photos, Hours, Phone, Website, Status
- 5-second delay after completion for user to read results
- Fix opening hours display (show formatted weekday_text)
- Fix reviews scoring (integer-based: 3 base + 1/review + 1 bonus)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-09 04:19:44 +01:00
fd5a04c02c auto-claude: subtask-3-2 - Update _check_photos() to use google_photos_count
Changed _check_photos method to read from analysis.google_photos_count
instead of total_images. This provides actual GBP photo count rather
than estimated website images.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-08 23:02:49 +01:00
d84588c46b auto-claude: subtask-3-1 - Update _check_hours() method to read from google_opening_hours
Changed _check_hours() in GBP Audit Service to read opening hours from
google_opening_hours field instead of google_business_status. The method
now properly returns the actual hours value when available.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-08 23:01:28 +01:00
47c415a63b auto-claude: subtask-3-4 - Integrate AI recommendations using Gemini service
Added AI-powered recommendation generation to GBP audit service:

- Import gemini_service module for AI integration
- generate_ai_recommendations(): Main method to generate personalized
  recommendations using Gemini with proper cost tracking
- _build_ai_recommendation_prompt(): Builds context-aware prompt with
  company info, audit results, and field statuses in Polish
- _parse_ai_recommendations(): Parses JSON response from Gemini with
  robust error handling and fallback to static recommendations
- audit_with_ai(): Convenience method for running audit with AI
- audit_company_with_ai(): Module-level convenience function

Features:
- Recommendations are personalized to company industry/category
- Includes action_steps and expected_impact for each recommendation
- Graceful fallback to static recommendations if AI unavailable
- Cost tracking via 'gbp_audit_ai' feature tag
- Updated test runner with --ai flag for testing AI mode

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-08 19:20:25 +01:00
edb3d41f49 auto-claude: subtask-2-2 - Create GBP audit service with completeness scoring
Add GBPAuditService with:
- Field-by-field completeness checking (name, address, phone, website, hours, categories, photos, description, services, reviews)
- Weighted scoring algorithm (total 100 points)
- AuditResult and FieldStatus dataclasses for structured results
- Automatic recommendation generation with priority levels
- save_audit() to persist results to GBPAudit model
- Convenience functions: audit_company(), get_company_audit(), batch_audit_companies()

Scoring weights:
- Photos: 15 pts (highest impact on engagement)
- Description: 12 pts
- Name, Address, Categories: 10 pts each
- Reviews: 9 pts
- Phone, Website, Hours, Services: 8-10 pts each

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-08 19:05:35 +01:00