Edge cases handled:
1. Partial submission:
- Added is_partial flag to save response
- Dynamic success message based on completeness score
- Completeness threshold messages (< 30%, 30-70%, > 70%)
2. Company without audit:
- Fixed template to show "Brak audytu" for companies without audit
- Added "Utwórz audyt" button (+ icon) for companies without audit
- Fixed data structure mismatch between route and template
3. Multiple audit history:
- Added get_company_audit_history() convenience function
- Added has_company_audit() helper function
- Added /api/it-audit/history/<company_id> API endpoint
- Returns history_count in save response
Other fixes:
- Fixed stats variable naming in admin_it_audit route
- Fixed collaboration_matches data structure for template
- Fixed url_for to use slug instead of company_id
- Fixed match_type filter (shared_licensing not shared_m365_licensing)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>