Update warranty status to use backend calculation and add comprehensive tests

Client-Side Changes:
- Add WarrantyStatus data class to Document model for backend-calculated status
- Update WarrantyCard to display backend status (statusText, statusColor) with client fallback
- Fix document list refresh: call loadDocuments() after create/update operations

Testing:
- Add ComprehensiveDocumentWarrantyTests with 25+ XCUITest cases
- Test document creation, update, delete, image upload
- Test warranty-specific fields and property selection
- Test both general documents and warranties
- Includes helper methods for form interaction and cleanup

Other:
- Update ApiConfig and PushNotificationManager

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Trey t
2025-11-24 13:09:55 -06:00
parent 15fac54f14
commit b2c3fac3f9
6 changed files with 958 additions and 3 deletions

View File

@@ -199,11 +199,11 @@ class PushNotificationManager: NSObject, ObservableObject {
// MARK: - Badge Management
func clearBadge() {
UIApplication.shared.applicationIconBadgeNumber = 0
UNUserNotificationCenter.current().setBadgeCount(0)
}
func setBadge(count: Int) {
UIApplication.shared.applicationIconBadgeNumber = count
UNUserNotificationCenter.current().setBadgeCount(count)
}
}